Newton's Divided Difference Polynomial Power

advertisement
Newton’s Divided Difference
Polynomial Method of
Interpolation
Chemical Engineering Majors
Authors: Autar Kaw, Jai Paul
http://numericalmethods.eng.usf.edu
Transforming Numerical Methods Education for STEM
Undergraduates
http://numericalmethods.eng.usf.edu
1
Newton’s Divided
Difference Method of
Interpolation
http://numericalmethods.eng.usf.edu
What is Interpolation ?
Given (x0,y0), (x1,y1), …… (xn,yn), find the
value of ‘y’ at a value of ‘x’ that is not given.
3
http://numericalmethods.eng.usf.edu
Interpolants
Polynomials are the most common
choice of interpolants because they
are easy to:
Evaluate
Differentiate, and
Integrate.
4
http://numericalmethods.eng.usf.edu
Newton’s Divided Difference
Method
Linear interpolation: Given ( x0 , y0 ), ( x1 , y1 ), pass a
linear interpolant through the data
f1 ( x)  b0  b1 ( x  x0 )
where
b0  f ( x0 )
b1 
5
f ( x1 )  f ( x0 )
x1  x0
http://numericalmethods.eng.usf.edu
Example
To find how much heat is required to bring a kettle of water to its boiling point,
you are asked to calculate the specific heat of water at 61°C. The specific heat of
water is given as a function of time in Table 1. Use Newton’s divided difference
method with a first order and then a second order polynomial to determine the
value of the specific heat at T = 61°C.
Table 1 Specific heat of water as a
function of temperature.
Temperature,
Specific heat,
22
42
52
82
100
4181
4179
4186
4199
4217
T C
 J 

C p 
 kg  C 
Figure 2 Specific heat of water vs. temperature.
6
http://numericalmethods.eng.usf.edu
Linear Interpolation
C p (T )  b0  b1 (T  T0 )
T0  52, C p (T0 )  4186
T1  82, C p (T1 )  4199
b0  C p (T0 )  4186
b1 
3 4200
4195
ys
f ( range)

f x desired

C p (T 1 )  C p (T 0 )
T 1 T 0
4199  4186

82  52
7
4.19910
 0.43333
4190
4.18610
3
4185
50
x s  10
0
60
70
x s  range  x desired
80
90
x s  10
1
http://numericalmethods.eng.usf.edu
Linear Interpolation (contd)
C p (T )  b0  b1 (T  T0 )
 4186  0.43333(T  52), 52  T  82
At T  61
C p (61)  4186  0.43333(61  52)
J
 4189.9
kg   C
4.19910
3 4200
4195
ys
f ( range)

f x desired

4190
4.18610
3
4185
50
x s  10
0
8
60
70
80
x s  range  x desired
http://numericalmethods.eng.usf.edu
90
x s  10
1
Quadratic Interpolation
Given ( x0 , y0 ), ( x1 , y1 ), and ( x2 , y2 ), fit a quadratic interpolant through the data.
f 2 ( x)  b0  b1 ( x  x0 )  b2 ( x  x0 )( x  x1 )
b0  f ( x0 )
f ( x1 )  f ( x0 )
b1 
x1  x0
f ( x 2 )  f ( x1 ) f ( x1 )  f ( x0 )

x 2  x1
x1  x0
b2 
x 2  x0
9
http://numericalmethods.eng.usf.edu
Quadratic Interpolation (contd)
C p (T )  b0  b1 (T  T0 )  b2 (T  T0 )(T  T1 )
4.19910
3
4200
4195
T0  42, C p (T0 )  4179
ys
T1  52, C p (T1 )  4186 
4190
f ( range)
f x desired

4185
T2  82, C p (T2 )  4199
4180
4.17910
3
4175
40
42
10
45
50
55
60
65
x s  range  x desired
70
75
80
85
82
http://numericalmethods.eng.usf.edu
Quadratic Interpolation (contd)
b0  C p (T0 )  4179
b1 
C p (T1 )  C p (T0 )
T1  T0
C p (T2 )  C p (T1 )
b2 


T2  T1

4186  4179
 0.7
52  42
C p (T1 )  C p (T0 )
T2  T0
T1  T0
4199  4186 4186  4179

52  42
 82  52
82  42
0.43333  0.7
40
 6.6667  10 3
11
http://numericalmethods.eng.usf.edu
Quadratic Interpolation (contd)
C p (T )  b0  b1 (T  T0 )  b2 (T  T0 )(T  T1 )
 4179  0.7(T  42)  6.6667  10 3 (T  42)(T  52),
42  T  82
At T  61,
C p (61)  4179  0.7(61  42)  6.6667 10 3 (61  42)(61  52)
J
 4191.2
kg   C
The absolute relative approximate error a obtained between the results from the first and
second order polynomial is
a 
4191.2  4189.9
 100
4191.2
 0.030063%
12
http://numericalmethods.eng.usf.edu
General Form
f 2 ( x)  b0  b1 ( x  x0 )  b2 ( x  x0 )( x  x1 )
where
b0  f [ x0 ]  f ( x0 )
f ( x1 )  f ( x 0 )
b1  f [ x1 , x0 ] 
x1  x0
f ( x 2 )  f ( x1 ) f ( x1 )  f ( x0 )

f [ x 2 , x1 ]  f [ x1 , x0 ]
x 2  x1
x1  x0
b2  f [ x 2 , x1 , x0 ] 

x 2  x0
x 2  x0
Rewriting
f 2 ( x)  f [ x0 ]  f [ x1 , x0 ]( x  x0 )  f [ x2 , x1 , x0 ]( x  x0 )( x  x1 )
13
http://numericalmethods.eng.usf.edu
General Form
Given (n  1) data points, x0 , y0 , x1 , y1 ,......, xn1 , y n1 , xn , y n  as
f n ( x)  b0  b1 ( x  x0 )  ....  bn ( x  x0 )( x  x1 )...( x  xn1 )
where
b0  f [ x0 ]
b1  f [ x1 , x0 ]
b2  f [ x2 , x1 , x0 ]

bn1  f [ xn1 , xn2 ,...., x0 ]
bn  f [ xn , xn1 ,...., x0 ]
14
http://numericalmethods.eng.usf.edu
General form
The third order polynomial, given ( x0 , y0 ), ( x1 , y1 ), ( x2 , y2 ), and ( x3 , y3 ), is
f 3 ( x)  f [ x0 ]  f [ x1 , x0 ]( x  x0 )  f [ x2 , x1 , x0 ]( x  x0 )( x  x1 )
 f [ x3 , x 2 , x1 , x0 ]( x  x0 )( x  x1 )( x  x 2 )
b0
x0
f ( x0 )
b1
f [ x1 , x0 ]
x1
b2
f [ x2 , x1 , x0 ]
f ( x1 )
f [ x3 , x2 , x1 , x0 ]
f [ x2 , x1 ]
x2
b3
f [ x3 , x2 , x1 ]
f ( x2 )
f [ x3 , x 2 ]
x3
15
f ( x3 )
http://numericalmethods.eng.usf.edu
Example
To find how much heat is required to bring a kettle of water to its boiling point,
you are asked to calculate the specific heat of water at 61°C. The specific heat of
water is given as a function of time in Table 1. Use Newton’s divided difference
method with a third order polynomial to determine the value of the specific heat at
T = 61°C.
Table 1 Specific heat of water as a
function of temperature.
Temperature,
Specific heat,
22
42
52
82
100
4181
4179
4186
4199
4217
T C
 J 

C p 
 kg  C 
Figure 2 Specific heat of water vs. temperature.
16
http://numericalmethods.eng.usf.edu
Example
The specific heat profile is chosen as
C p (T )  b0  b1 (T  T0 )  b2 (T  T0 )(T  T1 )  b3 (T  T0 )(T  T1 )(T  T2 )
We need to choose four data points that are closest to T  61C .
T0  42, C p (T0 )  4179
T1  52,
C p (T1 )  4186
T2  82,
C p (T2 )  4199
T3  100, C p (T3 )  4217
17
http://numericalmethods.eng.usf.edu
Example
b0
T0  42,
b1
4179
b2
0.7
T1  52,
 6.6667  10 3
4186
3.1849  10 4
0.43333
T2  82,
4199
b3
0.011806
1
T3  100,
4217
The values of the constants are found to be
b0  4179 b1  0.7
b2  6.6667  10 3
18
b3  3.1849  10 4
http://numericalmethods.eng.usf.edu
Example
C p (T )  b0  b1 (T  T0 )  b2 (T  T0 )(T  T1 )  b3 (T  T0 )(T  T1 )(T  T2 )
 4179  0.7(T  42)  6.6667  10 3 (T  42)(T  52)
 3.1849  10 4 T  42T  52T  82
42  T  100
At T  61,
C p (61)  4179  0.7(61  42)  6.6667  10 3 (61  42)(61  52)
 3.1849  10 4 61  4261  5261  82
J
 4190.0
kg   C
The absolute relative approximate error a obtained between the results from the second and
third order polynomial is
4190.0  4191.2
a 
 100
4190.0
 0.027295 %
19
http://numericalmethods.eng.usf.edu
Comparison Table
Order of
Polynomial
J
C p T 
kg   C
Absolute Relative
Approximate Error
20
1
2
3
4189.9
4191.2
4190.0
----------
0.030063%
0.027295%
http://numericalmethods.eng.usf.edu
Additional Resources
For all resources on this topic such as digital audiovisual
lectures, primers, textbook chapters, multiple-choice
tests, worksheets in MATLAB, MATHEMATICA, MathCad
and MAPLE, blogs, related physical problems, please
visit
http://numericalmethods.eng.usf.edu/topics/newton_div
ided_difference_method.html
THE END
http://numericalmethods.eng.usf.edu
Download