|
NAG[e02rac] NAG[nag_1d_pade] - Padé approximants
|
|
Calling Sequence
e02rac(c, a, b, 'ia'=ia, 'ib'=ib, 'fail'=fail)
nag_1d_pade(. . .)
Parameters
|
c - Vector(1.. , datatype=float[8]);
|
|
|
Note: the dimension, dim, of the array c must be at least .
|
|
|
a - Vector(1..ia, datatype=float[8]);
|
|
|
|
b - Vector(1..ib, datatype=float[8]);
|
|
|
|
'ia'=ia - integer; (optional)
'ib'=ib - integer; (optional)
|
|
|
Constraint: and . .
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_1d_pade (e02rac) calculates the coefficients in a Padé approximant to a function from its user-supplied Maclaurin expansion.
|
|
Description
|
|
Given a power series
nag_1d_pade (e02rac) uses the coefficients , for , to form the Padé approximant of the form
with defined to be unity. The two sets of coefficients , for and , for in the numerator and denominator are calculated by direct solution of the Padé equations (see Graves–Morris (1979) ); these values are returned through the argument list unless the approximant is degenerate.
Padé approximation is a useful technique when values of a function are to be obtained from its Maclaurin expansion but convergence of the series is unacceptably slow or even non-existent. It is based on the hypothesis of the existence of a sequence of convergent rational approximations, as described in Baker and Graves–Morris (1981) and Graves–Morris (1979).
Unless there are reasons to the contrary (as discussed in Baker and Graves–Morris (1981) Chapter 4, Section 2, Chapters 5 and 6), one normally uses the diagonal sequence of Padé approximants, namely
Subsequent evaluation of the approximant at a given value of may be carried out using e02rbc (nag_1d_pade_eval).
|
|
Error Indicators and Warnings
|
|
"NE_ALLOC_FAIL"
Dynamic memory allocation failed.
"NE_BAD_PARAM"
On entry, argument had an illegal value.
"NE_DEGENERATE"
The Pade approximant is degenerate.
"NE_INT_2"
On entry, , . Constraint: and .
"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.
|
|
Accuracy
|
|
The solution should be the best possible to the extent to which the solution is determined by the input coefficients. It is recommended that you determine the locations of the zeros of the numerator and denominator polynomials, both to examine compatibility with the analytic structure of the given function and to detect defects. (Defects are nearby pole-zero pairs; defects close to characterise ill-conditioning in the construction of the approximant.) Defects occur in regions where the approximation is necessarily inaccurate. The example program calls c02agc (nag_zeros_real_poly) to determine the above zeros.
It is easy to test the stability of the computed numerator and denominator coefficients by making small perturbations of the original Maclaurin series coefficients (e.g., or ). These questions of intrinsic error of the approximants and computational error in their calculation are discussed in Chapter 2 of Baker and Graves–Morris (1981).
|
|
Further Comments
|
|
The time taken is approximately proportional to .
|
|
|
Examples
|
|
>
|
ia := 5:
ib := 5:
c := Vector([1, 1, 0.5, 0.1666666666666667, 0.04166666666666666, 0.008333333333333333, 0.001388888888888889, 0.0001984126984126984, 2.48015873015873e-05], datatype=float[8]):
a := Vector(5, datatype=float[8]):
b := Vector(5, datatype=float[8]):
NAG:-e02rac(c, a, b, 'ia' = ia, 'ib' = ib):
|
|
|
See Also
|
|
Baker G A Jr and Graves–Morris P R (1981) Padé approximants, Part 1: Basic theory encyclopaedia of Mathematics and its Applications Addison–Wesley
Graves–Morris P R (1979) The numerical calculation of Padé approximants Padé Approximation and its Applications. Lecture Notes in Mathematics (ed L Wuytack) 765 231–245 Adison–Wesley
e02 Chapter Introduction.
NAG Toolbox Overview.
NAG Web Site.
|
|