0% found this document useful (0 votes)
61 views59 pages

DR ST-BS401-Numerical Methods-Module-4&5

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views59 pages

DR ST-BS401-Numerical Methods-Module-4&5

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 59

BS401-MODULE – IV & V

NUMERICAL METHODS

n
va
el
Dr. S.TAMILSELVAN
ils
Professor
m
Engineering Mathematics
Ta
S
r
D

Faculty of Engineering and Technology


Annamalai University
Annamalai Nagar
NOTES FOR
ve n
ity
NUMERICAL ni va
rs
U el
ai ils
al m

METHODS
m Ta
na S
An Dr

Dr. S.TAMILSELVAN
Numerical Methods

BISECTION METHOD

Bisection method is one of the bracketing methods. It is based on the “Intermediate value
theorem”

The idea behind the method is that if f(x) C [a, b] and f(a).f(b)<0 then there exist a root
“c (a,b)” such that “f(c)=0”

This method also known as BOLZANO METHOD (or) BINARY SECTON METHOD.

ALGORITHM

ve n
ity
ni va
For a given continuous function f(x)

rs
2. Let c = U el
1. Find a ,b such that f(a).f(b)<0 (this means there is a root “r
(mid-point)
(a,b)” such that f(r)=0
ai ils
3. If f(c)=0; done (lucky!)
al m

4. Else; check if ( ) ( ) or ( ) ( )
5. Pick that interval [a, c] or [c, b] and repeat the procedure until stop criteria satisfied.
m Ta

STOP CRITERIA
na S

1. Interval small enough.


2. |f(cn)| almost zero
An Dr

3. Maximum number of iteration reached


4. Any combination of previous ones

S Tamilselvan Annamalai University


Numerical Methods

CONVERGENCE CRITERIA
No. of iterations needed in the bisection method to achieve certain accuracy

Consider the interval [a0 ,b0] ,, c0 = and let r (a0,b0) be a root then the error is

0 = |r-c0|≤

Denote the further intervals as [an,bn] for iteration number “n” then

n=|r-cn|≤ ≤ =

If the error tolerance is “ ” we require “ n≤ ” then ≤

ve n
After taking logarithm log (b0-a0) – nlog2 ≤ log (2 )

ity
ni va
( )– ( ) ( )–
≤n ≤ n (which is required)

rs
U el
ai ils
MERITS OF BISECTION METHOD
al m

1. The iteration using bisection method always produces a root, since the method
brackets the root between two values.
m Ta

2. As iterations are conducted, the length of the interval gets halved. So one can
guarantee the convergence in case of the solution of the equation.
na S

3. Bisection method is simple to program in a computer.

DEMERITS OF BISECTION METHOD


An Dr

1. The convergence of bisection method is slow as it is simply based on halving the


interval.
2. Cannot be applied over an interval where there is discontinuity.
3. Cannot be applied over an interval where the function takes always value of the same
sign.
4. Method fails to determine complex roots (give only real roots)
5. If one of the initial guesses “a0” or “b0” is closer to the exact solution, it will take larger
number of iterations to reach the root.

S Tamilselvan Annamalai University


Numerical Methods

EXAMPLE

Solve x3-9x+1 for roots between x=2 and x=4

SOLUTION

X 2 4
f(x) -9 29

Since f (2). f (4) <0 therefore root lies between 2 and 4

(1) xr = = 3 so f(3) = 1 (+ve)

ve n
(2) For interval [2,3] ; xr = = 2.5

ity
ni va
f (2.5) = -5.875 (-ve)
(3) For interval [2.5,3]; xr = (2.5+3)/2 = 2.75

rs
(4) U el
f (2.75) = -2.9534 (-ve)
For interval [2.75,3]; xr = (2.75+3)/2 = 2.875
ai ils
f (2.875) = -1.1113 (-ve)
al m

(5) For interval [2.875,3]; xr = (2.875+3)/2 = 2.9375


f (2.9375) = -0.0901 (-ve)
m Ta

(6) For interval [2.9375,3]; xr = (2.9375+3)/2 = 2.9688


f (2.9688) = +0.4471 (+ve)
(7) For interval [2.9375,2.9688]; xr = (2.9375+2.9688)/2 = 2.9532
na S

f (2.9532) = +0.1772 (+ve)


An Dr

(8) For interval [2.9375,2.9532]; xr = (2.9375+2.9532)/2 = 2.9453


f (2.9453) = 0.1772
Hence root is 2. 9453 because roots are repeated.

S Tamilselvan Annamalai University


Numerical Methods

EXAMPLE

Use bisection method to find out the roots of the function describing to drag coefficient of
parachutist given by

f(c) = [1-exp(-0.146843c)]-40 Where “c=12” to “c=16” perform at least two iterations.

SOLUTION

Given that f(c) = [1-exp(-0.146843c)]-40

X 12 13 14 15
f(x) 6.670 3.7286 1.5687 -0.4261

ve n
ity
ni va
Since f (14). f (15) <0 therefore root lie between 14 and 15

rs
Xr = = 14.5
U el
So f(14.5) = 0.5537
ai ils
Again f (14.5). f (15) <0 therefore root lie between 14.5 and 15
al m

xr = = 14.75 So f(14.75) = 0.0608 These are the required iterations


m Ta
na S

EXAMPLE
An Dr

Explain why the equation e−x = x has a solution on the interval [0,1]. Use bisection to find the
root to 4 decimal places. Can you prove that there are no other roots?

SOLUTION
If f(x) = e−x − x, then f(0) = 1, f(1) = 1/e − 1 < 0, and hence a root is guaranteed by the

Intermediate Value Theorem. Using Bisection, the value of the root is x? = .5671.

Since f0(x) = −e−x − 1 < 0 for all x, the function is strictly decreasing, and so its graph can only

cross the x axis at a single point, which is the root.

S Tamilselvan Annamalai University


Numerical Methods

FALSE POSITION METHOD

This method also known as REGULA FALSI METHOD,, CHORD METHOD ,, LINEAR
INTERPOLATION and method is one of the bracketing methods and based on intermediate
value theorem.

This method is different from bisection method.

Like the bisection method we are not taking the mid-point of the given interval to determine
the next interval and converge faster than bisection method.

ALGORITHM

ve n
ity
Given a function f(x) continuous on an interval [a0,b0] and satisfying f(a0).f(b0)<0 for all

ni va
n = 0,1,2,3………….. then Use following formula to next root

rs
= ( ) ( ) U el
f(xf) We can also use xr = xn+1 ,,, xf = xn ,,, xi = xn-1
ai ils
STOPING CRITERIA
al m

1. Interval small enough.


m Ta

2. |f(cn)| almost zero


3. Maximum number of iteration reached
na S

4. Same answer.
5. Any combination of previous ones
An Dr

S Tamilselvan Annamalai University


Numerical Methods

EXAMPLE

Using Regula Falsi method Solve x3-9x+1 for roots between x=2 and x=4

SOLUTION

X 2 4
f(x) -9 29

Since f(2).f(4)<0 therefore root lies between 2 and 4

ve n
Using formula

ity
ni va
= xf - ( )
f(xf)
( )

rs
For interval [2,4] U el
we have xr ( )
29
ai ils
Which implies ( ) (-ve)
al m

Similarly, other terms are given below


m Ta

Interval xr F(xr)
[2.4737,4] 2.7399 -3.0905
na S

[2.7399,4] 2.8613 -1.326


An Dr

[2.8613,4] 2.9111 -0.5298


[2.9111,4] 2.9306 -0.2062
[2.9306,4] 2.9382 -0.0783
[2.9382,4] 2.9412 -0.0275
[2.9412,4] 2.9422 -0.0105
[2.9422,4] 2.9426 -0.0037
[2.9426,4] 2.9439 0.0183
[2.9426,2.9439] 2.9428 -0.0003
[2.9426,2.9439] 2.9428 -0.0003

S Tamilselvan Annamalai University


Numerical Methods

EXAMPLE

Using Regula Falsi method to find root of equation “ ” upto four decimal
places, after 3 successive approximations.

SOLUTION

X 0 1 2
F(X) - -0.5403 1.1093

Since f(1).f(2)<0 therefore root lies between 1 and 2

ve n
ity
ni va
Using formula

rs
Xr= xf - f(xf)
( ) ( )

U el
ai ils
For interval [1,2] we have xr=2- 1.1093=1.3275
( )
al m

Which implies f(2.4737)=0.0424(+ve)


m Ta

Similarly, other terms are given below

Interval xr F(xr)
na S

[1,1.3275] 1.3037 0.0013


An Dr

[1,1.3037] 1.3030 0.0001

Hence the root is 1.3030

KEEP IN MIND

 Calculate this equation in Radian mod


 If you have “log” then use “natural log”. If you have “ ” then use “simple
log”.

S Tamilselvan Annamalai University


Numerical Methods

GENERAL FORMULA FOR REGULA FALSI USING LINE EQUATION


Equation of line is

( ) ( ) ( )

Put (x,0) i.e. y=0

( ) ( ) ( )

( )
( ) ( )

ve n
( ) ( )

ity
ni va
( ) ( )

rs
(
U el ) ( )
ai ils
( ) ( )
al m

Hence first approximation to the root of f(x) =0 is given by

( ) ( )
m Ta

( ) ( )

We observe that f(xn-1), f(xn+1) are of opposite sign so, we can apply the above procedure to
na S

successive approximations.
An Dr

S Tamilselvan Annamalai University


Numerical Methods

NEWTON RAPHSON METHOD

The Newton Raphson method is a powerful technique for solving equations numerically. It is
based on the idea of linear approximation. Usually converges much faster than the linearly
convergent methods.

ve n
ALGORITHM

ity
ni va
The steps of Newton Raphson method to find the root of an equation “f(x) =0” are

rs
Evaluate ( )
U el
ai ils
Use an initial guess (value on which f(x) and ( ) becomes (+ve) of the roots “xn” to
estimate the new value of the root “xn+1” as
al m

( )
m Ta

( )
na S

STOPING CRITERIA
An Dr

1. Find the absolute relative approximate error as


2. Compare the absolute error with the pre-specified relative error tolerance “ s”.
3. If | a|> s then go to next approximation. Else stop the algorithm.
4. Maximum number of iterations reached.
5. Repeated answer.

CONVERGENCE CRITERIA
Newton method will generate a sequence of numbers (xn) ; n 0, that converges to the zero
“x*” of “f” if

 “f” is continuous.
 “x*” is a simple zero of “f”.
 “x0” is close enough to “x*”

S Tamilselvan Annamalai University


Numerical Methods

When the Generalized Newton Raphson method for solving equations is helpful?

To find the root of “f(x)=0” with multiplicity “p” the Generalized Newton formula is required.

What is the importance of Secant method over Newton Raphson method?

Newton Raphson method requires the evaluation of derivatives of the function and this is not
always possible, particularly in the case of functions arising in practical problems.

In such situations Secant method helps to solve the equation with an approximation to the
derivatives.

ve n
ity
ni va
Why Newton Raphson method is called Method of Tangent?

rs
U el
In this method we draw tangent line to the point” P0(x0,f(x0))”. The (x,0) where this tangent
line meets x-axis is 1st approximation to the root.
ai ils
Similarly, we obtained other approximations by tangent line. So, method also called Tangent
al m

method.
m Ta

Difference between Newton Raphson method and Secant method.


na S

Secant method needs two approximations x0,x1 to start, whereas Newton Raphson method
An Dr

just needs one approximation i.e. x0

Newton Raphson method converges faster than Secant method.

Newton Raphson method is an Open method, how?

Newton Raphson method is an open method because initial guess of the root that is needed
to get the iterative method started is a single point. While other open methods use two initial
guesses of the root but they do not have to bracket the root.

S Tamilselvan Annamalai University


Numerical Methods

INFLECTION POINT
For a function “f(x)” the point where the concavity changes from up-to-down

or down-to-up is called its Inflection point.

e.g. f(x) = (x-1)3 changes concavity at x=1,, Hence (1,0) is an Inflection point.

DRAWBACKS OF NEWTON’S RAPHSON METHOD

 Method diverges at inflection point.


 For f(x)=0 Newton Raphson method reduce. So one must be avoid division by zero.
Rather method not converges.

ve n
Root jumping is another drawback.

ity

ni va
Results obtained from Newton Raphson method may oscillate about the Local
Maximum or Minimum without converging on a root but converging on the Local

rs
U el
Maximum or minimum.
ai ils
Eventually, it may lead to division by a number close to zero and may diverge.
al m

 The requirement of finding the value of the derivatives of f(x) at each approximation
is either extremely difficult (if not possible) or time consuming.
m Ta
na S
An Dr

S Tamilselvan Annamalai University


Numerical Methods

FORMULA DARIVATION FOR NR-METHOD


Given an equation “f(x) = 0” suppose “x0” is an approximate root of “f(x) = 0”

Let ( )

Where “h” is the small; exact root of f(x)=0

Then ( ) ( )

By Taylor theorem

( ) ( ) ( ) ( )

ve n
Since “h” is small therefore neglecting higher terms we get

ity
ni va
( ) ( ) ( )

rs
( )
U el
ai ils
( )

( )
al m

( )
( )
m Ta

( )
Similarly ( )
na S

( )
( )
An Dr

( )
( )

This is required Newton’s Raphson Formula.

S Tamilselvan Annamalai University


Numerical Methods

EXAMPLE
Apply Newton’s Raphson method for correct to three decimal places.

SOLUTION
( )

( )
( )
Using formula ( )

at

ve n
( )
( )

ity
ni va
( )

( ) ( )

rs
Similarly U el
ai ils
n ( ) ( )
al m

2 0.531 -0.041 -3.110


3 0.518 -0.001 -3.043
m Ta

4 0.518 -0.001 -3.043


Hence root is “0.518”
na S

REMARK
An Dr

1. If two are more roots are nearly equal, then method is not fastly convergent.
2. If root is very near to maximum or minimum value of the function at the point, NR-
method fails.

S Tamilselvan Annamalai University


Numerical Methods

EXAMPLE
Apply Newton’s Raphson method for correct to two decimal places.

SOLUTION
( )

( )

( )

( )

ve n
ity
ni va
( )

rs
For interval
U el
ai ils
X 0 1 2 3 4 5 6 7
f(x) -4.77 -4.77 -4.17 -3.34 -2.36 -1.28 -0.10 1.15
al m
m Ta

Root lies between 6 and 7 and let x0 =7


( )
Using formula
na S

( )

Thus
An Dr

( )
( )

( ) ( )

Similarly

n ( ) ( )
2 6.08 0.00 0.00
Hence root is “6.08”

S Tamilselvan Annamalai University


Numerical Methods

GEOMETRICAL INTERPRETATION (GRAPHICS) OF NEWTON RAPHSON FORMULA


Suppose the graph of function “y=f(x)” crosses x-axis at then is the root of
equation ( ) .

CONDITION
Choose “x0” such that ( ) and ( ) have same sign. If ( ( )) is a point then slope
of tangent at ( ( )) ( ( )) ( )

Now equation of tangent is

( )

ve n
( ) ( )( ) ……………………………………………. (i)

ity
ni va
Since ( ( ) ) as we take x1 as exact root

rs
(i) (U el ) ( )( )
ai ils
( )
al m

( )

( )
m Ta

( )

Which is first approximation to the root . If “P1” is a point on the curve corresponding
na S

to “x1” then tangent at “P1” cuts x-axis at P1(x2, 0) which is still closer to “ ” than “x1”.
Therefore “x2” is a 2nd approximation to the root.
An Dr

Continuing this process, we arrive at the root “ ”.

S Tamilselvan Annamalai University


Numerical Methods

NEWTON SCHEME OF ITERATION FOR FINDING THE SQUARE ROOT OF POSITION NUMBER

The square root of “N” can be carried out as a root of the equation

Here ( ) ( )

( ) ( )
( )
Using Newton Raphson formula ( )

( )

ve n
ity
ni va
, - This is required formula.

rs
U el
ai ils
QUESTION
al m

Evaluate √ by Newton Raphson formula.


m Ta

SOLUTION

Let √
na S

Here ( ) ( ) ( )
An Dr

X 0 1 2 3 4
F(x) -12 -11 -8 -3 4
Root lies between 3 and 4 and x0 =4

Now using formula 0 1 0 1 ( )

For n=0 0 1 0 1=3.5

For n=2 0 1 0 1

Similarly
Hence √

S Tamilselvan Annamalai University


Numerical Methods

NEWTON SCHEME OF ITERATION FOR FINDING THE “pth” ROOT OF POSITION NUMBER “N”

Consider

Here ( ) ( )

( ) ( )

Since by Newton Raphson formula

( ) ( )
[ ]
( ) . /

( )
) , -

ve n
[( ] Required formula for pth root.

ity
ni va
QUESTION

rs
U el
Obtain the cube root of 12 using Newton Raphson iteration.
ai ils
SOLUTION
al m
m Ta

Consider

Here ( ) and ( ) ( )
na S

For interval
An Dr

X 0 1 2 3
F(x) -12 -11 -4 15
Root lies between 2 and 3 and x0=3

Since by Newton Raphson formula for pth root.

( ) ( )
, - 0 1 , -

( )
Put n=0 [ ] 0 1
( )

Similarly

Hence √

S Tamilselvan Annamalai University


Numerical Methods

THE SOLUTION OF LINEAR SYSTEM OF EQUATIONS

A system of “m” linear equations in “n” unknowns “ ” is a set of the


equations of the form

………………………………………………………………………………….

………………………………………………………………………………….

ve n
ity
ni va
Where the coefficients “ ” and “ ” are given numbers.

rs
U el
The system is said to be homogeneous if all the “ ” are zero. Otherwise it is said to be
ai ils
non-homogeneous.

SOLUTION OF LINEAR SYSTEM EQUATIONS


al m
m Ta

A solution of system is a set of numbers “ ” which satisfy all the “m”


equations.
na S

PIVOTING: Changing the order of equations is called pivoting.


An Dr

We are interested in following types of Pivoting

1. PARTIAL PIVOTING 2. TOTAL PIVOTING

PARTIAL PIVOTING
In partial pivoting we interchange rows where pivotal element is zero.

In Partial Pivoting if the pivotal coefficient “ ” happens to be zero or near to


zero, the i column elements are searched for the numerically largest element. Let the jth row
th

(j>i) contains this element, then we interchange the “ith” equation with the “jth” equation and
proceed for elimination. This process is continued whenever pivotal coefficients become zero
during elimination.

S Tamilselvan Annamalai University


Numerical Methods

TOTAL PIVOTING
In Full (complete, total) pivoting we interchange rows as well as column.

In Total Pivoting we look for an absolutely largest coefficient in the entire


system and start the elimination with the corresponding variable, using this coefficient as the
pivotal coefficient (may change row and column). Similarly, in the further steps. It is more
complicated than Partial Pivoting. Partial Pivoting is preferred for hand calculation.

Why is Pivoting important?

Because Pivoting made the difference between non-sense and a perfect result.

ve n
ity
ni va
rs
PIVOTAL COEFFICIENT
U el
ai ils
For elimination methods (Guass’s Elimination, Guass’s Jordan) the coefficient of the first
unknown in the first equation is called Pivotal Coefficient.
al m

BACK SUBSTITUTION
m Ta

The analogous algorithm for upper triangular system “Ax=b” of the form
na S

( ,( , ( , Is called Back Substitution.


An Dr


The solution “xi” is computed by

FORWARD SUBSTITUTION
The analogous algorithm for lower triangular system “Lx=b” of the form

( ,( , ( , Is called Forward Substitution.


The solution “xi” is computed by

S Tamilselvan Annamalai University


Numerical Methods

GUASS ELIMINATION METHOD

ALGORITHM

 In the first stage, the given system of equations is reduced to an equivalent upper
triangular form using elementary transformation.
 In the second stage, the upper triangular system is solved using back substitution
procedure by which we obtain the solution in the order

REMARK

ve n
ity
ni va
Guass’s Elimination method fails if any one of the Pivotal coefficient become zero. In such a
situation, we rewrite the equation in a different order to avoid zero Pivotal coefficients.

rs
U el
ai ils
QUESTION Solve the following system of equations using Elimination Method.
al m
m Ta
na S

SOLUTION
An Dr

We can solve it by elimination of variables by making coefficients same.

()

( )

( )

Multiply (i) by 2 and subtracted by (ii) ( )

Adding (i) and (iii) ( )

Now eliminating “y” Multiply (iv) by 3 then subtract from (v)

Using “z” in (iv) we get and Using “y”, “z” in (i) we get

Hence solution is

S Tamilselvan Annamalai University


Numerical Methods

QUESTION
Solve the following system of equations by Guass’s Elimination method with partial pivoting.

SOLUTION

[ ]6 7 [ ]

ve n
ity
ni va
[ ]6 7 [ ] * +6 7 [ ]

rs
U el
ai ils
al m

[ ]6 7 [ ] 6 7 [ ]
m Ta

[ ]

2nd row cannot be used as pivot row as a22 =0, So interchanging the 2nd and 3rd row we get
na S
An Dr

6 7 [ ]

[ ]

Using back substitution

S Tamilselvan Annamalai University


Numerical Methods

QUESTION
Solve the following system of equations using Guass’s Elimination Method with partial
pivoting.

SOLUTION

ve n
ity
ni va
[ ][ ] [ ]

rs
U el
ai ils
[ ][ ] [ ]
al m
m Ta

[ ][ ] [ ]
na S
An Dr

[ ][ ] [ ]

[ ] [ ] and

[ ]

[ ][ ] [ ]

S Tamilselvan Annamalai University


Numerical Methods

[ ] [ ]
[ ]

[ ] [ ] [ ]

ve n
ity
ni va
rs
U el
ai ils
al m
m Ta
na S
An Dr

Hence required solutions are

S Tamilselvan Annamalai University


Numerical Methods

UPPER TRIANGULATION MATRIX


A matrix having only zeros below the diagonal is called Upper Triangular matrix.

(OR)

A matrix “U” is upper triangular if its entries satisfy

i.e. [ ]

ve n
CROUTS REDUCTION METHOD

ity
ni va
In linear Algebra this method factorizes a matrix as the product of a Lower Triangular matrix

rs
U el
and an Upper Triangular matrix.
ai ils
Method also named as Cholesky’s reduction method, triangulation method,
al m

or LU-decomposition (Factorization)
m Ta

ALGORITHM
For a given system of equations ∑
na S

1. Construct the matrix “A”


An Dr

2. Use “A=LU” (without pivoting) and “PA=LU” (with pivoting) where “P” is the pivoting
matrix and find “ ”
3. Use formula “AX=B” where “X” is the matrix of variables and “B” is the matrix of
solution of equations.
4. Replace “AX=B” by “LUX=B” and then put “UX=Z” i.e. “LZ=B”
5. Find the values of “ ” then use “Z=UX” find “ ” ; i=1, 2, 3, …….n

ADVANTAGE/LIMITATION (FAILURE)
1. Cholesky’s method widely used in Numerical Solution of Partial Differential Equation.
2. Popular for Computer Programming.
3. This method fails if in that case the system is Singular.

S Tamilselvan Annamalai University


Numerical Methods

QUESTION
Solve the following system of equations using Crout’s Reduction Method

ANSWER

ve n
One of the
Let [ ]

ity
ni va
diagonals of L or U
must be 1

rs
Step I….
U el
ai ils
, - , -, -
al m

[ ] [ ][ ]
m Ta

After multiplication on R.H.S


na S
An Dr

[ ] [ ]

( )

( )

( * ( *

S Tamilselvan Annamalai University


Numerical Methods

. / . /. /

Step II…. Put , -, - , - , -, -, - , -

Put [U] [X] = [Z] , -, - , -

[ ][ ] [ ]

[ ][ ] [ ]

ve n
ity
ni va
. /

rs
U el ( * ( )
ai ils
al m

Step III…. Since [U][X] = [Z]


m Ta

[ ][ ] [ ]
na S
An Dr

[ ][ ] [ ]

( *

. / . /. / ( )

Hence required solutions are

S Tamilselvan Annamalai University


Numerical Methods

( )
( ) ( )

( ) ( ) ( )
( ) ( )

Put k = 4 for fifth iteration

( ) ( ) ( )

( ) ( ) ( )

( )
( ) ( )

ve n
ity
ni va
( ) ( ) ( )
( ) ( )

rs
U el
ai ils
GUASS SEIDEL ITERATION METHOD
al m

Guass’s Seidel method is an improvement of Jacobi’s method. This is also known as method
m Ta

of successive displacement.

ALGORITHM
na S

In this method we can get the value of “ ”from first equation and we get the value of “ ”
An Dr

by using “ ” in second equation and we get “ ” by using “ ” and “ ” in third equation


and so on.

ABOUT THE ALGORITHM

 Need only one vector for both and save memory space.
 Not good for parallel computing.
 Converge a bit faster than Jacobi’s.

S Tamilselvan Annamalai University


Numerical Methods

How Jacobi method is accelerated to get Guass Seidel method for solving system of Linear
Equations.

In Jacobi method the (r+1)th approximation to the system ∑ is given by


∑ from which we can observe that no
element of replaces entirely for next cycle of computations. However, this is done in
Guass Seidel method. Hence called method of Successive displacement.

QUESTION: Find the solutions of the following system of equations using Guass Seidel
method and perform the first five iterations.

ve n
ity
ni va
rs
U el
ai ils
al m
m Ta

ANSWER
na S
An Dr

For first iteration using ( ) we get

( )
( ) ( )

( )
( ) ( )

( )
( ) ( )

( )
( ) ( )

For second iteration using ( ) we get

S Tamilselvan Annamalai University


Numerical Methods

( )
( ) ( )

( )
( ) ( )

( )
( ) ( )

( )
( ) ( )

For third iteration using ( ) we get

( )
( ) ( )

ve n
( )

ity
ni va
( ) ( )

( )

rs
( ) ( )
U el
ai ils
( )
( ) ( )
al m

For fourth iteration using ( ) we get


m Ta

( )
( ) ( )
na S

( )
( ) ( )
An Dr

( )
( ) ( )

( )
( ) ( )

For fifth iteration using ( ) we get

( )
( ) ( )

( )
( ) ( )

( )
( ) ( )

( )
( ) ( )

S Tamilselvan Annamalai University


Numerical Methods

COLLOCATION
Like the finite difference methods, the idea behind the collocation is to reduce the boundary
value problem to a set of solvable algebraic equations.

However, instead of discretizing the differential equation by replacing derivative with finite
differences, the solution is given a functional from whose parameters are fit by the method.

CRITERION OF APPROXIMATION
Some methods are as follows

i. collocation ii. Osculation iii. Least square

ve n
ity
ni va
FORWARD DIFFERENCE OPERATOR ‘

rs
U el
We define forward difference operator as
ai ils
Where y=f(x) ( )
al m

For first order


m Ta

Given function y=f(x) and a value of argument ‘x’ as x=a, a+h…… a+nh etc.
Where ‘h’ is the step size (increment) first order Forward Difference Operator is
na S

( ) ( ) ( )
An Dr

For Second Order


Let ( ) ( ) =( ) ( )

For Third Order


( ) ( )
( ) ( ) ( )

In General: ( )

Remark ( )

S Tamilselvan Annamalai University


Numerical Methods

CONSTRUCTION OF FORWARD DIFFERENCE TABLE (Also called Diagonal difference table)

X Y

ve n
ity
ni va
rs
U el
QUESTION: Construct forward difference Table for the following value of ‘X’ and ‘Y’
ai ils
X 0.1 0.3 0.5 0.7 0.9 1.1 1.3
al m

Y 0.003 0.067 0.148 0.248 0.370 0.518 0.697


SOLUTION
m Ta

X y
0.1 0.003
na S

0.064
An Dr

0.3 0.067 0.017


0.081 0.002
0.5 0.148 0.019 0.001
0.100 0.003 0
0.7 0.248 0.022 0.001 0
0.122 0.004 0
0.9 0.370 0.026 0.001
0.148 0.005
1.1 0.518 0.031
0.179
1.3 0.697

S Tamilselvan Annamalai University


Numerical Methods

INTERPOLATION

For a given table of values( ) the process of estimating the values


of “y=f(x)” for any intermediate values of “x = g(x)” is called “interpolation”.
If g(x) is a Polynomial, Then the process is called “Polynomial” Interpolation.

ERROR OF APPROXIMATION
The deviation of g(x) from f(x) i.e. |f(x) – g (x)| is called Error of Approximation.

EXTRAPOLATION
The method of computing the values of ‘y’ for a given value of ‘x’ lying outside the table of

ve n
values of ‘x’ is called Extrapolation.

ity
ni va
REMARK

rs
U el
A function is said to interpolate a set of data points if it passes through those points.
ai ils
INVERSE INTERPOLATION
Suppose , - ( ) on [a, b] and has non- zero ‘p’ in *a, b+
al m

Let be ‘n+1’ distinct numbers in [a, b] with ( ) for each


m Ta

.
To approximate ‘p’ construct the interpolating polynomial of degree ‘n’ on the nodes
“y0, y1...........yn” for
na S

Since “yk=f (xk)” and f (p) =0, it follows that (yk) = Xk and p = (0).
An Dr

“Using iterated interpolation to approximate ( ) is called iterated Inverse interpolation”

LINEAR INTERPOLATION FORMULA


( ) ( ) ( )

Where

QUADRATIC INTERPOLATION FORMULA


( )
( ) ( )

Where

S Tamilselvan Annamalai University


Numerical Methods

NEWTON FORWARD DIFFERENCE INTERPOLATION FORMULA


Newton’s Forward Difference Interpolation formula is

( ) ( )
( ) ( ) ( )
( ) ( ) ( ) ( )
Where

DERIVATION:
Let ( ) ( )

( ) ( ) ( ) ( ) ( )

ve n
( ) ( ) ( )

ity
ni va
, - ( )

( )

rs
)
( ) (
U el) ( ) ( )
ai ils
CONDITION FOR THIS METHOD
al m

 Values of ‘x’ must have equal distance i.e. equally spaced.



m Ta

Value on which we find the function check either it is near to start or end.
 If near to start, then use forward method.
 If near to end, then use backward method.
na S
An Dr

S Tamilselvan Annamalai University


Numerical Methods

QUESTION
Evaluate ( ) given the following table of values

X : 10 20 30 40 50
f(x) : 46 66 81 93 101

SOLUTION
Here ‘15’ nearest to starting point we use Newtown’s Forward Difference Interpolation.

X Y Y 2Y  3Y  4Y
10 46

ve n
20

ity
ni va
20 66 -5
15 2

rs
30 81
U el 12
-3
-1
-3
ai ils
40 93 -4
8
al m

50 101
m Ta

( ) ( )( ) ( )( )( )
( )
na S

( )
An Dr

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

( )

NEWTONS’S BACKWARD DIFFERENCE INTERPOLATION FORMULA


Newton’s Backward Difference Interpolation formula is

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

S Tamilselvan Annamalai University


Numerical Methods

DERIVATION: Let ( ) ( ) Then

( ) ( ) ( ) ( ) ( ) ( )
( ) ( )( )
( ) 0 1 ( )

( )
( ) ( ) ( ) ( )

This is required Newton’s Gregory Backward Difference Interpolation formula.

QUESTION: For the following table of values estimate f(7.5)

X 1 2 3 4 5 6 7 8

ve n
f(x) 1 8 27 64 125 216 343 512

ity
ni va
SOLUTION

rs
U el
Since ‘7.5’ is nearest to End of table, So We use Newton’s Backward Interpolation.
ai ils
X Y Y  2Y  3Y  4Y
1 1
al m

7
2 8 12
m Ta

19 6
3 27 18 0
37 6
na S

4 64 24 0
61 6
An Dr

5 125 30 0
91 6
6 216 36 0
127 6
7 243 42
169
8 512

Since
( ) ( )( )
Now
( )( ) ( )( )( )
( )( ) ( ) ( )

( )

S Tamilselvan Annamalai University


Numerical Methods

LAGRANGE’S INTERPOLATION FORMULA

For points define the cardinal Function

(polynomial of n-degree)

( ) 2

The Lagrange form of interpolation Polynomial is ( )= ∑ ( )

ve n
ity
ni va
DERIVATION OF FORMULA

rs
n-degree polynomial U el
Let y=f (x) be a function which takes the values
( )= 0 +
so we will obtain an
+…………..+ n
ai ils
( ) ( )( ) ( )
al m

( )( ) ( )
() ( )( )( ) ( )
m Ta

Now

{ ( )( ) ( )
na S

Now we find the constants


An Dr

Put x= in (i)
( ) ( )( ) ( )
( )( ) ( )
() ( )( )( ) ( )

{ ( )( ) ( )

( )( ) ( )

,( )( ) ( )-

Now Put x=

( ) ( )( ) ( )

,( )( ) ( )-

S Tamilselvan Annamalai University


Numerical Methods

Similarly

,( )( ) ( )-

Putting all the values in (i) we get


( )( ) ( ) ( )( ) ( )
( ) + +……………
( )( ) ( ) ( )( ) ( )
( )( ) ( )
( )( ) ( )

( ) ∑
( )( ) ( )( ) ( )
Where ( ) ( )( ) ( )( ) ( )

ve n
ALTERNATIVELY DEFINE

ity
ni va
( ) ( )( ) ( )

rs
Then ( ) (U el ),( )( ) ( )-
ai ils
( ),( )( )( ) ( )-
al m

( ),( )( )( ) ( )-
m Ta

( ) ( )( ) ( )( ) ( )
( ) ( )( ) ( )( ) ( )
( )
na S

( ) ( )( ) ( )( ) ( )
An Dr

( )
Then ( ) ( ) ( )

CONVERGENCE CRITERIA
( )
Assume a triangular array of interpolation nodes exactly ‘ ’ distinct nodes for

( )

( ) ( )

( ) ( ) ( )

( ) ( ) ( ) ( )

S Tamilselvan Annamalai University


Numerical Methods

QUESTION
Find langrage’s Interpolation polynomial fitting The points ( )

( ) ( ) ( ) Hence find ( )

X: =1 =3 =4 =6

Y: -3 0 30 132

ANSWER
Since ( ) + + +

ve n
( )( )( ) ( )( )( ) ( )( )( )
( ) ( )( )( )
+( )( )( )
+( )( )( )
+

ity
ni va
( )( )( )
( )( )( )

rs
By putting values, we get
U el
ai ils
( )
al m
( )( )( ) ( )( )( ) ( )( )( ) ( )( )( )
( )( )( )
( ) ( ) ( ) ( )
( )( )( ) ( )( )( ) ( )( )( )
m Ta

( ) , -

Put to get ( )
na S

( ) , ( ) ( ) -
An Dr

Y (5) =75

DIVIDED DIFFRENCE

Assume that for a given value of ( )( ) ( )

, - ( )

Then the first order divided Difference is defined as

, - , -

, - [ ]
The 2nd Order Difference is [ ]

[ ] [ ]
Similarly [ ]

S Tamilselvan Annamalai University


Numerical Methods

NUMARICAL DIFFERENTIATION

The problem of numerical differentiation is the determination of approximate values the


derivatives of a function at a given point.

DIFFERENTIATION USING DIFFERENCE OPERATORS


We assume that the function ( ) is given for the equally spaced ‘x’ values
for to find the darivatives of such a tabular function, we proceed as
follows;

USING FORWARD DIFFERENCE OPERATOR

ve n
ity
( ) ( )

ni va
Since

, ( )-

rs
Where D is differential operator.
U el
ai ils
0 1 ()
al m

Therefore
m Ta

( ) 0 1 ( ) ( )
na S

( ) ( ) 0 ( ) ( ) ( ) ( ) 1
An Dr

0 1

Similarly, for second derivative

() 0 1

0 1 After solving

0 1

S Tamilselvan Annamalai University


Numerical Methods

USING BACKWARD DIFFERENCE OPERATOR “ ”

Since ( ) ( )

Since ( ) therefore

0 1 ()

Now ( ) 0 1 ( ) ( )

( ) ( ) 0 ( ) ( ) ( ) ( ) 1

ve n
0 1

ity
ni va
Similarly, for second derivative squaring (i) we get

rs
() U el 0 1
ai ils
al m

0 1
m Ta

TO COMPUTE DARIVATIVE OF A TABULAR FUNCTION AT POINT NOT FOUND IN THE TABLE

Since
na S

( )
( ) ( )( ) ( )
An Dr

( ) ( ) ( ) ( ) ()

( )

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

Differentiate with respect to ‘x’ and using (i) & (ii)


( )
0 ( ) ( ) ( ) 1 . /

( )
0 ( ) ( ) 1. /

S Tamilselvan Annamalai University


Numerical Methods

( )
6 ( ) ( ) 4 5 ( )

4 5 ( ) 7

( )

Differentiate with respect to ‘x’

0 ( ) ( ) ( ) . / ( ) 1

( )

ve n
ity
ni va
Equation ( )& ( ) are Newton’s backward interpolation formulae which can be used to
compute 1st and 2nd derivatives of a tabular function near the end of table similarly

rs
U el
Expression of Newton’s forward interpolation formulae can be derived to compute the 1st, 2nd
ai ils
and higher order derivatives near the beginning of table of values.
al m
m Ta

DIFFERENTIATION USING CENTRAL DIFFERENCE OPERATOR ( )

Since
na S
An Dr

Since therefore

Also as therefore . /

. / . / . /

Since by Maclaurin series

( ) . / ………..

. / . / . /
[ ( + ]

0 1 ()

S Tamilselvan Annamalai University


Numerical Methods

NUMERICAL INTEGRATION

The process of producing a numerical value for the defining integral ∫ ( ) is called
Numerical Integration. Integration is the process of measuring the Area under a function
plotted on a graph. Numerical Integration is the study of how the numerical value of an
integral can be found.

Also called Numerical Quadrature if ∫ ( ) ∑ ( ) which refers to finding a


square whose area is the same as the area under the curve.

A GENERAL FORMULA FOR SOLVING NUMERICAL INTEGRATION

ve n
ity
ni va
This formula is also called a general quadrature formula.

Suppose f(x) is given for equidistant value of ‘x’ say a=x0, x0+h,x0+2h …. x0+nh = b

rs
U el
Let the range of integration (a,b) is divided into ‘n’ equal parts each of width ‘h’ so that
ai ils
“b-a=nh”.
al m

By using fundamental theorem of numerical analysis It has been proved the general
m Ta

quadrature formula which is as follows


( ) ( ) ( )
0 ( ) ( ) . / . / . /
na S

( ) 1
An Dr

Bu putting n into different values various formulae is used to solve numerical integration.

That are Trapezoidal Rule, Simpson’s 1/3, Simpson’s 3/8, Boole’s, Weddle’s etc.

IMPORTANCE: Numerical integration is useful when

 Function cannot be integrated analytically.


 Function is defined by a table of values.
 Function can be integrated analytically but resulting expression is so complicated.

COMPOSITE (MODIFIED) NUMERICAL INTEGRATION


Trapezoidal and Simpson’s rules are limited to operating on a single interval. Of course, since
definite integrals are additive over subinterval, we can evaluate an integral by dividing the
interval up into several subintervals, applying the rule separately on each one and then
totaling up. This strategy is called Composite Numerical Integration.

S Tamilselvan Annamalai University


Numerical Methods

TRAPEZOIDAL RULE

Rule is based on approximating ( ) by a piecewise linear polynomial that interpolates


( ) at the nodes

Trapezoidal Rule defined as follows

∫ ( ) ( ) ( ) And this is called Elementary Trapezoidal Rule.

Composite form of Trapezoidal Rule is ∫ ( ) , ( ) -

DARIVATION (1st METHOD)

ve n
ity
ni va
Consider a curve ( ) bounded by and we have to find ∫ ( ) i.e.
( ) then for one Trapezium under the area i.e. n = 1

rs
Area under the curve

U el Y
ai ils
Y

f(x2)
al m
m Ta

F(x0) F(x1)
f(x0)

h h
na S
An Dr

O a=x0 B=x1 X

O a= x0 x1 b= x2 X

∫ ( )

( ) ( )
∫ ( ) , ( ) ( )-

For two trapeziums i. e. n = 2

∫ ( ) , ( ) ( )- , ( ) ( )- , ( ) ( ) ( )-

For n = 3 ∫ ( ) , ( ) ( )- , ( ) ( )- , ( ) ( )-

∫ ( ) , ( ) , ( ) ( )- ( )-

S Tamilselvan Annamalai University


Numerical Methods

In general for n – trapezium the points will be and function will be

∫ ( ) , ( ) , ( ) ( ) ( )- ( )-

∫ ( ) , ( ) -

Trapezium rule is valid for n (number of trapezium) is even or odd.

The accuracy will be increase if number of trapezium will be increased OR step size will be
decreased mean number of step size will be increased.

ve n
DARIVATION (2nd METHOD)

ity
ni va
Define y = f(x) in an interval , - , - then

rs
U el
ai ils
∫ ( ) ∫ ( ) ∫ ( ) ∫ ( )
al m

∫ ( ) [ ( )] [ ( )] [ ( )]
m Ta

Where , ( ) ( ) ( )- is global error.


na S

, ( )-
An Dr

Therefore ∫ ( ) , ( ) - Where

REMEMBER: The maximum incurred in approximate value obtained by Trapezoidal Rule is


( )
nearly equal to where ( ) , -

EXAMPLE: Evaluate ∫ using Trapezoidal Rule when

SOLUTION

X 0 1/4 1/2 3/4 1


F(x) 1 0.9412 0.8000 0.6400 0.5000
Since by Trapezoidal Rule ∫ , ( )-

S Tamilselvan Annamalai University


Numerical Methods

SIMPSON’S ( ) RULE

Rule is based on approximating f(x) by a Quadratic Polynomial that interpolate f(x) at

Simpson’s Rule is defined as for simple case ∫ ( ) , - ( )

While in composite form it is defined as

∫ ( ) , ( ) ( ) -

ve n
Global error for Simpson’s Rule is defined as ( ) ( )

ity
ni va
REMARK

rs
U el
In Simpson Rule number of trapezium must of Even and number of points must of Odd.
ai ils
DERIVATION OF SIMPSON’S ( ) RULE (1st method)
al m

Consider a curve bounded by x = a and x = b and let ‘c’ is the mid-point between and such
m Ta

that we have to find ∫ ( ) i.e. Area under the curve.

Y
na S
An Dr

f(c )
f(a) f(b)

A B C
0 a c b X

Consider ()

Now

()

S Tamilselvan Annamalai University


Numerical Methods

Now ∫ ( ) ∫ ( ) where y is small change

Using Taylor Series Formula ( ) ( ) ( ) ( )

∫ ( ) ∫ 0 ( ) ( ) ( ) 1

Neglecting higher derivatives

∫ ( ) ∫ 0 ( ) ( ) ( )1

∫ ( ) | ( ) ( ) ( )| 0 ( ) ( )1 ()

ve n
( ) ( ) ( ) ( ) ( )

ity
ni va
rs
( ) ( )
U el ( ) ( ) ( )
ai ils
( ) ( ) ( ) ( )
al m

( ) ( ) ( ) ( ) Put this value in (i)


m Ta

∫ ( ) , ( ) * ( ) ( ) ( )+-

∫ ( ) , ( ) ( ) ( ) ( )-
na S

( ) , ( ) ( ) ( )- , ( ) ( ) ( )-
An Dr

∫ ( ) , ( ) ( ) ( )- , -

For n = 4

∫ ( ) ∫ ( ) ∫ ( ) , - , -

∫ ( ) , ( ) -

In General

∫ ( ) , ( ) ( ) -

S Tamilselvan Annamalai University


Numerical Methods

DERIVATION OF SIMPSON’S ( ) RULE (2nd method)

∫ ( ) ∫ ( ) ∫ ( ) ∫ ( )

∫ ( ) , - , - , -

∫ ( ) , ( ) ( ) -

This is required formula for Simpson’s (1/3) Rule

EXAMPLE

ve n
ity
ni va
Compute √ ∫ using Simpson’s (1/3) Rule when

rs
SOLUTION U el
ai ils
X 0 0.125 0.250 0.375 0.5 0.625 0.750 0.875 1
al m

F(x) 0.798 0.792 0.773 0.744 0.704 0.656 0.602 0.544 0.484
m Ta

Since by Simpson’s Rule


na S

√ ∫ , ( ) ( )-
An Dr

√ ∫ After putting the values.

S Tamilselvan Annamalai University


Numerical Methods

SIMPSON’S ( ) RULE

Rule is based on fitting four points by a cubic.

Simpson’s Rule is defined as for simple case

∫ ( ) , - ( )

While in composite form (“n” must be divisible by 3) it is defined as

∫ ( ) , ( ) ( ) -

ve n
ity
ni va
DERIVATION

rs
∫ ( )
U el ∫ ( ) ∫ ( ) ∫ ( )
ai ils
∫ ( ) , - , -
al m
m Ta

, -

∫ ( ) , ( ) ( ) -
na S

This is required formula for Simpson’s (3/8) Rule.


An Dr

REMARK: Global error in Simpson’s (1/3) and (3/8) rule are of the same order but if we
consider the magnitude of error then Simpson (1/3) rule is superior to Simpson’s (3/8) rule.

S Tamilselvan Annamalai University


Numerical Methods

METHODS FOR NUMERICAL SOLUTIONS OF ORDINARY DIFFERENTIAL EQUATIONS

SINGLE STEP METHODS: A series for ‘y’ in terms of power of ‘x’ form which the value of
‘y’ at a particular value of ‘x’ can be obtained by direct substitution
e.g. Taylor’s, Picard’s, Euler’s, Modified Euler’s Method.

MULTI - STEP METHODS: In multi-step methods, the solution at any point ‘x’ is obtained
using the solution at a number of previous points.
(Predictor- corrector method, Adam’s Moulton Method, Adam’s Bash forth Method)

REMARK

ve n
There are some ODE that cannot be solved using the standard methods. In such situations we

ity
ni va
apply numerical methods. These methods yield the solutions in one of two forms.

rs
U el
(i) A series for ‘y’ in terms of powers of ‘x’ from which the value of ‘y’ can be obtained
by direct substitution. e.g. Taylor’s and Picard’s method
ai ils
(ii) A set of tabulated values of ‘x’ and ‘y’. e.g. and Euler’s, Runge Kutta
al m
m Ta

ADVANTAGE/DISADVANTAGE OF MULTI - STEP METHODS


They are not self-starting. To overcome this problem, the single step method with some order
na S

of accuracy is used to determine the starting values.


An Dr

Using these methods one step method clears after the first few steps.

LIMITATION (DISADVANTAGE) OF SINGLE STEP METHODS.


For one step method it is typical, for several functions evaluation to be needed.

IMPLICIT METHODS
Method that does not directly give a formula to the new approximation. A need to get it,
need an implicit formula for new approximation in term of known data. These methods also
known as close methods. It is possible to get stable 3 rd order implicit method.

EXPLICIT METHODS
Methods that not directly give a formula to new approximation and need an explicit formula
for new approximation in terms of known data. These are also called open methods.

S Tamilselvan Annamalai University


Numerical Methods

Most Authorities proclaim that it is not necessary to go to a higher order method. Explain.

Because the increased accuracy is offset by additional computational effort.

If more accuracy is required, then either a smaller step size. OR an adaptive method should
be used.

CONSISTENT METHOD: A multi-step method is consistent if it has order at least one “1”

TAYLOR’S SERIES EXPANSION

ve n
Given ( ) , smooth function. Expand it at point then

ity
ni va
( )
( ) ( ) ( ) ( ) ( )

rs
( U el
)
ai ils
( ) ∑ This is called Taylor’s series of ‘f’ at ‘c’
al m

If ( )
m Ta

( ) ( ) ( ) ( )

MECLAURIN SERIES FROM TAYLOR’S


na S

If we put in Taylor’s series then


An Dr

( ) ( ) ( ) ( ) ( ) ∑ ( )

ADVANTAGE OF TAYLOR’S SERIES


(1) One step, Explicit.
(2) Can be high order.
(3) Easy to show that global error is the same as local truncation error.
(4) Applicable to keep the error small.

DISADVANTAGE
Need to explicit form of the derivatives of function. That is why not practical.

S Tamilselvan Annamalai University


Numerical Methods

ERROR IN TAYLOR’S SERIES

Assume ( ) ( ) are continuous functions. Call

( )
( ) ∑ ( ) Then first ( ) term is Taylor series

Then the error is

( ) ( )
( ) ( )∑ ( ) ( )
( )

Where ‘ is some point between ‘x’ and ‘c’ .

CONVERGENCE

ve n
ity
ni va
A Taylor’s series converges rapidly if ‘x’ is nears ‘c’ and slowly (or not at all) if ‘x’ is for away
form ‘c’.

rs
EXAMPLE U el
ai ils
Obtain numerically the solution of ( ) using Taylor Series method to
al m

find ‘y’ at 1.3


m Ta

SOLUTION
()
na S

( ) [ ] ( )
An Dr

, - ( ) ...... ................................and so on.

where

therefore ( ) ,( ) ,( ) ,( ) ,...........................

Now by using formula ( ) ( ) ( ) ( )


we get

( ) ( ) as required.

S Tamilselvan Annamalai University


Numerical Methods

SECOND ORDER RUNGE KUTTA METHOD

WORKING RULE: For a given initial value problem of first order ( ) ( )

Suppose be equally spaced ‘x’ values with interval ‘h’

i.e.

Also denote ( ) ( ) ( )

Then for until termination do:

,, ( ) ,, ( )

ve n
Then ( ) Is the formula for second order RK-method.

ity
ni va
REMARK: Modified Euler Method is a special case of second order RK-Method.

rs
IN ANOTHER WAY: U el If ( ) ( )
ai ils
Then Equation for second order method is ( )
al m

This is called Heun’s Method


m Ta

ANOTHER FORMULA FOR SECOND ORDER RK-METHOD


na S

( ) Where ( ) . /
An Dr

LOCAL TRUNCATION ERROR IN RK-METHOD.


LTE in RK-method is the error that arises in each step simply because of the truncated Taylor
series. This error is inevitable. Error of Runge Kutta method of order two involves an error of
O( ).

In General RK-method of order ‘m’ takes the form

Where ( ) ( )

( ) ………………….….. ( ∑ )

MULTI STEP METHODS OVER RK-METHOD (PREFRENCE): Determination of


require only on evaluation of ( ) per step. Whereas RK-method for require four or
more function evaluations. For this reason, multi-step methods can be twice as fast as
RK-method of comparable Accuracy.

S Tamilselvan Annamalai University


Numerical Methods

EXAMPLE: use second order RK method to solve ( ) ( )


at x =0.4 and h=0.2

SOLUTION: ( ) ()

If ‘h’ is not given then use by own choice for 4 – step take h=0.1 and for 1 – step take h=0.4

Given that h=0.2 ,

Now using formula of order two

( ) Where ( ) . /

ve n
( ) . /

ity
ni va
𝑥 𝑥0
𝑛
For n = 0; ( ) . / ℎ

rs
() U el ( ) ( )
n = 2 steps
ai ils
( ) . /
al m

For n = 1;
m Ta

() ( ) ( )
na S

CLASSICAL RUNGE KUTTA METHOD (RK – METHOD OF ORDER FOUR)


An Dr

ALORITHM: Given the initial value problem of first order ( ) ( )

Suppose be equally spaced ‘x’ values with interval ‘h’

i.e.
Also denote ( ) ( ) ( )

Then for until termination do:

,, ( ) . /
. / ( )

Then ( )

Is the formula for Runge Kutta method of order four and its error is ( )

S Tamilselvan Annamalai University


Numerical Methods

ADVANTAGE OF METHOD

 Accurate method.  It lakes in estimating the error.


 Easy to compute for the use of  Easy to program and is efficient.
computer.
COMPUTATIONAL COMPARISON: The main computational effort in applying the
Runge Kutta method is the evaluation of . In RK – 2 the cost is two function evaluation per
step. In RK – 4 require four evaluations per step.

EXAMPLE: use 4th order RK method to solve ( ) from t =0 to 0.4 taking h = 0.4

SOLUTION: ()

ve n
ity
ni va
Now using formulas for the RK method of 4th order

rs
(
U el ) ( )
ai ils
Where ( ) , . / , . / ( )
al m

STEP I : for n=0;


m Ta

( ) , . /
. / ( )
na S

( ) ( ) ( )
An Dr

STEP II : for n=1;

( ) , . /
. / ( )
( ) ( ) ( )

STEP III : for n=2;

( ) , . /
. / ( )
( ) ( ) ( )
THIS IS REQUIRED ANSWER

S Tamilselvan Annamalai University


Numerical Methods

PREDICTOR - CORRECTOR METHODS

A predictor corrector method refers to the use of the predictor equation with one subsequent
application of the corrector equation and the values so obtained are the final solution at the
grid point.

PREDICTOR FORMULA
The explicit (open) formula used to predict approximation is called a predictor formula.

CORRECTOR FORMULA
The implicit (closed) formula used to determine is called Corrector Formula. This used
to improve

ve n
ity
ni va
IN GENERAL

rs
Explicit and Implicit formula are used as pair of formulas. The explicit formula is called
U el
‘predictor’ and implicit formula is called ‘corrector’
ai ils
al m

Implicit methods are often used as ‘corrector’ and Explicit methods are used as ‘predictor’ in
predictor-corrector method. why?
m Ta

Because the corresponding Local Truncation Error formula is smaller for implicit method on
the other hand the implicit methods has the inherent difficulty that extra processing is
na S

necessary to evaluate implicit part.


An Dr

REMARK
( )
 Truncation Error of predictor is
( )
 Local Truncation Error of Adam’s Predictor is
 Truncation Error of Corrector is

Why Should one bother using the predictor corrector method When the Single step method
are of the comparable accuracy to the predictor corrector methods are of the same order?

A practical answer to that relies in the actual number of functional evaluations. For example,
RK - Method of order four, each step requires four evaluations where the Adams Moulton
method of the same order requires only as few as two evaluations. For this reason, predictor
corrector formulas are in General considerably more accurate and faster than single step
methods.

S Tamilselvan Annamalai University


Numerical Methods

REMEMBER
In predictor corrector method if values of against the values of
are given the we use symbol predictor corrector method and in this
method we use given values of

If Are not given against the values of then we first find


values of by using RK - method
OR By using formula
( ) ( )
( )

BASE (MAIN IDEA) OF PREDICTOR CORRECTOR METHOS

ve n
In predictor corrector methods a predictor formula is used to predict the value of at

ity
ni va
and then a corrector formula is used to improve the value of

rs
Following are predictor – corrector methods
1. Milne’s Method
U el
ai ils
2. Adam – Moulton method
al m
m Ta

MILNE’S METHOD

It’s a multi-step method. In General, Milne’s Predictor – Corrector pair can be written as
na S

P: ( )
An Dr

C: ( )

REMARK: Magnitude of truncation error in Milne’s corrector formula is


and truncation error in Milne’s predictor formula is
stable, convergent, efficient, accurate, compeer friendly.

ALGORITHM
 First predict the value of by above predictor formula.
Where derivatives are computed using the given differential equation itself.
 Using the predicted value we calculate the derivative from the given
differential Equation.
 Then use the corrector formula given above for corrected value of . Repeat this
process.

S Tamilselvan Annamalai University


Numerical Methods

EXAMPLE: use Milne’s method to solve ( ) and compute y(0.8)

SOLUTION:
Now by using Euler’s method ( )
( ) ( )
( ) ( )
( ) ( )

Now

For n=1

ve n
For n=2

ity
ni va
For n=3

rs
U el
Now using Milne’s Predictor formula
ai ils
P: ( )
al m

( )
m Ta

Now using corrector formula


C: ( )
( ) ( )
na S
An Dr

S Tamilselvan Annamalai University

You might also like