hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_fit_pade_app (e02ra)

Purpose

nag_fit_pade_app (e02ra) calculates the coefficients in a Padé approximant to a function from its user-supplied Maclaurin expansion.

Syntax

[a, b, ifail] = e02ra(ia, ib, c)
[a, b, ifail] = nag_fit_pade_app(ia, ib, c)

Description

Given a power series
c0 + c1x + c2x2 + + cl + mxl + m +
c0+c1x+c2x2++cl+mxl+m+
nag_fit_pade_app (e02ra) uses the coefficients cici, for i = 0,1,,l + mi=0,1,,l+m, to form the [l / m][l/m] Padé approximant of the form
(a0 + a1x + a2x2 + + alxl)/(b0 + b1x + b2x2 + + bmxm)
a0+a1x+a2x2++alxl b0+b1x+b2x2++bmxm
with b0b0 defined to be unity. The two sets of coefficients ajaj, for j = 0,1,,lj=0,1,,l, and bkbk, for k = 0,1,,mk=0,1,,m, 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
{[m / m],m = 0,1,2,}.
{[m/m],m=0,1,2,}.
Subsequent evaluation of the approximant at a given value of xx may be carried out using nag_fit_pade_eval (e02rb).

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

Parameters

Compulsory Input Parameters

1:     ia – int64int32nag_int scalar
2:     ib – int64int32nag_int scalar
ia must specify l + 1l+1 and ib must specify m + 1m+1, where ll and mm are the degrees of the numerator and denominator of the approximant, respectively.
Constraint: ia1ia1 and ib1ib1.
3:     c(ic) – double array
ic, the dimension of the array, must satisfy the constraint icia + ib1icia+ib-1.
c(i)ci must specify, for i = 1,2,,l + m + 1i=1,2,,l+m+1, the coefficient of xi1xi-1 in the given power series.

Optional Input Parameters

None.

Input Parameters Omitted from the MATLAB Interface

ic w jw

Output Parameters

1:     a(ia) – double array
a(j + 1)aj+1, for j = 1,2,,l + 1j=1,2,,l+1, contains the coefficient ajaj in the numerator of the approximant.
2:     b(ib) – double array
b(k + 1)bk+1, for k = 1,2,,m + 1k=1,2,,m+1, contains the coefficient bkbk in the denominator of the approximant.
3:     ifail – int64int32nag_int scalar
ifail = 0ifail=0 unless the function detects an error (see [Error Indicators and Warnings]).

Error Indicators and Warnings

Errors or warnings detected by the function:
  ifail = 1ifail=1
On entry,jw < ib × (2 × ib + 3)jw<ib×(2×ib+3),
oria < 1ia<1,
orib < 1ib<1,
oric < ia + ib1ic<ia+ib-1
(so there are insufficient coefficients in the given power series to calculate the desired approximant).
  ifail = 2ifail=2
The Padé approximant is degenerate.

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 x = 0.0x=0.0 characterise ill-conditioning in the construction of the approximant.) Defects occur in regions where the approximation is necessarily inaccurate. The example program calls nag_zeros_poly_real (c02ag) 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., clcl or cl + mcl+m). 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 m3m3.

Example

function nag_fit_pade_app_example
ia = int64(5);
ib = int64(5);
c = [1;
     1;
     0.5;
     0.1666666666666667;
     0.04166666666666666;
     0.008333333333333333;
     0.001388888888888889;
     0.0001984126984126984;
     2.48015873015873e-05];
[a, b, ifail] = nag_fit_pade_app(ia, ib, c)
 

a =

    1.0000
    0.5000
    0.1071
    0.0119
    0.0006


b =

    1.0000
   -0.5000
    0.1071
   -0.0119
    0.0006


ifail =

                    0


function e02ra_example
ia = int64(5);
ib = int64(5);
c = [1;
     1;
     0.5;
     0.1666666666666667;
     0.04166666666666666;
     0.008333333333333333;
     0.001388888888888889;
     0.0001984126984126984;
     2.48015873015873e-05];
[a, b, ifail] = e02ra(ia, ib, c)
 

a =

    1.0000
    0.5000
    0.1071
    0.0119
    0.0006


b =

    1.0000
   -0.5000
    0.1071
   -0.0119
    0.0006


ifail =

                    0



PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013