POLYNOMIAL INTERPOLATION

advertisement
POLYNOMIAL
INTERPOLATION
• Fitting polynomial to given data points
• Most of numerical method schemes are
based on polynomial interpolation, e.g.
numerical integration and differentiation.
LINEAR INTERPOLATION
• The linear interpolation shown in figure
previous is given by
x  x0
x1  x
f ( x) 
f ( x0 ) 
f ( x1 )
x1  x0
x1  x0
• The maximum error of the linear
interpolation is expressed in the form
1
x0  x1
e( x)  x  x0 x  x1  f ' ' ( xm ) ,
xm 
2
2
Can three or more data points be fitted by a
curve ?
LAGRANGE INTERPOLATION
• Suppose N+1 data points are given. The
Lagrange interpolation formula of order N-th is
written as follows
( x  x1 )(x  x2 ) ( x  xN )
f ( x) 
f ( x0 )
( x0  x1 )(x0  x2 ) ( x0  xN )
( x  x0 )(x  x2 ) ( x  xN )

f ( x1 )   
( x1  x0 )(x1  x2 ) ( x1  xN )
( x  x0 )(x  x1 ) ( x  xN 1 )

f ( xN )
( xN  x0 )(xN  x2 ) ( xN  xN 1 )
• The maximum error of Lagrange
interpolation is expressed in the form
1
x  x0 x  x1 ( x  xN ) f ( N 1) ( xm ) ,
e( x) 
( N  1)!
• There is no guarantee that the
interpolation polynomial converges to the
exact function when the number of data
point is increased. In general, interpolation
with a large-order polynomial should be
avoided or used with extreme cautions
NEWTON INTERPOLATION
The drawback of the Lagrange interpolation:
• The amount of computation needed for
one interpolation is large
• No part of the previous application can be
used to interpolate another value of x
• When the number of data points has to be
increased or decreased, the results of the
previous computations cannot be used
• Evaluation of error is not easy
DIVIDED DIFFERENCE
• To evaluate a Newton interpolation formula, a
forward difference table is necessary
f ( xi 1 )  f ( xi )
f xi , xi 1  
xi 1  xi
i  0,1,2,, N
f [ xi 1 , xi  2 ]  f [ xi , xi 1 ]
f xi , xi 1 , xi  2  
xi  2  xi
f x1 , x2 ,, xN   f x0 , x1 , x2 ,, xN 1 
f x0 , x1 , x2 ,, xN  
xN  x0
• Therefore, the forward difference table is given
by (for third order)
i
xi
f ( xi )
f [ xi , xi 1 ] f [ xi , xi 1 , xi 2 ]
0
x0
f ( x0 )
f [ x0 , x1 ]
f [ x0 , x1 , x2 ]
1
x1
f ( x1 )
f [ x1 , x2 ]
f [ x1 , x2 , x3 ]
2
x2
f ( x2 )
f [ x2 , x3 ]
3
x3
f ( x3 )
f [ xi ,, xi 3 ]
f [ x0 , x1, x2 , x3 ]
• Hence, the Newton interpolation formula is
written as follows
f ( x)  f ( x0 )  x  x0  f [ x0 , x1 ]  ( x  x0 )(x  x1 ) f [ x0 , x1, x2 ]
  ( x  x0 )(x  x1 )( x  xN 1 ) f [ x0 , x1,, xN ]
where f [ x0 , x1 ], f [ x0 , x1, x2 ] , , f [ x0 , x1,, xN ]
are obtained from forward difference table
• The maximum error of Newton interpolation
is in the form
e( x)  x  x0 x  x1 ( x  xN ) f [ x0 , x1 ,, xN 1 ]
Application
Consider the data points given in the following table
i
0
1
2
3
4
5
xi
0.1
0.2
0.3
0.5
0.7
0.9
f ( xi ) 0.9975
0.9776
0.9384 0.8812 0.8075 0.7196
• Derive the Lagrange and Newton forward
interpolation fitted to the data points at
a. i = 0, 1, 2
(evaluate for x = 0.21)
b. i = 1, 2, 3
(evaluate for x = 0.21)
c. i = 1, 2, 3, 4 (evaluate for x = 0.21)
• Estimate the maximum error for every
evaluate of x
Download