http://numericalmethods.eng.usf.edu 1 newton’s divided difference polynomial method of...

24
http:// numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul http://numericalmethods.eng.u sf.edu Transforming Numerical Methods Education for STEM Undergraduates

Upload: mabel-wilson

Post on 17-Dec-2015

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu 1

Newton’s Divided Difference Polynomial

Method of Interpolation

Civil Engineering Majors

Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.eduTransforming Numerical Methods Education for STEM

Undergraduates

Page 2: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

Newton’s Divided Difference Method of

Interpolation

http://numericalmethods.eng.usf.edu

Page 3: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu3

What is Interpolation ?

Given (x0,y0), (x1,y1), …… (xn,yn), find the value of ‘y’ at a value of ‘x’ that is not given.

Page 4: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu4

Interpolants

Polynomials are the most common choice of interpolants because they are easy to:

EvaluateDifferentiate, and Integrate.

Page 5: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu5

Newton’s Divided Difference Method

Linear interpolation: Given pass a linear interpolant through the data

where

),,( 00 yx ),,( 11 yx

)()( 0101 xxbbxf

)( 00 xfb

01

011

)()(

xx

xfxfb

Page 6: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu6

ExampleTo maximize a catch of bass in a lake, it is suggested to throw the line to the depth of the thermocline. The characteristic feature of this area is the sudden change in temperature. We are given the temperature vs. depth plot for a lake. Determine the value of the temperature at z = −7.5 using Newton’s Divided Difference method for linear interpolation.

Temperature vs. depth of a lake

Temperature Depth

T (oC) z (m)19.1 019.1 -119 -2

18.8 -318.7 -418.3 -518.2 -617.6 -711.7 -89.9 -99.1 -10

Page 7: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu7

Linear Interpolation

15 10 5 011

12

13

14

15

16

17

1817.6

11.7

y s

f range( )

f x desired

x s1

10x s0

10 x s range x desired

)()( 010 zzbbzT

,80 z 7.11)( 0 zT

,71 z 6.17)( 1 zT

)( 00 zTb

7.11

01

011

)()(

zz

zTzTb

87

7.116.17

9.5

Page 8: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu8

Linear Interpolation (contd)

15 10 5 011

12

13

14

15

16

17

1817.6

11.7

y s

f range( )

f x desired

x s1

10x s0

10 x s range x desired

)()( 010 zzbbzT

),8(9.57.11 z 78 z

At 5.7z

)85.7(9.57.11)5.7( T

C 65.14

Page 9: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu9

Quadratic InterpolationGiven ),,( 00 yx ),,( 11 yx and ),,( 22 yx fit a quadratic interpolant through the data.

))(()()( 1020102 xxxxbxxbbxf

)( 00 xfb

01

011

)()(

xx

xfxfb

02

01

01

12

12

2

)()()()(

xx

xx

xfxf

xx

xfxf

b

Page 10: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu10

ExampleTo maximize a catch of bass in a lake, it is suggested to throw the line to the depth of the thermocline. The characteristic feature of this area is the sudden change in temperature. We are given the temperature vs. depth plot for a lake. Determine the value of the temperature at z = −7.5 using Newton’s Divided Difference method for quadratic interpolation.

Temperature vs. depth of a lake

Temperature Depth

T (oC) z (m)19.1 019.1 -119 -2

18.8 -318.7 -418.3 -518.2 -617.6 -711.7 -89.9 -99.1 -10

Page 11: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu11

Quadratic Interpolation (contd)

9 8.5 8 7.5 78

10

12

14

16

1817.6

9.89238

y s

f range( )

f x desired

79 x s range x desired

))(()()( 102010 zzzzbzzbbzT

,90 z 9.9)( 0 zT

,81 z 7.11)( 1 zT

,72 z 6.17)( 2 zT

Page 12: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu12

Quadratic Interpolation (contd)

9.9)( 00 zTb

8.178

9.97.11)()(

01

011

zz

zTzTb

02

01

01

12

12

2

)()()()(

zz

zz

zTzT

zz

zTzT

b

97

98

9.97.11

87

7.116.17

2

8.19.5

05.2

Page 13: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu13

Quadratic Interpolation (contd)

))(()()( 102010 zzzzbzzbbzT

),8)(9(05.2)9(8.19.9 zzz 79 z

At ,5.7z

)85.7)(95.7(05.2)95.7(8.19.9)5.7( T

C 138.14 The absolute relative approximate error a obtained between the results

from the first and second order polynomial is

100138.14

65.14138.14

a

%6251.3

Page 14: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu14

General Form

))(()()( 1020102 xxxxbxxbbxf

where

Rewriting))(](,,[)](,[][)( 1001200102 xxxxxxxfxxxxfxfxf

)(][ 000 xfxfb

01

01011

)()(],[

xx

xfxfxxfb

02

01

01

12

12

02

01120122

)()()()(

],[],[],,[

xx

xx

xfxf

xx

xfxf

xx

xxfxxfxxxfb

Page 15: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu15

General FormGiven )1( n data points, nnnn yxyxyxyx ,,,,......,,,, 111100 as

))...()((....)()( 110010 nnn xxxxxxbxxbbxf

where

][ 00 xfb

],[ 011 xxfb

],,[ 0122 xxxfb

],....,,[ 0211 xxxfb nnn

],....,,[ 01 xxxfb nnn

Page 16: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu16

General formThe third order polynomial, given ),,( 00 yx ),,( 11 yx ),,( 22 yx and ),,( 33 yx is

))()(](,,,[

))(](,,[)](,[][)(

2100123

1001200103

xxxxxxxxxxf

xxxxxxxfxxxxfxfxf

0b

0x )( 0xf 1b

],[ 01 xxf 2b

1x )( 1xf ],,[ 012 xxxf 3b

],[ 12 xxf ],,,[ 0123 xxxxf

2x )( 2xf ],,[ 123 xxxf

],[ 23 xxf

3x )( 3xf

Page 17: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu17

ExampleTo maximize a catch of bass in a lake, it is suggested to throw the line to the depth of the thermocline. The characteristic feature of this area is the sudden change in temperature. We are given the temperature vs. depth plot for a lake. Determine the value of the temperature at z = −7.5 using Newton’s Divided Difference method for cubic interpolation.

Temperature vs. depth of a lake

Temperature Depth

T (oC) z (m)19.1 019.1 -119 -2

18.8 -318.7 -418.3 -518.2 -617.6 -711.7 -89.9 -99.1 -10

Page 18: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu18

Example

The temperature profile is chosen as

))()(())(()()( 2103102010 zzzzzzbzzzzbzzbbzT

We need to choose four data points that are closest to 5.7z

,90 z 9.9)( 0 zT

,81 z 7.11)( 1 zT

,72 z 6.17)( 2 zT

,63 z 2.18)( 3 zT

Page 19: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu19

Example

The values of the constants are obtained as

0b 9.9 1b 8.1 2b 05.2 3b 5667.1

0b

,90 z 9.9 1b

8.1 2b

,81 z 7.11 05.2 3b

9.5 5667.1

,72 z 6.17 65.2

6.0

,63 z 2.18

Page 20: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu20

Example

))()(())(()()( 2103102010 zzzzzzbzzzzbzzbbzT

)7)(8)(9(5667.1)8)(9(05.2)9(8.19.9 zzzzzz , −9 ≤ z ≤ −6

At ,5.7z

)75.7)(85.7)(95.7(5667.1

)85.7)(95.7(05.2)95.7(8.19.9)5.7(

T

C 725.14 The absolute relative approximate error a obtained between the

results from the second and third order polynomial is

100725.14

138.14725.14

a

%9898.3

Page 21: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu21

Comparison Table

Order of Polynomial

1 2 3

Temperature (oC) 65.14 138.14 725.14

Absolute Relative Approximate Error

---------- %6251.3 %9898.3

Page 22: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu22

ThermoclineWhat is the value of depth at which the thermocline exists?

The position where the thermocline exists is given where 02

2

dz

Td

.

69,5667.155.3558.2629.615

69,7895667.18905.298.19.932

zzzz

zzzzzzzzT

69,7.41.7158.262 2 zzzdz

dT

69,4.91.712

2

zzdz

Td

Simply setting this expression equal to zero, we get

69,4.910.710 zz

m5638.7z

Page 23: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

Additional ResourcesFor all resources on this topic such as digital audiovisual lectures, primers, textbook chapters, multiple-choice tests, worksheets in MATLAB, MATHEMATICA, MathCad and MAPLE, blogs, related physical problems, please visit

http://numericalmethods.eng.usf.edu/topics/newton_divided_difference_method.html

Page 24: Http://numericalmethods.eng.usf.edu 1 Newton’s Divided Difference Polynomial Method of Interpolation Civil Engineering Majors Authors: Autar Kaw, Jai Paul

THE END

http://numericalmethods.eng.usf.edu