Академический Документы
Профессиональный Документы
Культура Документы
Polynomial interpolation determine the unique nth-order polynomial that fits n+1 data. e.g. 1st order polynomial(straight line) connect 2 points ; 2nd order polynomial connect 3 points etc. (Figure 18.1)
Although it is unique, the polynomial can be expressed in a variety of mathematical format: e.g. Newton and Lagrange Polynomials.
18.1 Newtons Divided difference Interpolating Polynomials among the most popular and useful forms. 18.1.1 Linear Interpolation use to connect two data points Refer to figure 18.2, using similar traingles, f1(x)-f(xo) = f(x1)-f(xo) x-xo x1-xo Can be rearranged to a linear interpolation formula f1(x) = f(xo) + f(x1)-f(xo) (x-xo) x1-xo The term f(x1)-f(xo) x1-xo
Is a finite-divided-difference approximation of the first derivative (recall eqn 4.17) --- the smaller the interval -- better approximation. Example 18.1
MATB324,June 2001 Chapter 18-2 Hanim Salleh
18.1.2 Quadratic Interpolation Previously we have seen some error in example 18.1. It is due to approximating a curve with a straight line. For three data points, a second-order polynomial can be used as in interpolating data.
f 2 ( x ) = bo + b1 ( x xo ) + b2 ( x xo )( x x1 )
. eqn. 18.3
or
f 2 ( x ) = ao + a1 x + a2 x 2
ao = bo b1 xo + b2 xo x1 a1 = b1 b2 xo b2 x1
where
a2=b2 when evaluate eqn. 18.3 , at x=xo f (x ) =b substitute back, then the eqn becomes,
o o
f ( x) = f ( xo ) + b1 ( x xo ) + b2 ( x xo )( x x1 )
or
b1 =
f ( x1 ) f ( x o ) x1 x o
if these b1 and bo values are substituted back into equation 18.3, and rearrange in terms of b2,
MATB324,June 2001 Chapter 18-3 Hanim Salleh
f ( x2 ) f ( x1 ) f ( x1 ) f ( xo ) x2 x1 x1 xo b2 = x2 xo
. Eq. 18.6
take note that this form is similar to finite divided difference for second derivative (eqn. 4.24) Example 18.2 18.1.3 General Form of Newtons Interpolating Polynomials We will look at general case to fit an nth-order polynomial to n+1 data points. The nth-order form is given by,
f n ( x) = bo + b1 ( x xo ) +.. + bn ( x xo )( x x1 )...( x xn1 )
the n+1 data points are [xo, f(xo)], [x1, f(x1)],. [xn, f(xn)], which are used to compute the coefficients bo= f(xo) ; b1=f[x1, xo] ; bn= f[xn, xn-1,x1, xo] where f[] indicates finite-divided difference e.g. eq. 18.12 through 18.14
from these relationship we can derive the Newtons divided-difference interpolating polynomial eqn. 18.5 Example 18.3 18.1.4 Error of Newtons Interpolating Polynomials Example 18.4 Computer Algorithm
18.2 LAGRANGE INTERPOLATING POLYNOMIALS This method is simply a reformulation of the Newton polynomial that avoids the computation of divided differences. It can be represented concisely as f ( x) = L ( x) f ( x ) eqn 18.20
n n i =0 i i
where
Li ( x) =
j =0; j i
x xj
i
xj
designates product of
or
f n ( x ) = Lo y o + L1 y1 +... + Ln y n
Li ( x ) =
notice that at x=xi, the Li (x) = 1 and Li (x)=0 when x=xj (at all other sample points). Thus each product takes on the value of f(xi) at the sample point xi. Consequently, the summation of all products designated by eqn, 18.20 is the unique nth order polynomial that passses exactly through all n+1 data points. See figure 18.10
Example Given three data points: [xo,yo]= (-2,4); (x1,y1)=(0,2), (x2,y2)=(2,8) Substitute in the formula: Lo = (x-0)(x-2)/(-2-0)(-2-2) L1 =(x-(-2))(x-2)/(0-(-2))(0-2) L2=(x-(-2))(x-0)/(2-(-2))(2-0)
f 2 ( x) = x( x 2) ( x + 2)( x 2) x( x + 2) 4+ 2+ 8 = x2 + x +2 8 4 8