You are on page 1of 24

THE JACOBI AND GAUSS SEIDELL

Siti Hajar Binti Muhamad Zaker Shah (130476)


Siti Hanum Binti Azmi (130163)
Siti Nur Farahiyah Binti Shahrudden (130478)
Soon Lang Feng (130482)
THE JACOBI METHOD
Invented by Carl Gustav Jacob Jacobi (1804-1851)
Iterative method to solve Ax = b
Make two assumptions
(1) System given has unique solution
(2) Coefficient matrix has no zeros on its main diagonal
If any diagonal entries are zero, then rows or columns must be
interchanged
HOW TO DO JACOBI METHOD?

Step 1 make an initial approximation of the solution


Step 2 - substitute these values of xi into right hand side of the
equation to obtain first approximation

By completing these 2 steps, one iteration has been performed

For 2nd iterations, substitute the firsts approximations x-


values into the right hand side equation
By repeated equations, sequence of approximations will be
formed that often converges to the actual solution
Example:
Use the Jacobi method to approximate the solution of the
following system of linear equations.
4x1 - x2 - x3 = 3
-2x1 + 6x2 + x3 = 9
-x1 + x2 + 7x3 = -6

Step 1:
3 1 1
x1 = + x2 + x3
4 4 4
3 1 1
x2 = + x1 - x3
2 3 6
6 1 1
x3 = - + x1 - x2
7 7 7

Since we do not know the actual solutions, choose


x1 = 0, x2 = 0, x3 = 0
as a convenient initial approximation.
Step 2:
3 1 1
X1 = + (0) + (0) = 0.750
4 4 3
3 1 1
X2 = + (0) - (0) = 1.500
2 3 6
6 1 1
X3 = - + (0) - (0) -0.857
7 7 7

n 0 1 2 3 4 5 6 7 8
X1 0.000 0.750 0.911 0.982 0.992 0.999 0.999 1.000 1.000
X2 0.000 1.500 1.893 1.964 1.994 1.997 2.000 2.000 2.000
X3 0.000 -0.857 -0.964 -0.997 -0.997 -1.000 -1.000 -1.000 -1.000

Since the last two columns are identical, we conclude that the solution is
x1 = 1.000, x2 = 2.000, x3 = -1.000
Diagonally Dominant Matrix

A matrix of n x n is diagonally

dominant if | | | | for

= = 1,2,3, , where denote
the entry th row and th column
Jacobi Iteration Theorem
Suppose that A is a strictly diagonally
dominant matrix. Then AX = B has a unique
solution X = P. By the Jacobi Iteration will
produce a sequence of vectors { } that
will converge to P for any choice of the
starting vector 0 .

Thistheorem gives a sufficient condition


for Jacobi iteration to converge.
Example 2

Consider the system of equations

2 + + 5 = 15
4 8 + = 21
4 + = 7
Rewriting the equations
in the form

2 + + 5 = 15 15 + + 5
=
2

4 8 + = 21 21 + 4 +
=
8

4 + = 7 = 7 4 +
(0 ,0 ,0 ) = (1,2,2)
Substitude 0 =1, 0 =2, and 0 =2 into
the equations to get the new values of 1 ,
1 , and 1
15 + (2) + 5(2)
1 = = 1.5
2
21 + 4(1) + (2)
1 = = 3.375
8
1 = 7 4 1 + 2 = 5
Divergent Jacobi Iteration
k
0 1.0 2.0 2.0
1 -1.5 3.375 5.0
2 6.6875 2.5 16.375
3 34.6875 8.014375 -17.24
4 -46.592813 17.81375 -123.735625
5 -307.932188 36.138360 211.185002
6 502.393325 124.942969 1202.590392

The coefficient matrix of the linear system is
not strictly diagonally dominant because

Inrow 1: | 2| < |1|+|5|


In row 2: | 8| > |4|+|1|
In row 3: |1| < |4|+| 1|.

Thus we get the solution of divergent


sequence
GAUSS-SEIDEL METHOD
Known as the Liebmann method or the method of
successive displacement
Is an iterative method for solving the equations of the
linear system of equations one at a time in sequence
Extremely similar to the Jacobi Method
Uses previously computed results as soon as they are
available.
Gauss-Seidel Method : Example 1
Consider the following system of linear
equation.
4x1 - x2 x3 = 3
-2x1 + 6x2 + x3 = 9
-x1 + x2 + 7x3 = -6

3 1 1
x1 = + x2 + x3
4 4 4
3 1 1
x2 = + x1 - x3
2 3 6
6 1 1
x3 = - + x1- x2
7 7 7
3 1 1
x1 = + x2 + x3
4 4 4
3 1 1
x2 = + x1 - x3
2 3 6
6 1 1
x3 = - + x1- x2
7 7 7

For n=1,
3 1 1
x1 = + (0) + (0) =0.75
4 4 4
3 1 1
x2 = + (0.75) - (0) = 1.75
2 3 6

6 1 1
x3 = - + (0.75)- (1.75) = -1
7 7 7
3 1 1
x1 = + x2 + x3
4 4 4
3 1 1
x2 = + x1 - x3
2 3 6
6 1 1
x3 = - + x1- x2
7 7 7

For n=2,
3 1 1
x1 = + (1.75) + (1) =0.938
4 4 4
3 1 1
x2 = + (0.938) - (-1) =1.979
2 3 6

6 1 1
x3 = - + (0.938)- (1.979) = -1.006
7 7 7
n 0 1 2 3 4 5
x1 0.000 0.750 0.938 0.993 1.000 1.000
x2 0.000 1.750 1.979 1.999 2.000 2.000
x3 0.000 -1.000 -1.006 -1.001 -1.000 -1.000

x1 = 1

x2 = 2

x3 = -1
Gauss-Seidel Method : Example 2

Consider the following system of linear equation.

41 2 + 23 = 12
31 + 82 23 = -20
1 + 2 + 33 = 10

Initial guess 1 = 0, 2 = 0, 3 = 0 .
Step 1: Step 2:

12+2 23 12+02(0)
1 = 1 = =3
4 4

2031 +23 20 3 3 +2(0)


2 = 2 = = -3.625
8 8

101 2 1000
3 = 3 = = 3.542
3 3
Step 3:
12+ 3.625 2(3.542)
1 = = 0.323
4
20 3 0.323 +2(3.542)
2 = = -1.736
8
100.323(1.736)
3 = = 3.804
3

n 0 1 2 3 4 5 6
1 0 3 0.323 0.664 0.695 0.686 0.686
2 0 -3.625 -1.736 -1.798 -1.832 -1.829 -1.829
3 0 3.542 3.804 3.711 3.712 3.714 3.714
Since the last two columns are identical, we conclude that
the solution is
x1 = 0.686, x2 = -1.829, x3 = 3.714
THANK YOU!!

You might also like