Sei sulla pagina 1di 6

Direct Method of Interpolation

What is Interpolation?
Given(𝑥0 , 𝑦0 ), (𝑥1 , 𝑦1 ), …… (𝑥𝑛 , 𝑦𝑛 ),find the value of ‘y’ at a value of ‘x’ that is not given.

Figure 1 Interpolation of discrete.


Interopolants
Polynomials are the most common choice of interpolants because they are easy to:
• Evaluate
• Differentiate, and
• Integrate

Direct Method
Given ‘n+1’ data points (𝑥0, 𝑦0 ),(𝑥1 , 𝑦1 ),………….. (𝑥𝑛 , 𝑦𝑛 ), pass a polynomial of order ‘n’
through the data as given below:

y  a0  a1 x  ....................  an x n .

where a0, a1,………………. an are real constants.


• Set up ‘n+1’ equations to find ‘n+1’ constants.
• To find the value ‘y’ at a given value of ‘x’, simply substitute the value of ‘x’ in the above
polynomial.

Linear Interpolation
y

x1 , y1 

x0 , y0 
f1 x 

Figure 3 Linear interpolation


𝒗(𝒕) = 𝒂𝟎 + 𝒂𝟏 𝒕

Example 1
The upward velocity of a rocket is given as a function of time in Table 1. Find the velocity at
t=16 seconds using the direct method for linear interpolation.

t , s  vt , m/s 

Table 1 Velocity as a function of time. Figure 2 Velocity vs. time data for the rocket example
Given:
n=1
n+1=2pts.
t=15; v=362.78
t=20; v=517.35

Solution
362.78 = 𝑎0 + 𝑎1 (15) 𝑒𝑞𝑢𝑎𝑡𝑖𝑜𝑛 1.
517.35 = 𝑎0 + 𝑎1 (20) 𝑒𝑞𝑢𝑎𝑡𝑖𝑜𝑛 2.
𝑎0 = −100.93
𝑎1 = 30.914
𝑣(𝑡) = −100.93 + 30.914𝑡
𝑣(16) = −100.93 + 30.914(16)
𝒗(𝟏𝟔) = 𝟑𝟗𝟑. 𝟔𝟗𝟒 𝒎⁄𝒔

Quadratic Interpolation

Figure 6 Quadratic interpolation.

𝒗(𝒕) = 𝒂𝟎 + 𝒂𝟏 𝒕 + 𝒂𝟐 𝒕𝟐

Example 2
The upward velocity of a rocket is given as a function of time in Table 2. Find the velocity at
t=16 seconds using the direct method for quadratic interpolation.

t , s  vt , m/s 

Table 2 Velocity as a function of time. Figure 5 Velocity vs. time data for the rocket example.
Given:
n=2
n+1=3pts.
t=15; v=362.78
t=20; v=517.35
t=10; v=227.04
Solution
362.78 = 𝑎0 + 𝑎1 (15) + 𝑎2 (225) 𝑒𝑞𝑢𝑎𝑡𝑖𝑜𝑛 1
517.35 = 𝑎0 + 𝑎1 (20) + 𝑎2 (400) 𝑒𝑞𝑢𝑎𝑡𝑖𝑜𝑛 2
227.04 = 𝑎0 + 𝑎1 (10) + 𝑎2 (100) 𝑒𝑞𝑢𝑎𝑡𝑖𝑜𝑛 3
𝑎0 = 12.05
𝑎1 = 17.733
𝑎2 = 0.3766
𝑣(𝑡) = 12.05 + 17.733𝑡 + 0.3766𝑡 2
𝑣(16) = 12.05 + 17.733(16) + 0.3766(16)2
𝒗(𝟏𝟔) = 𝟑𝟗𝟐. 𝟏𝟖𝟕𝟔 𝒎⁄𝒔

550
517.35

500

450

ys
400
f ( range)


f x desired  350

300

250

227.04 200
10 12 14 16 18 20
10 x s  range  x desired 20

The absolute relative approximate error obtained between the results from the first and second
order polynomial is

392.19  393.70
a  100
392.19
 0.38410%
Comparison Table
Table 4 Comparison of different orders of the polynomial.

Order of
1 2 3
Polynomial
vt  16 m/s 393.7 392.19 392.06
Absolute Relative
---------- 0.38410 % 0.033269 %
Approximate Error

Distance from Velocity Profile


Example 3
Find the distance covered by the rocket from t=11s to t=16s ?

vt   4.3810  21.289t  0.13064t 2  0.0054606t 3 , 10  t  22.5


Note:
𝑑𝑉
=𝑎
𝑑𝑡

∫ 𝑑𝑣 = 𝑎𝑑𝑡

∫ 𝑣𝑑𝑡 = 𝑥

Solution
Req’d: x=1 from t=11s to t=16s
16

𝑥 = ∫ 𝑣(𝑡)𝑑𝑡
11
16
∫ (−4.2540 + 21.266𝑡 + 𝑜. 13204𝑡 2 + 0.0054347𝑡 3 )𝑑𝑡
11

𝑡2 𝑡3 𝑡 4 16
[−4.2540𝑡 + 21.266 + 0.13204 + 0.00554347 ]11
2 3 4
𝒙 = 𝟏𝟔𝟎𝟒. 𝟗𝟖𝟖𝒎
Acceleration from Velocity Profile
Example 4
Find the acceleration of the rocket at t=16s given that

 t   4.2540  21.266t  0.132042  0.0054347t 3 ,10  t  22.5


Solution
𝑎(160 =?
𝑑(𝑣)
= 21.266 + 2(0.13204)𝑡 + 3(0.0054347)𝑡 2
𝑑𝑡
𝒂(𝟏𝟔) = 𝟐𝟗. 𝟔𝟔𝟒 𝒎⁄ 𝟐
𝒔

Potrebbero piacerti anche