Docsity

Newton's Divided Difference Method for Interpolation: Linear and Quadratic, Slides of Mathematical Methods for Numerical Analysis and Optimization

Partial preview of the text

Download Newton's Divided Difference Method for Interpolation: Linear and Quadratic and more Slides Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

Newton’s Divided Difference

Polynomial Method of

Interpolation

What is Interpolation?

Given (x

,y

), (x

,y

), …… (x

n

,y

n

), find the

value of ‘y’ at a value of ‘x’ that is not given.

Newton’s Divided Difference Method

Linear interpolation: Given pass a linear

interpolant through the data

where

( x 0 , y 0 ), ( x 1 , y 1 ),

f 1 (^) ( x )  b 0  b 1 ( xx 0 )

b 0 (^)  f ( x 0 )

1 0

1 0 1

( ) ( )

x x

f x f x b

 

Example

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 for linear interpolation.

Table. Velocity as a

function of time

Figure. Velocity vs. time data

for the rocket example

t (s) v ( t )(m/s)

Linear Interpolation (contd)

(^35010 12 14 16 18 20 22 )

400

450

500

517.35^550

y (^) s

f range( ) f x (^) de sire d

x (^) s 0  10 x (^) s  rangex (^) de sire d x (^) s 1  10 v ( t ) b 0  b 1 ( tt 0 )

 362. 78  30. 914 ( t  15 ), 15  t  20

At t  16

v ( 16 ) 362. 78  30. 914 ( 16  15 )

 393. 69 m/s

Quadratic Interpolation

Given (^ x 0 , y 0 ), (^ x 1 , y 1 ), and (^ x 2 , y 2 ), fit a quadratic interpolant through the data.

f (^) 2 ( x ) b 0  b 1 ( xx 0 ) b 2 ( xx 0 )( xx 1 )

b 0  f ( x 0 )

1 0

1 0 1

( ) ( )

x x

f x f x b

 

2 0

1 0

1 0

2 1

2 1

2

x x

x x

f x f x

x x

f x f x

b

Quadratic Interpolation (contd)

(^20010 12 14 16 18 )

250

300

350

400

450

500

517.35^550

y (^) s

f range( ) f x (^) de sire d

10 x (^) s  rangex (^) de sire d 20

t 0  10 , v ( t 0 )  227. 04

t 1  15 , v ( t 1 )  362. 78

t 2  20 , v ( t 2 )  517. 35

Quadratic Interpolation (contd)

b 0 (^)  v ( t 0 )

 227. 04

1 0

1 0 1

t t

v t v t b

 27. 148

2 0

1 0

1 0

2 1

2 1

2

t t

t t

v t v t

t t

v t v t

b

 0. 37660

General Form

2 0 1 0 2 0 1

f x  b  b x  x  b x  x x  x

where

Rewriting

f (^) 2 ( x )  f [ x 0 ] f [ x 1 , x 0 ]( xx 0 ) f [ x 2 , x 1 , x 0 ]( xx 0 )( xx 1 )

b 0 (^)  f [ x 0 ] f ( x 0 )

1 0

1 0 1 1 0

[ , ]

x x

f x f x b f x x

2 0

1 0

1 0

2 1

2 1

2 0

2 1 1 0 2 2 1 0

[ , ] [ , ]

[ , , ]

x x

x x

f x f x

x x

f x f x

x x

f x x f x x b f x x x

General Form

Given ( n  1 ) data points,  x 0 , y 0  , x 1 , y 1 ,......,  xn  1 , yn  1  , xn , yn  as

fn ( x ) b 0  b 1 ( xx 0 ).... bn ( xx 0 )( xx 1 )...( xxn  1 )

where

b 0 (^)  f [ x 0 ]

b 1 (^)  f [ x 1 , x 0 ]

b 2 (^)  f [ x 2 , x 1 , x 0 ]

b (^) n  1  f [ xn  1 , xn  2 ,...., x 0 ]

b (^) nf [ xn , xn  1 ,...., x 0 ]

Example

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 for cubic interpolation.

Table. Velocity as a

function of time

Figure. Velocity vs. time data

for the rocket example

t (s) v ( t )(m/s)

Example

The velocity profile is chosen as

v ( t )  b 0  b 1 ( tt 0 ) b 2 ( tt 0 )( tt 1 ) b 3 ( tt 0 )( tt 1 )( tt 2 )

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

t 0  10 , v ( t 0 ) 227. 04

t 1  15 , v ( t 1 ) 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:

b 0 = 227.04; b 1 = 27.148; b 2 = 0.37660; b 3 = 5.4347×

− 3

Example

Hence

v ( t ) b 0  b 1 ( tt 0 ) b 2 ( tt 0 )( tt 1 ) b 3 ( tt 0 )( tt 1 )( tt 2 )

  1. 4347 * 10 ( 10 )( 15 )( 20 )

  2. 04 27. 148 ( 10 ) 0. 37660 ( 10 )( 15 )

3    

     

t t t

t t t

At t  16 ,

  1. 4347 * 10 ( 16 10 )( 16 15 )( 16 20 )

( 16 ) 227. 04 27. 148 ( 16 10 ) 0. 37660 ( 16 10 )( 16 15 )

3    

     

v

 392. 06 m/s

The absolute relative approximate error  a obtained is

a x 100

  1. 06

Comparison Table

Order of

Polynomial

1 2 3

v(t=16)

m/s

393.69 392.19 392.

Absolute Relative

Approximate Error

---------- 0.38502 % 0.033427 %