SciPy

scipy.interpolate.NdPPoly.integrate

NdPPoly.integrate(ranges, extrapolate=None)[source]

Compute a definite integral over a piecewise polynomial.

Parameters:
ranges : ndim-tuple of 2-tuples float

Sequence of lower and upper bounds for each dimension, [(a[0], b[0]), ..., (a[ndim-1], b[ndim-1])]

extrapolate : bool, optional

Whether to extrapolate to out-of-bounds points based on first and last intervals, or to return NaNs.

Returns:
ig : array_like

Definite integral of the piecewise polynomial over [a[0], b[0]] x … x [a[ndim-1], b[ndim-1]]