Transcript PPT

Direct 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
Direct 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.
Figure 1 Interpolation of discrete.
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
Direct Method
Given ‘n+1’ data points (x0,y0), (x1,y1),………….. (xn,yn),
pass a polynomial of order ‘n’ through the data as given
below:
y  a0  a1 x  ....................  an x .
n
where a0, a1,………………. an are real constants.
 Set up ‘n+1’ equations to find ‘n+1’ constants.
 To find the value ‘y’ at a given value of ‘x’, simply
substitute the value of ‘x’ in the above polynomial.
5
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 linear, quadratic and cubic
interpolation 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   a 0  a1T
C p 52  a 0  a1 52  4186
C p 82  a 0  a1 82  4199
4.19910
3 4200
4195
ys
f ( range)

f x desired

4190
Solving the above two equations gives,
a0  4163.5
a1  0.43333
4.18610
3
4185
50
x s  10
0
60
70
80
x s  range  x desired
Hence
C p T   4163.5  0.43333T , 52  T  82.
J
C p 61  4163.5  0.4333361  4189.9
kg   C
7
http://numericalmethods.eng.usf.edu
90
x s  10
1
Quadratic Interpolation
C p T   a0  a1T  a2T
2
Cp42   a 0  a1 42   a 2 42   4179
2
Cp52   a 0  a1 52   a 2 52   4186
2
Cp82   a 0  a1 82   a 2 82   4199
2
Solving the above three equations gives
a0  4135.0
8
a1  1.3267
a2  6.6667  10 3
http://numericalmethods.eng.usf.edu
Quadratic Interpolation (contd)
4.19910
3
C p T   4135.0  1.3267T  6.6667  10 3 T 2 ,
4200
4195
42  T  82
ys
4190
f ( range)
C p 61  4135.0  1.326761  6.6667  10
J
 4191.2
kg   C
3
61
2

f x desired

4185
4180
4.17910
3
4175
40
42
45
50
55
60
65
70
75
80
x s  range  x desired
The absolute relative approximate error obtained between the results
from the first and second order polynomial is
a 
9
4191.2  4189.9
 100  0.030063%
4191.2
http://numericalmethods.eng.usf.edu
85
82
Cubic Interpolation
C p T   a0  a1T  a2T 2  a3T 3
Cp42   a 0  a1 42   a 2 42   a3 42   4179
2
3
Cp52   a 0  a1 52   a 2 52   a3 52   4186
2
3
Cp82   a 0  a1 82   a 2 82   a3 82   4199
2
3
Cp100   a 0  a1 100   a 2 100   a3 100   4217
2
a0  4078.0
10
a1  4.4771
3
a2  0.062720
a3  3.1849  10 4
http://numericalmethods.eng.usf.edu
Cubic Interpolation (contd)
4.21710
CpT   4078  4.4771T  0.06272T 2  3.1849  10 4 T 3 ,
42  T  100
3
4220
4210
ys
4200
f ( range)

f x desired

4190
T 61  4078  4.447161  0.0627261  3.1849  10 4 61
J
 4191.0
kg  C
2
3
4180
4.17910
3
4170
40
50
42
60
70
80
x s  range  x desired
90
100
100
The absolute relative approximate error obtained between the results
from the first and second order polynomial is
a 
11
4190.0  4191.2
 100  0.027295%
4190.0
http://numericalmethods.eng.usf.edu
Comparison Table
Order of
Polynomial
J
C p T 
kg   C
Absolute Relative
Approximate Error
12
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/direct_met
hod.html
THE END
http://numericalmethods.eng.usf.edu