Transcript PPT

Lagrangian Interpolation
Mechanical 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
Lagrange 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
Lagrangian Interpolation
Lagrangian interpolating polynomial is given by
n
f n ( x)   Li ( x) f ( xi )
i 0
where ‘ n ’ in f n (x) stands for the n th order polynomial that approximates the function y  f (x)
given at (n  1) data points as  x0 , y 0 , x1 , y1 ,......,  x n 1 , y n 1 ,  x n , y n  , and
n
Li ( x)  
j 0
j i
x  xj
xi  x j
Li (x) is a weighting function that includes a product of (n  1) terms with terms of j  i
omitted.
5
http://numericalmethods.eng.usf.edu
Example
A trunnion is cooled 80°F to − 108°F. Given below is the table of
the coefficient of thermal expansion vs. temperature. Determine
the value of the coefficient of thermal expansion at T=−14°F using
the Lagrangian method for linear interpolation.
6
Temperature
(oF)
Thermal Expansion
Coefficient (in/in/oF)
80
6.47 × 10−6
0
6.00 × 10−6
−60
5.58 × 10−6
−160
4.72 × 10−6
−260
3.58 × 10−6
−340
2.45 × 10−6
http://numericalmethods.eng.usf.edu
Linear Interpolation
1
 (T )   Li (T ) (Ti )
6
i 0
5.9
 L0 (T ) (T0 )  L1 (T ) (T1 )
ys
5.8
f ( range)

f x desired
T0  0, α T0   6.00 10

6
5.6
5.58
T1  60, αT1   5.58 10
7
5.7
6
5.5
10
x s  10
0
15
20
25
30
35
40
45
x s  range  x desired
http://numericalmethods.eng.usf.edu
50
x s  10
1
Linear Interpolation (contd)
1
L0 (T )  
j 0
j 0
1
L1 (T )  
j 0
j 1
α T  

T  Tj

T  T1
T0  T1

T  T0
T1  T0
T0  T j
T  Tj
T1  T j
T  T0
T  T1
α T0  
α T1 
T0  T1
T1  T0
T  60
T 0
6.00 10 6 
5.58 10 6 ,  60  T  0
0  60
 60  0




 14  60
 14  0
6.00 10 6 
5.58 10 6
0  60
 60  0
 0.76667 6.00 10 6  0.23333 5.58 10 6

α 14 







 5.902 10 6 in/in/ F
8
http://numericalmethods.eng.usf.edu
Quadratic Interpolation
For the second order polynomial interpolatio n (also called quadratic interpolation), we
choose the velocity given by
2
v (t )   Li ( t ) v(t i )
i 0
 L0 (t )v (t 0 )  L1 (t ) v( t1 )  L2 (t ) v( t 2 )
9
http://numericalmethods.eng.usf.edu
Example
A trunnion is cooled 80°F to − 108°F. Given below is the table of
the coefficient of thermal expansion vs. temperature. Determine
the value of the coefficient of thermal expansion at T=−14°F using
the Lagrangian method for quadratic interpolation.
10
Temperature
(oF)
Thermal Expansion
Coefficient (in/in/oF)
80
6.47 × 10−6
0
6.00 × 10−6
−60
5.58 × 10−6
−160
4.72 × 10−6
−260
3.58 × 10−6
−340
2.45 × 10−6
http://numericalmethods.eng.usf.edu
Quadratic Interpolation (contd)
To  80, αTo   6.47 10 6
6.47
T1  0, αT1   6.00 106
6.4
T2  60, αT2   5.58 106
T  Tj
 T  T1  T  T2 


 
L0 (T )  
j 0 T0  T j
 T0  T1  T0  T2 
2
6.2
ys
f ( range)

f x desired

j 0
j 1
6
5.8
T  Tj
 T  T0  T  T2 


 
L1 (T )  
j 0 T1  T j
 T1  T0  T1  T2 
2
6.6
5.6
5.58
5.4
60
 60
40
20
0
20
x s  range  x desired
40
60
80
80
T  Tj
 T  T0  T  T1 


 
T

T
T

T
T

T
j 0 2
0  2
1 
j
 2
2
L2 (T )  
j 2
11
http://numericalmethods.eng.usf.edu
Quadratic Interpolation (contd)
 T  T1  T  T2 
 T  T0  T  T2 
 T  T0  T  T1 

 (T0 )  


 (T1 )  
 (T2 )
T

T
T

T
T

T
T

T
T

T
T

T
2 
2 
0  2
1 
 0 1  0
 1 0  1
 2
 (T )  
 14  0 14  60 6.47 106    14  80 14  60 6.00 106 
80  080  60
0  800  60
 14  80 14  0 5.58 106 

 60  80 60  0
  0.05756.47 10 6   0.900836.00 10 6   0.15667 5.58 10 6 
α  14 
 5.9072 10 6 in/in/ F
The absolute relative approximate error a obtained between the results from the first and second order
polynomial is
5.9072 106  5.902 106
a 
100
5.9072 106
 0.087605%
12
http://numericalmethods.eng.usf.edu
Cubic Interpolation
For the third order polynomial (also called cubic interpolation), we choose
the coefficient of thermal expansion given by
3
 (T )   Li (T ) (Ti )
i 0
 L0 (T ) (T0 )  L1 (T ) (T1 )  L2 (T ) (T2 )  L3 (T ) (T3 )
6.47
6.5
6
ys
f ( range)

f x desired

5.5
5
4.72
13
4.5
200
 160
150
100
50
x s  range  x desired
0
50
100
80
http://numericalmethods.eng.usf.edu
Example
A trunnion is cooled 80°F to − 108°F. Given below is the table of
the coefficient of thermal expansion vs. temperature. Determine
the value of the coefficient of thermal expansion at T=−14°F using
the Lagrangian method for cubic interpolation.
14
Temperature
(oF)
Thermal Expansion
Coefficient (in/in/oF)
80
6.47 × 10−6
0
6.00 × 10−6
−60
5.58 × 10−6
−160
4.72 × 10−6
−260
3.58 × 10−6
−340
2.45 × 10−6
http://numericalmethods.eng.usf.edu
Cubic Interpolation (contd)
To  80, αTo   6.47 10 6
T1  0, αT1   6.00 106
T2  60, αT2   5.58 106
T3  160, α T3   4.72 10 6
T  Tj
 T  T1  T  T2  T  T3 



 
T

T
T

T
T

T
T

T
j 0 0
2  0
3 
j
 0 1  0
3
L0 (T )  
6.47
6.5
j 0
T  Tj
 T  T0  T  T2  T  T3 



 
L1 (T )  
j 0 T1  T j
 T1  T0  T1  T2  T1  T3 
3
j 1
L2 (T )  
ys
f ( range)
T  Tj
 T  T0  T  T1  T  T3 



 
T

T
T

T
T

T
T

T
j 0 2
0  2
1  2
3 
j
 2
3
6

f x desired

5.5
5
j 2
T  Tj
 T  T0  T  T1  T  T2 



 
j  0 T3  T j
 T3  T0  T3  T1  T3  T2 
3
L3 (T )  
15
j 3
4.72
4.5
200
150
 160
100
50
0
50
x s  range  x desired
http://numericalmethods.eng.usf.edu
100
80
Cubic Interpolation (contd)
 T  T1  T  T2  T  T3 
 T  T0  T  T2  T  T3 


α T0   

α T1 

α T   
 T0  T1  T0  T2  T0  T3 
 T1  T0  T1  T2  T1  T3 
 T  T0  T  T1  T  T3 
 T  T0  T  T1  T  T2 

α T0   


α T1 

 
 T2  T0  T2  T1  T2  T3 
 T3  T0  T3  T1  T3  T2 
, T0  T  T3
 14  0 14  60 14  160 6.47 106    14  80 14  60 14  160 6.00 106 
80  080  6080  160
0  800  600  160
 14  80 14  0 14  160 5.58  106    14  80 14  0 14  60 4.72 106 

 60  80 60  0 60  160
 160  80 160  0 160  60
  0.0349796.47 10 6   0.822016.00 10 6   0.228735.58 10 6     0.0157654.72 10 6 
α 14 
 5.9077 10 6 in/in/ F
The absolute relative approximate error a obtained between the results from the second and third order
polynomial is
5.9077  10 6  5.9072  10 6
a 
 100
5.9077  10 6
16
 0.0083867%
http://numericalmethods.eng.usf.edu
Comparison Table
Order of Polynomial
Thermal Expansion
Coefficient (in/in/oF)
Absolute Relative
Approximate Error
17
1
2
3
5.902 × 10−6
5.9072 × 10−6
5.9077 × 10−6
----------
0.087605%
0.0083867%
http://numericalmethods.eng.usf.edu
Reduction in Diameter
The actual reduction in diameter is given by
Tf
D  D  dT
Tr
where Tr = room temperature (°F)
Tf = temperature of cooling medium (°F)
108
Since Tr = 80 °F and Tr = −108 °F,
D  D  dT
80
Find out the percentage difference in the reduction in the
diameter by the above integral formula and the result
using the thermal expansion coefficient from the cubic
interpolation.
18
http://numericalmethods.eng.usf.edu
Reduction in Diameter
We know from interpolation that
 T   6.00 10 6  6.4786 10 9 T  8.1944 10 12 T 2  8.1845 10 15 T 3 ,
 160  T  80
Therefore,
Tf
D
  dT
D Tr
108

 6.00 10
6

 6.4786 10 9 T  8.1944 10 12 T 2  8.1845 10 15 T 3 dT
80
180

T
T
T 
 6.00 10 6 T  6.4786 10 9
 8.1944 10 12
 8.1845 10 15 
2
3
4  80

2
3
4
 1105.9 10 6
19
http://numericalmethods.eng.usf.edu
Reduction in diameter
Using the average value for the coefficient of thermal
expansion from cubic interpolation
D
 T
D
  T f  Tr 
 5.9077 10 6  108  80 
 1110.6 10 6
The percentage difference would be


 1105.9  10 6   1110.6  10 6
a 
100
6
 1105.9 10
 0.42775%
20
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/lagrange_
method.html
THE END
http://numericalmethods.eng.usf.edu