Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

Newton’s Divided Difference Interpolation formula

Newton’s Divided Difference Interpolation formula

Newton’s equation of a function that passes


through two points

 x0 , y 0  and x1 , y1  is

Px   a0  a1 x  x0 
Px   a0  a1 x  x0 
Set x  x0
P  x0   y0  a0
Set x  x1
P  x1   y1  a0  a1  x1  x0 
y1  y 0
a1 
x1  x0
Newton’s equation of a function that passes
through three points

x0 , y0  x1 , y1  and  x2 , y2 


is
P  x   a0  a1  x  x0 
 a2  x  x0  x  x1 
To find a 2 , set x  x 2
P  x2   a0  a1  x2  x0 
 a2  x2  x0  x2  x1 
y2  y1 y1  y0

x2  x1 x1  x0
a2 
x2  x0
Newton’s equation of a function that passes
through four points can be written by adding a
fourth term .

P  x   a0  a1  x  x0 
 a2  x  x0  x  x1 
 a3  x  x0  x  x1  x  x2 
P  x   a0  a1  x  x0 
 a2  x  x0  x  x1 
 a3  x  x0  x  x1  x  x2 

The fourth term will vanish at all three previous


points and, therefore, leaving all three previous
coefficients intact.
Divided differences and the coefficients

The divided difference of a function, f


with respect to xi is denoted as f  xi 

It is called as zeroth divided difference and is


simply the value of the function, f at xi

f xi   f xi 
The divided difference of a function, f
with respect to xi and xi 1

called as the first divided difference, is


denoted f  xi , xi 1 

f  xi 1   f  xi 
f  xi , xi 1  
xi 1  xi
The divided difference of a function, f
with respect to xi , xi 1 and xi  2

called as the second divided difference, is


denoted f  xi , xi 1 , xi 2 

f  xi 1 , xi  2   f  xi , xi 1 
f  xi , xi 1 , xi  2  
xi  2  xi
The third divided difference with respect to
x i
, x i 1
, xi 2 and x i 3

f  xi , xi 1 , xi  2 , xi 3 
f  xi 1 , xi  2 , xi 3   f  xi , xi 1 , xi  2 

xi 3  xi
The coefficients of Newton’s interpolating polynomial
are:

a0  f x0 
a1  f x0 , x1 
a2  f x0 , x1 , x2 

a3  f x0 , x1 , x2 , x3 
a4  f x0 , x1 , x2 , x3 , x4  and so on.
Example - 1
Find Newton’s interpolating polynomial to approximate
a function whose 5 data points are given below also
find 𝒇(𝟐. 𝟖).

x f  x
2.0 0.85467
2.3 0.75682
2.6 0.43126
2.9 0.22364
3.2 0.08567
𝒙𝒊 𝒇[𝒙𝒊 ] 𝒇 𝒙𝒊−𝟏 , 𝒙𝒊 𝒇 𝒙𝒊−𝟐 , 𝒙𝒊−𝟏 , 𝒙𝒊 𝒇 𝒙𝒊−𝟑 , … , 𝒙𝒊 𝒇 𝒙𝒊−𝟒 , … , 𝒙𝒊

2.0 0.85467

-0.32617

2.3 0.75682 -1.26505

-1.08520 2.1336

2.6 0.43126 0.65522 -2.0263

-0.6921 -0.2980

2.9 0.22364 0.3870

-0.45990

3.2 0.08567
The 5 coefficients of the Newton’s interpolating
polynomial are:

a0  f  x0   0.85467
a1  f  x0 , x1   0.32617

a2  f  x0 , x1 , x2   1.26505

a3  f  x0 , x1 , x2 , x3   2.13363
a4  f  x0 , x1 , x2 , x3 , x4   2.02642
P  x   a0  a1  x  x0 
 a2  x  x0  x  x1 
 a3  x  x0  x  x1  x  x2 
 a4  x  x0  x  x1  x  x2  x  x3 
P  x   0.85467  0.32617  x  2.0 
-1.26505  x  2.0  x  2.3
 2.13363  x  2.0  x  2.3 x  2.6 
2.02642  x  2.0  x  2.3 x  2.6  x  2.9 

𝑃 𝑥 = −100.1147 + 155.7512 ∙ 𝑥
−88.5126 ∙ 𝑥2 + 21.9925 ∙ 𝑥3 − 2.02642 ∙ 𝑥4
𝑃 2.8 = −100.1147 + 155.7512 ∙ 2.8
−88.5126 ∙ 2.8 2 + 21.9925 ∙ 2.8 3
− 2.02642 ∙ 2.8 4

𝑓(2.8) ≈ 𝑃 2.8 = 0.277


Example - 2
Find Newton’s interpolating polynomial to approximate
a function whose 4 data points are given below.

x f  x
1.0 0
2.0 1
4.0 2
0.5 -1
𝒙𝒊 𝒇[𝒙𝒊 ] 𝒇 𝒙𝒊−𝟏 , 𝒙𝒊 𝒇 𝒙𝒊−𝟐 , 𝒙𝒊−𝟏 , 𝒙𝒊 𝒇 𝒙𝒊−𝟑 , … , 𝒙𝒊

1.0 0

2.0 1 -0.1667

0.5 0.1428

4.0 2 -0.2381

0.8571

0.5 -1
The 4 coefficients of the Newton’s interpolating
polynomial are:

𝑎0 = 𝑓 𝑥0 = 0
𝑎1 = 𝑓 𝑥0 , 𝑥1 = 1
𝑎2 = 𝑓 𝑥0 , 𝑥1 , 𝑥2 = −0.1667
𝑎3 = 𝑓[𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 ] = 0.1428
𝑃 𝑥 = 𝑎0 + 𝑎1 𝑥 − 𝑥0
+𝑎2 𝑥 − 𝑥0 𝑥 − 𝑥1
+𝑎3 𝑥 − 𝑥0 𝑥 − 𝑥1 𝑥 − 𝑥2
𝑃 𝑥 = 0 + 1 𝑥 − 1.0
−0.1667 𝑥 − 1.0 𝑥 − 2.0
+0.1428 𝑥 − 1.0 𝑥 − 2.0 (𝑥 − 4.0)

𝑃 𝑥 = −2.4758 + 3.4993 ∙ x
2
−1.1663 ∙ x + 0.1428 ∙ x 3
Example-3
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 Newton Divided
Difference method.
Given 𝑣 16 = 392 𝑚/𝑠, calculate the absolute relative error.

Table. 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
Figure. Velocity vs. time data
for the rocket example
The velocity profile is chosen as

v(t )  b0  b1 (t  t 0 )  b2 (t  t 0 )(t  t1 )  b3 (t  t 0 )(t  t1 )(t  t 2 )

we need to choose four data points that are closest to t  16

t0  10, v(t 0 )  227.04


t1  15, v(t1 )  362.78
t 2  20, v(t 2 )  517.35
t 3  22.5, v(t 3 )  602.97

The values of the constants are found as:


b0 = 227.04; b1 = 27.148; b2 = 0.37660; b3 = 5.4347×10−3
b0
t0  10 227.04 b1
27.148 b2
t1  15, 362.78 0.37660 b3
30.914 5.4347 10 3
t 2  20, 517.35 0.44453
34.248
t3  22.5, 602.97

b0 = 227.04; b1 = 27.148; b2 = 0.37660; b3 = 5.4347×10−3


Hence
v (t)  b0  b1 (t  t 0 )  b2 (t  t0 )( t  t1 )  b3 (t  t0 )( t  t1 )(t  t 2 )
 227.04  27.148( t  10)  0.37660(t  10)(t  15)
 5.4347 * 10 3 (t  10)( t  15)( t  20)
At t  16,
v (16)  227.04  27.148(16  10)  0.37660(16  10)(16  15)
 5.4347 * 10 3 (16  10)(16  15)(16  20)
 392.06 m/s
The absolute relative approximate error | ∈𝑎 | obtained is
392 − 392.06
∈𝑎 = × 100
392
= 0.033427 %
Distance from Velocity Profile
Find the distance covered by the rocket from t=11s to
t=16s ?
v (t )  227.04  27.148(t  10)  0.37660( t  10)( t  15)
10  t  22.5
 5.4347 * 10 (t  10)( t  15)( t  20)
3

 4.2541  21.265t  0.13204t 2  0.0054347t 3 10  t  22.5

So
16
s16  s11   v t dt
11

16
  (  4.2541  21.265t  0.13204t 2  0.0054347t 3 ) dt
11

16
 t2 t3 t4 
  4.2541t  21.265  0.13204  0.0054347 
 2 3 4  11

 1605 m
Acceleration from Velocity Profile

Find the acceleration of the rocket at t=16s given that

v(t )  4.2541  21.265t  0.13204t 2  0.0054347t 3

v(t )   4.2541  21.265t  0.13204t 2  0.0054347t 3 


d d
a(t ) 
dt dt

 21.265  0.26408t  0.016304t 2


a(16)  21.265  0.26408(16)  0.016304(16) 2

 29.664 m / s 2

You might also like