Lagrangian Interpolation - Numerical Analysis - Solved Exam, Exams of Mathematical Methods for Numerical Analysis and Optimization

Main Points are:Lagrangian Interpolation, Method of Interpolation, Derivatives and Integrals, Discrete Functions, Interpolating Function, Newton’s Divided Difference Polynomial Method, Direct Method, Weighting Function

Typology: Exams

2012/2013

Uploaded on 04/16/2013

maalolan
maalolan 🇮🇳

4.5

(8)

121 documents

1 / 10

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
05.05.1
Chapter 05.04
Lagrangian Interpolation
After reading this chapter, you should be able to:
1. derive Lagrangian method of interpolation,
2. solve problems using Lagrangian method of interpolation, and
3. use Lagrangian interpolants to find derivatives and integrals of discrete functions.
What is interpolation?
Many times, data is given only at discrete points such as
,, 00 yx
11,yx , ......,

11, nn yx ,

nn yx , . So, how then does one find the value of y at any other value of
x
? Well, a
continuous function

xf may be used to represent the 1
n data values with

xf passing
through the 1n points (Figure 1). Then one can find the value of y at any other value of
x
. This is called interpolation.
Of course, if
x
falls outside the range of
x
for which the data is given, it is no longer
interpolation but instead is called extrapolation.
So what kind of function
xf should one choose? A polynomial is a common
choice for an interpolating function because polynomials are easy to
(A) evaluate,
(B) differentiate, and
(C) integrate,
relative to other choices such as a trigonometric and exponential series.
Polynomial interpolation involves finding a polynomial of order n that passes
through the 1n data points. One of the methods used to find this polynomial is called the
Lagrangian method of interpolation. Other methods include Newton’s divided difference
polynomial method and the direct method. We discuss the Lagrangian method in this
chapter.
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Lagrangian Interpolation - Numerical Analysis - Solved Exam and more Exams Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

Chapter 05.

Lagrangian Interpolation

After reading this chapter, you should be able to:

  1. derive Lagrangian method of interpolation,
  2. solve problems using Lagrangian method of interpolation, and
  3. use Lagrangian interpolants to find derivatives and integrals of discrete functions.

What is interpolation?

Many times, data is given only at discrete points such as  x 0 , y 0 ,  x 1 , y 1 , ......,  xn  1 , yn  1 ,

 xn , yn . So, how then does one find the value of y at any other value of x? Well, a

continuous function f   x may be used to represent the n  1 data values with f   x passing

through the n  1 points (Figure 1). Then one can find the value of y at any other value of

x. This is called interpolation. Of course, if x falls outside the range of x for which the data is given, it is no longer interpolation but instead is called extrapolation.

So what kind of function f ^ x  should one choose? A polynomial is a common

choice for an interpolating function because polynomials are easy to (A) evaluate, (B) differentiate, and (C) integrate, relative to other choices such as a trigonometric and exponential series. Polynomial interpolation involves finding a polynomial of order n that passes through the n  1 data points. One of the methods used to find this polynomial is called the Lagrangian method of interpolation. Other methods include Newton’s divided difference polynomial method and the direct method. We discuss the Lagrangian method in this chapter.

05.05.2 Chapter 05.

Figure 1 Interpolation of discrete data.

The Lagrangian interpolating polynomial is given by

n

i

f (^) n x Li x f xi 0

where n in f (^) n ( x ) stands for the (^) n th order polynomial that approximates the function

y  f ( x )given at n  1 data points as ^ x 0 , y 0  ,^ x 1 , y 1 ,......,^ ^ xn  1 , yn  1  ,^ xn , yn , and

n

ji

j (^) i j

j i x x

x x L x 0

Li ( x ) is a weighting function that includes a product of n^ ^1 terms with terms of ji

omitted. The application of Lagrangian interpolation will be clarified using an example.

Example 1

The upward velocity of a rocket is given as a function of time in Table 1.

Table 1 Velocity as a function of time. t (s) v (^ t )(m/s) 0 0 10 227. 15 362. 20 517. 22.5 602. 30 901.

 x 0 , y 0 

 x 1 , y 1 

 x 2 , y 2 

 x 3 , y 3 

f  x 

x

y

05.05.4 Chapter 05.

Figure 3 Linear interpolation.

Since we want to find the velocity at t  16 , and we are using a first order polynomial, we need to choose the two data points that are closest to t  16 that also bracket t  16 to

evaluate it. The two points are t (^) 0  15 and t 1 (^)  20.

Then

t 0  15 , v  t 0   362. 78

t 1  20 , v  t 1   517. 35

gives

1

0

(^0 )

j

j (^) j

j t t

t t L t

0 1

1 t t

t t

1

1

(^0 )

j

j (^) j

j t t

t t L t

1 0

0 t t

t t

Hence

( ) ( ) ( 1 ) 1 0

0 0 0 1

(^1) vt t t

t t vt t t

t t v t

t

t t

v

 x 0 , y 0 

 x 1 , y 1 

f 1  x 

x

y

Lagrangian Interpolation 05.05.

 393. 69 m/s

You can see that L 0 (^) ( t ) 0. 8 and L 1 (^) ( t ) 0. 2 are like weightages given to the velocities at

t  15 and t  20 to calculate the velocity at t  16.

Quadratic Interpolation

Figure 4 Quadratic interpolation.

Example 2

The upward velocity of a rocket is given as a function of time in Table 2.

Table 2 Velocity as a function of time. t (s) v ( t )(m/s) 0 0 10 227. 15 362. 20 517. 22.5 602. 30 901.

a) Determine the value of the velocity at t  16 seconds with second order polynomial interpolation using Lagrangian polynomial interpolation. b) Find the absolute relative approximate error for the second order polynomial approximation.

 x 0 , y 0 

 x 1 , y 1 

 x 2 , y 2 

f 2  x 

y

x

Lagrangian Interpolation 05.05.

b) The absolute relative approximate error  a for the second order polynomial is calculated

by considering the result of the first order polynomial (Example 1) as the previous approximation.

100

  1. 19

a

 0. 38410 %

Example 3

The upward velocity of a rocket is given as a function of time in Table 3.

Table 3 Velocity as a function of time t (s) v (^ t )(m/s) 0 0 10 227. 15 362. 20 517. 22.5 602. 30 901.

a) Determine the value of the velocity at t  16 seconds using third order Lagrangian polynomial interpolation. b) Find the absolute relative approximate error for the third order polynomial approximation. c) Using the third order polynomial interpolant for velocity, find the distance covered by the rocket from t  11 sto t  16 s. d) Using the third order polynomial interpolant for velocity, find the acceleration of the rocket at t  16 s.

Solution

a) For third order polynomial interpolation (also called cubic interpolation), the velocity is given by

3

0

i

vt Li tvti

L 0 (^) ( t ) v ( t 0 ) L 1 ( t ) v ( t 1 ) L 2 ( t ) v ( t 2 ) L 3 ( t ) v ( t 3 )

05.05.8 Chapter 05.

Figure 5 Cubic interpolation.

Since we want to find the velocity at t  16 , and we are using a third order polynomial, we need to choose the four data points closest to t  16 that also bracket t  16 to evaluate it.

The four points are t 0 (^)  10 , t 1  15 , t 2  20 and t 3 (^)  22. 5.

Then

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

gives

3

0

(^0 )

j

j (^) j

j t t

t t L t

0 3

3 0 2

2 0 1

1 t t

t t t t

t t t t

t t

3

1

0 1

j

j j

j t t

t t L t

1 3

3 1 2

2 1 0

0 t t

t t t t

t t t t

t t

3

2

0 2

j

j j

j t t

t t L t

2 3

3 2 1

1 2 0

0 t t

t t t t

t t t t

t t

 x 0 , y 0 

 x 1 , y 1 

 x 2 , y 2 

 x 3 , y 3 

f 3  x 

x

y

05.05.10 Chapter 05.

3 2 3 2

3 2 3 2

        

t t t t t t

t t t t t t

  4. 245  21. 265 t  0. 13195 t^2  0. 00544 t^3 , 10  t  22. 5

Note that the polynomial is valid between t  10 and t  22. 5 and hence includes the limits of t  11 and t  16. So

16

11

s ( 16 ) s ( 11 ) v ( t ) dt

16

11

( 4. 245 21. 265 t 0. 13195 t^2 0. 00544 t^3 ) dt

16

11

2 3 4

4

t t t t

 1605 m d) The acceleration at t  16 is given by

 16   v   t t  16

dt

d a

Given that

v ( t )  4. 245  21. 265 t  0. 13195 t^2  0. 00544 t^3 , 10  t  22. 5

  v   t

dt

d a t

 4. 245 21. 265 t 0. 13195 t^2 0. 00544 t^3 

dt

d     

 21. 265  0. 26390 t  0. 01632 t^2 , 10  t  22. 5 a ( 16 ) 21. 265  0. 26390 ( 16 ) 0. 01632 ( 16 )^2  29. 665 m/s^2 Note : There is no need to get the simplified third order polynomial expression to conduct the differentiation. An expression of the form

0 3

3 0 2

2 0 1

1 0 (^ ) t t

t t t t

t t t t

t t L t

gives the derivative without expansion as

 L 0 ( t )

dt

d  

0 1

1 0 3

3 0 3

3 0 2

2 0 2

2 0 1

1 t t

t t t t

t t t t

t t t t

t t t t

t t t t

t t