100% found this document useful (1 vote)
167 views11 pages

5.02 Direct Method of Interpolation

1) The document describes the direct method of interpolation, which fits a polynomial through discrete data points. 2) It provides two examples that use the direct method to find interpolants and derive values. The first example uses linear interpolation to estimate velocity at a given time. The second uses quadratic interpolation, and also estimates error and finds distance and acceleration values. 3) The direct method involves choosing data points closest to the desired value that bracket it, then setting up and solving simultaneous equations to find the polynomial coefficients. The polynomial can then be used to obtain interpolated and derived values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
167 views11 pages

5.02 Direct Method of Interpolation

1) The document describes the direct method of interpolation, which fits a polynomial through discrete data points. 2) It provides two examples that use the direct method to find interpolants and derive values. The first example uses linear interpolation to estimate velocity at a given time. The second uses quadratic interpolation, and also estimates error and finds distance and acceleration values. 3) The direct method involves choosing data points closest to the desired value that bracket it, then setting up and solving simultaneous equations to find the polynomial coefficients. The polynomial can then be used to obtain interpolated and derived values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

5.

02: Direct Method of Interpolation


Lesson 1: Direct Method of Interpolation
Learning Objectives
After successful completion of this lesson, you should be able to:
1) find the interpolant through the direct method,
2) choose the correct data points for interpolation,
3) solve problems using the direct method of interpolation,
4) use the direct method interpolants to find derivatives of discrete functions,
5) use the direct method interpolants to find integrals of discrete functions.

Direct Method
The direct method (also called the Vandermonde polynomial method) of interpolation is based on the following premise. Given
n + 1 data points, fit a polynomial of order n as given below

n
y = a0 + a1 x + … … … … … + an x (5.2.1.1)

through the data, where a , a , … … … , a are n + 1 real constants. Since n + 1 values of y are given at n + 1 values of x,
0 1 n

one can write n + 1 equations. Then the n + 1 constants, a , a , … … … , a can be found by solving the n + 1 simultaneous
0 1 n

linear equations. To find the value of y at a given value of x, simply substitute the value of x in Equation (5.2.1.1).
But, it is not necessary to use all the data points. How does one then choose the order of the polynomial and what data points to
use? This concept of choosing points and the direct method of interpolation are best illustrated using examples.

 Example 5.2.1.1

The upward velocity of a rocket is given as a function of time in Table 5.2.1.1.


Table 5.2.1.1. Velocity as a function of time.
t (s) v(t) (m/s)

0 0

10 227.04

15 362.78

20 517.35

22.5 602.97

30 901.67

5.02.1 https://math.libretexts.org/@go/page/126410
Figure 5.2.1.1 . Graph of velocity vs. time data for the rocket example.
Estimate the velocity at t = 16 seconds using the direct method of interpolation with a first-order polynomial.

Solution
For first-order polynomial interpolation (also called linear interpolation), the velocity given by

v (t) = a0 + a1 t (5.2.1.E1.1)

Figure 5.2.1.2 . Lienar 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 = 15 and t = 20 .
0 1

Then
t0 = 15, v (t0 ) = 362.78

t1 = 20, v (t1 ) = 517.35

5.02.2 https://math.libretexts.org/@go/page/126410
Equation (5.2.1.E1.1)gives
v (15) = a0 + a1 (15) = 362.78

v (20) = a0 + a1 (20) = 517.35

Writing the equations in matrix form, we have

1 15 a0 362.78
[ ][ ] =[ ]
1 20 a1 517.35

Solving the above two equations gives


a0 = −100.93

a1 = 30.914

Hence from Equation (5.2.1.E1.1)


v (t) = a0 + a1 t

= −100.93 + 30.914t, 15 ≤ t ≤ 20

At t = 16 ,

v (16) = −100.92 + 30.914 × 16

= 393.70 m/s

Add example text here.

 Example 5.2.1.2

The upward velocity of a rocket is given as a function of time in Table 5.2.1.2.


Table 5.2.1.2. Velocity as a function of time.
t (s) v(t) (m/s)

0 0

10 227.04

15 362.78

20 517.35

22.5 602.97

30 901.67

a) Estimate the velocity at t = 16 seconds using the direct method of interpolation with a second-order polynomial.
b) Find the absolute relative approximate error for the second-order polynomial approximation.
c) Using the second-order polynomial interpolant for velocity from part (a), find the distance covered by the rocket from
t = 11 s to t = 16 s .

d) Using the second-order polynomial interpolant for velocity from part (a), find the acceleration of the rocket at t = 16 s .

Solution
For second-order polynomial interpolation (also called quadratic interpolation), the velocity is given by
2
v (t) = a0 + a1 t + a2 t (5.2.1.E2.1)

5.02.3 https://math.libretexts.org/@go/page/126410
Figure 5.2.1.3 . Quadratic interpolation.
a) Since we want to find the velocity at t = 16 , and we are using a second-order polynomial, we need to choose the three data
points that are closest to t = 16 that also bracket t = 16 to evaluate it. The three points are t = 10, t = 15, and t = 20 .
0 1 2

Then

t0 = 10, v (t0 ) = 227.04

t1 = 15, v (t1 ) = 362.78

t2 = 20, v (t2 ) = 517.35

Equation (5.2.1.E2.1)gives
2
v (10) = a0 + a1 (10) + a2 (10) = 227.04
2
v (15) = a0 + a1 (15) + a2 (15) = 362.78
2
v (20) = a0 + a1 (20) + a2 (20) = 517.35

Writing the three equations in matrix form, we have


1 10 100 a0 227.04
⎡ ⎤⎡ ⎤ ⎡ ⎤

⎢1 15 225 ⎥ ⎢ a1 ⎥ = ⎢ 362.78 ⎥
⎣ ⎦⎣ ⎦ ⎣ ⎦
1 20 400 a2 517.35

Solving the above three equations gives


a0 = 12.050

a1 = 17.733

a2 = 0.37660

Hence from Equation (5.2.1.E2.1)


2
v (t) = 12.050 + 17.733t + 0.37660 t , 10 ≤ t ≤ 20 (5.2.1.E2.2)

At t = 16 ,
2
v (16) = 12.050 + 17.7333 (16) + 0.37660(16)

= 392.19 m/s

b) The absolute relative approximate error |ϵ | obtained between the results from the first- and second- order polynomial is
a

∣ 392.19 − 393.70∣
| ϵa | = ∣ ∣ × 100
∣ 392.19 ∣

= 0.38410%

c) The distance covered by the rocket between t = 11 s and t = 16 s can be calculated from the interpolating polynomial
(Equation 5.2.1.E2.2)
2
v (t) = 12.050 + 17.733t + 0.37660 t , 10 ≤ t ≤ 20

Note that the polynomial is valid between t = 10 s and t = 22.5 s and hence includes the limits of integration of t = 11 s and
t = 16 s .

5.02.4 https://math.libretexts.org/@go/page/126410
So,
16

s (16) − s (11) = ∫ v (t) dt


11

16
2
=∫ (12.050 + 17.733t + 0.3766 0t ) dt
11

16
2 3
t t
= [12.050t + 17.733 + 0.37660 ]
2 3
11

= 1604.3 m

d) The acceleration at t = 16 s is given by


d ∣
a (16) = v (t)∣
dt ∣
t=16

Given that from Equation (5.2.1.E2.2)


2
v (t) = 12.050 + 17.733t + 0.3766 0t , 10 ≤ t ≤ 20,

we get
d
a (t) = v (t)
dt

d 2
= (12.050 + 17.733t + 0.37660 t )
dt

= 17.733 + 0.75320t, 10 ≤ t ≤ 20

Hence
a (16) = 17.733 + 0.75320(16)

2
= 29.784 m/s

 Example 5.2.1.3

The upward velocity of a rocket is given as a function of time in Table 5.2.1.3.


Table 5.2.1.3. Velocity as a function of time.
t (s) v(t) (m/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 with 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 = 11 s 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

5.02.5 https://math.libretexts.org/@go/page/126410
a) For third-order polynomial interpolation (also called cubic interpolation), we choose the velocity given by
2 3
v (t) = a0 + a1 t + a2 t + a3 t (5.2.1.E3.1)

Figure 5.2.1.4 . Cubic interpolation.


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 brackets t = 16 to evaluate it.
The four points are t
0 = 10, t1 = 15, t2 = 20 and t3 = 22.5 .
Then
t0 = 10, v (t0 ) = 227.04

t1 = 15, v (t1 ) = 362.78

t2 = 20, v (t2 ) = 517.35

t3 = 22.5, v (t3 ) = 602.97

Applying Equation (5.2.1.E3.1)to each point, we get


2 3
v (10) = a0 + a1 (10) + a2 (10) + a3 (10) = 227.04
2 3
v (15) = a0 + a1 (15) + a2 (15) + a3 (15) = 362.78
2 3
v (20) = a0 + a1 (20) + a2 (20) + a3 (20) = 517.35

2 3
v (22.5) = a0 + a1 (22.5) + a2 (22.5) + a3 (22.5) = 602.97

Writing the four equations in matrix form, we have

1 10 100 1000 a0 227.04


⎡ ⎤⎡ ⎤ ⎡ ⎤

⎢1 15 225 3375 ⎥ ⎢ a1 ⎥ ⎢ 362.78 ⎥


⎢ ⎥⎢ ⎥ =⎢ ⎥
⎢1 20 400 8000 ⎥ ⎢ a2 ⎥ ⎢ 517.35 ⎥

⎣ ⎦⎣ ⎦ ⎣ ⎦
1 22.5 506.25 11391 a3 602.97

Solving the above four equations gives


a0 = −4.2540

a1 = 21.266

a2 = 0.13204

a3 = 0.0054347

Hence
2 3
v (t) = a0 + a1 t + a2 t + a3 t
(5.2.1.E3.2)
2 3
= −4.2540 + 21.266t + 0.13204 t + 0.0054347 t , 10 ≤ t ≤ 22.5

From Equation (5.2.1.E3.2)


2 3
v (16) = −4.2540 + 21.266 (16) + 0.13204 (16) + 0.0054347 (16)

= 392.06 m/s

5.02.6 https://math.libretexts.org/@go/page/126410
b) The absolute percentage relative approximate error |ϵ | for the value obtained for v(16) between the second- and third-order
a

polynomial is
∣ 392.06 − 392.19∣
| ϵa | = ∣ ∣ × 100
∣ 392.06 ∣

= 0.033269%

c) The distance covered by the rocket between t = 11 s and t = 16 s can be calculated from the interpolating polynomial
(Equation 5.2.1.E3.2), which is restated below:
2 3
v (t) = −4.2540 + 21.266t + 0.13204 t + 0.0054347 t , 10 ≤ t ≤ 22.5

Note that the polynomial is valid between t = 10 s and t = 22.5 s and hence includes the limits of integration of t = 11 s and
t = 16 s .

So,
16

s (16) − s (11) = ∫ v (t) dt


11

16
2 3
=∫ (−4.2540 + 21.266t + 0.13204 t + 0.0054347 t ) dt
11

16
2 3 4
t t t
= [−4.2540t + 21.266 + 0.13204 + 0.0054347 ]
2 3 4
11

= 1605.0 m

d) The acceleration at t = 16 s is given by


d ∣
a (16) = v (t)∣
dt ∣
t=16

Given that from Equation (5.2.1.E3.2),


2 3
v (t) = −4.2540 + 21.266t + 0.13204 t + 0.0054347 t , 10 ≤ t ≤ 22.5,

we get
d
a (t) = v (t)
dt
d
2 3
= (−4.2540 + 21.266t + 0.13204 t + 0.0054347 t )
dt
2
= 21.266 + 0.26408t + 0.016304 t , 10 ≤ t ≤ 22.5

Hence
2
a (16) = 21.266 + 0.26408 (16) + 0.016304(16)
2
= 29.665 m/s

Multiple Choice Test


(1). Given n + 1 data pairs, a unique polynomial of degree ________________ passes through n + 1 data points.
(A) n + 1
(B) n + 1 or less
(C) n
(D) n or less
(2). The data of the velocity of a body as a function of time is given as follows.

Time (s) 0 15 18 22 24

5.02.7 https://math.libretexts.org/@go/page/126410
Velocity (m/s) 22 24 37 25 123

The velocity in m/s at 16s using linear polynomial interpolation is most nearly
(A) 27.867
(B) 28.333
(C) 30.429
(D) 43.000
(3). The following data of the velocity of a body as a function of time is given as follows.

Time (s) 0 15 18 22 24

Velocity (m/s) 22 24 37 25 123

The velocity in m/s at 16s using quadratic polynomial interpolation is most nearly
(A) 27.867
(B) 28.333
(C) 30.429
(D) 43.000
(4). The following data of the velocity of a body is given as a function of time

Time, t (s) 0 15 18 22 24

Velocity, v (m/s) 22 24 37 25 123

Using quadratic interpolation, the interpolant


2
v (t) = 8.667 t − 349.67t + 3523, 18 ≤ t ≤ 24

approximates the velocity of the body. From this information, one of the times in seconds at which the velocity of the body is
35 m/s during the above time interval of t = 18 s to t = 24 s is

(A) 18.667
(B) 20.850
(C) 22.200
(D) 22.294
(5). The following data of the velocity of a body is given as a function of time

Time, t (s) 0 15 18 22 24

Velocity, v (m/s) 22 24 37 25 123

One of the interpolant approximations for the velocity from the above data is given as
2
v(t) = 8.6667 t − 349.67t + 3523, 18 ≤ t ≤ 24

Using the above interpolant, the distance in meters covered by the body between t = 19 s and t = 22 s is most nearly
(A) 10.337
(B) 88.500
(C) 93.000
(D) 168.00
(6). The following data of the velocity of a body is given as a function of time.

5.02.8 https://math.libretexts.org/@go/page/126410
Time, t (s) 0 15 18 22 24

Velocity, v (m/s) 22 24 37 25 123

If you were going to use quadratic interpolation to find the value of the velocity at t = 14.9 s , what three data points of time
would you choose for interpolation?
(A) 0, 15, 18
(B) 15, 18, 22
(C) 0, 15, 22
(D) 0, 18, 24
For complete solution, go to
http://nm.mathforcollege.com/mcquizzes/05inp/quiz_05inp_direct_solution.pdf

Problem Set
(1). The following data of the velocity of a body as a function of time is given

Time (s) 0 15 18 22 24

Velocity (m/s) 22 24 37 25 123

What is the velocity at t = 14 seconds using linear polynomial interpolation?

Answer
23.86 m/s

(2). The following data of the velocity of a body as a function of time is given

Time (s) 0 15 18 22 24

Velocity (m/s) 22 24 37 25 123

What is the velocity at t = 14 seconds using quadratic polynomial interpolation?

Answer
20.60 m/s

(3). The following data of the velocity of a body as a function of time is given:

Time (s) 0 15 18 22 24

Velocity (m/s) 22 24 37 25 123

What is the velocity at t = 14 seconds using cubic polynomial interpolation?

Answer
17.30 m/s

(4). The following data of the velocity of a body as a function of time is given as follows.

Time (s) 0 15 18 22 24

Velocity (m/s) 22 24 37 25 123

Using quadratic interpolation, the interpolant


2
v(t) = 9.500 t − 383.0t + 3853

5.02.9 https://math.libretexts.org/@go/page/126410
approximates the velocity of the body between 18 and 24 seconds. From this information, can you find out when the velocity of the
body is 26 m/s during the above time interval?

Answer
18.287 s or 22.028 s

(5). The following data of the velocity of a body as a function of time is given as follows.

Time (s) 0 15 18 22 24

Velocity (m/s) 22 24 37 25 123

Find the value of velocity at t = 16 seconds using the following interpolation function for the velocity of the body

v(t) = a0 + a1 sin(t) + a2 sin(2t)

where a 0, a1 , and a are the unknown constants.


2

Answer
24.875 m/s (Intermediate answers a
0 , ;
= 25.008 a1 = −9.2636 a2 = −5.0770 (arguments of sin are radians)

(6). You are given data for the upward velocity of a rocket as a function of time in the table below.

Time (s) 0 10 15 20 22.5 30

Velocity (m/s) 0 227.04 362.78 517.35 602.97 901.67

a) Determine the value of the velocity at t = 16 seconds using first order polynomial direct method.
b) Determine the value of the velocity at t = 16 seconds using second order polynomial direct method. Find the absolute relative
approximate error for approximation from the second order polynomial. How many significant digits would you at least trust in the
solution?
c) Determine the value of the velocity at t = 16 seconds using third order polynomial direct method. Find the absolute relative
approximate error for approximation from the third order polynomial. How many significant digits would you at least trust in the
solution?
d) What is the true error for part (a), (b) and (c), if I told you that the data given in the table above was derived from the formula
4
14 × 10
v(t) = 2000 ln[ ] − 9.8t, 0 ≤ t ≤ 30?
4
14 × 10 − 2100t

Answer
a) 393.69 m/s

b) 392.19 m/s, 0.38247%, 2 sig digits

c) 392.05 m/s, 0.035561%, 3 sig digits

d) Exact 392.08 m/s

Interpolant True Error (E )


t

1st order −1.61

2nd order −0.11

3rd order 0.03

(7). You are given data for the upward velocity of a rocket as a function of time in the table below.

Time (s) 0 10 15 20 22.5 30

5.02.10 https://math.libretexts.org/@go/page/126410
Velocity (m/s) 0 227.04 362.78 517.35 602.97 901.67

a) Use linear interpolant approximation of velocity to find the acceleration at t = 16 s .


b) Use quadratic interpolant approximation of velocity to find the acceleration at t = 16 s .
c) Find the distance covered by the rocket from t = 5 s to t = 16 s ? Use any method.

Answer
2
a) 30.914 m/s

2
b) 29.784 m/s

c)Method 1: 2672.3 mby integrating 3rd order polynomial interpolant


Method 2: 2704.2 mby Trapezoidal rule with unequal segments
Other methods are possible too – average method is unacceptable.

This page titled 5.02: Direct Method of Interpolation is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by
Autar Kaw via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon
request.

5.02.11 https://math.libretexts.org/@go/page/126410

You might also like