Professional Documents
Culture Documents
Derive Lagrangian Method of Interpolation, 2. Solve Problems Using Lagrangian Method of Interpolation, and 3. Use Lagrangian Interpolants To Find Derivatives and Integrals of Discrete
Derive Lagrangian Method of Interpolation, 2. Solve Problems Using Lagrangian Method of Interpolation, and 3. Use Lagrangian Interpolants To Find Derivatives and Integrals of Discrete
Lagrangian Interpolation
Lagrangian Method
The 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 , y0 , x1 , y1 ,......, xn1 , yn1 , xn , yn ,
and
n x xj
Li ( x)
j 0 xi x j
j i
x3 , y3
x1, y1
x2 , y2 f x
x0 , y0
x
Page | 145
Chemical engineering Department Assist Lecturer Ghadeer Jassim
Example 1
The upward velocity of a rocket is given as a function of time in Table 1.
Determine the value of the velocity at t 16 seconds using a first order Lagrange
polynomial.
Solution
For first order polynomial interpolation (also called linear interpolation), the
velocity is given by
1
v(t ) Li (t )v(t i )
i 0
L0 (t )v(t 0 ) L1 (t )v(t1 )
x1 , y1
f1 x
x0 , y0
x
Figure 2 Linear interpolation.
Since we want to find the velocity at t 16 , and we are using a first order
polynomial, we need to choose the two data points that are closest to t 16 that
also bracket t 16 to evaluate it. The two points are t 0 15 and t1 20 .
Page | 146
Chemical engineering Department Assist Lecturer Ghadeer Jassim
Then
t0 15, vt0 362.78
t1 20, vt1 517.35
gives
1 t tj t t1
L0 (t )
j 0 t0 t j t 0 t1
j 0
1 t tj t t0
L1 (t )
j 0 1 t tj t1 t 0
j 1
Hence
t t1 t t0
v(t ) v(t 0 ) v(t1 )
t 0 t1 t1 t 0
t 20 t 15
(362.78) (517.35), 15 t 20
15 20 20 15
16 20 16 15
v(16) (362.78) (517.35) 0.8(362.78) 0.2(517.35) 393.69 m/s
15 20 20 15
You can see that L0 (t ) 0.8 and L1 (t ) 0.2 are like weightages given to the
velocities at t 15 and t 20 to calculate the velocity at t 16 .
Quadratic Interpolation
y
x1 , y1
x2 , y2
f 2 x
x0 , y0
x
Figure 3 Quadratic interpolation.
Example 2
The upward velocity of a rocket is given as a function of time in Table 2.
Page | 147
Chemical engineering Department Assist Lecturer Ghadeer Jassim
Solution
a) For second order polynomial interpolation (also called quadratic
interpolation), the velocity is given by
2
v(t ) Li (t )v(t i )
i 0
2 t tj t t 0 t t 2
L1 (t )
j 0 t1 t j t1 t 0 t1 t 2
j 1
Page | 148
Chemical engineering Department Assist Lecturer Ghadeer Jassim
2 t tj t t 0 t t1
L2 (t )
j 0 t 2 t j t 2 t 0 t 2 t1
j 2
Hence
t t1 t t 2 t t 0 t t 2 t t 0 t t1
v(t ) v(t 0 ) v(t1 ) v(t 2 ), t 0 t t 2
0 1 0 2
t t t t t
1 0 1 2
t t t t
2 0 2 1
t t t
b) The absolute relative approximate error a for the second order polynomial is
calculated by considering the result of the first order polynomial (Example 1) as
the previous approximation.
392.19 393.69
a 100 0.38410%
392.19
Example 3
The upward velocity of a rocket is given as a function of time in Table 3.
Page | 149
Chemical engineering Department Assist Lecturer Ghadeer Jassim
b) Find the absolute relative approximate error for the third order polynomial
approximation.
c) Using the third order polynomial interpolant for velocity, find the distance
covered by the rocket from t 11 s to t 16 s .
d) Using the third order polynomial interpolant for velocity, find the acceleration
of the rocket at t 16 s .
Solution
a) For third order polynomial interpolation (also called cubic interpolation), the
velocity is given by
3
v(t ) Li (t )v(t i )
i 0
x3 , y3
x1, y1
x2 , y2 f 3 x
x0 , y0
x
Since we want to find the velocity at t 16 , and we are using a third order
polynomial, we need to choose the four data points closest to t 16 that also
bracket t 16 to evaluate it. The four points are t0 10, t1 15, t 2 20 and t 3 22.5 .
Then
t0 10, vt0 227.04
t1 15, vt1 362.78
t 2 20, vt 2 517.35
t 3 22.5, vt 3 602.97
Page | 150
Chemical engineering Department Assist Lecturer Ghadeer Jassim
gives
3 t tj t t1 t t 2 t t 3
L0 (t )
j 0 t 0 t j t 0 t1 t 0 t 2 t 0 t 3
j 0
3 t tj t t 0 t t 2 t t 3
L1 (t )
j 0 t1 t j t1 t 0 t1 t 2 t1 t 3
j 1
3 t tj t t 0 t t1 t t 3
L2 (t )
j 0 t 2 t j t 2 t 0 t 2 t1 t 2 t 3
j 2
3 t tj t t 0 t t1 t t 2
L3 (t )
j 0 t 3 t j t 3 t 0 t 3 t1 t 3 t 2
j 3
Hence
t t1 t t 2 t t3 t t0 t t 2 t t3
v(t ) v(t0 ) v(t1 )
t0 t1 t0 t 2 t0 t3 t1 t0 t1 t 2 t1 t3
t t0 t t1 t t3 t t0 t t1 t t 2
v(t 2 ) v(t3 ), t0 t t3
t 2 t 0 t 2 t1 t 2 t 3 t 3 t 0 t 3 t1 t 3 t 2
b) The absolute percentage relative approximate error, a for the value obtained
for v(16) can be obtained by comparing the result with that obtained using the
second order polynomial (Example 2)
392.06 392.19
a 100 0.033269%
392.06
Page | 151
Chemical engineering Department Assist Lecturer Ghadeer Jassim
Note that the polynomial is valid between t 10 and t 22.5 and hence includes the
limits of t 11 and t 16 .
So
16 16
s(16) s(11) v(t )dt (4.245 21.265t 0.13195t 2 0.00544t 3 )dt
11 11
16
t2 t3 t4
4.245t 21.265 0.13195 0.00544 1605 m
2 3 4 11
at
d
dt
vt
d
dt
4.245 21.265t 0.13195t 2 0.00544t 3
21.265 0.26390t 0.01632t 2 , 10 t 22.5
Page | 152