9.6 KB · commit a9602da
The Lagrange interpolation formula, derived in Section 3.9.1, has the disadvantage that if another interpolation point were added, then the interpolation coefficients li(x) will have to be recomputed. We therefore seek an interpolation polynomial which has the property that a polynomial of higher degree may be derived from it by simply adding new terms. Newton's general interpolation formula is one such formula and it employs what are called divided differences. It is our principal purpose in this section to define such differences and discuss certain of their properties to obtain the basic formula due to Newton.
Let (x0,y0),(x1,y1),…,(xn,yn) be the given (n+1) points. Then the divided differences of order 1,2,…,n are defined by the relations:
[x0,x1][x0,x1,x2][x0,x1,…,xn]=x1−x0y1−y0,=x2−x0[x1,x2]−[x0,x1],⋮=xn−x0[x1,x2,…,xn]−[x0,x1,…,xn−1].⎭⎬⎫(3.58)Even if the arguments are equal, the divided differences may still have a meaning. We then set x1=x0+ε so that
[x0,x1]=ε→0lim[x0,x0+ε]=ε→0limεy(x0+ε)−y(x0)=y′(x0),if y(x) is differentiable.Similarly, [(r+1) argumentsx0,x0,…,x0]=r!yr(x0).(3.59)
From Eq. (3.58), it is easy to see that [x0,x1]=x0−x1y0+x1−x0y1=[x1,x0]. Again,
[x0,x1,x2]=x2−x01(x2−x1y2−y1−x1−x0y1−y0)=x2−x01[x2−x1y2−y1(x2−x11+x1−x01)+x1−x0y0]=(x0−x1)(x0−x2)y0+(x1−x0)(x1−x2)y1+(x2−x0)(x2−x1)y2.(3.60)Similarly it can be shown that
[x0,x1,…,xn]=(x0−x1)…(x0−xn)y0+(x1−x0)…(x1−xn)y1+…+(xn−x0)…(xn−xn−1)yn.(3.61)Hence the divided differences are symmetrical in their arguments.
Now let the arguments be equally spaced so that x1−x0=x2−x1=⋯=xn−xn−1=h. Then we obtain [x0,x1]=x1−x0y1−y0=h1Δy0(3.62) [x0,x1,x2]=x2−x0[x1,x2]−[x0,x1]=2h1(hΔy1−hΔy0)=2h21Δ2y0=h22!1Δ2y0(3.63) and in general, [x0,x1,…,xn]=hnn!1Δny0.(3.64)
If the tabulated function is a polynomial of nth degree, then Δny0 would be a constant and hence the nth divided difference would also be a constant.
For the set of values (xi,yi), i=0,1,2,…,n, divided differences can be generated by the following statements:
Define y(x_j) = y_j = DD(0, j), j = 0, 1, 2, ..., n
Do i = 1(1)n
Do j = 0(1)(n - i)
DD(i, j) = [DD(i - 1, j + 1) - DD(i - 1, j)] / [X(i + j) - X(j)]
Next j
Next i
By definition, we have [x,x0]=x−x0y−y0, so that y=y0+(x−x0)[x,x0](3.65) Again [x,x0,x1]=x−x1[x,x0]−[x0,x1] which gives [x,x0]=[x0,x1]+(x−x1)[x,x0,x1] Substituting this value of [x,x0] in Eq. (3.65), we obtain y=y0+(x−x0)[x0,x1]+(x−x0)(x−x1)[x,x0,x1](3.66) But [x,x0,x1,x2]=x−x2[x,x0,x1]−[x0,x1,x2], and so [x,x0,x1]=[x0,x1,x2]+(x−x2)[x,x0,x1,x2](3.67) Equation (3.66) now gives
y=y0+(x−x0)[x0,x1]+(x−x0)(x−x1)[x0,x1,x2]+(x−x0)(x−x1)(x−x2)[x,x0,x1,x2](3.68)Proceeding in this way, we obtain
y=y0+(x−x0)[x0,x1]+(x−x0)(x−x1)[x0,x1,x2]+(x−x0)(x−x1)(x−x2)[x0,x1,x2,x3]+…+(x−x0)(x−x1)(x−x2)…(x−xn)[x,x0,x1,…,xn](3.69)This formula is called Newton's general interpolation formula with divided differences, the last term being the remainder term after (n+1) terms.
After generating the divided differences, interpolation can be carried out by the following statements:
Let y_k be required corresponding to the value x = x_k. Then
Y_k = y_0
factor = 1.0
Do i = 0(1)(n - 1)
factor = factor * (x_k - x_i)
Y_k = Y_k + factor * DD(i + 1, 0)
Next i
End
Hence Eq. (3.69) gives
f(x)=3+(x+1)(−9)+x(x+1)(6)+x(x+1)(x−3)(5)+x(x+1)(x−3)(x−6)=x4−3x3+5x2−6.◀
Newton's general interpolation formula may be considered as one of a class of methods which generate successively higher-order interpolation formulae. We now describe another method of this class, due to A.C. Aitken, which has the advantage of being very easily programmed for a digital computer.
Given the (n+1) points (x0,y0),(x1,y1),…,(xn,yn), where the values of x need not necessarily be equally spaced, then to find the value of y corresponding to any given value of x we proceed iteratively as follows: obtain a first approximation to y by considering the first-two points only; then obtain its second approximation by considering the first-three points, and so on. We denote the different interpolation polynomials by Δ(x), with suitable subscripts, so that at the first stage of approximation, we have Δ01(x)=y0+(x−x0)[x0,x1]=x1−x01y0y1x0−xx1−x.(3.70) Similarly, we can form Δ02(x),Δ03(x),…
Next, we form Δ012 by considering the first-three points: Δ012(x)=x2−x11Δ01(x)Δ02(x)x1−xx2−x.(3.71) Similarly, we obtain Δ013(x),Δ014(x), etc. At the nth stage of approximation, we obtain Δ012…n(x)=xn−xn−11Δ012…n−1(x)Δ012…n−2n(x)xn−1−xxn−x.(3.72)
The computations may conveniently be arranged as in Table 3.8 below:
Table 3.8 Aitken's Scheme
| x | y | ||||
|---|---|---|---|---|---|
| x0 | y0 | ||||
| Δ01(x) | |||||
| x1 | y1 | Δ012(x) | |||
| Δ02(x) | Δ0123(x) | ||||
| x2 | y2 | Δ013(x) | Δ01234(x) | ||
| Δ03(x) | Δ0124(x) | ||||
| x3 | y3 | Δ014(x) | |||
| Δ04(x) | |||||
| x4 | y4 |
A modification of this scheme, due to Neville, is given in Table 3.9. Neville's scheme is particularly suited for iterated inverse interpolation.
Table 3.9 Neville's Scheme
| x | y | ||||
|---|---|---|---|---|---|
| x0 | y0 | ||||
| Δ01(x) | |||||
| x1 | y1 | Δ012(x) | |||
| Δ12(x) | Δ0123(x) | ||||
| x2 | y2 | Δ123(x) | Δ01234(x) | ||
| Δ23(x) | Δ1234(x) | ||||
| x3 | y3 | Δ234(x) | |||
| Δ34(x) | |||||
| x4 | y4 |
As an illustration of Aitken's method, we consider, again, Example 3.22.
An obvious advantage of Aitken's method is that it gives a good idea of the accuracy of the result at any stage.