class scipy.interpolate.PiecewisePolynomial(xi, yi, orders=None, direction=None, axis=0)[source]

Piecewise polynomial curve specified by points and derivatives

This class represents a curve that is a piecewise polynomial. It passes through a list of points and has specified derivatives at each point. The degree of the polynomial may vary from segment to segment, as may the number of derivatives available. The degree should not exceed about thirty.

Appending points to the end of the curve is efficient.

Parameters :

xi : array-like

a sorted 1-d array of x-coordinates

yi : array-like or list of array-likes

yi[i][j] is the j-th derivative known at xi[i] (for axis=0)

orders : list of integers, or integer

a list of polynomial orders, or a single universal order

direction : {None, 1, -1}

indicates whether the xi are increasing or decreasing +1 indicates increasing -1 indicates decreasing None indicates that it should be deduced from the first two xi

axis : int, optional

Axis in the yi array corresponding to the x-coordinate values.


If orders is None, or orders[i] is None, then the degree of the polynomial segment is exactly the degree required to match all i available derivatives at both endpoints. If orders[i] is not None, then some derivatives will be ignored. The code will try to use an equal number of derivatives from each end; if the total number of derivatives needed is odd, it will prefer the rightmost endpoint. If not enough derivatives are available, an exception is raised.


__call__(x) Evaluate the interpolant
append(xi, yi[, order]) Append a single point with derivatives to the PiecewisePolynomial
derivative(x[, der]) Evaluate one derivative of the polynomial at the point x
derivatives(x[, der]) Evaluate many derivatives of the polynomial at the point x
extend(xi, yi[, orders]) Extend the PiecewisePolynomial by a list of points

Previous topic


Next topic