Expand description
Integration of sampled data, following scipy.integrate: the composite trapezoid and Simpson
rules for equally or unequally spaced samples, Romberg integration of 2ᵏ + 1 equally spaced
samples, and the cumulative trapezoid and Simpson integrals.
See the book entry Integrating sampled data.
Enums§
- Spacing
- The sample positions: explicit abscissae, or a constant spacing.
Functions§
- cumulative_
simpson - The running Simpson integral (SciPy’s
cumulative_simpson): each interval is integrated by the parabola through it and a neighbour (the next interval’s for the first of each pair, the previous one’s for the second), so every partial integral is exact for quadratics. - cumulative_
trapezoid - The running trapezoid integral: element
iintegrates over the firsti + 1samples (SciPy’scumulative_trapezoid). Withinitial, that value is prepended and added, so the result has the length ofy; otherwise it is one shorter. - romb
- Romberg integration of
2ᵏ + 1equally spaced samples (SciPy’sromb): trapezoid sums on the nested grids of spacingh, 2h, 4h, …, combined by Richardson extrapolationR(i, j) = R(i, j−1) + (R(i, j−1) − R(i−1, j−1)) / (4ʲ − 1). - simpson
- Simpson’s rule on pairs of intervals,
(h₀ + h₁)/6 [(2 − h₁/h₀) y₀ + (h₀ + h₁)²/(h₀h₁) y₁ + (2 − h₀/h₁) y₂], the integral of the parabola through three samples (SciPy’ssimpson). With an even number of samples, the last interval is integrated by the parabola through the last three samples (Cartwright’s correction), which keeps it exact for quadratics (but not cubics). - trapezoid
- The composite trapezoid rule
Σ (yᵢ + yᵢ₊₁) hᵢ / 2(SciPy’strapezoid).