Upload
others
View
6
Download
0
Embed Size (px)
Citation preview
http://numericalmethods.eng.usf.edu 1
Lagrangian Interpolation
Mechanical Engineering Majors
Authors: Autar Kaw, Jai Paul
http://numericalmethods.eng.usf.eduTransforming Numerical Methods Education for STEM
Undergraduates
Lagrange Method of Interpolation
http://numericalmethods.eng.usf.edu
http://numericalmethods.eng.usf.edu3
What is Interpolation ?Given (x0,y0), (x1,y1), …… (xn,yn), find the value of ‘y’ at a value of ‘x’ that is not given.
http://numericalmethods.eng.usf.edu4
Interpolants
Polynomials are the most common choice of interpolants because they are easy to:
EvaluateDifferentiate, and Integrate.
http://numericalmethods.eng.usf.edu5
Lagrangian InterpolationLagrangian interpolating polynomial is given by
∑=
=n
iiin xfxLxf
0
)()()(
where ‘ n ’ in )(xfn stands for the thn order polynomial that approximates the function )(xfy =
given at )1( +n data points as ( ) ( ) ( ) ( )nnnn yxyxyxyx ,,,,......,,,, 111100 −− , and
∏≠= −
−=
n
ijj ji
ji xx
xxxL
0
)(
)(xLi is a weighting function that includes a product of )1( −n terms with terms of ij = omitted.
http://numericalmethods.eng.usf.edu6
ExampleA 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.
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.edu7
Linear Interpolation
5045403530252015105.5
5.6
5.7
5.8
5.9
6
5.58
y s
f range( )
f x desired( )
x s110+x s0
10− x s range, x desired,
∑=
=1
0)()()(
iii TTLT αα
)()()()( 1100 TTLTTL αα +=
( ) 600 100060 −×== .Tα,T
( ) 611 1058560 −×=−= .Tα,T
http://numericalmethods.eng.usf.edu8
Linear Interpolation (contd)∏≠= −
−=
1
00 0
0 )(jj j
j
TTTT
TL10
1
TTTT−−
=
∏≠= −
−=
1
10 1
1 )(jj j
j
TTTT
TL01
0
TTTT
−−
=
( ) ( ) ( )
( ) ( ) 060,10585060
01000660060 66
101
00
10
1
≤≤−×−−−
+×++
=
−−
+−−
=
−− T.T.T
TαTTTTTα
TTTTTα
( ) ( ) ( )( ) ( )
Fin/in/ 1090251058523333010006766670
1058506001410006
600601414
6
66
66
°×=
×+×=
×−−−−
+×++−
=−
−
−−
−−
.....
..α
http://numericalmethods.eng.usf.edu9
Quadratic InterpolationFor the second order polynomial interpolation (also called quadratic interpolation), we
choose the veloc ity given by
∑=
=2
0
)()()(i
ii tvtLtv
)()()()()()( 221100 tvtLtvtLtvtL ++=
http://numericalmethods.eng.usf.edu10
ExampleA 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.
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.edu11
Quadratic Interpolation (contd)
60 40 20 0 20 40 60 805.4
5.6
5.8
6
6.2
6.4
6.66.47
5.58
y s
f range( )
f x desired( )
8060− x s range, x desired,
( ) 61047680 −×== .Tα,T oo
( ) 611 100060 −×== .Tα,T
( ) 622 1058560 −×=−= .Tα,T
∏≠= −
−=
2
00 0
0 )(jj j
j
TTTT
TL
−−
−−
=20
2
10
1
TTTT
TTTT
∏≠= −
−=
2
10 1
1 )(jj j
j
TTTT
TL
−−
−−
=21
2
01
0
TTTT
TTTT
∏≠= −
−=
2
20 2
2 )(jj j
j
TTTT
TL
−−
−−
=12
1
02
0
TTTT
TTTT
http://numericalmethods.eng.usf.edu12
Quadratic Interpolation (contd))()()()( 2
12
1
02
01
21
2
01
00
20
2
10
1 TTTTT
TTTT
TTTTT
TTTT
TTTTT
TTTTT αααα
−−
−−
+
−−
−−
+
−−
−−
=
( ) ( )( )( )( ) ( ) ( )( )
( )( ) ( )( )( )( )( ) ( )( )( ) ( )( ) ( )( )
Fin/in/109072.510585156670100069008301047605750
1058506080600148014
10006600800
60148014104766080080
601401414
6
666
6
66
°×=
×+×+×−=
×−−−−−−−−
+
×+−
+−−−+×
+−+−−−
=−
−
−−−
−
−−
......
.
..α
The absolute relative approximate error a∈ obtained between the results from the first and second order polynomial is
1001090725
10902510907256
66
××
×−×=∈ −
−−
...
a
%087605.0=
http://numericalmethods.eng.usf.edu13
Cubic Interpolation
200 150 100 50 0 50 1004.5
5
5.5
6
6.56.47
4.72
y s
f range( )
f x desired( )
80160− x s range, x desired,
For the third order polynomial (also called cubic interpolation), we choose
the coefficient of thermal expansion given by
∑=
=3
0)()()(
iii TTLT αα
)()()()()()()()( 33221100 TTLTTLTTLTTL αααα +++=
http://numericalmethods.eng.usf.edu14
ExampleA 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.
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.edu15
Cubic Interpolation (contd)
200 150 100 50 0 50 1004.5
5
5.5
6
6.56.47
4.72
y s
f range( )
f x desired( )
80160− x s range, x desired,
( ) 61047680 −×== .Tα,T oo ( ) 611 100060 −×== .Tα,T
( ) 622 1058560 −×=−= .Tα,T ( ) 6
33 10724160 −×=−= .Tα,T
∏≠= −
−=
3
00 0
0 )(jj j
j
TTTT
TL
−−
−−
−−
=30
3
20
2
10
1
TTTT
TTTT
TTTT
∏≠= −
−=
3
10 1
1 )(jj j
j
TTTT
TL
−−
−−
−−
=31
3
21
2
01
0
TTTT
TTTT
TTTT
∏≠= −
−=
3
20 2
2 )(jj j
j
TTTT
TL
−−
−−
−−
=32
3
12
1
02
0
TTTT
TTTT
TTTT
∏≠= −
−=
3
30 3
3 )(jj j
j
TTTT
TL
−−
−−
−−
=23
2
13
1
03
0
TTTT
TTTT
TTTT
http://numericalmethods.eng.usf.edu16
Cubic Interpolation (contd)( ) ( ) ( )
( ) ( )123
2
13
1
03
00
32
3
12
1
02
0
131
3
21
2
01
00
30
3
20
2
10
1
TαTTTT
TTTT
TTTTTα
TTTT
TTTT
TTTT
TαTTTT
TTTT
TTTTTα
TTTT
TTTT
TTTTTα
−−
−−
−−
+
−−
−−
−−
+
−−
−−
−−
+
−−
−−
−−
=
, 30 TTT ≤≤
( ) ( )( )( )( )( )( ) ( ) ( )( )( )
( )( )( ) ( )( )( )( )( )( )( ) ( ) ( )( )( )
( )( )( ) ( )( )( ) ( )( ) ( )( ) ( )( )
Fin/in/ 109077.51072401576501058522873010006822010104760349790
1072460160016080160
6014014801410585160600608060160140148014
100061600600800
160146014801410476160806080080
16014601401414
6
6666
66
66
°×=
×−+×+×+×−=
×+−−−−−
+−−−−−+×
+−−−−−+−−−−−
+
×++−
+−+−−−+×
++−+−+−−−
=−
−
−−−−
−−
−−
........
. .
..α
The absolute relative approximate error a∈ obtained between the results from the second and third order polynomial is
%0083867.0
1001090775
109072510907756
66
=
××
×−×=∈ −
−−
...
a
http://numericalmethods.eng.usf.edu17
Comparison Table
Order of Polynomial 1 2 3 Thermal Expansion
Coefficient (in/in/oF) 5.902 × 10−6 5.9072 × 10−6 5.9077 × 10−6
Absolute Relative Approximate Error ---------- 0.087605% 0.0083867%
http://numericalmethods.eng.usf.edu18
Reduction in DiameterThe actual reduction in diameter is given by
where Tr = room temperature (°F)Tf = temperature of cooling medium (°F)
Since Tr = 80 °F and Tr = −108 °F,
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.
∫−
=∆108
80
dTDD α
∫=∆Tf
Tr
dTDD α
http://numericalmethods.eng.usf.edu19
Reduction in DiameterWe know from interpolation that
( )80160
,101845.8101944.8104786.61000.6 31521296
≤≤−×+×−×+×= −−−−
TTTTTα
Therefore,
( )
6
180
80
415
312
296
108
80
31521296
109.1105
4101845.8
3101944.8
2104786.61000.6
101845.8101944.8104786.61000.6
−
−
−−−−
−−−−−
×−=
×+×−×+×=
×+×−×+×=
=∆
∫
∫
TTTT
dTTTT
dTDD f
r
T
T
α
http://numericalmethods.eng.usf.edu20
Reduction in diameterUsing the average value for the coefficient of thermal expansion from cubic interpolation
( )( )6
6
106.111080108109077.5
−
−
×−=
−−×=
−=
∆=∆
rf TT
TDD
α
α
The percentage difference would be
( )
%42775.0
100109.1105
106.1110109.11056
66
=
××−
×−−×−=∈ −
−−
a
Additional ResourcesFor 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