lagrangian interpolation

Post on 05-Jan-2016

58 Views

Category:

Documents

3 Downloads

Preview:

Click to see full reader

DESCRIPTION

Lagrangian Interpolation. Computer 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

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

Lagrangian Interpolation

Computer 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

Example A robot arm with a rapid laser scanner is doing a quick quality

check on holes drilled in a rectangular plate. The hole centers in the plate that describe the path the arm needs to take are given below.

If the laser is traversing from x = 2 to x = 4.25 in a linear path, find the value of y at x = 4 using the Lagrange method for linear interpolation.

x (m) y (m)

2 7.24.25 7.15.25 6.07.81 5.09.2 3.510.6 5.0

Figure 2 Location of holes on the rectangular plate.

http://numericalmethods.eng.usf.edu7

Linear Interpolation

1

0

)()()(i

ii xyxLxy

)()()()( 1100 xyxLxyxL

5 0 5 107.08

7.1

7.12

7.14

7.16

7.18

7.27.2

7.1

y s

f range( )

f x desired

x s1

10x s0

10 x s range x desired

2.7,00.2 00 xyx

1.7,25.4 11 xyx

http://numericalmethods.eng.usf.edu8

Linear Interpolation (contd)

1

00 0

0 )(

jj j

j

xx

xxxL

10

1

xx

xx

1

10 1

1 )(

jj j

j

xx

xxxL

01

0

xx

xx

25.400.2,1.700.225.4

00.22.7

25.400.2

25.4

)( 101

00

10

1

xxx

xyxx

xxxy

xx

xxxy

in.1111.7

)1.7(88889.0)2.7(11111.0

)1.7(00.225.4

00.200.4)2.7(

25.400.2

25.400.4)00.4(

y

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

Example A robot arm with a rapid laser scanner is doing a quick quality

check on holes drilled in a rectangular plate. The hole centers in the plate that describe the path the arm needs to take are given below.

If the laser is traversing from x = 2 to x = 4.25 in a linear path, find the value of y at x = 4 using the Lagrange method for quadratic interpolation.

x (m) y (m)

2 7.24.25 7.15.25 6.07.81 5.09.2 3.510.6 5.0

Figure 2 Location of holes on the rectangular plate.

http://numericalmethods.eng.usf.edu11

Quadratic Interpolation

2

00 0

0 )(

jj j

j

xx

xxxL

20

2

10

1

xx

xx

xx

xx

2

10 1

1 )(

jj j

j

xx

xxxL

21

2

01

0

xx

xx

xx

xx

2

20 2

2 )(

jj j

j

xx

xxxL

12

1

02

0

xx

xx

xx

xx

2 2.5 3 3.5 4 4.5 5 5.56

6.5

7

7.5

87.56258

6

y s

f range( )

f x desired

5.252 x s range x desired

2.7,00.2 oo xyx

1.7,25.4 11 xyx

0.6,25.5 22 xyx

http://numericalmethods.eng.usf.edu12

Quadratic Interpolation (contd)

)()()()( 212

1

02

01

21

2

01

00

20

2

10

1 xyxx

xx

xx

xxxy

xx

xx

xx

xxxy

xx

xx

xx

xxxy

0.6

25.425.500.225.5

25.400.400.200.41.7

25.525.400.225.4

25.500.400.200.42.7

25.500.225.400.2

25.500.425.400.400.4

y

0.615385.01.71111.12.7042735.0

in.2735.7

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

polynomial is

1002735.7

1111.72735.7

a

%2327.2

http://numericalmethods.eng.usf.edu13

Comparison Table

Order of Polynomial

1 2

Location (in.) 7.1111 7.2735

Absolute Relative Approximate Error

---------- 2.2327%

http://numericalmethods.eng.usf.edu14

Example A robot arm with a rapid laser scanner is doing a quick quality

check on holes drilled in a rectangular plate. The hole centers in the plate that describe the path the arm needs to take are given below.

If the laser is traversing from x = 2 to x = 4.25 in a linear path, find the value of y at x = 4 using a fifth order Lagrange polynomial.

x (m) y (m)

2 7.24.25 7.15.25 6.07.81 5.09.2 3.510.6 5.0

Figure 2 Location of holes on the rectangular plate.

http://numericalmethods.eng.usf.edu15

Fifth Order Interpolation

5

0

)()()(i

ii xyxLxy

)()()()()()()()()()()()( 554433221100 xyxLxyxLxyxLxyxLxyxLxyxL

2.7,00.2 oo xyx

1.7,25.4 11 xyx

0.6,25.5 22 xyx

0.5,81.7 33 xyx

5.3,20.9 44 xyx

0.5,60.10 55 xyx

http://numericalmethods.eng.usf.edu16

Fifth Order Interpolation (contd)

5

00 0

0 )(

jj j

j

xx

xxxL

50

5

40

4

30

3

20

2

10

1

xx

xx

xx

xx

xx

xx

xx

xx

xx

xx

5

10 1

1 )(

jj j

j

xx

xxxL

51

5

41

4

31

3

21

2

01

0

xx

xx

xx

xx

xx

xx

xx

xx

xx

xx

5

20 2

2 )(

jj j

j

xx

xxxL

52

5

42

4

32

3

12

1

02

0

xx

xx

xx

xx

xx

xx

xx

xx

xx

xx

5

30 3

3 )(

jj j

j

xx

xxxL

53

5

43

4

23

2

13

1

03

0

xx

xx

xx

xx

xx

xx

xx

xx

xx

xx

5

40 4

4 )(

jj j

j

xx

xxxL

54

5

34

3

24

2

14

1

04

0

xx

xx

xx

xx

xx

xx

xx

xx

xx

xx

5

50 5

5 )(

jj j

j

xx

xxxL

45

4

35

3

25

2

15

1

05

0

xx

xx

xx

xx

xx

xx

xx

xx

xx

xx

http://numericalmethods.eng.usf.edu17

Fifth Order Polynomial (contd)

)(

)(

)(

)(

)(

)()(

545

4

35

3

25

2

15

1

05

0

454

5

34

3

24

2

14

1

04

0

353

5

43

4

23

2

13

1

03

0

252

5

42

4

32

3

12

1

02

0

151

5

41

4

31

3

21

2

01

0

050

5

40

4

30

3

20

2

10

1

xyxx

xx

xx

xx

xx

xx

xx

xx

xx

xx

xyxx

xx

xx

xx

xx

xx

xx

xx

xx

xx

xyxx

xx

xx

xx

xx

xx

xx

xx

xx

xx

xyxx

xx

xx

xx

xx

xx

xx

xx

xx

xx

xyxx

xx

xx

xx

xx

xx

xx

xx

xx

xx

xyxx

xx

xx

xx

xx

xx

xx

xx

xx

xxxy

http://numericalmethods.eng.usf.edu18

Fifth Order Polynomial (contd)

)0.5()20.960.10)(81.760.10)(25.560.10)(25.460.10)(00.260.10(

)20.9)(81.7)(25.5)(25.4)(00.2(

)5.3()60.1020.9)(81.720.9)(25.520.9)(25.420.9)(00.220.9(

)60.10)(81.7)(25.5)(25.4)(00.2(

)0.5()60.1081.7)(20.981.7)(25.581.7)(25.481.7)(00.281.7(

)60.10)(20.9)(25.5)(25.4)(00.2(

)0.6()60.1025.5)(20.925.5)(81.725.5)(25.425.5)(00.225.5(

)60.10)(20.9)(81.7)(25.4)(00.2(

)1.7()60.1025.4)(20.925.4)(81.725.4)(25.525.4)(00.225.4(

)60.10)(20.9)(81.7)(25.5)(00.2(

)2.7()60.1000.2)(20.900.2)(81.700.2)(25.500.2)(25.400.2(

)60.10)(20.9)(81.7)(25.5)(25.4()(

xxxxx

xxxxx

xxxxx

xxxxx

xxxxx

xxxxxxy

http://numericalmethods.eng.usf.edu19

Fifth Order Polynomial (contd)

24.228

4.32065.37277.157378.30851.28

273.78

3.36946.42412.175781.33591.29

069.41

8.43514.49121.198453.3663.31

304.29

9.64735.69033.257222.43386.33

461.35

1.79975.81697.287983.46286.34

38.365

16994128622.377377.53611.37

2345

2345

2345

2345

2345

2345

xxxxx

xxxxx

xxxxx

xxxxx

xxxxx

xxxxxxy

6.102

,0072923.023091.07862.2855.15344.41898.30)( 5432

x

xxxxxxy

http://numericalmethods.eng.usf.edu20

Fifth Order Polynomial (contd)

6.102

,0072929.023093.07865.2858.15351.41900.30)( 5432

x

xxxxxxy

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

top related