Professional Documents
Culture Documents
by Sarath Chandar A P
Newtons method
Gauss-Jordan method
Iterative method
Gauss-Seidel method
Extrapolation The process of computing the value of a function outside the given
range is called extrapolation.
E=1+
=1-E
u(u1) 2 u(u1)(u2) 3
y = y0 + uy0 + 2! y0 + 3! y0 + ...
where u = (x - x0 ) / h
The above formula is used mainly for interpolating the values of y near the begin-
ning of a set of tabular values.
u(u+1) 2 u(u+1)(u+2) 3
y = yn + uyn + 2! yn + 3! yn + ...
where u = (x - xn ) / h
The above formula is used mainly for interpolating the values of y near the end of
a set of tabular values.
Newtons forward and backward interpolation formulae can be used only when the val-
ues of dependent variables are equally spaced; where the values of independent variables
are not equally spaced, then we can use following Lagrangians Interpolation formula
and inverse interpolation formula.
If the values of x are given at unequal intervals then we use divided differences. Divided
differences take into consideration the change of the values of the function f(x) and also
the changes in the values of the arguments of x.
Suppose the function y = f(x) assume the values of f(x0 ), f(x1 ), f(x2 ),....f(xn ) re-
spectively, where the intervals x1 x0 , x2 x1 ,..... xn xn1 need not be equal.
First divided difference of f(x)
f (x1 )f (x0 )
f(x0 , x1 ) = x1 x0
similarly,
f (x2 )f (x1 )
f(x1 , x2 ) = x2 x1
f (xn )f (xn1 )
f(xn1 , xn ) = xn xn1
The above steps are called divided differences of order 1,2,3 respectively.
Property: The divided differences are symmetrical in all the arguments. i.e. the value
of any difference is independent of order of arguments.
Suppose n+1 data points are given we have to find the value of y corresponding to x
where xi x xi+1 where i = 0,1,2,.. n+1. In this case we have to use cubic spline
method.
00
3. f (x) is a first degree polynomial.
0 00
4. f(x), f (x), f (x) are continuous at each point (xi , yi ) where i = 0,1,2,..n.
If the above all conditions are satisfied, then f(x) follows cubic spline.
h i h i
h2 Mi1 h2 Mi
1
(xi x)3 Mi1 + (x xi1 )3 Mi + xihx yi1 + xxhi1 yi
f(x) = 6h 6 6
6
Mi1 + 4Mi + Mi+1 = h2 [yi1 2yi + yi+1 ] i
at a given point is called numerical differentiation. In this case, we have to use Newtons
forward and backward difference formula to compute the derivatives.
In the previous units, we are finding the polynomial curves y = f(x) passing through
n+1 points. But in this unit we have to calculate the derivative of such curves at a par-
ticular point say Xk .
If the values of X are equally spaced, we get the interpolating polynomial using
Newtons formula.
If the derivative required at a point nearer to starting value in table, use newtons
forward method and for value at end of the table use newtons backward method.
In the case of unequal intervals, we can use, Newtons divided difference formula or
Lagrangian interpolation formula.
where u = (x - x0 ) / h
dy 1 1 2 1 3 1 4
dx at(x = x0 ) = h y0 2 y0 + 3 y0 4 y0 + ...
2
d y 1 11 4 13 5
2 3
dx2 at(x = x0 ) = h2 y0 y0 + 12 y0 16 y0 + ...
3
d y 1 3 4
3
dx3 at(x = x0 ) = h3 y0 2 y0 + ...
where u = (x - xn ) / h
dy 1 1 2 1 3 1 4
dx at(x = xn ) = h yn + 2 yn + 3 yn + 4 yn + ...
2
d y 1 11 4
2 3
dx2 at(x = xn ) = h2 yn + yn + 12 yn + ...
3
d y 1
3 4
dx3 at(x = xn ) = h3 2 yn + ...
3.2 Numerical integration by trapezoidal and Simpson 1/3 and 3/8 rules
The
R term numerical integration is the numerical evaluation of a definite integral say
b
a f(x) dx
h
I= 2 [(y0 + yn ) + 2(y1 + y2 + ... + yn1 )]
h
I= 3 [(y0 + yn ) + 2(y2 + y4 + ...) + 4(y1 + y3 + ...)]
Note: In simpsons 1/3 rule, y(x) is a polynomial of degree 2. To apply this rule
the number of intervals should be even or the number of ordinates must be odd. In
simpsons 1/3 rule, the truncation error is of the order h4 . i.e.
(ba)h4 M
|E| 180
3h
I= 8 [(y0 + yn ) + 3(y1 + y2 + y4 + y5 + ... + yn3 ) + 2(y3 + y6 + ...)]
Note: In simpsons 3/8 rule, y(x) is a polynomial of degree 3. To apply this rule the
number of intervals must be a multiple of 3.
Using trapezoidal or simpsons rule, let us find the value of the given definite inte-
gral by taking the different values of h or x.
Let us apply trapezoidal rule for several times by the values as h, h/2, h/4, h/8,
h/16...
I2 I1
I = I2 + 3
where I1 = the value of the definite integral, dividing h into two parts.
Similarly I2 = the value of the definite integral, dividing h into four parts.
Similarly we can calculate the values of
I3 I2
I = I3 + 3
This method can continue till we get two successive values are equal.
a+b ba
x= 2 + 2 t
1
R
1 f(t) dt = f(1/ 3) + f(-1/ 3)
Three point formula In this case change the given interval a to b into -1 to 1 using
the following procedure. Transformation formula is
a+b ba
x= 2 + 2 t
7
1
R
1 f(t) dt = A1 f(t1 ) + A2 f(t2 ) + A3 f(t3 )
where A1 = A3 = 0.5555
A2 = 0.88888
t1 = 0.7745
t2 = 0
t3 = +0.7745
I = hk
4 [sumof thef ourcornervalues(circle)+
2(sum of values available in rectangular box) + 4(sum of remaining values) ]
simpson rule is
I = hk
9 [sumof thef ourcornervalues(circle)+
4(sum of values available in rectangular box) + 16(sum of remaining values) ]
Euler method for first order equation eulers method formula or eulers algorithm.
yn+1 = yn + h f(xn , yn ) where n=0,1,2...
yn+1 = yn + h f xn + h2 ; yn + h2 f (xn , yn )
8
Fourth order Runge-Kutta method for solving first and second order equa-
tions in this method , let us assume that
dy
dx = f(x,y) be given
diff eqn, the above eqn can be solved under the condition
y(xo )= y0
K1 = h f(x0 , y0 )
k1
K2 = h f(x0 + h2 , y0 + 2 )
k2
K3 = h f(x0 + h2 , y0 + 2 )
K4 = h f(x0 + h, y0 + k3 )
(K1 +2K2 +2K3 +K4 )
y = 6
y1 = y0 + y
x1 = x0 + h
The increments in y for the second interval is computed in a similar manner by the
following formulae.
K1 = h f(x1 , y1 )
k1
K2 = h f(x1 + h2 , y1 + 2 )
k2
K3 = h f(x1 + h2 , y1 + 2 )
K4 = h f(x1 + h, y1 + k3 )
(K1 +2K2 +2K3 +K4 )
y = 6
y2 = y1 + y
x2 = x1 + h
2. If the initial values are not given, we can obtain these values either by using Taylors
series method or by R-K method.
3. We can apply milnes corrector formula only after applying milnes predictor for-
mula.