|
NAG[e02ajc] NAG[nag_1d_cheb_intg] - Integral of fitted polynomial in Chebyshev series form
|
|
Calling Sequence
e02ajc(n, xmin, xmax, a, ia1, qatm1, aint, iaint1, 'fail'=fail)
nag_1d_cheb_intg(. . .)
Parameters
|
n - integer;
|
|
|
On entry: , the degree of the given polynomial .
|
|
Constraint: . .
|
|
|
xmin - float;
xmax - float;
|
|
|
On entry: the lower and upper end points respectively of the interval . The Chebyshev-series representation is in terms of the normalized variable , where
|
|
Constraint: . .
|
|
|
a - Vector(1.. , datatype=float[8]);
|
|
|
Note: the dimension, dim, of the array a must be at least .
|
|
|
ia1 - integer;
|
|
|
On entry: the index increment of a. Most frequently the Chebyshev coefficients are stored in adjacent elements of a, and ia1 must be set to 1. However, if for example, they are stored in , then the value of ia1 must be 3. See also Section [Further Comments].
|
|
Constraint: . .
|
|
|
qatm1 - float;
|
|
|
On entry: the value that the integrated polynomial is required to have at the lower end point of its interval of definition, i.e., at which corresponds to . Thus, qatm1 is a constant of integration and will normally be set to zero by you.
|
|
|
aint - Vector(1.. , datatype=float[8]);
|
|
|
Note: the dimension, dim, of the array aint must be at least .
|
|
|
iaint1 - integer;
|
|
|
On entry: the index increment of aint. Most frequently the Chebyshev coefficients are required in adjacent elements of aint, and iaint1 must be set to 1. However, if, for example, they are to be stored in , then the value of iaint1 must be 3. See also Section [Further Comments].
|
|
Constraint: . .
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_1d_cheb_intg (e02ajc) determines the coefficients in the Chebyshev-series representation of the indefinite integral of a polynomial given in Chebyshev-series form.
|
|
Description
|
|
nag_1d_cheb_intg (e02ajc) forms the polynomial which is the indefinite integral of a given polynomial. Both the original polynomial and its integral are represented in Chebyshev-series form. If supplied with the coefficients , for , of a polynomial of degree , where
the function returns the coefficients , for , of the polynomial of degree , where
and
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 integral to be with respect to the variable . If the integral with respect to is required, set and .
Values of the integral can subsequently be computed, from the coefficients obtained, by using e02akc (nag_1d_cheb_eval2).
The method employed is that of Chebyshev-series (see Chapter 8 of Modern Computing Methods (1961)), modified for integrating with respect to . Initially taking , the function forms successively
The constant coefficient is chosen so that is equal to a specified value, qatm1, at the lower end point of the interval on which it is defined, i.e., , which corresponds to .
|
|
Error Indicators and Warnings
|
|
"NE_BAD_PARAM"
On entry, argument had an illegal value.
"NE_INT"
On entry, . Constraint: .
On entry, . Constraint: .
On entry, . Constraint: .
"NE_INTERNAL_ERROR"
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please consult NAG for assistance.
"NE_REAL_2"
On entry, : , .
|
|
Accuracy
|
|
In general there is a gain in precision in numerical integration, in this case associated with the division by in the formula quoted in Section [Description].
|
|
Further Comments
|
|
The time taken is approximately proportional to .
The increments ia1, iaint1 are included as arguments to give a degree of flexibility which, for example, allows a polynomial in two variables to be integrated with respect to either variable without rearranging the coefficients.
|
|
|
Examples
|
|
>
|
n := 6:
xmin := -0.5:
xmax := 2.5:
ia1 := 1:
qatm1 := 0:
iaint1 := 1:
a := Vector([2.53213, 1.13032, 0.2715, 0.04434, 0.00547, 0.00054, 4e-05], datatype=float[8]):
aint := Vector(8, datatype=float[8]):
NAG:-e02ajc(n, xmin, xmax, a, ia1, qatm1, aint, iaint1):
|
|
|