Page 141 - Applied Numerical Methods Using MATLAB
P. 141
130 INTERPOLATION AND CURVE FITTING
o
o
o
o
f(x) ≈ T M+N (x − x ) = f(x ) + f (x )(x − x )
o
o
f (2) (x ) o 2 f (M+N) (x ) o M+N
+ (x − x ) +· · · + (x − x )
2 (M + N)!
o
o M+N
o 2
= a 0 + a 1 (x − x ) + a 2 (x − x ) +· · · + a M+N (x − x ) (3.4.2)
o
Assuming x = 0 for simplicity, we get the coefficients of D N (x) and Q M (x)
such that
Q M (x)
T M+N (x) − = 0
D N (x)
N
(a 0 + a 1 x +· · · + a M+N x M+N )(1 + d 1 x +· · · + d N x )
M
−(q 0 + q 1 x +· · · + q M x )
= 0
2
1 + d 1 x + d 2 x +· · · + d N x N
N
(a 0 + a 1 x +· · · + a M+N x M+N )(1 + d 1 x +· · · + d N x )
= q 0 + q 1 x +· · · + q M x M (3.4.3)
by solving the following equations:
a 0 = q 0
a 1 + a 0 d 1 = q 1
a 2 + a 1 d 1 + a 0 d 2 = q 2 (3.4.4a)
··· ··· · · · · ·· · · ·
a M + a M−1 d 1 + a M−2 d 2 ·· · + a M−N d N = q M
a M+1 + a M d 1 + a M−1 d 2 ·· · + a M−N+1 d N = 0
a M+2 + a M+1 d 1 + a M d 2 ·· · + a M−N+2 d N = 0
(3.4.4b)
··· ··· · · · · ·· · · · · ··
a M+N + a M+N−1 d 1 + a M+N−2 d 2 ·· · + a M d N = 0
Here, we must first solve Eq. (3.4.4b) for d 1 ,d 2 ,.. . ,d N and then substitute d i ’s
into Eq. (3.4.4a) to obtain q 0 ,q 1 ,...,q M .
The MATLAB routine “padeap()” implements this scheme to find the coef-
ficient vectors of the numerator/denominator polynomial Q M (x)/D N (x) of the
Pade approximation for a given function f(x). Note the following things:
o
o
o
ž The derivatives f (x ), f (2) (x ), . ..,f (M+N) (x ) up to order (M + N)are
computed numerically by using the routine “difapx()”, that will be intro-
duced in Section 5.3.
ž In order to compute the values of the Pade approximate function, we substi-
o
tute (x − x ) for x in p M,N (x) which has been obtained with the assumption
o
that x = 0.