Numerical Methods
Numerical Methods
NUMERICAL METHODS
Unit – I
STRUCTURE
1.0 Objective
1.1 Introduction
1.2 Different Types of errors
1.3 Root of equations
1.4 Summary
1.5 Important Questions
1.0 Objective
Different Types Of Errors
Truncation Error
Resolution error, etc.,
Bisection Method
1.0 Introduction
Numerical Methods evolved out of necessity for simulation of physical
situations by mathematical models. A mathematical model when simulated on an
electronic digital computer with the help of numerical methods gives out the response
and behavior analogous to those of the physical situation under similar conditions. But
since the digital computer works on the basis of the four basic arithmetic symbols (+, -
,/,*) and logic operations ,all numerical methods are founded on these structural factors.
1. Truncation error
2. Resolution error
3. Round off error
4.
5.
ANNAMALAI
ANNAMALAI UNIVERSITY
UNIVERSITY
Propagated error
Data error
1. Truncation error
This is a type of error derived from the approximation in the numerical analysis
scheme itself. Truncation often refers to truncating a series representation either of a
function being used or sought. Taylor series is often truncated after a specified number of
terms and it is used in deriving a finite difference operator. This is a primary source of
error in finite difference schemes.
2. Resolution error
Another type of truncation can erode accuracy and that is due to limiting the
resolution of your representation.
One must have a finite interval between grid points. The larger the interval the
worse the accuracy.
Similarly, in a Galerkin method, the more functions we have, generally the better
our solution or more accuracy.
3. Round-off error
All computers represent non-integers with some imprecision. Some symbolic
algebra solutions may work with integer parts of rational fractions to gain a bit of
accuracy.
4. Propagated error
Propagated error means an error in succeeding steps depends on the error in
previous steps. This is an error type that often occurs due to a misuse of a numeric
scheme.
ANNAMALAI
ANNAMALAI UNIVERSITY
UNIVERSITY
Root of equations
The most important problem in mathematics is to find the root of an equation .The
equation is of the form Transcendental and numerical algebraic equations.
If f (x) is continuous from x a and x b and if f (a) and f (b) are opposite
signs, then the equation f ( x) 0 will have at least one real root between a and b .
Every equation of an odd degree has at least one real root, whose sign is opposite to
that of its last term.
Bisection Method
The earliest method of finding the roots of an equation is known as Bisection method.
Consider a function f (x) , which is continuous and lies between the points a and b . Let
f (a) be negative and f (b) be positive, Then there is a root of f ( x) 0 , lying between
a and b . Let its approximate value be given by x 0 = (a b) / 2 . If f ( x0 ) = 0 then x0 is
the root of the given equation f ( x) 0 . Otherwise the root lies between 0 and b or
x
ANNAMALAI
ANNAMALAI UNIVERSITY
x UNIVERSITY
between 0 and a , accordingly as
f ( x0 ) is negative or positive. Then as before bisect
the interval and continue the process until the root obtains a desired accuracy.
Linear Interpolation
x
Linear interpolation can be used between f (a) and f (b) to obtain 0 and that
between
f ( x0 ) and f (b) to obtain x1 , and so on till we obtain the root.
THEOREM:
If the iterative procedure is to converge to the solution point x c for the given
equation x f (x) ,then the next point x1 must move closer to point c as compared to 0
x
f ' ( x) 1
with respect to c. Let I be an interval containing the root c. If for all x in I,
x x
the sequence of approximations 0 , x1 , x2 , …. n will converge to root c.
Proof:
C is a root of the equation x f (x)
The formula for the Newton's method can be derived in two ways they are,
1. By using Taylor series
2. By using graphical method
By using Taylor series
Taylor series is given by,
h h2
f ( x) f ( x0 ) f ' ( x0 ) f ' ' ( x0 ) ......
1! 2!
2. By using graphical method
consecutive values are same and equal to c then c is one of the roots of f ( x) 0 . Since
the method deals with the tangent line, this method is also known as method of tangents.
The above relation shows that at each stage the subsequent error is proportional to
the square of the previous error.
Condition for convergence of Newton's method:
The Newton's formula is given by,
f ( xn )
xn 1 xn
f ' ( xn )
xn1 ( xn )
i.e.,
' ( x) 1
Newton Raphson method converges only when
f ( x)
( x) x
f ' ( x)
Since the function R(x) becomes zero for all values of x for which
F (x) vanishes, R(x) has same roots as those of F (x) . As such without loss of
generality, R(x) may be used in place of F (x) in the Newton Raphson method. Thus the
modified Newton’s formula is given by,
R( xi )
xi 1 xi
R' ( xi )
Secant Method
There is another method known as Secant method. This method is similar to that
of Newton Raphson method except that the derivative
F ' ( xi ) in the Newton Raphson
method is replaced by a different expression. Hence it is not necessary to give the
derivative expression for F ' ( x) along with the Function F (x) in the program. This
method is handled only when it is difficult to differentiate the function.
1.4 Summary
To find the real root of rational integral equations, there is no closed formula for
ANNAMALAI
ANNAMALAI UNIVERSITY
it. UNIVERSITY
Four methods such as Bisectional method, iteration method, Regula falsi method
and Newton Raphson method were introduced in this unit as a solution for the
above problem to find the real root of an equation.
For all the above methods, the interval at which the root lies must be calculated in
a similar way.
The initial approximation can be found out easily in the bisection method and
iteration method, but the convergence will be more rapid.
In the above methods, there is a formula involved in Regula falsi method and
Newton Raphson method to find initial and successive approximations of the root.
af (b) bf (a)
f ( x0 )
For Regula falsi method, f (b ) f ( a ) ,
f ( xn )
xn 1 xn
For Newton Raphson method, f ' ( xn ) .
b) x 5x 2 0
2
1
x sin x 0
c) 2
2. Using the Bisection method, Obtain a root of the following equations correct to
three decimal places
a) x x 1 0
3
b) x x x 7 0
3 2
c) cos x x x 0
2
3. Find a real root of the equation Cosx 3x 1 0 correct to 3 decimal places using
the method of successive approximations.
4. Find the real root for the following equations by using iteration method,
3x log10 x 6 0
a)
l3 l5 l7 l9 l 11
l ... 0.4431
b) 3 10 42 216 1320
Find the real root of the equation xe 2 0 , correct to four decimal places using
x
5.
ANNAMALAI
ANNAMALAI UNIVERSITY
UNIVERSITY
the method of false position.
6. Compute the real root of the following equations correct to three decimal places
using the Regula falsi method.
a) x 20 0
2
b) x tan x 1 0
x 2 log e x 12 0
c)
d) 2 x 3x 10 0
3
e) e 3x 0
x
8. Using the Newton-Raphson method, find a real root of the following equations
a) x 2 12 0
b) x 2 4 sin x 0
c) x3 3x 2 5.5x 9.5 0
d) x 4 x 10 0
e)
x log10 x 1.2 0
1
x
9. Solve the equation N and hence prove that xn1 xn (2 Nxn )
10. Find the real root of the equation, 3x cos x 1 0 using Regula falsi method
and Newton-Raphson method. Compare their results.
ANNAMALAI
ANNAMALAI UNIVERSITY
UNIVERSITY
NUMERICAL METHODS
Unit – II
STRUCTURE
2.0 Objective
2.1 Solution of Linear Algebraic Equations
2.2 Introduction to Iterative method
2.3 Summary
2.4 Important Questions
2.0 Objective
Solution of Linear Algebraic Equations
Introduction to Iterative method
x , x ,........, xn
A Problem of Finding n Unknowns 1 2 in a system of m simultaneous
linear equations is known as solutions of linear algebraic equations. This way of
providing solutions arises in situations such as linear programming.
ANNAMALAI
ANNAMALAI UNIVERSITY
UNIVERSITY
............................................................
am1 x1 am 2 x2 ............ amn xn bm
x , x ,.....xn b , b ,......bm
Where the coefficient 1 2 and 1 2 are constants
This method has got some limitations in solving large set of simultaneous
equations.
A
For example, in the above equation, if the matrix A is singular that is, equal to
or close to zero, unique solutions cannot be obtained. Hence to solve large set of
simultaneous linear equations two methods are used. They are:
1.Direct method
Gauss elimination method
Gauss-Jordan method
Direct Method
This method eliminates the elements the unknowns one by one and transforms the
given set of equations to a triangular form.
Let us now deal with a direct method that is, Gauss Elimination method
This is an effective direct solution technique. It is quite efficient, but the round off
errors are significant for large set of equations. The method successively eliminates the
elements of coefficient matrix below the diagonal by manipulation of equations with
simple arithmetic operations without changing the equality on both sides of equations.
Consider the following set of equations
a11x1 a12 x2 a13 x3 b1
a21x1 a22 x2 a23 x3 b2
a31x1 a32 x2 a33 x3 b3
aij ' s
While performing arithmetic operations on these equations, only the constants and
bj ' s x ,x ,x
undergo changes but the value of 1 2 3 remains unaltered.
ANNAMALAI
ANNAMALAI UNIVERSITY
UNIVERSITY
Gauss - Jordan Method
This method has got some modification to Gauss elimination method. In Gauss’s
method, after Triangularisation, values of variables have to be obtained by back
substitution. In Jordan’s modification the co-efficient matrix is reduced to a diagonal
matrix rather than a triangular matrix as in Gaussian method. Here the elements above the
diagonal are also eliminated along with the elimination of elements below the diagonal.
This method is therefore suitable for computer implementations. After completion of
Gauss-Jordan method the equation becomes
1 0 0 ............ 0 x1 b1
0 1 0 ............ 0 x2 b2
........ ......... ........... ............ .......... ........ .........
........ ......... ........... ............ .......... ........ .........
0 x b
0 0 ............ 1 n n
For Gauss-Jordan method first five steps are similar to Gauss method
x1 x2 x3 0
To start with guess the initial estimate of the solution as . Using
these values in equation (4) the equation obtained is:
b a (0) a13 (0)
x11 2 12
a11
x
Using the value of x11 and x21 in equation (6) value of 31 is obtained.
b a x a x
x31 3 31 11 32 21
a33
Note that the initial guess x1 0 is not used at all. The values of x11, x21 and 31
x
x ,x ,x
may be used in the above equations again to obtain 12 22 32 and this process may be
iterated again and again until the values of unknown converge. In general form the
equation may be rewritten as
b1 a12 x2 I a13 x3 I
x1 ( I 1)
ANNAMALAI
ANNAMALAI UNIVERSITY
UNIVERSITY
a11
b2 a21x1 ( I 1) a23x3 I
x2 ( I 1)
a22
b3 a31x1 ( I 1) a32 x2 ( I 1)
x3 ( I 1)
a33
(i.e.,)
n
aii aij i 1,2,3...........n, i j
j 1
2.3 Summary
Basically Cramer's rule is applicable for solving simultaneous linear algebraic
equations.
If the number of simultaneous equations is larger, otherwise if there are more than
3 or 4 simultaneous equations, Cramer's rule will not give the desired result,
Hence we go for some other methods to solve the simultaneous linear equation.
Two methods such as direct and indirect methods were used to solve the above
problem of finding the roots of an simultaneous equation.
Gauss elimination method and Gauss Jordan method are known as direct methods.
Thus the roots of the simultaneous equation can be found out directly at last
without iteration.
Gauss Siedal method is known as iterative method. The convergence will be very
slow and it takes time to find the root of the simultaneous equations, because of
its large number of iterations.
b.)
2 x1 4 x2 2 x3 15
2 x1 x2 2 x3 5
4 x1 x2 2 x3 0
d.) w 2 x 12 y 8z 27
5w 4 x 7 y 2 z 4
3w 7 x 9 y 5z 11
6w 12 x 8 y 3z 49
ANNAMALAI
ANNAMALAI UNIVERSITY
UNIVERSITY
a.) 10 x y z 12
2 x 10 y z 13
x y 5z 7
b.) 5x 2 y 3z 18
x 7 y 3z 22
2 x y 6 z 22
2 x 4 x2 x3 3
c.) 1
3x1 2 x2 2 x3 2
x1 x2 x3 6
d.)
5x1 x2 x3 x4 4
x1 7 x2 x3 x4 12
x1 x2 6 x3 x4 5
x1 x2 x3 4 x4 6
a.) 8x y z 8
2x 4 y z 4
x 3 y 5z 5
4 x1 2 x2 x3 5
b.)
x1 3x2 2 x3 13
2 x1 x2 3x3 9
c.) 28x 4 y z 32
x 3 y 10 z 24
2 x 17 y 4 z 35
ANNAMALAI
ANNAMALAI
6 x y z 11.33
UNIVERSITY
UNIVERSITY
d.)
x 6 y z 32
x y 6 z 35
e.) 27 x 6 y z 85
6 x 15 y 2 z 72
x y 54 z 110
NUMERICAL METHODS
Unit – III
STRUCTURE
3.0 Objective
3.1 Finite Differences
3.2 Interpolation
3.3 Interpolation with Unequal Intervals
3.4 Summary
3.5 Important Questions
3.0 Objective
Finite Differences
Interpolations
Newton’s forward interpolation formula
Differentiation using central difference formula
Interpolation with Unequal intervals
3.1Finite Differences
Finite Differences and associated concepts bear much importance in numerical
analysis. In the digital computer, it is tedious to perform the Operation of differentiation
as it is done in the classical theory of calculus. Hence to compute the differentiation using
digital computer four arithmetic operations and some logical functions may be used. This
is done by the Finite Differences.
The derivatives so computed may then be used in Taylor series or to find a
polynomial, matching the given data and so on.
ANNAMALAI
ANNAMALAI UNIVERSITY
UNIVERSITY
y corresponding to x0 , x0 h, x0 2h........... of the values of x .
(t a) 2 (t a)3 (t a) n ( n )
f (t ) f (a) (t a) f ' (a) f ' ' (a) f ' ' ' (a) ...... f (a)......
2! 3! n!
Where f ' (a) df / dt and f ' ' (a) d 2 f / dt 2 and so on.
The analyticity of f (t ) at t a implies that f (t ) and all its derivatives at t=a must
exist with a finite value. Since Taylor series can be used to find the value of f (t ) for any
t , assume t b . Then the Taylor series becomes,
(b a) 2 (b a) 3 (b a) n ( n )
f (b) f (a) (b a) f ' (a) f ' ' (a) f ' ' ' (a) ...... f (a)......
2! 3! n!
Consider an analytic function f (t ) as shown in the figure below. Using b t h ,
a t and the deviation (b a) h , in the above Taylor series, the equation obtained is:
h2 h3
f (t h) f (t ) hf ' (t ) f ' ' (t ) f ' ' ' (t ) ..............
2! 3!
In general,
n f i (n1 f i )
The corresponding forward difference expressions for derivatives of any order can
be obtained as follows,
d n f n f i
n 0(h)
dt 2 h
Difference Table
y4
x4
In the above table all difference values link with each other
3.2 Interpolation
Experimental data of physical phenomena is often available at discrete instants of
time and it becomes necessary, at times, to find its value either between discrete points or
outside the range of available observations.
Consider the following table
x x0 x1 x2 ........................xn
f (x) f ( x0 ) f ( x1 ) f ( x2 ) ………… f ( xn )
Difference Table
Since the forward differences use data values in forward direction, forward
interpolation formula is used at a point near the beginning of the table, where the
backward points are not available. When the interpolation is desired at the end of the
table forward points and hence the forward differences are not available. Hence to
acquire the interpolation at the end of the table backward differences are used.
x y y 2 y 3 y 4 y
x4 x0 4h y 4
y3
y 3 2 y 2
x3 x0 3h y2 3 y1
2 y1 4 y0
y 2
x2 x0 2h y1 3 y0
y1 2 y0
y 0
x1 x0 h y0
x0 y0
ANNAMALAI
ANNAMALAI UNIVERSITY
UNIVERSITY
Newton's backward interpolation formula
As interpolation is dealt with already, while deriving forward interpolation
formula, the formula for backward interpolation, is derived here straightly.
y1 (1 ) y0 (2)
h3
f (t h) f (t h) 2hf ' (t ) f ' ' '......
3
By Re-arranging
f (t h) f (t h) h 2
f ' (t ) f ' ' ' (t ) ........
2h 6
Stirling's Formula
Stirling's central difference formula can be derived by using the Gauss's forward
and backward formulas. By taking the mean of the two different formulas, Stirling's
central difference formula can be obtained.
Hence by taking the mean of two above formulas i.e., Gauss's forward and Backward
formula, the equation obtained is:
y y1 n 2
2
n(n 2 1) 3 y1 3 y2 n 2 (n 2 1) 4
y( x0 nh) y0 n 0 y1 y2 ......
2 2! 3! 2 4!
f ( x) f ( x0 )
f ( x, x0 )
x x0
The Newton's forward and backward interpolation formulas can be used only
when the values of the independent variable x are equally spaced. Also the differences of
y must become ultimately small. In such situations Lagrange's interpolation formula can
be used.
3.4 Summary
Series of values of x and f (x) are given and the intermediate value of f (x) to be
found out. This process is called interpolation.
Stirling's formula was used to find the value of f (x) at the middle of the table.
The above formulas were suited only for the interpolation with equal
intervals.The formulas, which were used for the interpolation with unequal
intervals, are Newton's divided difference formula and Lagrange's interpolation
formula.
4. Find the value of y at x = 2.7 from the following table using Gauss's forward
formula.
0
5. Find the value of Cos 51 42' by using Gauss's backward formula from the
following table
log10 337.5
6. Find the value of by using Stirling's formula from the following table.
7. Find the cubic function f (x) from the following table using Newton's divided
difference formula.
ANNAMALAI
ANNAMALAI
x
UNIVERSITY
UNIVERSITY 0 1 4 5
f (x) 8 11 78 123
8. Find the value of f (2) using Lagrange's interpolation formula from the following
table
x 0 1 3 4
f (x) 5 6 50 105
9. Find the function f (x) from the following table using Lagrange's interpolation
formula by a polynomial of degree 2.
x 1 2 -4
y 3 -5 4
NUMERICAL METHODS
Unit – IV
STRUCTURE
4.0 Objective
4.1 Numerical Differentiation
4.2 Numerical Integration
4.3 Summary
4.4 Important Questions
4.0 Objective
Numerical Differentiation
Numerical Integration
Newton cote’s Formula
If the value of dy / dx is required at a point near the middle of the table, one of
the central difference interpolation formula are used.
If the value of x is not equally spaced, Newton’s divided difference formula
should be used to represent the function.
y y1 r 2
2
r (r 2 1) 3 y1 3 y2
y ( x0 rh) y0 r 0 y
3!
1
2 2! 2
r 2 (r 2 1) 4 r (r 2 1)(r 2 4) 5
4!
y 2
5!
y2 5 y3 .....
y y1 r 2
2
(r 3 r ) 3 y1 3 y2
y ( x0 rh) y0 r 0 y1
2 2! 3! 2
(r 4 r 2 ) 4 (r 5 5r 3 4r ) 5
y 2 y2 5 y3 .....
ANNAMALAI
ANNAMALAI UNIVERSITY
UNIVERSITY4! 5!
Where a and b are given constants and f (x) is a continuous function given
analytically by a formula or empirically by a table of values.
1. Trapezoidal Rule
2. Simpson’s Rule (OR) Simpson’s 1/3 Rule
3. Simpson’s 3/8th Rule
Trapezoidal Rule
It is well known that the area under the curve f (x) is in between the ordinates
x a and x b . Let the interval a x b be divided into n equal parts, each of same
width h given by
(b a)
h
n
0
By putting n 1 the equation obtained is:
x0 h
1
y( x)dx h y
x0
0 y0
2
(By neglecting higher order differences)
h
2 y0 y0
2
y0 ( y0 y0
h
2
y0 y1
h
2
Thus the above equation can be written as,
x0 nh
Simpson’s Rule
The simple way of finding the formula for Simpson’s rule without truncation error
is given below:
L
M N
P O Q X
Trapezoidal rule
I 1.00009
3. This method is much useful to civil engineers for calculating the amount of
earth that must be moved to provide a level highway or supplied to fill a
depression or make a dam.
4. Profiles of the earth levels along different sections are prepared from surveys
and contour maps, and the average height is calculated by the one-third rule,
with respect to the desired level.
Summary: -
In Numerical differentiation, the derivatives of a given function are calculated by
means of a table, given values of that function.
ANNAMALAI
ANNAMALAI UNIVERSITY
UNIVERSITY
Important Questions
1. Calculate the value of f ' ( x) and f ' ' ( x) at x 1.35 from the following table
using Newton's forward interpolation formula.
2. Determine the first and second derivative using the Newton's backward difference
formula from the following data.
x 0 1 2 3 4 5
f (x) 0 1 8 27 64 125
dy d2y
3. Find the values of and 2 for x 1.15 , from the following table using
dx dx
Stirling's formula.
2
4. Using the Trapezoidal rule, evaluate ydx from the following table.
0 .6
ANNAMALAI
ANNAMALAI UNIVERSITY
UNIVERSITY
NUMERICAL METHODS
Unit – I
STRUCTURE
5.0 Objective
5.1 Differential Equation
5.2 Predictor and Corrector Methods
5.3 Summary
5.4 Important Questions
5.0 Objective
Differential Equation
Euler Method
Runge – Kutta Method
Heun’s Method
Predictor and Corrector Methods
Adams, Milne’s Predictor & Corrector Methods
If the solution is not obtained using the formula or if it is tedious to attain the
solution for that particular problem, Step – by – Step method can be followed. This
Method starts from y( x0 ) y0 and proceeds with the approximate value of y1 of the
solution of y of (1) at x x1 x0 h .
Euler Method
Runge kutta Method
Milne’s predictor and corrector methods
Euler Method
The simplest method to obtain the solution of differential equation is the Eulers
method. To obtain the solution one should assume the solution curve to be a straight line
over the integration interval. Euler method is a step-by-step method, which gives result in
a set of tabulated values of x and y . It is very inaccurate.
The higher order derivatives in the Taylor’s series are computed indirectly by
evaluating f ( x, t ) at more than one value of point ( x, t ) over the integration interval
between ti and ti 1 to obtain xi 1
Heun’s Method
With Euler method one can get only approximate solution. To get accurate results
Euler method is modified a bit. A better value of xi 1 can be obtained by finding the
average of slopes at xi and xi 1 in place of f ( xi , ti ) in equation (above equation). For the
differential equation,
dx
f ( x, t ), x(t0 ) x0
dt
Then xi 1 is given by
xi 1 xi hR*
This method is popularly known as Runge-Kutta method and it is widely used for
its better accuracy. The solution for this method can be obtained as,
h
xi 1 xi ( K1 2 K 2 2 K 3 K 4 ) (1)
6
Where K1 f ( xi , ti )
ANNAMALAI
ANNAMALAI
2
K f x
hK
2
i
h
,t
2
1
UNIVERSITY
UNIVERSITY
i
hK h
K 3 f xi 2 , ti
2 2
K 4 f xi hK3 , ti h
As seen earlier, the derivations for second order, third order, fourth order formulas
for Runge kutta method are more elaborate. Hence, The above formulas are discussed
here briefly.
Then y K1 4 K 2 K 3
1
6
ANNAMALAI
ANNAMALAI UNIVERSITY
UNIVERSITY
involved in second order runge kutta method.
To find the incremental value K 3 . Where K3 hf ( x0 h / 2, y0 K 2 / 2)
To find the incremental value K 4 . Where K 4 hf ( x0 h, y0 K3 )
Then y K1 2 K 2 2 K 3 K 4
1
6
dy dz
f1 ( x, y, z ); f 2 ( x, y, z )
dx dx
Subject to the conditions y( x0 ) y0 and z ( x0 ) z0
d2y dy
g x, y ,
dx
2
dx
The Runge-kutta method does not require prior calculation of the higher
order derivatives of y (x) , as it is done in the Taylor's method.
Runge-kutta methods agree with Taylor series solution upto the terms of
x
h , where r differs from method to method and is known as the order of that
Runge-kutta method.
While using the Runge-Kutta methods for the solution of differential equations,
ANNAMALAI
ANNAMALAI UNIVERSITY
UNIVERSITY
information at only previous point ( xi , ti ) is used to evaluate xi 1 at ti 1 . It is easier when
( x0 , t0 ) is used to evaluate x1 and t1 .
This would reduce a time and such pairs of formulas are called as Predictor-
Corrector methods.
Consider a second order Adams closed formula, which is equivalent to the
predictor formula of second order
The estimate of the truncation error at the (i 1)th stage is obtained as,
et
1
5
xi 1 xi(01)
Where xi 1 is the value of xi(m11) obtained after the last iteration of equation (4).
The equation converges if h 2 / S , where S is the maximum value of df / dx over the
integration interval.
Hence the more accurate corrector formula is obtained at the fourth order closed
Adams formula.
ANNAMALAI
ANNAMALAI UNIVERSITY
UNIVERSITY
It can be written as,
9 ( m) 19 5 1
xi(m11) xi h f i 1 fi f i 1 f i 2 , m 0,1,2,......
24 24 24 24
dy
f ( x, y ) , Subject to the condition y( x0 ) y0 .
dx
In Milne's corrector formula, the equation (1) should be integrated with respect to
x over the interval x0 to x0 2h , whereas in Milne's predictor formula, the equation (1)
will be integrated with respect to x over the interval x0 to x0 4h . Hence the only
difference in deriving the Milne's predictor and corrector formula is their intervals.
By neglecting the error in the above equation, the equation obtained is:
yn 1 yn 1 y'n 1 4 y'n y'n1
h
3
The problems given here are solved using two methods shown below:
1.Euler's method
2.Modified Eulers method
Problem:
ANNAMALAI
ANNAMALAI UNIVERSITY
are
UNIVERSITY
y(0) 1.0 , It is desired to obtain the value of y(0.2), y(0.4) . Here h 0.1
1. Euler's method:
By Euler's method, y1 y0 hf ( x0 , y0 )
dy
Given: f ( x, y) x2 y
dx
x0 0, y0 1.0 (Since y (0) = -1.0)
h 0.2
Solution:
Therefore f ( x0 , y0 ) ( x0 y0 )
2
f ( x0 , y0 ) = 0 + 1.0
f ( x0 , y0 ) = 1.0
And, f ( x0 h, y0 hf ( x0 , y0 )) f (0 0.2,1.0 0.2(1.0)) {given x0 0 &
y0 1.0 }
f ( x0 h, y0 hf ( x0 , y0 )) f (0.2,1.2)
Problem:
Obtain the value of y(0.4) using Adam's and Milne's method, given that,
dy
x 2 y, y(0) 1; y(0.1) 0.90516; y(0.2) 0.82127; y(0.3) 0.74918.
dx
Solution:
dy
Given: x 2 y y'
dx
x0 0; y0 1
x1 0.1; y1 0.90516
x2 0.2; y2 0.82127
x3 0.3; y3 0.74918
x4 0.4
x y4
2
4
(0.4) 2 0.6896
0.5296
4h
2 y'n2 y'n1 2 y'n
yn1, p yn 3
3
By putting n 3 , So as to get y4 , we get
Problem:
Determine the value of y(0.1) , y(0.2) , y(0.3) by using Runge-kutta method.
Using the above values, find y(0.4) through Adam's predictor-corrector method. The
given values are y(0) 1 and the differential equation is given by,
dy 1
xy
dx 2
Solution:
Given:
dy 1
f ( x, y) xy
dx 2
y(0) 1 , h 0.1
Therefore, x0 0 y0 1
Using Runge-kutta method to find y(0.1) , y(0.2) , y(0.3)
ANNAMALAI
ANNAMALAI
UNIVERSITY
UNIVERSITY
Adam's predictor formula is,
yn 1, p yn
h
55 yn' 59 yn' 1 37 yn' 2 9 yn' 3
24
5.3 Summary
In this unit, we saw that the numerical solution of an ordinary differential
equation can be found out with the given initial conditions.
Euler's method, Runge kutta method, Milne's predictor corrector method, Adam's
predictor corrector method are the four methods used to find the solution of an
ordinary differential equation.
For Milne's predictor corrector method and Adam's predictor corrector method, at
least four values prior to the required value must be required.
The values can be obtained by using Runge kutta method, if it is not given.
dy y x
1. Solve the first order differential equation in the interval 0 x 0.1 by
dx y x
Euler's method taking h=0.02 and y(0) 1 . find the value y(0.1) .
dy 1
2. Using Euler modified method, solve the differential equation y y by
dx x
taking y = x =1 and h=0.1.find the value of y at x =1.6.
5. Find the solution of the initial value problem by using Adam's Predictor Corrector
dy
method at y(1.4) . Given x( x xy ) , y(1) 1, y(1.1) 1.233, y(1.2) 1.548
dx
and y(1.3) 1.979 .
dy
6. Calculate y(0.4) from 3e x 2 y using Adam's Predictor Corrector method
dx
by calculating the value of y(0.1), y(0.2), y(0.3) using fourth order Runge-kutta
method. Given y(0) 0 .
ANNAMALAI
ANNAMALAI UNIVERSITY
UNIVERSITY
References
1. M.K.Jain, S.R.K.Iyengar and R.K.Jain, “Numerical methods for
Scientific and Engineering Computation”, New Age International (P)
Ltd, Publishers, 1996.
2. Steven C.Chapra and Raymond p. Canale, “Numerical Methods for
Engineers with programming and Software Applications”, Third
Edition, TMH, NewDelhi. 2000.
ANNAMALAI
ANNAMALAI UNIVERSITY
UNIVERSITY