Processing math: 100%
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

5.02: Direct Method of Interpolation

( \newcommand{\kernel}{\mathrm{null}\,}\)

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

y=a0+a1x++anxn(5.2.1.1)

through the data, where a0, a1,, an are n+1 real constants. Since n+1 values of y are given at n+1 values of x, one can write n+1 equations. Then the n+1 constants, a0, a1,, an can be found by solving the n+1 simultaneous 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
Graph of velocity vs. time data for the rocket example.
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+a1t(5.2.1.E1.1)

Linear interpolation between two points (x0, y0) and (x1, y1).
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 t0=15 and t1=20.

Then

t0=15, v(t0)=362.78t1=20, v(t1)=517.35

Equation (5.2.1.E1.1) gives

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

Writing the equations in matrix form, we have

[115120][a0a1]=[362.78517.35]

Solving the above two equations gives

a0=100.93a1=30.914

Hence from Equation (5.2.1.E1.1)

v(t)=a0+a1t=100.93+30.914t, 15t20

At t=16,

v(16)=100.92+30.914×16=393.70 m/s

Audiovisual Lecture

Title: Direct Method of Interpolation: Linear Interpolation

Summary: Learn the direct method of linear polynomial interpolation.

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

v(t)=a0+a1t+a2t2(5.2.1.E2.1)

Quadratic interpolation between three points (x0, y0), (x1, y1), and (x2, y2).
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 t0=10,  t1=15, and t2=20.

Then

t0=10, v(t0)=227.04t1=15, v(t1)=362.78t2=20, v(t2)=517.35

Equation (5.2.1.E2.1) gives

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

Writing the three equations in matrix form, we have

[110100115225120400][a0a1a2]=[227.04362.78517.35]

Solving the above three equations gives

a0=12.050a1=17.733a2=0.37660

Hence from Equation (5.2.1.E2.1)

v(t)=12.050+17.733t+0.37660t2, 10t20(5.2.1.E2.2)

At t=16,

v(16)=12.050+17.7333(16)+0.37660(16)2=392.19 m/s

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

|ϵa|=|392.19393.70392.19|×100=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)

v(t)=12.050+17.733t+0.37660t2, 10t20

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,

s(16)s(11)=1611v(t)dt=1611(12.050+17.733t+0.37660t2) dt=[12.050t+17.733t22+0.37660t33]1611=1604.3 m

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

a(16)=ddtv(t)|t=16

Given that from Equation (5.2.1.E2.2)

v(t)=12.050+17.733t+0.37660t2, 10t20,

we get

a(t)=ddtv(t)=ddt(12.050+17.733t+0.37660t2)=17.733+0.75320t, 10t20

Hence

a(16)=17.733+0.75320(16)=29.784 m/s2

Audiovisual Lecture

Title: Direct Method of Interpolation: Quadratic Interpolation

Summary: Learn how to do quadratic interpolation via the direct method.

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

a) For third-order polynomial interpolation (also called cubic interpolation), we choose the velocity given by

v(t)=a0+a1t+a2t2+a3t3(5.2.1.E3.1)

Cubic interpolation of four discrete data points.
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 t0=10,t1=15, t2=20 and t3=22.5.

Then

t0=10, v(t0)=227.04t1=15, v(t1)=362.78t2=20, v(t2)=517.35t3=22.5, v(t3)=602.97

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

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

Writing the four equations in matrix form, we have

[110100100011522533751204008000122.5506.2511391][a0a1a2a3]=[227.04362.78517.35602.97]

Solving the above four equations gives

a0=4.2540a1=21.266a2=0.13204a3=0.0054347

Hence
v(t)=a0+a1t+a2t2+a3t3=4.2540+21.266t+0.13204t2+0.0054347t3, 10t22.5(5.2.1.E3.2)

From Equation (5.2.1.E3.2)

v(16)=4.2540+21.266(16)+0.13204(16)2+0.0054347(16)3=392.06 m/s

b) The absolute percentage relative approximate error |ϵa| for the value obtained for v(16) between the second- and third-order polynomial is

|ϵa|=|392.06392.19392.06|×100=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:

v(t)=4.2540+21.266t+0.13204t2+0.0054347t3, 10t22.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,

s(16)s(11)=1611v(t) dt=1611(4.2540+21.266t+0.13204t2+0.0054347t3) dt=[4.2540t+21.266t22+0.13204t33+0.0054347t44]1611=1605.0 m

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

a(16)=ddtv(t)|t=16

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

v(t)=4.2540+21.266t+0.13204t2+0.0054347t3, 10t22.5,

we get

a(t)=ddtv(t)=ddt(4.2540+21.266t+0.13204t2+0.0054347t3)=21.266+0.26408t+0.016304t2, 10t22.5

Hence

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

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
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

v(t)=8.667t2349.67t+3523, 18t24

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

v(t)=8.6667t2349.67t+3523, 18t24

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.

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

v(t)=9.500t2383.0t+3853

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+a1sin(t)+a2sin(2t)

where a0, a1, and a2 are the unknown constants.

Answer

24.875 m/s (Intermediate answers a0=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

v(t)=2000ln[14×10414×1042100t]9.8t,0t30?

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 (Et)
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
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

a) 30.914 m/s2

b) 29.784 m/s2

c) Method 1: 2672.3 m by integrating 3rd order polynomial interpolant
Method 2: 2704.2 m by 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.

Support Center

How can we help?