GAUSS-SEIDEL METHOD
Introduction
In numerical linear algebra, the Gauss–Seidel method, also known
as the Liebmann method or the method of successive displacement,
is an iterative method used to solve a linear system of equations.
The Gauss-Seidel method is a technique for solving the n equations
of the linear system of equations, A x = b, one at a time in sequence,
and uses previously computed results as soon as they are available.
The new iterate depends upon all previously computed
components.
Introduction
Gauss–Seidel method is an improved form of Jacobi method. This
method is named after Carl Friedrich Gauss (Apr 1777–Feb 1855)
and Philipp Ludwig von Seidel (Oct 1821–Aug 1896). The reason the
Gauss–Seidel method is commonly known as the successive
displacement method is because the second unknown is
determined from the first unknown in the current iteration, the
third unknown is determined from the first and second unknowns,
etc.
Applicable for sparse matrix, i.e., one in which most of the elements
are zeros.
The Gauss-Seidel method is used frequently in the solution of
Laplace’s and Poissons’s partial differential equations.
ILLUSTRATION
Solve the linear system of equations:
𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 = 𝑏1
𝑎21 𝑥1 + 𝑎22 𝑥2 + 𝑎23 𝑥3 = 𝑏2
𝑎31 𝑥1 + 𝑎32 𝑥2 + 𝑎33 𝑥3 = 𝑏3
Beginning with initial guess for the unknowns, 𝑥1 (0) 𝑥2 (0) 𝑥3 (0)
𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 = 𝑏1
𝑏1 − 𝑎12 𝑥2 − 𝑎13 𝑥3
𝑥1 =
𝑎11
𝑎21 𝑥1 + 𝑎22 𝑥2 + 𝑎23 𝑥3 = 𝑏2
𝑏2 − 𝑎21 𝑥1 − 𝑎23 𝑥3
𝑥2 =
𝑎22
𝑎31 𝑥1 + 𝑎32 𝑥2 + 𝑎33 𝑥3 = 𝑏3
𝑏3 − 𝑎31 𝑥1 − 𝑎32 𝑥2
𝑥3 =
𝑎33
Beginning with initial guess for the unknowns: 𝑥1 (0) 𝑥2 (0) 𝑥3 (0)
𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 = 𝑏1
𝑏1 − 𝑎12 𝑥2 − 𝑎13 𝑥3
𝑥1 =
𝑎11
𝑎21 𝑥1 + 𝑎22 𝑥2 + 𝑎23 𝑥3 = 𝑏2
𝑏2 − 𝑎21 𝑥1 − 𝑎23 𝑥3
𝑥2 =
𝑎22
𝑎31 𝑥1 + 𝑎32 𝑥2 + 𝑎33 𝑥3 = 𝑏3
𝑏3 − 𝑎31 𝑥1 − 𝑎32 𝑥2
𝑥3 =
𝑎33
Beginning with initial guess for the unknowns: 𝑥1 (0) 𝑥2 (0) 𝑥3 (0)
𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 = 𝑏1
𝑏1 − 𝑎12 𝑥2 − 𝑎13 𝑥3
𝑥1 =
𝑎11
𝑎21 𝑥1 + 𝑎22 𝑥2 + 𝑎23 𝑥3 = 𝑏2
𝑏2 − 𝑎21 𝑥1 − 𝑎23 𝑥3
𝑥2 =
𝑎22
𝑎31 𝑥1 + 𝑎32 𝑥2 + 𝑎33 𝑥3 = 𝑏3
𝑏3 − 𝑎31 𝑥1 − 𝑎32 𝑥2
𝑥3 =
𝑎33
A. Iterative formula
𝑛 𝑛
1
𝑥𝑖 (𝑘+1)
= 𝑏𝑖 − 𝑎𝑖𝑗 𝑥𝑗 (𝑘+1) − 𝑎𝑖𝑗 𝑥𝑗 (𝑘)
𝑎𝑖𝑖
𝑗<𝑖 𝑗>𝑖
B. Conditions for convergence
1) The coefficient matrix must be diagonally dominant.
Diagonally dominant matrix – is one in which the magnitude of the
element on the diagonal in each row is larger than the sum of the
magnitudes of all the other elements in that row.
𝑛
𝑎𝑖𝑖 ≥ 𝑎𝑖𝑗
𝑎𝑙𝑙 𝑗≠𝑖
2) If a set of equations does not possess diagonal dominance in its
present form, it is frequently possible to rearrange the set so that
the coefficient matrix is diagonally dominant.
C. Example: Solve using Gauss-Seidel method
4𝑥1 − 𝑥2 − 𝑥3 = 110
𝑥1 −4𝑥2 = −250
2𝑥1 − 4𝑥3 = −140
Diagonally dominant
C. Example: Solve using Gauss-Seidel method
4𝑥1 − 𝑥2 − 𝑥3 = 110
𝑥1 −4𝑥2 = −250
2𝑥1 − 4𝑥3 = −140
k 1
𝑥1 = 110 + 𝑥2 + 𝑥3
4
C. Example: Solve using Gauss-Seidel method
4𝑥1 − 𝑥2 − 𝑥3 = 110
𝑥1 −4𝑥2 = −250
2𝑥1 − 4𝑥3 = −140
k 1 1
𝑥1 = 110 + 𝑥2 + 𝑥3 𝑥2 = 250 + 𝑥1
4 4
C. Example: Solve using Gauss-Seidel method
4𝑥1 − 𝑥2 − 𝑥3 = 110
𝑥1 −4𝑥2 = −250
2𝑥1 − 4𝑥3 = −140
k 1 1 1
𝑥1 = 110 + 𝑥2 + 𝑥3 𝑥2 = 250 + 𝑥1 𝑥3 = 140 + 2𝑥1
4 4 4
C. Example: Solve using Gauss-Seidel method
4𝑥1 − 𝑥2 − 𝑥3 = 110
𝑥1 −4𝑥2 = −250
2𝑥1 − 4𝑥3 = −140
k 1 1 1
𝑥1 = 110 + 𝑥2 + 𝑥3 𝑥2 = 250 + 𝑥1 𝑥3 = 140 + 2𝑥1
4 4 4
0 0.0 0.0 0.0
C. Example: Solve using Gauss-Seidel method
4𝑥1 − 𝑥2 − 𝑥3 = 110
𝑥1 −4𝑥2 = −250
2𝑥1 − 4𝑥3 = −140
k 1 1 1
𝑥1 = 110 + 𝑥2 + 𝑥3 𝑥2 = 250 + 𝑥1 𝑥3 = 140 + 2𝑥1
4 4 4
0 0.0 0.0 0.0
1
C. Example: Solve using Gauss-Seidel method
4𝑥1 − 𝑥2 − 𝑥3 = 110
𝑥1 −4𝑥2 = −250
2𝑥1 − 4𝑥3 = −140
k 1 1 1
𝑥1 = 110 + 𝑥2 + 𝑥3 𝑥2 = 250 + 𝑥1 𝑥3 = 140 + 2𝑥1
4 4 4
0 0.0 0.0 0.0
1 27.50
C. Example: Solve using Gauss-Seidel method
4𝑥1 − 𝑥2 − 𝑥3 = 110
𝑥1 −4𝑥2 = −250
2𝑥1 − 4𝑥3 = −140
k 1 1 1
𝑥1 = 110 + 𝑥2 + 𝑥3 𝑥2 = 250 + 𝑥1 𝑥3 = 140 + 2𝑥1
4 4 4
0 0.0 0.0 0.0
1 27.50 69.38
C. Example: Solve using Gauss-Seidel method
4𝑥1 − 𝑥2 − 𝑥3 = 110
𝑥1 −4𝑥2 = −250
2𝑥1 − 4𝑥3 = −140
k 1 1 1
𝑥1 = 110 + 𝑥2 + 𝑥3 𝑥2 = 250 + 𝑥1 𝑥3 = 140 + 2𝑥1
4 4 4
0 0.0 0.0 0.0
1 27.50 69.38 48.75
C. Example: Solve using Gauss-Seidel method
4𝑥1 − 𝑥2 − 𝑥3 = 110
𝑥1 −4𝑥2 = −250
2𝑥1 − 4𝑥3 = −140
k 1 1 1
𝑥1 = 110 + 𝑥2 + 𝑥3 𝑥2 = 250 + 𝑥1 𝑥3 = 140 + 2𝑥1
4 4 4
0 0.0 0.0 0.0
1 27.50 69.38 48.75
2
C. Example: Solve using Gauss-Seidel method
4𝑥1 − 𝑥2 − 𝑥3 = 110
𝑥1 −4𝑥2 = −250
2𝑥1 − 4𝑥3 = −140
k 1 1 1
𝑥1 = 110 + 𝑥2 + 𝑥3 𝑥2 = 250 + 𝑥1 𝑥3 = 140 + 2𝑥1
4 4 4
0 0.0 0.0 0.0
1 27.50 69.38 48.75
2 57.03 76.76 63.52
With tolerance = 0.1
C. Example: Solve using Gauss-Seidel method
4𝑥1 − 𝑥2 − 𝑥3 = 110
𝑥1 −4𝑥2 = −250
2𝑥1 − 4𝑥3 = −140
k 1 1 1
𝑥1 = 110 + 𝑥2 + 𝑥3 𝑥2 = 250 + 𝑥1 𝑥3 = 140 + 2𝑥1
4 4 4
0 0.0 0.0 0.0
1 27.50 69.38 48.75
2 57.03 76.76 63.52
3 62.57 78.14 66.28
4 63.61 78.40 66.80
5 63.80 78.45 66.90
Assignment
Discuss in detail Jacobi method.
Discuss the difference between Gauss-Seidel
and Jacobi method.
Due: Next meeting