You are on page 1of 18

TALK ON I N T E R P O L A T I O N

WBSU DEPARTMENT OF PHYSICS(3RD SEM)


Guided by Dr. Arunava Adhikari Represented by :>>
I. Tanmay Sarkar (Page 1 to 8) ID No. 100092160594 II. Arup Ghosh (Page 9 to 18) ID No. 100092160593

Simple curves of interpolating polynomial

Introduction:
Literally interpolation means reading in between the lines. Let us consider a function f(x) is not given in the analytical form but the function f(x) is tabulated at (n+1) points, (i=0, 1, 2, 3 . n). These points are called base points. ( ) : : ( : : : : ) ( )

: : :

The object of interpolation is to estimate the values of the function at non-tabular points having an error bound between the estimated and true values. It is required to find a simpler function say (x), such that f(x) and (x) are agree at the set of tabulated points. Such a process is called interpolation. If (x) is a polynomial then the process is called polynomial interpolation and (x) is called the interpolating polynomial. Similarly, different types of interpolation arises depending on whether (x) is finite trigonometric series i,e; series of Bessel function etc.

Weierstrass Theorem (1885):

This theorem justifies the approximation of unknown function by means of a polynomial which is, If f(x) is continuous in then given any > 0 there exists polynomial (x) such that for all x where .

|f(x) (x) | < ,

This means that it is possible to find a polynomial (x) whose graph remains within the region bounded by y = f(x) - and y = f(x) + for all x between & however small may be.

Depending upon the nature of the tabulated points there are several interpolation methods. When the base points are equally spaced we can use finite difference interpolating formula, Newtons Forward, Backward difference formula are introduced. For unequally spaced base points Lagranges interpolation formula, Gaussian formula etc. are preserved.

Uniqueness of Polynomial:

To prove (x) obtained is unique we assume that there is an another polynomial *(x) which satisfies, ( ) = ( ) where i = 0, 1, 2 , n. so ( ) = 0 ( ).

Consider (x) = (x) - *(x)

Since both (x) & *(x) are both polynomial of degree n which has n+1 distinct roots , . . . (x) = 0, because (x) is polynomial of degree has exactly n roots. So, (x) = *(x)

Error Calculation:
Consider a function y(x) defined in (n+1) points ( , ) i= 0, 1, 2 .. n be continuous and differentiable for (n+1) times. Let f(x) be approximated by a polynomial ( ) of degree not exceeding such that, ( ) = i=0, 1 ..n. =
, ,

If no error then, ( )

Putting

( )=0

Where

L is to be determine such that equation 1 holds for any intermediate value of x say , L=
( ( ) )

( ) = (

( )

( )= )(

) (

( ) .. (1)

. (2) ( ) (

Now we construct a function F(x) such that ( ) = ( ) ( ) . (3) )= ( )=0

Where L is given by (2)

So F(x) vanishes (n+2) times in

) = ( ) = ( .

By Rolle s Theorem,

Thus

( ) vanishes (n+1) times,

( ) vanishes for one time within the interval. Let at this point = 0= < <

( ) vanishes for n times etc. in

Differentiating (n+1) times equation (3) gives,

( ) ( + 1)! ( ) ( + 1)!

Putting value of L in equation (2) we get, ( ) So, ( ) This is the required expression for error.

( ) = ( ) =

( ) ( + 1)!

( ) ( )

( ) ( + 1)!

Since y(x) is generally unknown and hence we dont have any information concerning ( ). But it is very useful formula indifferent branches of numerical analysis.

Methods of Interpolation Using Equally spaced Base Point Data:


Given the set of (n+1) values ( , = ( ), ), ( , ) ( ) , )

It is required to find n th order polynomial ( ). Let the values of x be equidistant and h be the constant spacing between two adjacent points then, = + , = + 2 . . = +

Where

= ( ) . . . . . . . . . . . . . . . .

= (

Newton Forward Difference Method:

Need to define forward difference operator which is, f(x) = f(x+h) f(x) ( )= ( )= ( ) = ( + ) ( ) = ( + ) ( + ) ( )

. . . ( ) = ( + ) ( )

( ) =

( ) =

( + )

( )

We know that ( )= +

Now the polynomial is assumed to be, ( )+ (

( )= ( )=

)(

= 0, 1, 2 ( )( ) ( )

) + .

Determination of
( ) = = ( ) = ( ) , = + ( (

) , )+

= ( )= =

::::

( ) ( ) ( = )( )

+ ) ( ) ( ) =

+(

)+

(2)

= =

Similarly, 3!

2 + 2!

2!

= So, !

( )=

It is used generally for interpolating a function y=f(x) in neighborhood of the initial value of

( )+ ( 2! )

)(

) + . .+

( !

)(

) .( .

Newton Backward Difference Method:


Starting point is + ( =

Here we get = (2) = = + = +

( )=

)+

)( = )

)+ .

)(

) (

( (

) , )+ =

.. .. = !

2!

)(

( )=

( )

)+

( 2!

)(

) + ..+

( !

)(

) .(

It is used to interpolate a function y = f(x) in the neighborhood of end point . It can be used find the value, short distance ahead of . This process of computing the value of the function outside the range called extrapolation.

Gaussian Interpolation:

Our assumed polynomial is, ( )= +

= ( ) +

We define here y = f(x) as known (2n+1) equally spaced base points .. , , , = 0, 1, 2

So,

( )= = =

( ) + ( )( ) + ( )( )( ) )( )( ) . ( + .+ ( ) ..( )( )( ) . ( ) + ( ) ..(

= =

+ +

= (

1!

) )+ ) ( )( )

( =

2 + )( +3 3!

(2 )!

( (2 1)!

2!

3!

( )=

+(

+ ( + ) =

+( 1!
( ( ) )

)(

+( 2! )( )(

Now if we introduce +

+ . . +( + +( +

+ ( 1)

+ then above equation becomes, 2! + ( + 1) ( 1) 3!

)(

)(

) ..(

)(

)(

)(

+ 3! ( ) ) (2 1)! ) (2 )!

1) . ( + 1) ( 1) . ( )

1) . ( + 1) ( 1) . ( (2 )!
(

+ 1)

(2 1)!

This is called Gauss forward difference formula. The backward difference formula is given by, ( + ) = + + ( + 1) 2! + ( + 1) ( 1)

+ . . +( +

+ ( + ) . ( + 1) ( 1) . (

1) . ( + 1) ( 1) . ( + 1) (2 )!

3!

+ 1)

(2 1)!

Methods of Interpolation Those Can Be Used For Equally spaced & Unequally Spaced Base Point Data:

Divided Difference Method:


= ( ) as zeroth order divided difference.

We define = ( ) = lim

( ) ( )

Also define first finite divided difference as, , So, , , ( ( = = ( ) ( ) ( ) ( ) ,

( ) ( ) )( ) ( ( ) )( ) + (

( ) ( ) )( ) ( ) )( )

Then,

( ) )(

) + ( ) )..(

..

( )=

( ) ( +

+ .. +

)(

) )+ (

( ) )..( )(

( ) )...(

)(

Our assumed polynomial, (

Calculating coefficients,

( )= ( )=

)(

) + .

, = 0, 1, 2

)(

) (

= ( )= + ( ) ( )= ( ( ) ( ) )( ) (

So, =

( ) ( ) = ( )+

)(

( ) ( ) )( ) = ,

Similarly, = ,

.. .. = , ..

So,

( )=

, ( )+ + . ,

, , ..

( )( ) ( )( ) (

Lagranges Method:

A straight line passing through two points( , So, ( )= ( ) +

Before we derive a general formula lets consider a simple case, ) ( , ).

( )= ( )=

Let,

, = 0, 1, 2

+ ( )

( ) =

& ( ) =

= Now,

( ) . . (1) ( ) = 1 , ( ) = 0, ( ) = 0 , ( ) = 1 1, 0, =

( )= Again,

Equation (1) is the Lagranges polynomial of degree one passing through two points. In a similar way, the Lagranges polynomial of degree two passing through three points ( , ), ( , ) & ( , ) is written as, ( )= ( ) ( ( )( ) )( ) ( ( )( ) )( ) ( + 1) ( ( )( ) )( )

( )=

( )+ ( )

=1

To derive the general formula let, ( )= = + +

At the base points = + + + +

+ ..+

(2)

... ... = + + + .. +

+ ..+

+ . .+

These (n+1) equations will have a solution if 1 1 . .. . . 0 . .. . . 1 )( ).(

The value of this determinant, called Vandermondes determinant, is ( )( ).( ) ( )

Taking the coefficients of have

( )

for unknown point and base points from equation (2) we

This shows that ( )= ( )

( ) is a linear combination of

1 1 1 . . . . . . 1

. . . . . .

=0 . Hence we write,

Since

Where ( )s are polynomial of order n. = = 0, 1, 2 . .

So, ( )= ( )= Or, ( )=

( ) may be written as ( ( )( )(

1, = 0, )( ) ( )( )( ) ( ) ) ( )

Spline Interpolation:

Now we have some idea about the higher order polynomial interpolation. Disadvantage of it is it can overshoot at some certain point so much that the interpolated values become unrealistic. One solution of it is to choose each pair of the data set and fit a low order curve through them. At the same time, we ensure that the overall curve passing through the data points is continuous and smooth at the junctions. These junctions are known as nodes. A special class of curves, called Splines is used for this purpose. Spline is used to draw a smooth curve through set points. At the end points the spline straightens out. When we derive such a spline mathematically we call it a natural spline.

Types of Spline:

Spline can be explained with three different types. I. II. III. Linear Spline Quadratic Spline & Cubic spline

Linear spline:

It is first order spline. It merely joint adjacent points by straight lines. To fit a set of n data points, there will be (n-1) intervals and as many splines. So we have (n-1) number of linear equation (one for each interval). Let us define a linear equation ( ) , = 0, 1, 2 . ( 1) ) = 0, 1, ( 2)

Now we represent the data points as The splines are defined as, ( )=

.... ( )= = +

( )=

+ +

Here

are the slope of these straight lines and defined as,

When we attempt an interpolation for a certain value of x lying between , using upper equations the first task is to find out the appropriate spline for the interval in which x lies. Next the value of the function is computed at this x.

= 0, 1, 2 . . ( 2)

NB:
The curves in linear spline are not smooth at the junctions. So it is not expected to perform the interpolation correctly at points other than the base points.

Quadratic Spline:

It is used to fit the data with a quadratic function for each interval is used. Apparently, a second-order polynomial can provide a smoother fit to the data than linear fit. For every interval we have a function of the form, ( )= + + = 0, 1, 2 ( 2)

So, for n data points there have (n-1) number of second order curves. Each of the functions has three unknown constants. Thus, total number of constants = 3(n-1). So, we need 3(n-1) equations at least to determine all constants uniquely. To do this we can impose the following conditions:

Condition 1>>
The values of the quadratic functions on the adjacent intervals must be same at the node between them. So, + + ( )= ( )=

This gives 2 (n-2) numbers of equations.

= 1, 2, 3 . ( 2)

= 1, 2, 3 ( 2)

Condition 2>>
The first & last functions must pass through the two end points. That is, + + + + = =

This gives two more equations.

Condition 3>>
The first derivative of the functions at the nodes must equal. This condition ensures the smoothness of the curves at the nodes. So, 2 + =2 + = 1, 2, 3 ( 2)

So, (n-2) more equations.

Condition 4>>

The last condition can be imposed in different ways. One popular choice is to set the second derivative of the function is zero at the first point. So, =0

So we get another one equation. Now the four conditions gives us (2(n - 2) + 2 + (n - 2) + 1) = 3(n-1) equations to determine 3(n-1) constants.

Example>>>>>>>
Let we have following data points.. 0 1 2 1 2 4 5.0 8.6 3.1

Here n=3. Therefore n-2=1 No. of unknown constants = 3(n-1) = 6 Con (1) gives us the following equations 4 4

+2

Con (2) gives us the following equations 16 4

+2

+ +

= 8.6 = 5.5

= 8.6

Con (3) gives one equation

+4

= 3.1 +

From con (4)..

=4 =0

So,

Solving by LU decomposition we get, = 3.6, = 1.4,

2 0 1 0 1

1 0 1 0 0

0 0 4 2 0 0 16 4 4 1

0 1 0 1 0

8.6 8.6 = 5.0 3.1 0 = 16.3 & = 11.3

So,

= 3.175,

( ) = 3.6 + 1.4 & ( ) = 3.175

+ 16.3 11.3

Cubic Spline:

In this case there is a third order polynomial in each interval having the following form>>> ( )= + + + = 1, 2, 3 . ( 2)

For each interval there are four constants. So, total number of constants 4(n-1). That is 4(n-1) equations are needed. Like before we impose the conditions>>>>>>>>>>>>>

Condition 1>>
The values of the cubic functions on the adjacent intervals must be same at the node between them. So, + + + ( )= ( )= =

This gives 2(n-2) equations.

= 1, 2, 3 . ( 2)

= 1, 2, 3 . ( 2)

Condition 2>>
The first & last functions must pass through the two end points. That is, + + + + + + = =

So two more equations.

Condition 3>>
The first derivative of the functions at the nodes must equal. This condition ensures the smoothness of the curves at the nodes. So, 3 +2 + =3 +2 + = 1, 2, 3 ( 2)

So, (n-2) more equations.

Condition 4>>
The second derivative of the two adjacent functions at their common node is equal. 6 +2 =6 + 2 = 1, 2, 3 ( 2)

We get another (n-2) equation.

Condition 5>>
The second derivatives at the end points are zero. This causes the first and last functions to become linear at the end points. This condition is also known as natural spline condition since spline behaves in a similar manner. 6 +2 =6 +2 =0

We get two more equation from here. So at last we get [2(n-2) + 2 + (n-2) + (n-2) + 2] = 4(n-1) equation by those we can uniquely determine the unknown constants

================================== O ==================================.

You might also like