naginterfaces.library.fit.dim1_cheb_deriv¶
- naginterfaces.library.fit.dim1_cheb_deriv(n, xmin, xmax, a, ia1, iadif1)[source]¶
dim1_cheb_deriv
determines the coefficients in the Chebyshev series representation of the derivative of a polynomial given in Chebyshev series form.For full information please refer to the NAG Library document for e02ah
https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/e02/e02ahf.html
- Parameters
- nint
, the degree of the given polynomial .
- xminfloat
The lower and upper end points respectively of the interval . The Chebyshev series representation is in terms of the normalized variable , where
- xmaxfloat
The lower and upper end points respectively of the interval . The Chebyshev series representation is in terms of the normalized variable , where
- afloat, array-like, shape
The Chebyshev coefficients of the polynomial . Specifically, element of must contain the coefficient , for . Only these elements will be accessed.
Unchanged on exit, but see , below.
- ia1int
The index increment of . Most frequently the Chebyshev coefficients are stored in adjacent elements of , and must be set to . However, if for example, they are stored in , the value of must be . See also Further Comments.
- iadif1int
The index increment of . Most frequently the Chebyshev coefficients are required in adjacent elements of , and must be set to . However, if, for example, they are to be stored in , the value of must be . See Further Comments.
- Returns
- patm1float
The value of . If this value is passed to the integration function
dim1_cheb_integ()
with the coefficients of , the original polynomial is recovered, including its constant coefficient.- adiffloat, ndarray, shape
The Chebyshev coefficients of the derived polynomial . (The differentiation is with respect to the variable .) Specifically, element of contains the coefficient , for . Additionally, element is set to zero. A call of the function may have the array name the same as , provided that note is taken of the order in which elements are overwritten, when choosing the starting elements and increments and , i.e., the coefficients must be intact after coefficient is stored. In particular, it is possible to overwrite the completely by having , and the actual arrays for and identical.
- Raises
- NagValueError
- (errno )
On entry, , and .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, , and .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, and .
Constraint: .
- (errno )
On entry, .
Constraint: .
- Notes
dim1_cheb_deriv
forms the polynomial which is the derivative of a given polynomial. Both the original polynomial and its derivative are represented in Chebyshev series form. Given the coefficients , for , of a polynomial of degree , wherethe function returns the coefficients , for , of the polynomial of degree , where
Here denotes the Chebyshev polynomial of the first kind of degree with argument . It is assumed that the normalized variable in the interval was obtained from your original variable in the interval by the linear transformation
and that you require the derivative to be with respect to the variable . If the derivative with respect to is required, set and .
Values of the derivative can subsequently be computed, from the coefficients obtained, by using
dim1_cheb_eval2()
.The method employed is that of Chebyshev series (see Module 8 of Modern Computing Methods (1961)), modified to obtain the derivative with respect to . Initially setting , the function forms successively
- References
Modern Computing Methods, 1961, Chebyshev-series, NPL Notes on Applied Science (16), (2nd Edition), HMSO