05 02 Direct Method of Interpolation
05 02 Direct Method of Interpolation
02
Direct Method of Interpolation
05.03.1
05.01.2
Chapter 05.02
(x3 , y3 )
(x1, y1 )
(x2 , y2 )
f (x )
(x0 , y0 )
x
05.01.3
Figure 2 Graph of velocity vs. time data for the rocket example.
Determine the value of the velocity at t = 16 seconds using the direct method of interpolation
and a first order polynomial.
Solution
For first order polynomial interpolation (also called linear interpolation), the velocity given
by
v(t ) = a0 + a1t
(x1 , y1 )
f1 ( x )
(x0 , y0 )
x
05.01.4
Chapter 05.02
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 .
Then
t 0 = 15, v(t 0 ) = 362.78
t1 = 20, v(t1 ) = 517.35
gives
v(15) = a 0 + a1 (15) = 362.78
v(20) = a 0 + a1 (20) = 517.35
Writing the equations in matrix form, we have
1 15 a 0 362.78
1 20 a = 517.35
a1 = 30.914
v(t ) = a 0 + a1t
= 100.93 + 30.914t , 15 t 20
At t = 16 ,
v(16) = 100.92 + 30.914 16
= 393.7 m/s
Example 2
The upward velocity of a rocket is given as a function of time in Table 2.
Table 2 Velocity as a function of time.
v(t ) (m/s)
t (s)
0
0
10
227.04
15
362.78
20
517.35
22.5
602.97
30
901.67
Determine the value of the velocity at t = 16 seconds using the direct method of interpolation
and a second order polynomial.
Solution
For second order polynomial interpolation (also called quadratic interpolation), the velocity
is given by
v(t ) = a 0 + a1t + a 2 t 2
05.01.5
(x1 , y1 )
( x2 , y 2 )
f 2 (x )
( x0 , y 0 )
x
gives
1 20 400 a 2 517.35
2
Hence
a1 = 17.733
a2 = 0.3766
05.01.6
Chapter 05.02
The absolute relative approximate error a obtained between the results from the first and
second order polynomial is
392.19 393.70
a =
100
392.19
= 0.38410%
Example 3
The upward velocity of a rocket is given as a function of time in Table 3.
Table 3 Velocity as a function of time.
v(t ) (m/s)
t (s)
0
0
10
227.04
15
362.78
20
517.35
22.5
602.97
30
901.67
a) Determine the value of the velocity at t = 16 seconds using the direct method of
interpolation and a third order polynomial.
b) Find the absolute relative approximate error for the third order polynomial approximation.
c) Using the third order polynomial interpolant for velocity from part (a), find the distance
covered by the rocket from t = 11s to t = 16 s .
d) Using the third order polynomial interpolant for velocity from part (a), find the
acceleration of the rocket at t = 16 s .
Solution
a) For third order polynomial interpolation (also called cubic interpolation), we choose the
velocity given by
v(t ) = a 0 + a1t + a 2 t 2 + a3 t 3
05.01.7
(x3 , y3 )
(x1, y1 )
f 3 (x )
(x2 , y2 )
(x0 , y0 )
x
=
1 20
400
8000 a 2 517.35
05.01.8
Hence
Chapter 05.02
a3 = 0.0054347
v(t ) = a 0 + a1t + a 2 t 2 + a3 t 3
b) The absolute percentage relative approximate error a for the value obtained for v(16)
between second and third order polynomial is
392.06 392.19
a =
100
392.06
= 0.033269%
c) The distance covered by the rocket between t = 11s and t = 16 s can be calculated from the
interpolating polynomial
v(t ) = 4.2540 + 21.266t + 0.13204t 2 + 0.0054347t 3 , 10 t 22.5
Note that the polynomial is valid between t = 10 and t = 22.5 and hence includes the limits
of integration of t = 11 and t = 16 .
So
16
16
t3
t4
t2
= 4.2540t + 21.266 + 0.13204 + 0.0054347
2
3
4 11
= 1605 m
d) The acceleration at t = 16 is given by
d
a(16 ) = v(t ) t =16
dt
Given that
v(t ) = 4.2540 + 21.266t + 0.13204t 2 + 0.0054347t 3 , 10 t 22.5
d
a(t ) = v(t )
dt
d
=
4.2540 + 21.266t + 0.13204t 2 + 0.0054347t 3
dt
= 21.266 + 0.26408t + 0.016304t 2 , 10 t 22.5
= 29.665 m/s 2
05.01.9