pade
-- Pade approximationpade
(f, ..)
computes a Pade approximant of
the expression f
.
pade(f, x <, [m, n]>)
pade(f, x = x0 <, [m, n]>)
f |
- | an arithmetical expression
or a series of domain type Series::Puiseux generated by the
function series |
x |
- | an identifier |
x0 |
- | an arithmetical expression.
If x0 is not specified, then x0 = 0 is
assumed. |
[m, n] |
- | a list of nonnegative integers specifying the order of
the approximation. The default values are [3, 3] . |
an arithmetical expression or FAIL
.
(x-x0)^p * (a0+a1*(x-x0)+..+a.m*(x-x0)^m) / (1+b1*(x-x0)+..+b.n*(x-x0)^n)approximating f. The parameters p and a0 are given by the leading order term f = a0*(x-x0)^p + O((x-x0)^(p+1)) of the series expansion of f around x = x0. The parameters a1,..,b.n are chosen such that the series expansion of the Pade approximant coincides with the series expansion of f to the maximal possible order.
FAIL
is returned. Note
that series
must be
able to produce a Taylor series or a Laurent series of f,
i.e., an expansion in terms of integer powers of x-x0 must
exist.The Pade approximant is a rational approximation of a series expansion:
>> f := cos(x)/(1 + x): P := pade(f, x, [2, 2])
2 2 x - 7 x + 12 --------------- 2 14 x + x + 12
For most expressions of leading order 0, the series expansion of the Pade approximant coincides with the series expansion of the expression through order m + n:
>> S := series(f, x, 6)
2 3 4 5 x x 13 x 13 x 6 1 - x + -- - -- + ----- - ----- + O(x ) 2 2 24 24
This differs from the expansion of the Pade approximant at order 5:
>> series(P, x, 6)
2 3 4 5 x x 13 x 85 x 6 1 - x + -- - -- + ----- - ----- + O(x ) 2 2 24 144
The series expansion can be used directly as input to
pade
:
>> pade(S, x, [2, 3]), pade(S, x, [3, 2])
2 2 3 12 - 5 x 12 x + 7 x - 7 x - 12 -------------------, ----------------------- 2 3 2 12 x + x + x + 12 13 x - 12
Both Pade approximants approximate f
through order m + n = 5:
>> map([%], series, x)
-- 2 3 4 5 | x x 13 x 13 x 6 | 1 - x + -- - -- + ----- - ----- + O(x ), -- 2 2 24 24 2 3 4 5 -- x x 13 x 13 x 6 | 1 - x + -- - -- + ----- - ----- + O(x ) | 2 2 24 24 --
>> delete f, P, S:
The following expression does not have a Laurent expansion around x = 0:
>> series(x^(1/3)/(1 - x), x)
1/3 4/3 7/3 10/3 13/3 16/3 x + x + x + x + x + O(x )
Consequently, pade
fails:
>> pade(x^(1/3)/(1 - x), x, [3, 2])
FAIL
Note that the specified orders [m, n] do not necessarily coincide with the orders of the numerator and the denominator if the series expansion does not start with a constant term:
>> pade(x^10*exp(x), x, [2, 2]), pade(x^(-10)*exp(x), x, [2, 2])
10 11 12 2 12 x + 6 x + x 6 x + x + 12 --------------------, -------------------- 2 10 11 12 x - 6 x + 12 12 x - 6 x + x
Dom::Pade
pade
is not a domain any longer, hence Pade
approximants no longer form a data type of their own.