lagrangian method power point interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · ppt...

21
http:// numericalmethods.eng.usf.edu 1 Lagrangian Interpolation Major: All Engineering Majors Authors: Autar Kaw, Jai Paul http://numericalmethods.eng.us f.edu Transforming Numerical Methods Education for STEM Undergraduates

Upload: phamkhanh

Post on 03-Apr-2018

217 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Lagrangian Method Power Point Interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · PPT file · Web view · 2012-08-23Velocity vs. time data for the rocket example (s) ... The

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

Lagrangian Interpolation

Major: All Engineering Majors

Authors: Autar Kaw, Jai Paul

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

Undergraduates

Page 2: Lagrangian Method Power Point Interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · PPT file · Web view · 2012-08-23Velocity vs. time data for the rocket example (s) ... The

Lagrange Method of Interpolation

http://numericalmethods.eng.usf.edu

Page 3: Lagrangian Method Power Point Interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · PPT file · Web view · 2012-08-23Velocity vs. time data for the rocket example (s) ... The

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: Lagrangian Method Power Point Interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · PPT file · Web view · 2012-08-23Velocity vs. time data for the rocket example (s) ... The

http://numericalmethods.eng.usf.edu4

Interpolants Polynomials are the most

common choice of interpolants because they are easy to:

EvaluateDifferentiate, and Integrate.

Page 5: Lagrangian Method Power Point Interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · PPT file · Web view · 2012-08-23Velocity vs. time data for the rocket example (s) ... The

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.

Page 6: Lagrangian Method Power Point Interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · PPT file · Web view · 2012-08-23Velocity vs. time data for the rocket example (s) ... The

http://numericalmethods.eng.usf.edu6

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

Table Velocity as a function of time

Figure. Velocity vs. time data for the rocket example

(s) (m/s)

0 010 227.0415 362.7820 517.35

22.5 602.9730 901.67

t )(tv

Page 7: Lagrangian Method Power Point Interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · PPT file · Web view · 2012-08-23Velocity vs. time data for the rocket example (s) ... The

http://numericalmethods.eng.usf.edu7

Linear Interpolation

10 12 14 16 18 20 22 24350

400

450

500

550517.35

362.78

y s

f range( )

f x desired

x s110x s0

10 x s range x desired

)()()(1

0ii

itvtLtv

)()()()( 1100 tvtLtvtL

78.362,15 00 tt

35.517,20 11 tt

Page 8: Lagrangian Method Power Point Interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · PPT file · Web view · 2012-08-23Velocity vs. time data for the rocket example (s) ... The

http://numericalmethods.eng.usf.edu8

Linear Interpolation (contd)

1

00 0

0 )(jj j

j

tttt

tL 10

1

tttt

1

10 1

1 )(jj j

j

tttt

tL 01

0

tttt

)()()( 101

00

10

1 tvtttt

tvtttt

tv

)35.517(1520

15)78.362(2015

20

tt

)35.517(15201516)78.362(

20152016)16(

v

)35.517(2.0)78.362(8.0

7.393 m/s.

Page 9: Lagrangian Method Power Point Interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · PPT file · Web view · 2012-08-23Velocity vs. time data for the rocket example (s) ... The

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

Page 10: Lagrangian Method Power Point Interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · PPT file · Web view · 2012-08-23Velocity vs. time data for the rocket example (s) ... The

http://numericalmethods.eng.usf.edu10

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 Lagrangian method for quadratic interpolation.

Table Velocity as a function of time

Figure. Velocity vs. time data for the rocket example

(s) (m/s)

0 010 227.0415 362.7820 517.35

22.5 602.9730 901.67

t )(tv

Page 11: Lagrangian Method Power Point Interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · PPT file · Web view · 2012-08-23Velocity vs. time data for the rocket example (s) ... The

http://numericalmethods.eng.usf.edu11

Quadratic Interpolation (contd)

10 12 14 16 18 20200

250

300

350

400

450

500

550517.35

227.04

y s

f range( )

f x desired

2010 x s range x desired

,100 t 04.227)( 0 tv

,151 t 78.362)( 1 tv

,202 t 35.517)( 2 tv

2

00 0

0 )(jj j

j

tttt

tL

20

2

10

1

tttt

tttt

2

10 1

1 )(jj j

j

tttt

tL

21

2

01

0

tttt

tttt

2

20 2

2 )(jj j

j

tttt

tL

12

1

02

0

tttt

tttt

Page 12: Lagrangian Method Power Point Interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · PPT file · Web view · 2012-08-23Velocity vs. time data for the rocket example (s) ... The

http://numericalmethods.eng.usf.edu12

Quadratic Interpolation (contd)

m/s19.392

35.52712.078.36296.004.22708.0

35.51715201516

1020101678.362

20152016

1015101604.227

20102016

1510151616

212

1

02

01

21

2

01

00

20

2

10

1

v

tvtttt

tttttv

tttt

tttttv

tttt

tttttv

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

a

%38410.0

10019.392

70.39319.392

a

Page 13: Lagrangian Method Power Point Interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · PPT file · Web view · 2012-08-23Velocity vs. time data for the rocket example (s) ... The

http://numericalmethods.eng.usf.edu13

Cubic Interpolation

10 12 14 16 18 20 22 24200

300

400

500

600

700602.97

227.04

y s

f range( )

f x desired

22.510 x s range x desired

For the third order polynomial (also called cubic interpolation), we choose the velocity given by

3

0

)()()(i

ii tvtLtv

)()()()()()()()( 33221100 tvtLtvtLtvtLtvtL

Page 14: Lagrangian Method Power Point Interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · PPT file · Web view · 2012-08-23Velocity vs. time data for the rocket example (s) ... The

http://numericalmethods.eng.usf.edu14

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

Table Velocity as a function of time

Figure. Velocity vs. time data for the rocket example

(s) (m/s)

0 010 227.0415 362.7820 517.35

22.5 602.9730 901.67

t )(tv

Page 15: Lagrangian Method Power Point Interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · PPT file · Web view · 2012-08-23Velocity vs. time data for the rocket example (s) ... The

http://numericalmethods.eng.usf.edu15

Cubic Interpolation (contd) 04.227,10 oo tvt 78.362,15 11 tvt

35.517,20 22 tvt 97.602,5.22 33 tvt

3

00 0

0 )(jj j

j

tttt

tL

30

3

20

2

10

1

tttt

tttt

tttt

;

3

10 1

1 )(jj j

j

tttt

tL

31

3

21

2

01

0

tttt

tttt

tttt

3

20 2

2 )(jj j

j

tttt

tL

32

3

12

1

02

0

tttt

tttt

tttt

;

3

30 3

3 )(jj j

j

tttt

tL

23

2

13

1

03

0

tttt

tttt

tttt

10 12 14 16 18 20 22 24

200

300

400

500

600

700602.97

227.04

y s

f range( )

f x desired

22.510 x s range x desired

Page 16: Lagrangian Method Power Point Interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · PPT file · Web view · 2012-08-23Velocity vs. time data for the rocket example (s) ... The

http://numericalmethods.eng.usf.edu16

Cubic Interpolation (contd)

m/s06.392

97.6021024.035.517312.078.362832.004.2270416.0

97.602205.22

2016155.22

1516105.22

101635.5175.22205.2216

15201516

10201016

78.3625.22155.2216

20152016

1015101604.227

5.22105.2216

20102016

1510151616

323

2

13

1

13

12

32

3

12

1

02

0

231

3

21

2

01

01

30

3

20

2

10

1

v

tvtttt

tttt

tttttv

tttt

tttt

tttt

tvtttt

tttt

tttttv

tttt

tttt

tttttv

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

a

%033269.0

10006.392

19.39206.392

a

Page 17: Lagrangian Method Power Point Interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · PPT file · Web view · 2012-08-23Velocity vs. time data for the rocket example (s) ... The

http://numericalmethods.eng.usf.edu17

Comparison Table

Order of Polynomial 1 2 3

v(t=16) m/s 393.69 392.19 392.06Absolute Relative

Approximate Error

-------- 0.38410%

0.033269%

Page 18: Lagrangian Method Power Point Interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · PPT file · Web view · 2012-08-23Velocity vs. time data for the rocket example (s) ... The

http://numericalmethods.eng.usf.edu18

Distance from Velocity Profile

Find the distance covered by the rocket from t=11s to

t=16s ?

,00544.013195.0265.21245.4)( 32 ttttv 5.2210 t

16

11

)()11()16( dttvss

16

11

32 )00544.013195.0265.21245.4( dtttt

1611

432

]4

00544.03

13195.02

265.21245.4[ tttt

1605 m

)5727.2)(300065045()1388.4)(33755.7125.47(

)9348.1)(45008755.52()36326.0)(67505.10875.57()(2323

2323

tttttt

tttttttv

Page 19: Lagrangian Method Power Point Interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · PPT file · Web view · 2012-08-23Velocity vs. time data for the rocket example (s) ... The

http://numericalmethods.eng.usf.edu19

Acceleration from Velocity Profile

,

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

32 00544.013195.0265.21245.4 tttdtdtv

dtdta

201632.026390.0265.21 tt

2)16(01632.0)16(26390.0265.21)16( a

665.29 2/ sm

,00544.013195.0265.21245.4)( 32 ttttv 5.2210 t

Page 20: Lagrangian Method Power Point Interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · PPT file · Web view · 2012-08-23Velocity vs. time data for the rocket example (s) ... The

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

Page 21: Lagrangian Method Power Point Interpolationmathforcollege.com/nm/mws/gen/05inp/mw… · PPT file · Web view · 2012-08-23Velocity vs. time data for the rocket example (s) ... The

THE END

http://numericalmethods.eng.usf.edu