Home | Trees | Indices | Help |
|
---|
|
object --+ | interpclass --+ | PiecewisePolynomial
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 very 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.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
Inherited from |
|
|||
Inherited from |
|
Construct a piecewise polynomial Parameters ---------- xi : array-like of length N a sorted list of x-coordinates yi : list of lists of length N yi[i] is the list of derivatives known at xi[i] 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 Notes ----- 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.
|
Construct the interpolating polynomial object 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. |
Append a single point with derivatives to the PiecewisePolynomial Parameters ---------- xi : float yi : array-like yi is the list of derivatives known at xi order : integer or None a polynomial order, or instructions to use the highest possible order |
Extend the PiecewisePolynomial by a list of points Parameters ---------- xi : array-like of length N1 a sorted list of x-coordinates yi : list of lists of length N1 yi[i] is the list of derivatives known at xi[i] 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 |
Evaluate the piecewise polynomial Parameters ---------- x : scalar or array-like of length N Returns ------- y : scalar or array-like of length R or length N or N by R |
Evaluate a derivative of the piecewise polynomial Parameters ---------- x : scalar or array-like of length N der : integer which single derivative to extract Returns ------- y : scalar or array-like of length R or length N or N by R Notes ----- This currently computes all derivatives of the curve segment containing each x but returns only one. This is because the number of nonzero derivatives that a segment can have depends on the degree of the segment, which may vary. |
Evaluate a derivative of the piecewise polynomial Parameters ---------- x : scalar or array-like of length N der : integer how many derivatives (including the function value as 0th derivative) to extract Returns ------- y : array-like of shape der by R or der by N or der by N by R |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Dec 2 23:44:24 2012 | http://epydoc.sourceforge.net |