0% found this document useful (0 votes)
79 views

Lecture 4

The document provides information about Jacobi's method and Gauss-Seidel method for solving systems of linear equations. Jacobi's method uses successive approximations to iteratively solve the system, assuming the coefficient matrix is diagonally dominant. Gauss-Seidel is similar but uses the most recent approximations in subsequent iterations, making it generally faster converging than Jacobi's method. An example demonstrates applying Jacobi's method to iteratively solve a 3x3 system of equations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views

Lecture 4

The document provides information about Jacobi's method and Gauss-Seidel method for solving systems of linear equations. Jacobi's method uses successive approximations to iteratively solve the system, assuming the coefficient matrix is diagonally dominant. Gauss-Seidel is similar but uses the most recent approximations in subsequent iterations, making it generally faster converging than Jacobi's method. An example demonstrates applying Jacobi's method to iteratively solve a 3x3 system of equations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

SOLUTION OF

SYSTEM OF LINEAR
EQUATIONS
Lecture 4: (a) Jacobi's method.
method (general).
(b) Gauss Seidel method.
Jacobi’s Method:

Carl Gustav Jacob Jacobi (1804-1851) gave an indirect method for finding the
solution of a system of linear equations, which is based on the successive better
approximations of the values of the unknowns, using an iterative procedure. The
sufficient condition for the convergence of Gauss Jacobi method to solve A x  b
is that the coefficient matrix A is strictly diagonally row dominant, that is, if
 a11 a12  a1n 
 
a21 a22  a2 n 
A
      , then
 
 an1 an2  ann 
n
aii   aij
j 1
j i
It should be noted that this method makes two assumptions. First, the system of
linear equations to be solved, must have a unique solution and second, there should
not be any zeros on the main diagonal of the coefficient matrix A. In case, there
exist zeros on its main diagonal, then rows must be interchanged to obtain a
coefficient matrix that does not have zero entries on the main diagonal.

Consider a system of n linear equations in n unknowns, which are strictly


diagonally row dominant, as follows:

a11 x1  a12 x2  ..........  a1,n 1 xn 1  a1n xn  b1


a21 x1  a22 x2  ..........  a2, n 1 xn 1  a2 n xn  b2
....................................................................
an1 x1  an 2 x2  ..........  an,n 1 xn 1  ann xn  bn

Since the system is strictly diagonally row dominant, aii  0 .


Therefore, the system of equations is rewritten as

b1 a a a
x1   0. x1  12 x2  .......  1,n 1 xn 1  1n xn
a11 a11 a11 a11
b2 a a a
x2   21 x1  0. x2  .......  2,n 1 xn 1  2 n xn
a22 a22 a22 a22
............................................................................
bn a a a
xn   n1 x1  n 2 x2  .......  n ,n 1 xn 1  0. xn
ann ann ann ann

We then consider an arbitrary initial guess of the solution as

 x   , x   ,................, x    ,
1
0
2
0
n
0

which are row substituted to the right hand side of the rewritten equations to obtain
the first approximation as
1
x1   b1  a12 x20  a13 x30   .......  a1n 1 xn01  a1 n xn0  
1

a11  
1
x2   b2  a21 x10  a23 x30  .......  a2,n 1 xn01  a2 n xn0 
1

a22  

1
xn   bn  an 1 x1 0  an 2 x20  ........  an ,n 1 xn01 
1

ann  

This process is repeated by substituting the first approximate solution

 x   , x   , , x    to the r.h.s of the rewritten equations. By repeated iteration, we


1
1
2
1
n
1

get the required solution up to the desired level of the accuracy.


Example 6. Solve the system of linear equations by Jacobi’s method.

x1  x2  4 x3  9
8 x1  3 x2  2 x3  20
4 x1  11x2  x3  33

Solution: The given system of equations is not diagonally row dominant as


a11  a12  a13 . Therefore, we re-arrange the system as

8 x1  3 x2  2 x3  20
4 x1  11x2  x3  33
x1  x2  4 x3  9

Here, 8  3  2 , 11  4  1 and 4  1  1 . Thus, the system is diagonally row


dominant. We now re-write the system as

1
x1   20  3 x2  2 x3 
8
1
x2   33  4 x1  x3 
11
1
x3   9  x1  x2 
4
 0  0  0
Let the initial guess be x1  1, x2  1, x3  0 .Then, the first approximation to
the solution is given by

 1 1
 x1  (20  3 1  2  0)  2.875
8

 1 1
 x2   33  4 1  0   2.636
 11
 1 1
 x3   9  1  1  1.75
 4
Second approximation

  2 1
 x1   20  3  2.636  2 1.75   3.051
8

  2 1
 x2   33  4  2.875  1.75  2.114
 11
  3 1
 x3   9  2.875  2.636   0.872
 4

Third approximation

x1
3
 3.075
x2
3
 1.969
x3
3
 0.959

Fourth approximation

 x1 4  2.999

  4
 x2  1.969
  4
 x3
  0.989

Fifth approximation

 x15  2.991

  5
 x2  1.999
  5
 x3
  1.008

Sixth approximation
 x1 6  2.997

  6
 x2  2.004
  6
 x3
  1.002
Therefore, x1  3.0, x2  2.0 and x3  1.0, correct to two significant figures.
Gauss Seidel Method

Gauss Seidel iteration method for solving a system of n-linear equations in n-


unknowns is a modified Jacobi’s method. Therefore, all the conditions that is true
for Jacobi’s method, also holds for Gauss Seidel method. As before, the system of
linear equations are rewritten as

b1 a a a
x1   0. x1  12 x2  .......  1,n 1 xn 1  1n xn
a11 a11 a11 a11
b2 a a a
x2   21 x1  0. x2  .......  2,n 1 xn 1  2 n xn
a22 a22 a22 a22
............................................................................
bn a a a
xn   n1 x1  n 2 x2  .......  n ,n 1 xn 1  0. xn
ann ann ann ann

If  x   , x   ,......, x    be
1
0
2
0
n
0
the initial guess of the solution, which is
arbitrary, then the first approximation to the solution is obtained as

1
x1    b1  a12 x20   a13 x30   .......  a1, n 1 xn01  a1 n xn0  
1

a11  
1 
x21  b  a x 1
 a x 0
 .......  a x 0
 a x 0 
a11  
1 21 1 23 3 2, n 1 n 1 2 n n

1
x31   b1  a31 x11  a32 x21  a34 x40   .......  a3,n 1 xn01  a3n xn0  
a11  
.....................................................................................................
1
xn1   b1  an1 x11  an 2 x21  .........  an ,n 1 xn11 
a11  
(1) (1)
Please note, while calculating x2 , the value of x1 is replaced by x1 , not by
x1(0) . . This is the basic difference of Gauss Seidel with Jocobi’s method.
The successive iteration’s are generated by the scheme called iteration formulae of
Gauss-Seidel method, which is as follows:
1
x1
 1
  b1  a12 x2   a13 x3   .......  a1n 1 xn1  a1 n xn  
a11  
1
x2 1  b2  a21 x1 1  a23 x3   .......  a2 n 1 xn1  a2 n xn  
a22  
..........................................................................................
1
xn11  bn 1  an 1,1 x1 1  .......  an 1,n 2 xn21  an 1,n xn  
an 1,n 1  
1 
xn
 1  1  1  1 
 b  a x  a x  .......  a x
ann 
n n 1 1 n 2 2 n , n 1 n 1 

The number of iterations   required depends upon the desired degree of


accuracy.
Example 6. Solve the system of linear equations by Gauss Seidel method.

x1  x2  4 x3  9
8 x1  3 x2  2 x3  20
4 x1  11x2  x3  33

Solution: The given system of equations is not diagonally row dominant as


a11  a12  a13 . Therefore, we re-arrange the system as

8 x1  3 x2  2 x3  20
4 x1  11x2  x3  33
x1  x2  4 x3  9

Here, 8  3  2 , 11  4  1 and 4  1  1 . Thus, the system is diagonally row


dominant. We now re-write the system as

1
 20  3 x2  2 x3 
x1 
8
1
x2   33  4 x1  x3 
11
1
x3   9  x1  x2 
4
 0  0  0
Let the initial guess be x1  1, x2  1, x3  0 . Then, the first
approximation to the solution is given by

1
x1  
1
 20  3  1  2  0   2.875
8
x2  
1 1
11
 1
 0 1
33  4  x1   x3    33  4  2.875  0  1.955
11
1 1
4
 1 1
 1
x3   9  x1   x2    9  2.875  1.955  1.043
4
2nd approximation

 2
 x1 
1
8
20 3  x2
1
 2  x 3
1

1
8
 20  3  1.955  2  1.043  2.972

 2
 x2 
1
11
  1
33  4  x12   x13   33  4  2.972  1.043  2.014
11

 2
 x3 
1
4
9  x2 
2
 x3 
2

1
4
 9  2.972  2.014   1.004

3rd approximation

  3
 x1 
1
8
20  
3  x 2
2  2  x3
2
 
1
8
 20  3  2.014  2  1.004   3.004

  3
 x2 
1
11
  1
33  4  x13  x32    33  4  3.004  1.004   1.999
11

  3
 x3 
1
4
9  x1
 3
 x 2 
 3

1
4
 9  3.004  1.999   0.999

4th approximation

 x1 4   3.00

  4
 x2  2.00
  4
 x3
  1.00

Therefore, x1  3.0, x2  2.0 and x3  1.0 , correct to two significant figure.


Exercises

(1) Use Jacobi’s method to solve the following system of equations, with
x  1,1,1 as initial approximation, correct to 2 significant figures.
 0 T

x  10 y  3z  39
10 x  2 y  5 z  26
4 x  5 y  10 z  47

What is the minimum number of iterations required to get 5 significant digit


accuracy, if 5 digit arithmetic is used.

(Ans: True solution  3, 3, 2 T ; number of iteration required=36)

(2) Do three iterations of Jacobi’s method to solve

2 x  3 y  10 z  22
10 x  2 y  z  9
x  10 y  z  22

with x 0  1, 1,1T as starting vector. What is the minimum number of iterations
required, so that the solution is correct to 4 decimal places.

(Ans: True solution 1, 2, 3T ; number of iteration required =17)

(3) Solve, by Gauss-Seidal iteration method, the system of linear equations

3 x  9 y  2 z  11
4 x  2 y  13z  24
4 x  2 y  z  8

correct up to four significant figures.

(Ans: x  1.423, y  2.131, z  1.956)


(4) Compute the solution of the system of linear equations by Gauss-Seidal
iteration method

6.7 x  1.1 y  2.2 z  20.5


3.1x  9.4 y  1.5 z  22.9
2.1x  1.5 y  8.4 z  28.8
correct up to 3-significant figures.
(Ans: x  1.50, y  2.50, z  3.50 )

(5) Do five iterations of each Jacobi’s and Gauss Seidel method to solve

2 x  3 y  7 z  16
3x  y  z  6
x  5 y  3z  10
with starting initial guess as (x, y, z) = (1,1,1). What is the minimum number of
iterations required, so that the solutions correct to 8 significant figures?

(Ans: True solution: x  1.2, y  0.8, z  1.6 )

You might also like