• No results found

Lagrangian Interpolation

N/A
N/A
Protected

Academic year: 2021

Share "Lagrangian Interpolation"

Copied!
10
0
0

Loading.... (view fulltext now)

Full text

(1)

LAGRANGIAN METHOD

TEXT BOOK NOTES

INTERPOLATION MAJOR

GENERAL

Topic Interpolation

Sub Topic Textbook Notes – Lagrangian Method

Summary Textbook notes of Lagrangian Method of interpolation.

Authors Autar Kaw, Michael Keteltas

Date February 5, 2003

LAGRANGIAN INTERPOLATION What is interpolation?

Many a times, a function y = f

( )

x is given only at discrete points such as

(

x0,y0

) (

, x1,y1

)

,...,

(

xn−1,yn−1

) (

, xn,yn

)

. How 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

( )

x

f passing through the ‘n+1’ points. 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 interpolating function because polynomials are easy to

a) evaluate

b) differentiate, and

c) integrate

(2)

Figure 1: Interpolation of discrete data

Polynomial interpolation involves finding a polynomial of order ‘n’ that passes through the ‘n+1’ points. One of the methods to find this polynomial is called Lagrangian Interpolation. Other methods include the direct method and the Newton’s Divided Difference Polynomial method.

Lagrangian interpolating polynomial is given by

= = n i i i n x L x f x f 0 ) ( ) ( ) (

where ‘n’ in fn(x) stands for the n order polynomial that approximates the function th y = f(x)

given at (n+1) data points as

(

x0,y0

) (

, x1,y1

)

,...,

(

xn1,yn1

) (

, xn,yn

)

, and

≠ = − − = n i j j i j j i x x x x x L 0 ) ( ) (x

Li is a weighting function that includes a product of (n−1) terms with terms of j = i

omitted. The application would be clear 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 v(t) s m/s 0 0 10 227.04 15 362.78 20 517.35 22.5 602.97

(3)

30 901.67

Figure 2: Velocity vs. time data for the rocket example

Determine the value of the velocity at t=16 seconds using a first order polynomial.

Solution

For the first order polynomial (also called linear interpolation), we choose the velocity as given by

= = 1 0 ) ( ) ( ) ( i i i t v t L t v =L0(t)v(t0)+L1(t)v(t1)

Figure 3: Linear interpolation

Since we want to find the velocity at t=16, we choose two data points that are closest to t=16 and that also bracket t=16. Those two points are to=15 and t1=20.

( )

362.78 , 15 0 0 = t = t ν

( )

517.35 , 20 1 1 = t = t ν

≠ = − − = 1 0 0 0 0( ) j j j j t t t t t L

(4)

1 0 1 t t t t − − =

≠ = − − = 1 10 1 1( ) j j j j t t t t t L 0 1 0 t t t t − − = ( ) ( ) (1) 0 1 0 0 1 0 1 v t t t t t t v t t t t t v − − + − − = (517.35) 15 20 15 ) 78 . 362 ( 20 15 20 − − + − − = t t ) 35 . 517 ( 15 20 15 16 ) 78 . 362 ( 20 15 20 16 ) 16 ( − − + − − = v =0.8(362.78)+0.2(517.35) =393.7 m/s.

You can see that L0(t)=0.8 and L1(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

For the second order polynomial interpolation (also called quadratic interpolation), we choose the velocity given by

= = 2 0 ) ( ) ( ) ( i i i t v t L t v =L0(t)v(t0)+L1(t)v(t1)+L2(t)v(t2)

(5)

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 v(t) s m/s 0 0 10 227.04 15 362.78 20 517.35 22.5 602.97 30 901.67

Determine the value of the velocity at t=16 seconds using second order polynomial interpolation using Lagrangian polynomial interpolation. Find the absolute relative approximate error for approximation from second order polynomial.

Solution:

Since we want to find the velocity at t=16, we need to choose data points that are closest to t=16 as well as bracket t=16. These three points are t0=10, t1=15, t2=20.

( )

227.04 , 10 = = o o vt t

( )

362.78 , 15 1 1 = v t = t

( )

517.35 , 20 2 2 = vt = t gives

(6)

≠ = − − = 2 0 0 0 0( ) j j j j t t t t t L       − −       − − = 2 0 2 1 0 1 t t t t t t t t

≠ = − − = 2 10 1 1( ) j j j j t t t t t L       − −       − − = 2 1 2 0 1 0 t t t t t t t t

≠ = − − = 2 2 0 2 2( ) j j j j t t t t t L       − −       − − = 1 2 1 0 2 0 t t t t t t t t ( ) ( ) ( ) ( 2) 1 2 1 0 2 0 1 2 1 2 0 1 0 0 2 0 2 1 0 1 v t t t t t t t t t t v t t t t t t t t t v t t t t t t t t t v       − −       − − +       − −       − − +       − −       − − = ) 35 . 517 ( ) 15 20 )( 10 20 ( ) 15 16 )( 10 16 ( ) 78 . 362 ( ) 20 15 )( 10 15 ( ) 20 16 )( 10 16 ( ) 04 . 227 ( ) 20 10 )( 15 10 ( ) 20 16 )( 15 16 ( ) 16 ( − − − − + − − − − + − − − − = v =(−0.08)(227.04)+(0.96)(362.78)+(0.12)(517.35) =392.19 m/s.

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

100 19 . 392 70 . 393 19 . 392 − × = ∈a =0.38502% Example 3

(7)

Table 3: Velocity as a function of time t v(t) s m/s 0 0 10 227.04 15 362.78 20 517.35 22.5 602.97 30 901.67

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

b) Using the third order polynomial interpolant for velocity, find the distance covered by the rocket from t=11s to t=16s.

c) Using the third order polynomial interpolant for velocity, find the acceleration of the rocket at t=16s.

Solution:

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

= = 3 0 ) ( ) ( ) ( i i i t v t L t v =L0(t)v(t0)+L1(t)v(t1)+L2(t)v(t2)+L3(t)v(t3)

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

(8)

( )

227.04 , 10 = = o o vt t

( )

362.78 , 15 1 1 = v t = t

( )

517.35 , 20 2 2 = vt = t

( )

602.97 , 5 . 22 3 3 = v t = t such that

≠ = − − = 3 0 0 0 0( ) j j j j t t t t t L       − −       − −       − − = 3 0 3 2 0 2 1 0 1 t t t t t t t t t t t t

≠ = − − = 3 10 1 1( ) j j j j t t t t t L       − −       − −       − − = 3 1 3 2 1 2 0 1 0 t t t t t t t t t t t t

≠ = − − = 3 2 0 2 2( ) j j j j t t t t t L       − −       − −       − − = 3 2 3 1 2 1 0 2 0 t t t t t t t t t t t t

≠ = − − = 3 3 0 3 3( ) j j j j t t t t t L       − −       − −       − − = 2 3 2 1 3 1 0 3 0 t t t t t t t t t t t t ) ( ) ( ) ( ) ( ) ( 3 2 3 2 1 3 1 0 3 0 2 3 2 3 1 2 1 0 2 0 1 3 1 3 2 1 2 0 1 0 0 3 0 3 2 0 2 1 0 1 t v t t t t t t t t t t t t t v t t t t t t t t t t t t t v t t t t t t t t t t t t t v t t t t t t t t t t t t t v       − −       − −       − − +       − −       − −       − − +       − −       − −       − − +       − −       − −       − − =

(9)

) 97 . 602 ( ) 20 5 . 22 )( 15 5 . 22 )( 10 5 . 22 ( ) 20 16 )( 15 16 )( 10 16 ( ) 35 . 517 ( ) 5 . 22 20 )( 15 20 )( 10 20 ( ) 5 . 22 16 )( 15 16 )( 10 16 ( ) 78 . 362 ( ) 5 . 22 15 )( 20 15 )( 10 15 ( ) 5 . 22 16 )( 20 16 )( 10 16 ( ) 04 . 227 ( ) 5 . 22 10 )( 20 10 )( 15 10 ( ) 5 . 22 16 )( 20 16 )( 15 16 ( ) 16 ( − − − − − − + − − − − − − + − − − − − − + − − − − − − = v =(−0.0416)(227.04)+(0.832)(362.78)+(0.312)(517.35)+(−0.1024)(602.97) =392.06 m/s

The absolute percentage relative approximate error, ∈a for the value obtained for v(16) between second and third order polynomial is

100 06 . 392 19 . 392 06 . 392 − × = ∈a =0.033427%

b) The distance covered by the rocket between t=11s and t=16s can be calculated from the interpolating polynomial 5 . 22 10 ), 97 . 602 ( ) 20 5 . 22 )( 15 5 . 22 )( 10 5 . 22 ( ) 20 )( 15 )( 10 ( ) 35 . 517 ( ) 5 . 22 20 )( 15 20 )( 10 20 ( ) 5 . 22 )( 15 )( 10 ( ) 78 . 362 ( ) 5 . 22 15 )( 20 15 )( 10 15 ( ) 5 . 22 )( 20 )( 10 ( ) 04 . 227 ( ) 5 . 22 10 )( 20 10 )( 15 10 ( ) 5 . 22 )( 20 )( 15 ( ) ( ≤ ≤ − − − − − − + − − − − − − + − − − − − − + − − − − − − = t t t t t t t t t t t t t t v ) 97 . 602 ( ) 5 . 2 )( 5 . 7 )( 5 . 12 ( ) 20 )( 150 25 ( ) 35 . 517 ( ) 5 . 2 )( 5 )( 10 ( ) 5 . 22 )( 150 25 ( ) 78 . 362 ( ) 5 . 7 )( 5 )( 5 ( ) 5 . 22 )( 200 30 ( ) 04 . 227 ( ) 5 . 12 )( 10 )( 5 ( ) 5 . 22 )( 300 35 ( ) ( 2 2 2 2 − + − + − − + − + − − − + − + − − − − + − = t t t t t t t t t t t t t v ) 5727 . 2 )( 3000 650 45 ( ) 1388 . 4 )( 3375 5 . 712 5 . 47 ( ) 9348 . 1 )( 4500 875 5 . 52 ( ) 36326 . 0 )( 6750 5 . 1087 5 . 57 ( ) ( 2 3 2 3 2 3 2 3 − + − + − − + − + − + − + − − + − = t t t t t t t t t t t t t v , 00544 . 0 13195 . 0 265 . 21 245 . 4 ) (t t t2 t3 v =− + + + 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.

(10)

= − 16 11 ) ( ) 11 ( ) 16 ( s v t dt s ≈16

− + + + 11 3 2 0.00544 ) 13195 . 0 265 . 21 245 . 4 ( t t t dt 16 11 4 3 2 ] 4 00544 . 0 3 13195 . 0 2 265 . 21 245 . 4 [− t+ t + t + t = =1605 m

c) The acceleration at t=16 is given by

( )

16 = v

( )

t t=16 dt d a Given that v(t)=4.245+21.265t+0.13195t2 +0.00544t3 10≤ t22.5

( )

( )

(

4.245 21.265t 0.13195t2 0.00544t3

)

dt d t v dt d t a = = − + + + =21.265+0.26390t+0.01632t2 2 ) 16 ( 01632 . 0 ) 16 ( 26390 . 0 265 . 21 ) 16 ( = + + a =29.665 m/ s2

References

Related documents

[r]

The per hectare cost of production in a contract farm is about 13 percent lower and as a result the average profit margin under contract is more than 50 percent above those without

Instruments included the Fear Avoidance Belief Tool (FABT), Tampa Scale of Kinesiophobia for Health Care Practitioners (TSK-HC), Health Care Providers’ Pain and

The first column shows the response to a conventional monetary policy shock (i.e shock to the federal funds rate equa- tion), while the second column shows the response to a

Training advisory services help develop competences and skills in companies, observe the current situation concerning skilled personnel in companies, in the sector and in the

The purpose of the workshop will be to engage clinical trialists, industry, the representatives of national/regional healthcare systems (who are also interested in improving

CORPORATE NAME: RIZAL COMMERCIAL BANKING CORPORATION DIRECTORS / OFFICERS NAME/CURRENT RESIDENTIAL ADDRESS NATIONALITY INCR BOARD GENDER STOCK. HOLDER OFFICER*

Interpolation is then used to find the member of this class of functions that agrees with the given data... In fact, this is what is done continually with