Click to add title - DAV College For Girls, Yamunanagar

Download Report

Transcript Click to add title - DAV College For Girls, Yamunanagar

Numerical
Analysis
TOPIC
Interpolation
Interpolation is the process of estimating the
value of function for any intermediate value of
the variable with the help of its given set of
values .
Let us assume that the function y=f(x) is
known for certain values of x say a for
x0,x1,x2,………xn.
As f(x0),f(x1),……..f(xn). The process of finding
the value of f(x) corresponding to x=xi.
Where x0<xi<xn. With the help of given data is
called interpolation .
1.Finite Difference Operators
2.Newton’s Forward Difference
Interpolation Formula
3.Newton’s Backward Difference
Interpolation Formula
4.Lagrange’s Interpolation Formula
rth
forward difference
r 1
r 1
 yi   yi 1   yi
r
kth
backward difference
 yi  
k
k 1
yi  
k 1
i  n,(n  1),..., k
yi 1 ,
Thus
yx  yxh  yx  f ( x  h)  f ( x)
 yx  yxh  yx
2
Similarly
yx  yx  yxh  f ( x)  f ( x  h)
Shift operator, E
E f ( x)  f ( x  h)
E f ( x)  f ( x  nh)
n
E yx  yxnh
n
The inverse operator
is defined as
-1
E
1
E f ( x)  f ( x  h)
Similarly,
n
E f ( x)  f ( x  nh)
Average Operator,
1
 f ( x)   f
2
h

x 
2

1
  yx  ( h / 2)  yx ( h / 2) 
2

h 

f  x  
2 

Differential Operator, D
d

Df ( x) 
f ( x)  f ( x) 

dx

2
d
2
n

D f ( x)  2 f ( x)  f ( x)

dx
Important Results
  E 1
E 1
  1 E 
E
1
1 1/ 2
1/ 2
  (E  E )
2
Newton’s
Forward
Difference
Interpolation
Formula
E f ( x)  f ( x  ph).
p
f ( x0  ph)  E f ( x0 )  (1  ) f ( x0 )
p
p
p( p  1) 2 p( p  1)( p  2) 3

 1  p 
 
 
2!
3!


 f ( x0 )
f ( x0  ph)  f ( x0 )  pf ( x0 )
p ( p  1) 2
p ( p  1)( p  2) 3

 f ( x0 ) 
 f ( x0 )
2!
3!
p ( p  1) ( p  n  1) n
 
 f ( x0 )  Error
n!
This is known as Newton’s
forward difference formula for
interpolation, which gives the
value of f (x0 + ph) in terms of f (x0)
and its leading differences.
This formula is also known as
Newton-Gregory forward
difference interpolation formula.
Here p=(x-x0)/h.
An alternate expression is
p( p  1) 2
yx  y0  py0 
 y0
2!
p( p  1)( p  2) 3

 y0 
3!
p( p  1)( p  n  1) n

 y0  Error
n!
p ( p  1) 2
f ( x0  ph)  f ( x0 )  pf ( x0 ) 
 f ( x0 )
2
p ( p  1)( p  2) 3

 f ( x0 )
6
Here,
x  x0 x  0
p

x
h
1
f ( x0 )  6
 f ( x0 )  2
2
 f ( x0 )  6
3
x ( x  1)
f ( x )  3  6 x 
(2)
2
x ( x  1)( x  2)

(6)
6
f ( x)  x  2x  7 x  3,
3
2
The required cubic polynomial.
Let y = f (x) be a function
which takes on values
f (xn), f (xn-h), f (xn-2h), …, f (x0)
corresponding to equispaced
values xn, xn-h, xn-2h, …, x0.
Suppose, we wish to evaluate
the function f (x) at (xn + ph),
f ( xn  ph)  E p f ( xn )  (E 1 ) p f ( xn )  (1 ) p f ( xn )
Binomial expansion yields,
p( p  1) 2 p( p  1)( p  2) 3

f ( xn  ph)  1  p 
 
 
2!
3!

p( p  1)( p  2) ( p  n  1) n


  Error  f ( xn )
n!

f ( xn  ph)  f ( xn )  pf ( xn )
p( p  1) 2

 f ( xn )
2!
p( p  1)( p  2) 3

 f ( xn ) 
3!
p( p  1)( p  2) ( p  n  1) n

 f ( xn )  Error
n!
This formula is known as
Newton’s backward
interpolation formula. This
formula is also known as
Newton’s-Gregory backward
difference interpolation
formula.
p( p  1) 2
yx  yn  pyn 
 yn
2!
p( p  1)( p  2) 3

 yn 
3!
p( p  1)( p  2) ( p  n  1) n

 yn  Error
n!
p
x  xn
h
Example:For the following table of
values, estimate f (7.5).
Difference Table
p ( p  1) 2
y x  yn  pyn 
 yn
2!
p ( p  1)( p  2) 3

 yn
3!
In this problem,
x  xn 7.5  8.0
p

 0.5
h
1
yn  169,  yn  42,  yn  6
2
3
(0.5)(0.5)
y7.5  512  (0.5)(169) 
(42)
2
(0.5)(0.5)(1.5)

(6)
6
 512  84.5  5.25  0.375
 421.875
-3
1979  1982
p
 1.5
2
and
yn  5,  yn  1,
2
 yn  2,  yn  5
3
4
Newton’s interpolation formula gives
Therefore,
DERIVATION:Let y = f (x) be a function which
takes the values,
y0 , y1 ,…yn
corresponding to x0 , x1, …xn . Since
there are (n + 1) values of y
corresponding to (n + 1) values of x,
we can represent the function f (x)
by a polynomial of degree n.
or in the form
Here, the coefficients ak are
so chosen as to satisfy this
equation by the (n + 1) pairs
(xi, yi). Thus we get
Therefore,
y1
a1 
( x1  x0 )( x1  x2 )
ai 
( xi  x0 )( xi  x1 )
( x1  xn )
yi
( xi  xi 1 )( xi  xi 1 )
( xi  xn )
and
yn
an 
( xn  x0 )( xn  x1 )
( xn  xn 1 )
y  f ( x) 
( x  x1 )( x  x2 ) ( x  xn )
( x  x0 )( x  x2 ) ( x  xn )
y0 
y1 
( x0  x1 )( x0  x2 ) ( x0  xn )
( x1  x0 )( x1  x2 ) ( x1  xn )
( x  x0 )( x  x1 ) ( x  xi 1 )( x  xi 1 ) ( x  xn )

yi 
( xi  x0 )( xi  x1 ) ( xi  xi 1 )( xi  xi 1 ) ( xi  xn )
( x  x0 )( x  x1 )( x  x2 ) ( x  xn1 )

yn
( xn  x0 )( xn  x1 )( xn  x2 ) ( xn  xn 1 )
The Lagrange’s formula for
interpolation
We can easily observe that,
and
Thus introducing Kronecker
delta notation
Example:Find Lagrange’s
interpolation polynomial
fitting the points
y(1) = -3, y(3) = 0,
y(4) = 30, y(6) = 132.
Hence find y(5).
Using Lagrange’s interpolation
formula, we have
On simplification, we get
which is required Lagrange’s
interpolation polynomial.
Now, y(5) = 75.
Solution:-
Using Lagrange’s formula,
( x  x1 )( x  x2 )
f ( x) 
f ( x0 )
( x0  x1 )( x0  x2 )
( x  x0 )( x  x2 )

f ( x1 ) 
( x1  x0 )( x1  x2 )
( x  x0 )( x  x1 )
f ( x2 )
( x2  x0 )( x2  x1 )
Therefore
1.
Evaluate : (x.log x)
2.
Evaluate : (sin2x.cos4x)
3.
Estimate the missing term:
x
0
1
2
3
4
Y
1
3
9
_
81
4.Derive newton forward formula for
interpolation.
5. Derive newton backward formula
for interpolation.
1. Evaluate (x2+sinx) , the
interval of difference being .
2. Find the lowest degree
polynomial which satisfies the
following table:
X
0
1
2
3
4
5
F(x)
0
3
8
15
24
35
3.The population of a town is as
follow:
YEAR
1961
1971
1981
1991
2001
2011
POPULATION
20
24
35
40
42
51