Lagrangian Interpolation

Post on 06-Jan-2016

120 views 6 download

Tags:

description

Lagrangian Interpolation. Civil Engineering Majors Authors: Autar Kaw, Jai Paul http://numericalmethods.eng.usf.edu Transforming Numerical Methods Education for STEM Undergraduates. Lagrange Method of Interpolation http://numericalmethods.eng.usf.edu. What is Interpolation ?. - PowerPoint PPT Presentation

Transcript of Lagrangian Interpolation

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

Lagrangian Interpolation

Civil Engineering Majors

Authors: Autar Kaw, Jai Paul

http://numericalmethods.eng.usf.edu

Transforming Numerical Methods Education for STEM Undergraduates

Lagrange Method of Interpolation

http://numericalmethods.eng.usf.edu

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.

http://numericalmethods.eng.usf.edu4

Interpolants

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

EvaluateDifferentiate, and Integrate.

http://numericalmethods.eng.usf.edu5

Lagrangian Interpolation

Lagrangian interpolating polynomial is given by

n

iiin xfxLxf

0

)()()(

where ‘ n ’ in )(xf n stands for the thn order polynomial that approximates the function )(xfy

given at )1( n data points as nnnn yxyxyxyx ,,,,......,,,, 111100 , and

n

ijj ji

ji xx

xxxL

0

)(

)(xLi is a weighting function that includes a product of )1( n terms with terms of ij

omitted.

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

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

1

0

)()()(i

ii zTzLzT

)()()()( 1100 zTzLzTzL

7.11,8 00 zTz

6.17,7 11 zTz

http://numericalmethods.eng.usf.edu8

Linear Interpolation (contd)

10

11

00 0

0 )(zz

zz

zz

zzzL

jj j

j

01

01

10 1

1 )(zz

zz

zz

zzzL

jj j

j

78),6.17(87

8)7.11(

78

7)()()( 1

01

00

10

1

zzz

zTzz

zzzT

zz

zzzT

C65.14

)6.17(5.0)7.11(5.0)6.17(87

85.7)7.11(

78

75.7)5.7(

T

http://numericalmethods.eng.usf.edu9

Quadratic InterpolationFor the second order polynomial interpolation (also called quadratic interpolation), we

choose the velocity given by

2

0

)()()(i

ii tvtLtv

)()()()()()( 221100 tvtLtvtLtvtL

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

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

9.9,9 oo zTz

7.11,8 11 zTz

6.17,7 22 zTz

2

00 0

0 )(

jj j

j

zz

zzzL

20

2

10

1

zz

zz

zz

zz

2

10 1

1 )(

jj j

j

zz

zzzL

21

2

01

0

zz

zz

zz

zz

2

20 2

2 )(

jj j

j

zz

zzzL

12

1

02

0

zz

zz

zz

zz

http://numericalmethods.eng.usf.edu12

Quadratic Interpolation (contd)

212

1

02

01

21

2

01

00

20

2

10

1)( zTzz

zz

zz

zzzT

zz

zz

zz

zzzT

zz

zz

zz

zzzT

C138.14

6.17375.07.1175.09.9125.0

6.178797

85.795.77.11

7898

75.795.79.9

7989

75.785.75.7

T

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

http://numericalmethods.eng.usf.edu13

Cubic InterpolationFor the third order polynomial (also called cubic interpolation), we choose the

temperature given by

3

0

)()()(i

ii zTzLzT

)()()()()()()()( 33221100 zTzLzTzLzTzLzTzL

9 8.5 8 7.5 7 6.5 68

10

12

14

16

18

2019.19774

9.44745

y s

f range( )

f x desired

69 x s range x desired

http://numericalmethods.eng.usf.edu14

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

http://numericalmethods.eng.usf.edu15

Cubic Interpolation (contd)

9 8.5 8 7.5 7 6.5 68

10

12

14

16

18

2019.19774

9.44745

y s

f range( )

f x desired

69 x s range x desired

9.9,9 oo zTz 7.11,8 11 zTz

6.17,7 22 zTz 2.18,6 33 zTz

3

00 0

0 )(

jj j

j

zz

zzzL

30

3

20

2

10

1

zz

zz

zz

zz

zz

zz

3

10 1

1 )(

jj j

j

zz

zzzL

31

3

21

2

01

0

zz

zz

zz

zz

zz

zz

3

20 2

2 )(

jj j

j

zz

zzzL

32

3

12

1

02

0

zz

zz

zz

zz

zz

zz

3

30 3

3 )(

jj j

j

zz

zzzL

23

2

13

1

03

0

zz

zz

zz

zz

zz

zz

http://numericalmethods.eng.usf.edu16

Cubic Interpolation (contd)

323

2

13

1

03

02

30

3

10

1

02

0

131

3

21

2

01

00

30

3

20

2

10

1

zTzz

zz

zz

zz

zz

zzzT

zz

zz

zz

zz

zz

zz

zTzz

zz

zz

zz

zz

zzzT

zz

zz

zz

zz

zz

zzzT

30 zzz

2.18768696

75.785.795.76.17

678797

65.785.795.7

7.11687898

65.775.795.79.9

697989

65.775.785.75.7

T

2.180625.06.175625.07.115625.09.90625.0

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

http://numericalmethods.eng.usf.edu17

Comparison Table

Order of Polynomial

1 2 3

Temperature °C 65.14 138.14 725.14

Absolute Relative Approximate Error

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

http://numericalmethods.eng.usf.edu18

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

2.18768696

7896.17

678797

689

7.11687898

6799.9

697989

678

32

zzzz

zzzzzz

zzzzzzzT

69,4.91.71

69,7.41.7158.262

2

2

2

zzdz

Td

zzzdz

dT

Simply setting this expression equal to zero, we get

m5638.7

69,4.91.710

z

zz

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/lagrange_method.html

THE END

http://numericalmethods.eng.usf.edu