Sunteți pe pagina 1din 7

Interpolation

Interpolation is an art of reading between lines. When we conduct experiments, in our Engineering labs, we always collect datas relating two or more parameters. Let us say, somebody collected datas relating two parameters, one is independent ( x ) and another one is dependent of ( y ) . Let them be

x : y( x ) :

x1 y1

x2 y2

x3 y3

xi yi

.. ..

xn yn
x = xp ,

Now we need the value of y corresponding to some which lies between


xi

say

and

xi + 1

i.e.

x p ( xi , xi +1 )
y( x ) ,

If we know the functional relationship between x and

we can is not

computer. But, the functional relationship between x and

y( x )

defined explicitly. So, we replace the original function, which relates

x and

y( x ) ,

by one simpler function say, ( x ) for which the given


i = 0, 1,2 ,..., n
x = xp .

data ( xi , yi ) for required y ( x ) at

satisfies ( x ) and thus computing

Replacing the actual (original) function relating x and y ( x ) by


one simpler function, ( x ) , which satisfies the given data and thus computing the required
y( x ) y( x )

at

x = xp .

This process of computing

is called interpolation

The replacing function, ( x ) is called interpolating function (or) smoothing function.

Example:

y( x) A( x 0 , y 0 )

f ( x)

B( x1 , y1 ) Q

( x)
yn yp

y0

x0

xp

xn
f ( x)

Let PQ be the actual functional curve, [actually this curve is hidden curve.)

relating x and

y( x ) .

Choose two points from the given data say ( x0 , y 0 ) and ( x n , y n ) . Construct are straight line with these 2 points. Let AB represents that straight line. This line AB is our replacing function, ( x ) . Now estimate
yp

(approximately) at

x = xp ,

using the straight line AB

instead of actual curve PQ (say interpolation.

f ( x ) ).

This process is called linear

These replacing function, ( x ) can be polynomials, trigonometric function, etc,. Thus the corresponding interpolation are called polynomial interpolation and trigonometric interpolation.
Suppose the data is provided in the range ( x0 , x n ) (i.e) x0 xi x n for
i =1,2 ,3,..., n

then the process of computing the value of


x = x p ( x0 , xn )

yp

corresponding to
x = x j ( x0 , x n )

is called interpolation.
yj

Where as the process of computing the value of [(i.e.


xj

corresponding to

lies outside the range] is called extrapolation

Before learning interpolating methods let us first learn finite difference basic concepts.

1. Forward difference 2. Backward difference First forward difference


y o = y1 y 0 y1 = y 2 y1 y 2 = y 3 y 2 y i = y i +1 y i

Difference between successive member of dependent variables Always subtract the proceeding value from the current. Second forward differences:
2 y o = y1 y 0 2 y1 = y 2 y1 2 y i = y i +1 y i i = 0 ,1,2 ,...

Third forward difference


3 2 2 yo = y1 y0 3 2 2 y1 = y2 y1 3 2 2 y2 = y3 y2

3 2 2 yi = y i +1 yi

In general any rth difference (forward) is defined as

r +1 y i = r y i +1 r y i

Backward Difference First backward difference

y1 = y1 y 0 y 2 = y 2 y1 y3 = y3 y 2 y i = y i y i 1
i =1,2,3,...

Second backward difference


2 y 2 = y 2 y1 2 y3 = y 3 y2 2 y 4 = y 4 y3

2 yi = y i y i 1

i =1,2,3,...

Third backward difference


3 y 3 = 2 y 3 2 y 2 3 y 4 = 2 y 4 2 y 3 3 y 5 = 2 y 5 2 y 4 3 y i = 2 y i 2 y i 1
i = 3,4,5,...

In general
r +1 y i = r y i r y i 1

for

i = r +1, r 2 + 2,...

Interpolating methods 1. For equally spaced xi ' s (Equal intervals) 2. For unequally spaced xi ' s (Unequal intervals)

Interpolating methods [For equal intervals] 1. Newtons forward interpolation formula 2. Newtons backward interpolation formula The numerical scheme for forward interpolation formula is

y p = y0 +

Where

py 0 p( p 1) 2 p( p 1)( p 2 ) 3 + y0 + y 0 + ... 1! 2! 3! x x 0 = ph

x x0 p= h

The numerical scheme for backward interpolation formula is


y p = yn + py n 2 y n 3 y n + p ( p + 1) + p ( p 1)( p 2 ) + ... 1! 2! 3!

x xn p= h

Interpolating formula for unequal intervals a) Lagrange interpolation formula b) Divided difference interpolation formula The Lagranges interpolating polynomial is given by
y( x ) =

( x x1 ) ( x x2 ) ( x xn ) .y + ( x0 x1 ) ( x0 x2 ) ( x0 xn ) 0 ( x x0 ) ( x x 2 ) ( x x n ) .y + ( x1 x0 ) ( x1 x2 ) ( x1 xn ) 1 ( x x0 ) ( x x1 ) ( x xn 1 ) + ( x n x0 ) ( xn x1 ) ( xn x n1 )

yn

Divided difference The 1st divided difference are defined as


f ( x1 ) f ( x 0 ) = f ( x 0 , x1 ) x1 x 0

Second divided difference


5

f ( x1 , x 2 ) f ( x 0 , x1 ) = f ( x 0 , x1 , x 2 ) x 2 x0

Third divided difference


f ( x1 , x 2 , x3 ) f ( x 0 , x1 , x 2 ) = f ( x 0 , x1 , x 2 , x3 ) x3 x 0

The Newtons divided difference polynomial is given by


f ( x ) = f ( x0 ) + ( x x 0 ) f ( x 0 , x1 ) + ( x x0 ) ( x x1 ) f ( x 0 , x1 , x 2 ) + ( x x 0 ) ( x x1 ) ( x x 2 ) f ( x 0 , x1 , x 2 , x3 ) +

Assignments 1. The table gives the distance in nautical miles of the visible horizon for the given heights in feet above the earths surface: x = height : 100 150 200 250 300 350 400 y = distanc : 10.63 13.03 15.04 16.81 18.42 19.90 21.27 e (ii ) x = 380 . Find the values of y when (i ) x = 218 ft
2. Given sin 45 = 0.7071, sin 50 = 0.7660 , sin 55 = 0.8192 , sin 60 = 0.8660

find

sin 52 .

3. The area A of a circle of diameter d is given for the following values: d : 80 85 90 95 100 A : 5026 5674 6362 7088 7854 4. Given the values x : 5 7 11 13 17 f ( x) : 150 392 1452 2366 5202 Find f (9 ) using (i) Lagranges formula, (ii) Newtons divided difference formula 5. Given . Find the value of
log 10 656

log 10 654 = 2.8156 , log10 658 = 2.8182 , log10 659 = 2.8189 , log 10 661 = 2.8202

using Lagranges.

6. Given f ( 0 ) = 18, f (1) = 0 , f ( 3) = 0 , f ( 5) = 248, f ( 6 ) = 0 , f ( 9 ) = 13104 ,

find the interpolating polynomial for the above data using Newtons divided difference scheme and hence find f ( 7 ) .

7. The following table gives the viscosity of an oil as a function of

temperature. Use Lagranges formula to find viscosity of the oil at a temperature 140 . Temp : 110 130 160 190 Viscosity : 10.8 8.1 5.5 4.8

S-ar putea să vă placă și