integrate.simpson behaviour for even number of samples
Andrew Nelson <[email protected]>
| Newsgroups | gmane.comp.python.scientific.devel |
|---|---|
| Message-ID | <CAAbtOZc_dEb5aH_O-2oVKGU=Da1=ffuLSMNq7s6bFUGL1F=HCA@mail.gmail.com> |
At the moment `integrate.simpson` has three different modes for how to deal with an even number of samples. This is specified using the `even` keyword. Each of those modes use the trapezoid rule. `first` and `last` use the trapzeoid rule on the last/first interval respectively, and simpson on the remaining intervals. `avg` takes the mean of those two. It was pointed out in #18151 that there's a different way of dealing with the last/first interval for an even number of points that retains the quadratic nature of the rule. See https://en.wikipedia.org/wiki/Simpson%27s_rule#Composite_Simpson's_rule_for_irregularly_spaced_data . The article references Cartwright, Kenneth V. (September 2017). "Simpson's Rule Cumulative Integration with MS Excel and Irregularly-spaced Data". Journal of Mathematical Sciences and Mathematics Education. 12 (2): 1–9. Should we implement this rule in `integrate.simpson`? It should be strictly better than what we have already and may be faster? -- _____________________________________ Dr. Andrew Nelson _____________________________________ _______________________________________________ SciPy-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/scipy-dev.python.org/ Member address: [email protected]