bundles / scipy latest / scipy / interpolate / _interpolate / BPoly / from_derivatives
classmethod
scipy.interpolate._interpolate:BPoly.from_derivatives
Summary
Construct a piecewise polynomial in the Bernstein basis, compatible with the specified values and derivatives at breakpoints.
Parameters
xi: array_likesorted 1-D array of x-coordinates
yi: array_like or list of array_likesyi[i][j]is thejth derivative known atxi[i]orders: None or int or array_like of ints. Default: None.Specifies the degree of local polynomials. If not None, some derivatives are ignored.
extrapolate: bool or 'periodic', optionalIf bool, determines whether to extrapolate to out-of-bounds points based on first and last intervals, or to return NaNs. If 'periodic', periodic extrapolation is used. Default is True.
Notes
If k derivatives are specified at a breakpoint x, the constructed polynomial is exactly k times continuously differentiable at x, unless the order is provided explicitly. In the latter case, the smoothness of the polynomial at the breakpoint is controlled by the order.
Deduces the number of derivatives to match at each end from order and the number of derivatives available. If possible it uses the same number of derivatives from each end; if the number is odd it tries to take the extra one from y2. In any case if not enough derivatives are available at one end or another it draws enough to make up the total from the other end.
If the order is too high and not enough derivatives are available, an exception is raised.
Examples
from scipy.interpolate import BPoly
✓BPoly.from_derivatives([0, 1], [[1, 2], [3, 4]])
✗BPoly.from_derivatives([0, 1, 2], [[0, 1], [0], [2]])
✗Aliases
-
scipy.interpolate.BPoly.from_derivatives