Professional Documents
Culture Documents
MAFE208IU L5 - Linear Systems of Equations - Part 2
MAFE208IU L5 - Linear Systems of Equations - Part 2
Systems of Equations
Lecture 2
Gauss-Seidel iteration Method
Gauss-Seidel Method
A set of n equations and n unknowns:
a11 x1 a12 x2 a13 x3 ... a1n xn b1
a21 x1 a22 x2 a23 x3 ... a2n xn b2
……
an1x1 an 2 x2 an3 x3 ... ann xn bn
b2 a21 x1 a23 x3 a2 n xn
x2 From equation 2
a22
…..
bn 1 an 1,1 x1 an 1,2 x2 an 1,n 2 xn 2 an 1,n xn
xn 1 From equation n-1
an 1,n 1
bn an1 x1 an 2 x2 an,n 1 xn 1
xn From equation n
ann
MAFE208IU-L5 3
Algorithm for Gauss-Seidel Method
Let x ( k ) ( x1( k ) , x2( k ) ,...., xn( k ) ) be a given approximate value,
k 0,1, 2,..., we compute the new approximate value x ( k 1) :
Ea max{| x new
i x old
i |, i 1, 2,..., n}
new
x x old
a max{ i
new
i
, i 1, 2,..., n}
xi
MAFE208IU-L5 8
Comments on Gauss-Seidel
• Disadvantages:
– it may not converge
– When it converged, it did so very slowly
• Advantages:
– When matrix is very sparse (most elements are
zero), elimination methods waste large amount of
computer memory by storing zeros
– Gauss-Seidel method saves memory because only
nonzero coefficients are involved in the structure
of equations
MAFE208IU-L5 9
Exercise
Using Gauss-Seidel iteration method, solve the following system
3 x1 x2 5
2 x2 x3 1
x2 5 x3 2 x4 25
x3 6 x4 x5 16
x4 3x5 11
Use x (0) =(0,0,0,0,1), stopping condition: | Ea | 0.02
MAFE208IU-L5 10
Quiz 2
2) Using Gauss-Seidel
mn: last two digits of your iteration method, solve the
Student ID number following system