NAG FL Interface
e02raf (pade_app)
1
Purpose
e02raf calculates the coefficients in a Padé approximant to a function from its user-supplied Maclaurin expansion.
2
Specification
Fortran Interface
Integer, Intent (In) |
:: |
ia, ib, ic, jw |
Integer, Intent (Inout) |
:: |
ifail |
Real (Kind=nag_wp), Intent (In) |
:: |
c(ic) |
Real (Kind=nag_wp), Intent (Out) |
:: |
a(ia), b(ib), w(jw) |
|
C Header Interface
#include <nag.h>
void |
e02raf_ (const Integer *ia, const Integer *ib, const double c[], const Integer *ic, double a[], double b[], double w[], const Integer *jw, Integer *ifail) |
|
C++ Header Interface
#include <nag.h> extern "C" {
void |
e02raf_ (const Integer &ia, const Integer &ib, const double c[], const Integer &ic, double a[], double b[], double w[], const Integer &jw, Integer &ifail) |
}
|
The routine may be called by the names e02raf or nagf_fit_pade_app.
3
Description
Given a power series
e02raf 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 nonexistent. 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 Chapter 4, Section 2, Chapters 5 and 6 of
Baker and Graves–Morris (1981)), 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
e02rbf.
4
References
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
5
Arguments
-
1:
– Integer
Input
-
2:
– Integer
Input
-
On entry:
ia must specify
and
ib must specify
, where
and
are the degrees of the numerator and denominator of the approximant, respectively.
Constraint:
and .
-
3:
– Real (Kind=nag_wp) array
Input
-
On entry: must specify, for , the coefficient of in the given power series.
-
4:
– Integer
Input
-
On entry: the dimension of the array
c as declared in the (sub)program from which
e02raf is called.
Constraint:
.
-
5:
– Real (Kind=nag_wp) array
Output
-
On exit: , for , contains the coefficient in the numerator of the approximant.
-
6:
– Real (Kind=nag_wp) array
Output
-
On exit: , for , contains the coefficient in the denominator of the approximant.
-
7:
– Real (Kind=nag_wp) array
Workspace
-
8:
– Integer
Input
-
On entry: the dimension of the array
w as declared in the (sub)program from which
e02raf is called.
Constraint:
.
-
9:
– Integer
Input/Output
-
On entry:
ifail must be set to
,
or
to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value
or
is recommended. If message printing is undesirable, then the value
is recommended. Otherwise, the value
is recommended.
When the value or is used it is essential to test the value of ifail on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
6
Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
Errors or warnings detected by the routine:
-
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, , and .
Constraint: .
On entry, and .
Constraint: .
-
The Pade approximant is degenerate.
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See
Section 9 in the Introduction to the NAG Library FL Interface for further information.
7
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
c02agf 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).
8
Parallelism and Performance
e02raf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
e02raf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
The time taken is approximately proportional to .
10
Example
This example calculates the
Padé approximant of
(whose power-series coefficients are first stored in the array
c). The poles and zeros are then calculated to check the character of the
Padé approximant.
10.1
Program Text
10.2
Program Data
None.
10.3
Program Results