Вы находитесь на странице: 1из 26

LECTURE NOTES BY DR. J.S.V.R.

KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS
MTH-366(A): Applied Numerical Methods
Unit 1: Simultaneous Linear equations Periods - 15, Marks – 10
1.1 Method of factorization or triangularization.
1.2 Crout’s method
1.3 Inverse of a matrix by Crout’s method.
1.4 Gauss- Seidal iteration method.
1.5 Relaxation Method

E.
Unit 2: Interpolation with Unequal Intervals: Periods - 15, Marks – 10
2.1 Newton’s Divided Difference Formula.

EG
2.2 Lagrange’s Interpolation Formula
2.3 Inverse Interpolation

LL
2.4 Lagrange’s Method
2.5 Iterative Method.

CO
Unit 3: Numerical Differentiation and Integration: Periods - 15, Marks – 10
3.1 Numerical differentiation.
3.2 Derivatives using Newton’s Forward Difference formulae.
J.
3.3 Derivative using Newton’s Backward Difference formulae.
3.4 Numerical integration, general quadrature formula.
M.

3.5 Trapezoidal rule.


3.6 Simpson’s 1/3 rule.
3.7 Romberg method.
.,

Unit 4: Numerical Solutions of Ordinary Differential Equations Periods - 15, Marks – 10


4.1 Picard’s Method
PT

4.2 Taylor’s series Method


4.3 Modified Euler’s method.
DE

4.4 Runge Kutta Fourth order Method.


4.5 Miline’s Method .
4.6 Adam-Bashforth Method
S

Recommended Text Book:


TH

1. Numerical Methods by V.N. Veda Murthy and N.Ch.S.N. Iyengar, Vikas publications, India.
Reference Book:
MA

1. Numerical Analysis by S.S. Sastry.


………………………………………………………………………………………………………………

PAGE-1
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS
LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD
UNIT-I: SYSTEM OF LINEAR EQUATIONS

E.
EG
LL
CO
J.
M.

CHOLESKY’S TRIANGULARISATION METHOD


.,

Cholesky’s decomposition method is faster than the LU decomposition. There is no need for pivoting. If the
decomposition fails, the matrix is not positive definite.
PT

Consider the system of linear equations:


a11x1 + a12x2 + a13x3 = b 1
a21x1 + a22x2 + a23x3 = b 2
DE

a31x1 + a32x2 + a33x3 = b 3 (2.21)


The above system can be written as (2.22)
Ax = b
S

 a11 a12 a13   x1  b1 


TH

   
where A =  a21 a22 
a23  , x =  x2  , b = b2 
 a31 a32 a33   x3  b3 
MA

Let A = LU… (2.23)

 1 0 0 u11 u12 u13 


L = l21 1 0 and U =  0 u22
  u23 
 l31 l32 1  0 0 u33 
Equation (2.21) can be written as
LUX = b (2.24)
If we write UX = V (2.25)

PAGE-2
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS
LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD
UNIT-I: SYSTEM OF LINEAR EQUATIONS

Equation (2.24) becomes


LV = b (2.26)
Equation (2.26) is equivalent to the system

E.
v1 = b 1

EG
l21v1 + v2 = b 2
l31v1 + l32v2 + v3 = b 3 (2.27)

LL
The above system can be solved to find the values of v1, v2 and v3 which give us the matrix V.
UX = V

CO
then becomes
u11x1 + u12x2 + u13x3 = v 1
u22x2 + u23x3 = v 2
u33x 3 = v 3 J. (2.28)

which can be solved for x3, x2 and x1 by the backward substitution process.
M.
In order to compute the matrices L and U, we write Eq. (2.23) as

1 0 0 u11 u12 u13   a11 a12 a13 


l 0  0 u22 u23  =  a21 a22 a23 
 21 1
.,

(2.29)
l31 l32 1  0 0 u33   a31 a32 a33 
PT

Multiplying the matrices on the left and equating the corresponding elements of both sides, we obtain
u11 = a11, u12 = a12, u13 = a13 (2.30)
DE

a21 
l21u11 = a21 ⇒ l21 =
a11 

a (2.31)
l31u11 = a31 ⇒ l31 = 31 
a11 
S
TH

a21 
l21u12 + u22 = a22 ⇒ u22 = a22 − a12 
a11 
MA


a21 (2.32)
l21u13 + u23 = a23 ⇒ u23 = a23 − a13 
a11 

1  a31 
l31u12 + l32 u22 = a32 ⇒ l32 =  a32 − a a12  (2.33)
u22  11 
and l31u13 + l32u23 + u33 = a33 (2.34)

The value of u33 can be computed from Eq. (2.34).


To obtain the elements of L and U, we first find the first row of U and the first column of L. Then, we
determine the second row of U and the second column of L. Finally, we compute the third row of U.

PAGE-3
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS
LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD
UNIT-I: SYSTEM OF LINEAR EQUATIONS

Cholesky’s triangularisation method is also known as method of factorisation.

Example 1

E.
Solve the following equations by Cholesky’s triangularisation method.
2x + y + 4z = 12

EG
8x – 3y + 2z = 20
4x + 11y – z = 33

LL
Solution:

2 1 4 x 12 

CO
We have A =  8 −3 2 , X =  y  , B =  20
   
 4 11 −1  z  33 

1 0 0 u11 u12
J.
u13   2 1 4
l 0  0 u22 
u23  =  8 −3 2

Let  21 1
M.
l31 l32 1   0 0 u33   4 11 −1

Multiplying and equating we get:


l × u11 = 2 ⇒ u11 = 2
.,

l × u12 = 1 ⇒ u12 = 1
PT

l × u13 = 4 ⇒ u13 = 4
8 8
l21 × u11 = 8 ⇒ l21 = = =4
DE

u11 2
l21 × u12 + u22 = –3 ⇒ u22 = –3 – l21 × u12 = –3 – 4 × 1 = –7

l21 × u13 + u23 = 2 ⇒ u23 = 2 – l21 × u13 = 2 – 4 × 4 = –14


S
TH

4 4
l31 × u11 = 4 ⇒ l31 = = =2
u11 2
11 − l31 × u12 11 − 2 × 1
MA

9
l31 × u12 + l32 × u22 = 11 ⇒ l32 = = =−
u22 −7 7
 9 
l31 × u13 + l32 × u23 + l × u33 = –1 ⇒ u33 = –1 – l31 × u13 – l32 × u23 = –1 – 2 × 4 –  − ( −14) = –27
 7 
1 0 0
4 2 1 4
1 0  
We get: A=   0 −7 − 14 
 9 
 2 − 1  0 0 −27 
 7 

PAGE-4
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS
LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD
UNIT-I: SYSTEM OF LINEAR EQUATIONS

and the given system can be written as:

1 0 0
4 2 1 4  x  12 
1 0 
0 −7 −14  y  =  20

E.

 9  
2 − 1  0 0 −27  z  33 
 7 

EG
Writing: LV = B, we get

LL
1 0 0
4  V1  12 
 1 0  V2  =  20

CO
 9    
 2 − 1  V3  33 
 7 

which gives V1 = 12 ⇒ V2
J.
4V1 + V2 = 20 ⇒ V2 = 20 – 4 × 12 = –28
M.

9 9
2V1 – V2 + V3 = 33 ⇒ V3 = 33 + (–28) – 2 × 12 = –27
7 7
The solution to the original system is given by:
.,

UX = V
2 4  x   12
PT

1
 0 −7 −14  y  =  −28
    
 0 0 −27   z   −27 
DE

2x + y + 4z = 12
–7y – 14z = –28
S

–27z = –27 ⇒ z =1
TH

14
7y = 28 – 14 × 1 ⇒ y = ⇒ y=2
7
MA

6
2x = 12 – y – 4z = 12 – 2 – 4 × 1 ⇒ x = ⇒ x = 3
2
Example 2
Solve the system of equations using Cholesky’s factorisations.
x1 + x2 + x3 – x4 = 2
x1 – x2 – x3 + 2x4 = 0
4x1 + 4x2 + x3 + x4 = 11
2x1 + x2 + 2x3 – 2x4 = 2

PAGE-5
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS
LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD
UNIT-I: SYSTEM OF LINEAR EQUATIONS

Solution:
The set of equations can be written in the matrix form [A]{x} = {b}
 1 1 1 −1  x1   2 

E.
 1 −1 −1 2   x   0 
   2  =  
4 4 1 1  x3  11

EG
 
 2 1 2 −2   x4   2 
Let us decompose [A] in the form

LL
[A] = [L] [U]

CO
1 0 0 0 u11 u12 u13 u14 
l 1 0 0 0 u u23 u24 
[ L] =  and [U ] = 
21 22
where
l31 l32 1 0 0 0 u33 u34 
  J.  
l41 l42 l43 1   0 0 0 u44 

The product of [L][U] gives


M.

 u11 u12 u13 u14 


l u l21u12 + u22 l21u13 + u23 l21u14 + u24 
[ L][U ] =  
21 11
.,

l31u11 l31u12 + l32 u22 l31u13 + l32 u23 + u33 l31u14 + l32 u24 + u34 
 
l41u11 l41u12 + l42 u22 l41u13 + l42 u23 + l43u33 l41u14 + l42 u24 + l43u34 + u44 
PT

Equating the elements of this matrix to the [A] matrix yields the following equations
u11 = 1 l21u11 = 1 l31u11 = 4 l41u11 = 2
DE

u12 = 1 l21u12 + u22 = –1 l31u12 + l32u22 = 4 l41u12 + l42u22 = 1


u13 = 1 l21u13 + u23 = –1 l31u13 + l32u23 + u33 = 1 l41u13 + l42u23 + l23u33 = 2
u14 = –1 l21u14 + u24 = 2 l31u14 + l32u24 + u34 = 1 l41u14 + l42u24 + l43u34 + u44 = –2
S

By solving these sixteen equations we get


TH

 1 0 0 0 1 1 1 −1
 1 1 0 0  
MA

[ L] =   and [U ] =  0 −2 −2 3 
 4 0 1 0  0 0 −3 5 
   1 
 2 2 − 3 1
1 1
 0 0 0 6 

To solve [A]{x} = {b} we have to solve the two systems


[L]{Y} = {b}
[U]{x} = {Y}

PAGE-6
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS
LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD
UNIT-I: SYSTEM OF LINEAR EQUATIONS

1 0 0 0  y1   2 
1 1 0 0    
   y2  =  0 
 4 0 1 0   y3  11
i.e.,

E.
    
 2 2 3 1   y4   2 
1 1

EG
which gives by forward substitution
y1 = 2, y2 = –2, y3 = 3, y4 = 0

LL
and hence [U]{x} = {y} becomes

CO
1 1 1 −1  x1   2
0 −2 −2 3     
   x2  =  −2
0 0 −3 5   x3   3
    
1   J.
 0 0 0   x4   0
6 

Then by back substitution we obtain


M.

x4 = 0, x3 = –1, x2 = 2, x1 = 1.
Example 3
.,

Solve the system of linear equations using Cholesky’s factorisation method.


2x – 6y + 8z = 24
5x + 4y – 3z = 2
PT

3x + y + 2z = 16
Solution:
DE

 1 0 0 u11 u12 u13   2 −6 8 


l    
 21 1 0  0 u22 u23  =  5 4 −3
l31 l32 1   0 0 u33   3 1 2 
S

 u11 u12 u13   2 −6 8 


TH

l u l21u12 + u22 l21u13 + u23  =  5 4 −3


 21 11   
l31u11 l31u12 + l32 u22 l31u13 + l32 u23 + u33   3 1 2 
MA

u11 = 2, u12 = –6, u13 = 8

5
l21 = = 2.5
u11

3
l31 = = 1.5
u11
u22 = 4 – l21u12 = 19
u23 = –3 – l21u13 = –23

PAGE-7
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS
LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD
UNIT-I: SYSTEM OF LINEAR EQUATIONS

1 − l31u12 10
l32 = =
u22 19

E.
40
l33 = 2 – l31u13 – l32u23 =
19
 1 0 0  2 −6 8 

EG
 0 , U =  0 19 −23
L =  2.5 1
1.5 10
1  0 0 40 
19 

LL
19

1 0 0  v1   24
LV = B ⇒  2.5 0  v2  =  2 

CO
1
   
1.5 10
19
1  v3  16 
⇒ v1 = 24
v2 = 2 – 2.5 × 24 = –58
J.
10 200
v3 = 16 – 1.5 × 24 – ( −58) =
M.
19 19
 24
 2 −6 8   x  
  −58
UX = V ⇒  0 19 −23  y  = 
 200 
.,

 0 0 40 
  
19   z  
 19 
2x – 6y + 8z = 24 (E.1)
PT

19y – 23z = –58 (E.2)


40 200
z= ⇒ z=5
DE

(E.3)
19 19
From Eqs.(E.2) and (E.3), we have

y=3
S
TH

From Eqs.(E.1), (E.2) and (E.3), we get

x =1
MA

2. CROUT’S METHOD

This method is based on the fact that every square matrix A can be expressed as the product of a lower
triangular matrix and an upper triangular matrix, provided all the principle minors of A are non-singular. Also,
such a factorisation, if exists, is unique.
This method is also called triangularisation or factorisation method. Here, we factorise the given matrix
as A = LU, where L is a lower triangular matrix with unit diagonal elements and U is an upper triangular
matrix. Then,
A–1 = (LU)–1 = U–1L–1

PAGE-8
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS
LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD
UNIT-I: SYSTEM OF LINEAR EQUATIONS

Consider the system


a11x1 + a12x2 + a13x3 = b 1
a21x1 + a22x2 + a23x3 = b 2

E.
a31x1 + a32x2 + a33x3 = b 3 (2.35)
The above system can be written as

EG
Ax = b
Let A = LU (2.36)

LL
 l11 0 0 1 u12 u13 
where L = l21 l22 
0  and U = 0 1 u23  (2.37)

CO
l31 l32 l33  0 0 1 

Here, L is a lower triangular matrix and U is an upper triangular matrix with diagonal elements equal to unity.
A = LU ⇒ A–1 = U–1L–1 J. (2.38)
 a11 a12 a13   l11 0 0  1 u12 u13 
A = LU ⇒  a21 a22 a23  = l21 l22 0   0 1 u23 
M.
Now
 a31 a32 a33  l31 l32 l33   0 0 1 
 a11 a12 a13   l11 l11u12 l11u13 
a   l21u13 + l22u23 
.,

or  21 a22 a23  = l21 l21u12 + l22


 a31 a32 a33  l31 l31u12 +l32 l31u13 +l32u23 +l33 
PT

Equating the corresponding elements, we obtain


l11 = a11 l21 = a21 l31 = a31 (2.39)
DE

l11u12 = a12 l11u13 = a13 (2.40)


l21u12 + l22 = a22 l31u12 + l32 = a32 (2.41)
l21u13 + l22u23 = a23 (2.42)
S

and l31u13 + l32u23 + l33 = a33 (2.43)


TH

from (2.40) we find


u12 = a12 /l11 = a12/a11
MA

from (2.41) we obtain


l 22 = a22 – l21u12 (2.44)
l 32 = a32 – l31u12 (2.45)
Equation (2.42) gives
u 23 = (a23 – l21u23)/l22 (2.46)
from the relation (2.43) we get
l 33 = a33 – l31u13 – l32u23 (2.47)
Thus, we have determined all the elements of L and U.
From Eqs.(2.36) and (2.37) we have
LUx = b (2.48)
PAGE-9
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS
LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD
UNIT-I: SYSTEM OF LINEAR EQUATIONS
// Numerical Methods //

Let UX = V
 v1 
v 
V= 

E.
2
where
 
 
vn 

EG
From Eq. (2.48) we have LV = b, which on forward substitution yields V.
From UX = V, we find x (by backward substitution).

LL
Example 4

CO
Solve the following set of equations by Crout’s method:
2x + y + 4z = 12
8x – 3y + 2z = 20
4x + 11y – z = 33 J.
Solution:
M.
2 1 4  x 12 
We have A =  8 −3 2  , X =  y  , B =  20
 4 11 −1  z  33 
.,

AX = B
Let A = LU
PT

 l11 0 0 1 u12 u13 


L = l21 l22 0  U =  0 1 u23 
DE

 l31 l32 l33   0 0 1 

 2 1 4   l11 0 0  1 u12 u13 


8 −3 2  = l 0  0 1 u23 
   21 l22
S

 4 11 −1 l31 l32 l33  0 0 1 


TH

 2 1 4   l11 l11u12 l11u13 


8 −3 2  = l l21u13 + l22u23 
  21 l21u12 + l22
MA


 4 11 −1 l31 l31u12 + l32 l31u13 + l32 u23 + l33 

1
l 11u 12 = 1 ⇒ u12 =
2
4
l 11u 12 = 4 ⇒ u13 = =2
2
 1
l22 + l21u12 = –3 ⇒ l22 = −3 − 8   = −7
 2
 1
l32 + l21u12 = –3 ⇒ l32 = 11 − 4   = 9
 2
PAGE-10
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS
LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD
UNIT-I: SYSTEM OF LINEAR EQUATIONS

2−8× 2
l21u13 + l22u23 = 2 ⇒ u23 = =2
−7
l31u13 + l32u23 + l33 = –1 ⇒ l33 = −1 − 4 × 2 − 9 × 2 = −27

E.
2 0 0 1 12 2
   

EG
L =  8 −7 0 and U =  0 1 2
 4 9 −27   0 0 1 

LL
LV = B

CO
2 0 0 v1  12 
 8 −7  
 0 v2  =  20
 4 9 −27  v3  33 
J.
2v1 = 12 ⇒ v1 = 6
−20 + 8 × 6
M.
8v1 – 7v2 = 20 ⇒ v2 = =4
7
−33 + 4 × 6 + 9 × 4
4v1 + 9v2 – 27v3 = 33 ⇒ v3 = =1
27
.,

V1  6 
V = V2  =  4 ; Ux = V
PT

V3  1 
1 12 2  x  6 
    
DE

 0 1 2   y  =  4
0 0 1   z  1 
1
x+ y + 2z = 6
S

2
TH

y + 2z = 4
z =1
MA

y = 4 – 2× 1
⇒ y=2
1
x=6– × 2–2× 1 ⇒ x = 3
2
Example 5
Solve the following set of equations by using the Crout’s method:
2x1 + x2 + x3 = 7
x1 + 2x2 + x3 = 8
x1 + x2 + 2x3 = 9

PAGE-11
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS
LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD
UNIT-I: SYSTEM OF LINEAR EQUATIONS
// Numerical Methods //

Solution:

2 1 1 x  7
A = 1 2 1  , x =  y  , B = 8 
   

E.
1 1 2  z  9 

EG
Let A = LU

 l11 0 0 1 u12 u13 

LL
L = l21 l22 0  U = 0 1 u23 
l31 l32 l33  0 0 1 

CO
 2 1 1   l11 l11u12 l11u13 
 1 2 1  = l l21u13 + l22u23 
   21 l21u12 + l22
1 1 2 l31 l31u12 + l32
J. l31u13 + l32 u23 + l33 
l11 = 2, l21 = 1, l31 = 1
M.
1 1
u12 = , u13 =
2 2
1 3
l22 = 2 – l21u12 = 2 – 1 × =
.,

2 2
1 1
l32 = 1 – l31u12 = 1 – 1 × =
PT

2 2
1 − l21u13 1
u23 = =
DE

l22 3
1 1 1 4
l33 = 2 – l31u13 – l32u23 = 2 – − × =
2 2 3 3
S

2 0 0  1 1/ 2 1/ 2
 0 , U = 0
 1 1/ 3
TH

L =  1 3/ 2
 1 1/ 2 4 / 3 0 0 1
MA

Ax = B, LU.x = B, Ux = V
2 0 0  v1   7
 
LV = B ⇒  1 3 / 2 0  v2  = 8 

 1 1/ 2 4 / 3 v3  9 
2v1 = 7 ⇒ v1 = 3.5 
3  3.5
v1 + v2 = 8 ⇒ v2 = 3  3 
2  ⇒ V =  
1 4  3 
v1 + v2 + v3 = 9 ⇒ v3 = 3
2 3 
PAGE-12
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS
LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD
UNIT-I: SYSTEM OF LINEAR EQUATIONS

1 1/ 2 1/ 2  x1  3.5
 
Ux = V ⇒ 0 1 1/ 3  x2  = 3 
0 0 1   x3  3 

E.
1 1
x1 + x2 + x3 = 3.5

EG
(E.1)
2 2
1
x2 + x3 = 3 (E.2)

LL
3
x3 = 3 (E.3)

CO
From Eqs.(E.2) and (E.3), we have

x2 = 2

From Eq.(E.1), we get


J.
x1 = 1
M.

-------------------------------------------------------------------------------------------------------------------
.,
PT
DE
S
TH
MA

PAGE-13
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS

E.
EG
LL
CO
J.
M.
.,
PT
DE
S
TH
MA

PAGE-14
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS

E.
EG
LL
CO
-----------------------------------------------------------------------------------------------
J.
M.
.,
PT
DE
S
TH
MA

PAGE-15
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS
LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD
UNIT-I: SYSTEM OF LINEAR EQUATIONS

E.
EG
LL
3. GAUSS-SEIDAL ITERATION METHOD

The Gauss-Seidal method is applicable to predominantly diagonal systems. A predominantly diagonal system

CO
has large diagonal elements. The absolute value of the diagonal element in each case is larger than the sum
of the absolute values of the other elements in that row of the matrix A. For such predominantly diagonal
systems, the Gauss-Seidal method always converges to the correct solution, irrespective of the choice of the
initial estimates. Since the most recent approximations of the variables are used while proceeding to the next
J.
step, the convergence of the Gauss-Seidal method is twice as fast as in Jacobi’s method. The Gauss-Seidal
and Jacobi’s methods converge for any choice of the initial approximations, if in each equation of the system,
M.
the absolute value of the largest coefficient is greater than the sum of the absolute values of the remaining
coefficients. In other words,
n | aij |
∑|a ≤1 i = 1, 2, 3, …, n
.,

i =1 ii |
j ≠1
PT

where the inequality holds in case of at least one equation. Convergence is assured in the Gauss-Seidal
method if the matrix A is diagonally dominant and positive definite. If it is not in a diagonally dominant form,
it should be connected to a diagonally dominant form by row exchanger, before starting the Gauss-Seidal
DE

iterative scheme.
Gauss-Seidal method is also an iterative solution procedure which is an improved version of Jacobi’s
method. The method is also known as the method of successive approximations.
S

Consider the system of linear simultaneous equations


TH

a11x1 + a12x2 + a13x3 = b 1


a21x1 + a22x2 + a23x3 = b 2
a31x1 + a32x2 + a33x3 = b 3 (2.54)
MA

If the absolute value of the largest coefficient in each equation is greater than the sum of the absolute values
of all the remaining coefficients, then the Gauss-Seidal iteration method will converge. If this condition is not
satisfied, then Gauss-Seidal method is not applicable. Here, in Eq.(2.54), we assume the coefficient a11, a22
and a33 are the largest coefficients.
We can rewrite Eq.(2.54) as
1
x1 = (b1 – a12x2 – a13x3)
a11
1
x2 = (b2 – a21x1 – a23x3)
a22

PAGE-16
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS
LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD
UNIT-I: SYSTEM OF LINEAR EQUATIONS

1
x3 = (b3 – a31x1 – a32x2) (2.55)
a33

E.
Let the initial approximations be x10 , x20 and x30 respectively. The following iterations are then carried out.
Iteration 1: The first improvements of x1, x2 and x3 are obtained as

EG
x11 =
1
(
b − a x − a x 0
a11 1 12 2 13 3
)

LL
x21 =
1
(
b − a21 x11 − a23 x30
a22 2
)

CO
(b3 − a31 x11 − a32 x21 )
1
x31 = (2.56)
a33
J.
Iteration 2: The second improvements of x1, x2 and x3 are obtained as
1
x12 =
M.
(b1 – a12x11 – a13x31)
a11
1
x22 = (b2 – a21x12 – a23x31)
a22
.,

1
x32 = (b3 – a31x12 – a32x22) (2.57)
a33
PT

The above iteration process is continued until the values of x1, x2 and x3 are obtained to a pre-assigned or
desired degree of accuracy. In general, the initial approximations are assumed as x10 = x20 = x30 = 0 . Gauss-
DE

Seidal method generally converges for any initial values of x10 , x20 , x30 . The convergence rate of Gauss-Seidal
method is found to be twice to that of Jacobi’s method. Like the Jacobi’s method, Gauss-Seidal method can
also be extended to n linear simultaneous algebraic equations in n unknowns.
S
TH

Example E2.21
Solve the following equations by Gauss-Seidal method.
MA

8x + 2y – 2z = 8
x – 8y + 3z = –4
2x + y + 9z = 12
Solution:
In the above equations:
|8| > |2| + | –2|
| –8| > |1| + |3|
|9| > |2| + |1|
So, the conditions of convergence are satisfied and we can apply Gauss-Seidal method. Then we rewrite the
given equations as follows:

PAGE-17
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS
LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD
UNIT-I: SYSTEM OF LINEAR EQUATIONS

1
x1 = (d1 − b1 y 0 − c1 z 0 )
a1
1
y1 = (d 2 − a2 x1 − c2 z 0 )

E.
b2
1
z1 = (d3 − a3 x1 − b3 y1 )

EG
c3
Let the initial approximations be:

LL
x0 = y0 = z0 = 0
Iteration 1:

CO
d1 8
x1 = = = 1.0
a1 8
1 1
y1 = (d 2 − a2 x1 ) = ( −4 − 1 × 1.0) = 0.625
J.
b2 −8
1 1
z1 = (d 3 − a3 x1 − b3 y1 ) = (12 − 2) = 2 × 1.0 − 1 × 0.625) = 1.042
M.
c3 9
Iteration 2:
1 1
x2 = (d1 − b1 y1 − c1 z1 ) = (8 − 2 × 0.625 − (−2) × 1.042) = 1.104
.,

a1 8
1 1
y2 = (d 2 − a2 x2 − c2 z1 ) = ( −4 − 1 × 1.104 − 3 × 1.042) = 1.029
PT

b2 −8
1 1
z2 = (d3 − a3 x2 − b3 y2 ) = (12 − 2 × 1.104 − 1 × 1.029) = 0.974
DE

c3 9
Iteration 3:
1 1
x3 = (d1 − b1 y2 − c1 z 2 ) = (8 − 2 × 1.029 − ( −2) × 0.974) = 0.986
S

a1 8
TH

1 1
y3 = (d 2 − a2 x3 − c2 z2 ) = ( −4 − 1 × 0.986 − 3 × 0.974) = 0.989
b2 −8
MA

1 1
z3 = (d3 − a3 x3 − b3 y3 ) = (12 − 2 × 0.986 − 1 × 0.989) = 1.004
c3 9
Iteration 4:

1
x4 = (8 − 2 × 0.989 − ( −2) × 1.004) = 1.004
8
1
y4 = ( −4 − 1 × 1.004 − 3 × 1.004) = 1.002
−8
1
z4 = (12 − 2 × 1.004 − 1 × 1.002) = 0.999
9

PAGE-18
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS
LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD
UNIT-I: SYSTEM OF LINEAR EQUATIONS
// Linear System of Equations //

Iteration 5:
1
x5 = (8 − 2 × 1.002 − ( −2) × 0.999) = 0.999
8

E.
1
y5 = ( −4 − 1 × 0.999 − 3 × 0.999) = 1.0
−8
1

EG
z5 = (12 − 2 × 0.999 − 1 × 1.0) = 1.0
9
Iteration 6:

LL
1
x6 = (8 − 2 × 1 + 2 × 1) = 1.0
8

CO
1
y6 = ( −4 − 1 × 1.0 − 3 × 1.0) = 1.0
−8
1
z6 = (12 − 2 × 1.0 − 1 × 1.0) = 1.0
9 J.
Example E2.22
Using the Gauss-Seidal method solve the system of equations correct to three decimal places.
M.

x + 2y + z = 0
3x + y – z = 0
x – y + 4z = 3
.,

Solution:
Rearranging the given equations to give dominant diagonal elements, we obtain
PT

3x + y – z = 0
x + 2y + z = 0
DE

x – y + 4z = 3 (E.1)
Equation (E.1) can be rewritten as
x = (z – y)/3
S

y = –(x + z)/2
z = (3 + x + y)/2 (E.2)
TH

Writing Eq.(E.2) in the form of Gauss-Seidal iterative scheme, we get


x (r +1) = (z (r) – y (r))/3
MA

y (r +1) = – (x (r +1) – z (r))/2


z (r +1) = (3 – x (r +1) + y (r +1))/4
We start with the initial value
x(0) = y(0) = z(0) = 1
The iteration scheme gives
x(1) = (z(0) – y(0))/3 = (1 – 1)/3 = 0
y(1) = (–x(1) – z(0))/2 = (0 – 1)/2 = –0.5
z = (3 – x(1) + y(1))/4 = (3 – 0 – 0)/4 = 0.625
(1)

PAGE-19
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS
LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD
UNIT-I: SYSTEM OF LINEAR EQUATIONS

The second iteration gives


x(2) = (z(1) – y(1))/3 = (0.625 + 0.5)/3 = 0.375
y = (–x(2) – z(1))/2 = (– 0.375 – 0.625)/2 = –0.50
(2)

E.
z(2) = (3 – x(2) + y(2))/4 = (3 – 0.375 – 0.5)/4 = 0.53125
Subsequent iterations result in

EG
x(3) = 0.34375 y(3) = – 0.4375 z(3) = 0.55469
(4)
x = 0.33075 y(4) = – 0.44271 z(4) = 0.55664

LL
x(5) = 0.33312 y(5) = – 0.44488 z(5) = 0.5555
(6)
x = 0.33346 y(6) = – 0.44448 z(6) = 0.55552
Hence, the approximate solution is as follows:

CO
x = 0.333 y = –0.444 z = 0.555

Example E2.23
J.
Solve the following equations by the Gauss-Seidal method.
4x – y + z = 12
– x + 4y – 2z = –1
M.

x – 2y + 4z = 5
Solution:
The iteration formula is
.,

 n 
1 bi − ∑ Aij x j 
xi ← i = 1, 2, …, n
PT

Aii  j =1 
 j ≠ i 
DE

1
Hence x = (12 + y – z)
4
1
y = (–1 + x + 2z)
S

4
TH

1
z = (5 – x + 2y)
4
MA

Choosing the starting values x = y = z = 0, we have the first iteration


1
x = (12 + 0 – 0) = 3
4
1
y = [–1 + 3 + 2(0)] = 0.5
4
1
z = [5 – 3 + 2)0.5) = 0.75
4

PAGE-20
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
The second iteration gives for TY B.Sc., NUMERICAL ANALYSIS
1
x = (12 + 0.5 – 0.75) = 2.9375
4
1
y = [–1 + 2.9375 + 2(0.75)] = 0.8594
4
1
z = (5 – 2.9375 + 2(0.8594)] = 0.9453
4
The third iteration yields

E.
1
x = [12 + 0.8594 – 0.9453] = 2.9785
4

EG
1
y = [–1 + 2.9785 + 2(0.9453)] = 0.9673
4

LL
1
z = (5 – 2.9785 + 2(0.9673)] = 0.9890
4

CO
After five more iterations, we obtain the final values for x, y and z as x = 3, y = 1 and z = 1.
RELAXATION METHOD:

J.
M.
.,
PT
DE
S
TH
MA

PAGE-21
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS

E.
EG
LL
CO
J.
M.
.,
PT
DE
S
TH
MA

PAGE-22
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS

E.
EG
LL
CO
J.
M.
.,
PT
DE
S
TH
MA

PAGE-23
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS

E.
EG
LL
CO
J.
M.
.,
PT
DE
S
TH
MA

PAGE-24
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS
LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD
UNIT-I: SYSTEM OF LINEAR EQUATIONS

1. Solve the following set of simultaneous linear equations by the Cholesky’s factorisation:
(a) 2x – y = 3

E.
–x + 2y – z = –3
–y + z = 2

EG
(b) x+y+z = 7
3x + 3y + 4z = 23

LL
2x + y + z = 10
(c) x + 0.5y = 1

CO
0.5x + y + 0.5z = 2
0.5y + z = 3
(d) 2x + 3y + z = 9
x + 2y + 3z = 6 J.
3x + y + 2z = 8
M.
(e) x – 2y + z = 2
5x + y – 3z = 0
3x + 4y + z = 9
(f) 12x1 – 6x2 – 6x3 + 1.5x4 = 1
.,

–6x1 + 4x2 + 3x3 + 0.5x4 = 2


–6x1 + 3x2 + 6x3 + 1.5x4 = 3
PT

–1.5x1 + 0.5x2 + 1.5x3 + x4 = 4


2. Solve the following set of simultaneous linear equations using the Crout’s method.
DE

(a ) 2x + y = 7
x + 2y = 5
(b) 3x + 2y + 7z = 4
S

2x + 3y + z = 5
TH

3x – 4y + z = 7
(c) x+y+z = 9
2x – 3y + 4z = 13
MA

3x + y + 5z = 40
(d) 3x + y = –1
2x + 4y + z = 7
2y + 5z = 9
(e) 2x + y – z = 6
x – 3y + 5z = 11
–x + 5y + 4z = 13

PAGE-25
LECTURE NOTES BY DR. J.S.V.R. KRISHNA PRASAD
for TY B.Sc., NUMERICAL ANALYSIS
LECTURE NOTES PREPARED BY DR. J.S.V.R. KRISHNA PRASAD
UNIT-I: SYSTEM OF LINEAR EQUATIONS
/
f) 2 x 1 – x2 = 1
–x1 + 2x2 – x3 = 0
–x2 + 2x3 – x4 = 0

E.
–x3 + 2x4 = 1

EG
2.9 Solve the following system of simultaneous linear equations using the Gauss-Seidal method.

LL
(a) 4x – 3y + 5z = 34
2x – y – z = 6

CO
z + y + 4z = 15
(b) 2x – y + 5z = 15
2x + y + z = 7
x + 3y + z = 10 J.
(c) 15x + 3y – 2z = 85
2x + 10y + z = 51
M.

x – 2y + 8z = 5
(d) 10x1 – 2x2 – x3 – x4 = 3
–2x1 + 10x2 – x3 – x4 = 15
.,

–x1 – x2 + 10x3 – 2x4 = 27


–x1 – x2 – 2x3 + 10x4 = –9
PT

(e) 4x1 + 2x2 = 4


2x1 + 8x2 + 2x3 = 0
DE

2x2 + 8x3 + 2x3 = 0


2x3 + 4x4 = 0
(f) 4x1 + 2x2 = 4
S

2x1 + 8x2 + 2x3 = 0


TH

2x2 + 8x3 + 2x3 = 0


2x3 + 4x4 = 14
MA

------------------------------ ALL THE BEST! -------------------------------------------------

PAGE-26

Вам также может понравиться