Ma214 S23 Part05
Ma214 S23 Part05
Ma214 S23 Part05
In Section 4.1.1 and Section 4.1.4 we have discussed methods that obtain exact solution
of a linear system Ax = b in the absence of floating point errors (i.e., when the infi-
nite precision arithmetic is used). Such methods are called the direct methods. The
solution of a linear system can also be obtained using iterative procedures. Such meth-
ods are called iterative methods. There are many iterative procedures out of which
Jacobi and Gauss-Seidel methods are the simplest ones. In this chapter we introduce
these two basic iterative methods and discuss a sufficient condition under which these
methods converge. We introduce the notion of spectral radius of a matrix and prove a
necessary and sufficient condition on the spectral radius of the iterative matrix for the
convergence of a general iterative method to solve system of linear equations.
83
S. Baskar and S. Sivaji Ganesh Spring 2022-23
Section 6.1 Jacobi Method
where aii , i = 1, 2, · · · , n are the diagonal elements of the matrix A. Then the given
system of linear equations can be rewritten as
Dx = Cx + b. (6.1)
If we assume that the right hand side is fully known to us, then the above system can
be solved very easily as D is a diagonal matrix. But the right hand side involves the
unknown vector x and therefore is unknown to us. Rather, if we choose (arbitrarily)
some specific value for x, say x = x(0) , on the right hand side then the resulting system
Dx = Cx(0) + b
can be readily solved for x on the left hand side. Let us call the solution of this system
as x(1) . That is,
Dx(1) = Cx(0) + b.
Now taking x = x(1) on the right hand side of (6.1) we can obtain the value of x on
the left hand side, which we denote as x(2) . Repeat this procedure to get a general
iterative procedure as
Dx(k+1) = Cx(k) + b, k = 0, 1, 2, · · · .
If D is invertible, then the above iterative procedure can be written as
x(k+1) = Bx(k) + c, k = 0, 1, 2, · · · , (6.2)
where B = D−1 C and c = D−1 b. The iterative procedure (6.2) is called the Jacobi
method and the matrix B is called the Jacobi iterative matrix.
Example 6.1.1.
Let us illustrate the Jacobi method in the case of 3 × 3 system
where a11 $= 0, a22 $= 0, and a33 $= 0. We can rewrite the above system of linear
equations as
1
x1 = (b1 − a12 x2 − a13 x3 )
a11
1
x2 = (b2 − a21 x1 − a23 x3 )
a22
1
x3 = (b3 − a31 x1 − a32 x2 )
a33
84
S. Baskar and S. Sivaji Ganesh Spring 2022-23
Section 6.1 Jacobi Method
Let x(0) = (x1 , x2 , x3 )T be an initial guess to the true solution x, which is chosen
(0) (0) (0)
which is the Jacobi iterative sequence given by (6.2) in the case of 3 × 3 system.
Now, the question is that will the sequence of vectors {x(k+1) } generated by the iterative
procedure (6.2) always converge to the exact solution x of the given linear system?
The following example gives a system for which the Jacobi iterative sequence converges
to the exact solution.
Example 6.1.2.
The Jacobi iterative sequence for the system
6x1 + x2 + 2x3 = −2,
x1 + 4x2 + 0.5x3 = 1,
−x1 + 0.5x2 − 4x3 = 0.
is given by 1
(k+1) (k) (k)
x1 = (−2 − x2 − 2x3 ),
6
(k+1) 1 (k) (k)
x2 = (1 − x1 − 0.5x3 ),
4
(k+1) 1 (k) (k)
x3 = − (0 + x1 − 0.5x2 ).
4
The exact solution (upto 6-digit rounding) of this system is
x ≈ (−0.441176, 0.341176, 0.152941).
85
S. Baskar and S. Sivaji Ganesh Spring 2022-23
Section 6.1 Jacobi Method
and so on. We observe from the above computed results that the sequence {x(k) }
seems to be approaching the exact solution.
In the following example we discuss a system for which the Jacobi iterative sequence
does not converge to the exact solution.
Example 6.1.3.
Consider the system
x1 + 4x2 + 0.5x3 = 1,
6x1 + x2 + 2x3 = −2,
−x1 + 0.5x2 − 4x3 = 0.
which is exactly the same as the system discussed in Example 6.1.2 but the only
difference is the interchange of first and second equation. Hence, the exact solution
is same as given in (??). The Jacobi iterative sequence for this system is given by
(k+1) (k) (k)
x1 = (1 − 4x2 − 0.5x3 ),
(k+1) (k) (k)
x2 = (−2 − 6x1 − 2x3 ),
(k+1) 1 (k) (k)
x3 = − (0 + x1 − 0.5x2 ).
4
Choosing the initial guess x(0) = (0, 0, 0), we get
The above two examples shows that the Jacobi sequence need not converge always and
so we need to look for a condition on the system for which the Jacobi iterative sequence
converges to the exact solution.
Define the error in the k th iterate x(k) compared to the exact solution by
e(k) = x − x(k) .
86
S. Baskar and S. Sivaji Ganesh Spring 2022-23
Section 6.1 Jacobi Method
e(k+1) = Be(k) ,
where B is as defined in (6.2). Using any vector norm and the matrix norm subordinate
to it in the above equation, we get
Thus, when &B& < 1, the iteration method (6.2) always converges for any initial guess
x(0) .
Again the question is
“what are all the matrices A for which the corresponding matrices B in (6.2) have the
property &B& < 1, for some matrix norm subordinate to some vector norm?”
We would like an answer that is ‘’easily verifiable” using the entries of the matrix
A. One such class of matrices are the diagonally dominant matrices, which we define
now.
We now prove the sufficient condition for the convergence of the Jacobi method. This
theorem asserts that if A is a diagonally dominant matrix, then B in (6.2) of the Jacobi
method is such that &B&∞ < 1.
87
S. Baskar and S. Sivaji Ganesh Spring 2022-23
Section 6.1 Jacobi Method
Proof.
Since A is diagonally dominant, the diagonal entries are all non-zero and hence the
Jacobi iterating sequence x(k) given by
, n
-
1 +
(6.3)
(k+1) (k)
xi = bi − aij xj , i = 1, 2, · · · , n.
aii j=1,j"=i
which gives
n .
+ .
. aij . (k)
. . &e &∞ . (6.5)
(k+1)
|ei | ≤ . aii .
j=1
j"=i
Define n . .
+ . aij .
µ = max . .
. aii . . (6.6)
1≤i≤n
j=1
j"=i
Then
(6.7)
(k+1)
|ei | ≤ µ&e(k) &∞ ,
which is true for all i = 1, 2, · · · , n. Therefore, we have
The matrix A is diagonally dominant if and only if µ < 1. Then iterating the last
inequality we get
&e(k+1) &∞ ≤ µk+1 &e(0) &∞ . (6.9)
Therefore, if A is diagonally dominant, the Jacobi method converges.
Remark 6.1.6.
Observe that the system given in Example 6.1.2 is diagonally dominant, whereas
the system in Example 6.1.3 is not so.
88
S. Baskar and S. Sivaji Ganesh Spring 2022-23
Section 6.2 Gauss-Seidel Method
Example 6.2.1.
Consider the 3 × 3 system
When the diagonal elements of this system are non-zero, we can rewrite the above
system as
1
x1 = (b1 − a12 x2 − a13 x3 ),
a11
1
x2 = (b2 − a21 x1 − a23 x3 ),
a22
1
x3 = (b3 − a31 x1 − a32 x2 ).
a33
Let
(0) (0) (0)
x(0) = (x1 , x2 , x3 )T
be an initial guess to the true solution x. Define a sequence of iterates (for k =
0, 1, 2, · · · ) by
(k+1) 1 (k) (k)
x1 = (b1 − a12 x2 − a13 x3 ),
a11
1
(k+1) (k+1) (k)
x2 = (b2 − a21 x1 − a23 x3 ), (GSS)
a22
1
).
(k+1) (k+1) (k+1)
x3 = (b3 − a31 x1 − a32 x2
a33
This sequence of iterates is called the Gauss-Seidel iterative sequence and the
method is called Gauss-Seidel Iteration method.
Remark 6.2.2.
Compare (JS) and (GSS).
89
S. Baskar and S. Sivaji Ganesh Spring 2022-23
Section 6.2 Gauss-Seidel Method
Proof.
Since A is diagonally dominant, all the diagonal elements of A are non-zero, and
hence the Gauss-Seidel iterative sequence given by
/ i−1 n
0
1 + +
(6.10)
(k+1) (k+1) (k)
xi = bi − aij xj − aij xj , i = 1, 2, · · · , n.
aii j=1 j=i+1
with the convention that α1 = βn = 0. Note that µ given in (6.6) can be written as
µ = max (αi + βi )
1≤i≤n
(6.12)
(k+1)
|ei | ≤ αi &e(k+1) &∞ + βi &e(k) &∞ , i = 1, 2, · · · , n.
90
S. Baskar and S. Sivaji Ganesh Spring 2022-23
Section 6.3 Stopping Criteria
Since µ < 1, we have αl < 1 and therefore the above inequality gives
βl
&e(k+1) &∞ ≤ &e(k) &∞ . (6.14)
1 − αl
Define
βi
η = max . (6.15)
1≤i≤n 1 − αi
βi αi [1 − (αi + βi )] αi
(αi + βi ) − = ≥ [1 − µ] ≥ 0, (6.17)
1 − αi 1 − αi 1 − αi
we have
η ≤ µ < 1. (6.18)
Thus, when the coefficient matrix A is diagonally dominant, Gauss-Seidel method
converges.
Remark 6.2.4.
A careful observation of the proof of the above theorem reveals that the Gauss-
Seidel method converges faster than the Jacobi method by comparing (6.18) and
(6.9).
e = x − x∗ . (6.19)
Recall from Chapter 3 that the mathematical error is due to the approximation made
in the numerical method where the computation is done without any floating-point
approximation ( ie., without rounding or chopping). Observe that to get the mathe-
matical error, we need to know the exact solution. But an astonishing feature of linear
systems (which is not there in nonlinear equations) is that this error can be obtained
91
S. Baskar and S. Sivaji Ganesh Spring 2022-23
Section 6.3 Stopping Criteria
exactly without the knowledge of the exact solution. To do this, we first define the
residual vector
r = b − Ax∗ (6.20)
Ae = r. (6.21)
This shows that the error e satisfies a linear system with the same coefficient matrix
A as in the original system Ax = b, but a different right hand side vector. Thus, by
having the approximate solution x∗ in hand, we can obtain the error e without knowing
the exact solution x of the system.
In the iterative methods discussed above, we have a sequence {x(k) } that is expected
to converge to the exact solution of the given linear system. In practical situation, we
cannot go on computing the x(k) indefinitely and we need to terminate our computation
once the value of x(k) reaches a desired accuracy for a sufficiently large k. That is, when
the error
&e(k) & = &x − x(k) &
in the k th iteration in some norm is sufficiently small. Since, we do not know the exact
solution x, the error given above cannot be computed easily and needs another linear
system (6.21) to be solved. Therefore, the question is how to decide where we have to
stop our computation (without solving this linear system)? In other words, how do we
know whether the computed vector x(k) at the k th iteration is sufficiently close to the
exact solution or not. This can be decided by looking at the residual error vector of
the k th iteration defined as
Thus, for a given sufficiently small positive number $, we stop the iteration if
92
S. Baskar and S. Sivaji Ganesh Spring 2022-23
Section 6.4 Exercises
6.4 Exercises
Iterative Methods
1. Let A be a diagonally dominant matrix such that aij = 0 for every i, j ∈
{1, 2, · · · , n} such that i > j + 1. Does naive Gaussian elimination method
preserve the diagonal dominance? Justify your answer.
2. Let A be a diagonally dominant matrix. Show that all the diagonal elements of
A are non-zero (i.e., aii $= 0 for i = 1, 2, · · · , n.). As a consequence, the iterating
sequences of Jacobi and Gauss-Seidel methods are well-defined if the coefficient
matrix A in the linear system Ax = b is a diagonally dominant matrix.
3. Write the formula for the Jacobi iterative sequence of the system
Without performing the iterations, show that the sequence does not converge to
the exact solution of this system. Can you make a suitable interchange of rows
so that the resulting system is diagonally dominants?
4. Find the n×n matrix B and the n-dimensional vector c such that the Gauss-Seidel
method can be written in the form
x(k+1) = Bx(k) + c, k = 0, 1, 2, · · ·
93
S. Baskar and S. Sivaji Ganesh Spring 2022-23