7.3 the jacobi and gauss-seidel iterative methodszxu2/acms40390f15/lec-7.3.pdfย ยท main idea of...
TRANSCRIPT
1
7.3 The Jacobi and Gauss-Seidel Iterative Methods
2
The Jacobi Method Two assumptions made on Jacobi Method:
1.The system given by ๐๐11๐ฅ๐ฅ1 + ๐๐12๐ฅ๐ฅ2 + โฏ๐๐1๐๐๐ฅ๐ฅ๐๐ = ๐๐1 ๐๐21๐ฅ๐ฅ1 + ๐๐22๐ฅ๐ฅ2 + โฏ๐๐2๐๐๐ฅ๐ฅ๐๐ = ๐๐2
โฎ ๐๐๐๐1๐ฅ๐ฅ1 + ๐๐๐๐2๐ฅ๐ฅ2 + โฏ๐๐๐๐๐๐๐ฅ๐ฅ๐๐ = ๐๐๐๐
Has a unique solution. 2.The coefficient matrix ๐ด๐ด has no zeros on its main diagonal, namely, ๐๐11, ๐๐22, โฆ , ๐๐๐๐๐๐ are nonzeros.
3
Main idea of Jacobi To begin, solve the 1st equation for ๐ฅ๐ฅ1, the 2nd equation for ๐ฅ๐ฅ2 and so on to obtain the rewritten equations:
๐ฅ๐ฅ1 =1๐๐11
(๐๐1 โ ๐๐12๐ฅ๐ฅ2 โ ๐๐13๐ฅ๐ฅ3 โ โฏ๐๐1๐๐๐ฅ๐ฅ๐๐)
๐ฅ๐ฅ2 =1๐๐22
(๐๐2 โ ๐๐21๐ฅ๐ฅ1 โ ๐๐23๐ฅ๐ฅ3 โ โฏ๐๐2๐๐๐ฅ๐ฅ๐๐)
โฎ
๐ฅ๐ฅ๐๐ =1๐๐๐๐๐๐
(๐๐๐๐ โ ๐๐๐๐1๐ฅ๐ฅ1 โ ๐๐๐๐2๐ฅ๐ฅ2 โ โฏ๐๐๐๐,๐๐โ1๐ฅ๐ฅ๐๐โ1)
Then make an initial guess of the solution ๐๐(0) = (๐ฅ๐ฅ1(0), ๐ฅ๐ฅ2
(0), ๐ฅ๐ฅ3(0), โฆ ๐ฅ๐ฅ๐๐
(0)). Substitute these values into the right hand side the of the rewritten equations to obtain the first approximation, ๏ฟฝ๐ฅ๐ฅ1
(1), ๐ฅ๐ฅ2(1), ๐ฅ๐ฅ3
(1), โฆ ๐ฅ๐ฅ๐๐(1)๏ฟฝ.
This accomplishes one iteration.
4
In the same way, the second approximation ๏ฟฝ๐ฅ๐ฅ1(2), ๐ฅ๐ฅ2
(2), ๐ฅ๐ฅ3(2), โฆ ๐ฅ๐ฅ๐๐
(2)๏ฟฝ is computed by substituting the first approximationโs value ๏ฟฝ๐ฅ๐ฅ1
(1), ๐ฅ๐ฅ2(1), ๐ฅ๐ฅ3
(1), โฆ ๐ฅ๐ฅ๐๐(1)๏ฟฝ into the right hand side of the rewritten equations.
By repeated iterations, we form a sequence of approximations ๐๐(๐๐) =
๏ฟฝ๐ฅ๐ฅ1(๐๐), ๐ฅ๐ฅ2
(๐๐), ๐ฅ๐ฅ3(๐๐), โฆ ๐ฅ๐ฅ๐๐
(๐๐)๏ฟฝ๐ก๐ก
, ๐๐ = 1,2,3, โฆ
The Jacobi Method. For each ๐๐ โฅ 1, generate the components ๐ฅ๐ฅ๐๐(๐๐) of
๐๐(๐๐) from ๐๐(๐๐โ๐๐) by
๐ฅ๐ฅ๐๐(๐๐) =
1๐๐๐๐๐๐
โฃโขโขโขโก๏ฟฝ(โ๐๐๐๐๐๐๐ฅ๐ฅ๐๐
(๐๐โ1))๐๐
๐๐=1,๐๐โ ๐๐
+ ๐๐๐๐
โฆโฅโฅโฅโค
, for ๐๐ = 1,2, , โฆ๐๐
5
Example. Apply the Jacobi method to solve 5๐ฅ๐ฅ1 โ 2๐ฅ๐ฅ2 + 3๐ฅ๐ฅ3 = โ1โ3๐ฅ๐ฅ1 + 9๐ฅ๐ฅ2 + ๐ฅ๐ฅ3 = 2 2๐ฅ๐ฅ1 โ ๐ฅ๐ฅ2 โ 7๐ฅ๐ฅ3 = 3
Continue iterations until two successive approximations are identical when rounded to three significant digits. Solution
๐๐ ๐๐ = 0 ๐๐ = 1 ๐๐ = 2 ๐๐ = 3 ๐๐ = 4 ๐๐ = 5 ๐๐ = 6 ๐ฅ๐ฅ1
(๐๐) 0.000 -0.200 0.146 0.192
๐ฅ๐ฅ2(๐๐) 0.000 0.222 0.203 0.328
๐ฅ๐ฅ2(๐๐) 0.000 -0.429 -0.517 -0.416
6
When to stop: 1. ||๐๐(๐๐)โ๐๐(๐๐โ1)||
||๐๐(๐๐)||< ๐๐; or ๏ฟฝ๏ฟฝ๐๐(๐๐) โ ๐๐(๐๐โ1)๏ฟฝ๏ฟฝ < ๐๐. Here ๐๐ is
a given small number . Another stopping criterion: ||๐๐(๐๐)โ๐๐(๐๐โ1)||
||๐๐(๐๐)||
Definition 7.1 A vector norm on ๐ ๐ ๐๐ is a function, || โ ||, from ๐ ๐ ๐๐ to ๐ ๐ with the properties:
(i) ||๐๐|| โฅ 0 for all ๐๐ โ ๐ ๐ ๐๐ (ii) ๏ฟฝ|๐๐|๏ฟฝ = 0 if and only if ๐๐ = ๐๐ (iii)๏ฟฝ|๐ผ๐ผ๐๐|๏ฟฝ = |๐ผ๐ผ|๏ฟฝ|๐๐|๏ฟฝ for all ๐ผ๐ผ โ ๐ ๐ and ๐๐ โ ๐ ๐ ๐๐ (iv) ๏ฟฝ|๐๐ + ๐๐|๏ฟฝ โค ๏ฟฝ|๐๐|๏ฟฝ + ||๐๐|| for all ๐๐,๐๐ โ ๐ ๐ ๐๐
Definition 7.2 The Euclidean norm ๐๐2 and the infinity norm ๐๐โ for the vector ๐๐ = [๐ฅ๐ฅ1, ๐ฅ๐ฅ2, โฆ , ๐ฅ๐ฅ๐๐]๐ก๐ก are defined by
||๐๐||2 = ๏ฟฝ๏ฟฝ๐ฅ๐ฅ๐๐2๐๐
๐๐=1
๏ฟฝ
12
and
7
||๐๐||โ = max1โค๐๐โค๐๐
|๐ฅ๐ฅ๐๐|
Example. Determine the ๐๐2 and ๐๐โ norms of the vector ๐ฅ๐ฅ = (โ1,1,โ2)๐ก๐ก. Solution:
||๐๐||2 = ๏ฟฝ(โ1)2 + (1)2 + (โ2)2 = โ6.
||๐๐||โ = max{|โ1|, |1|, |โ2|} = 2.
8
The Jacobi Method in Matrix Form Consider to solve an ๐๐ ร ๐๐ size system of linear equations ๐ด๐ด๐๐ = ๐๐ with
๐ด๐ด = ๏ฟฝ
๐๐11 ๐๐12 โฆ ๐๐1๐๐๐๐21 ๐๐22 โฆ ๐๐2๐๐โฎ๐๐๐๐1
โฎ๐๐๐๐2
โฑโฆ
โฎ๐๐๐๐๐๐
๏ฟฝ and ๐๐ = ๏ฟฝ
๐๐1๐๐2โฎ๐๐๐๐
๏ฟฝ for ๐๐ = ๏ฟฝ
๐ฅ๐ฅ1๐ฅ๐ฅ2โฎ๐ฅ๐ฅ๐๐๏ฟฝ.
We split ๐ด๐ด into
9
๐ด๐ด = ๏ฟฝ
๐๐11 0 โฆ 00 ๐๐22 โฆ 0โฎ0
โฎ0
โฑโฆ
โฎ๐๐๐๐๐๐
๏ฟฝ โ ๏ฟฝ
0 โฆ 0 0โ๐๐21 โฆ 0 0โฎ
โ๐๐๐๐1โฑ โฎ
โฆ โ๐๐๐๐,๐๐โ1 0
๏ฟฝ
โ ๏ฟฝ
0 โ๐๐12 โฆ โ๐๐1๐๐0 0 โฎโฎ0
โฎ0
โฑโฆ
โ๐๐๐๐โ1,๐๐0
๏ฟฝ = ๐ท๐ท โ ๐ฟ๐ฟ โ ๐๐
Where ๐ท๐ท = ๏ฟฝ
๐๐11 0 โฆ 00 ๐๐22 โฆ 0โฎ0
โฎ0
โฑโฆ
โฎ๐๐๐๐๐๐
๏ฟฝ ๐ฟ๐ฟ = ๏ฟฝ
0 โฆ 0 0โ๐๐21 โฆ 0 0โฎ
โ๐๐๐๐1โฑ โฎ
โฆ โ๐๐๐๐,๐๐โ1 0
๏ฟฝ,
10
๐๐ = ๏ฟฝ
0 โ๐๐12 โฆ โ๐๐1๐๐0 0 โฎโฎ0
โฎ0
โฑโฆ
โ๐๐๐๐โ1,๐๐0
๏ฟฝ
๐ด๐ด๐๐ = ๐๐ is transformed into (๐ท๐ท โ ๐ฟ๐ฟ โ ๐๐)๐๐ = ๐๐. ๐ท๐ท๐๐ = (๐ฟ๐ฟ + ๐๐)๐๐ + ๐๐
Assume ๐ท๐ทโ1 exists and ๐ท๐ทโ1 =
โฃโขโขโขโขโก1๐๐11
0 โฆ 0
0 1๐๐22
โฆ 0
โฎ0
โฎ0
โฑโฆ
โฎ1๐๐๐๐๐๐โฆ
โฅโฅโฅโฅโค
Then ๐๐ = ๐ท๐ทโ1(๐ฟ๐ฟ + ๐๐)๐๐ + ๐ท๐ทโ1๐๐
The matrix form of Jacobi iterative method is ๐๐(๐๐) = ๐ท๐ทโ1(๐ฟ๐ฟ + ๐๐)๐๐(๐๐โ1) + ๐ท๐ทโ1๐๐ ๐๐ = 1,2,3, โฆ
11
Define ๐๐๐๐ = ๐ท๐ทโ1(๐ฟ๐ฟ + ๐๐) and ๐๐ = ๐ท๐ทโ1๐๐, Jacobi iteration method can also be written as
๐๐(๐๐) = ๐๐๐๐๐๐(๐๐โ1) + ๐๐ ๐๐ = 1,2,3, โฆ The Gauss-Seidel Method Main idea of Gauss-Seidel
12
With the Jacobi method, only the values of ๐ฅ๐ฅ๐๐(๐๐) obtained in the ๐๐ th
iteration are used to compute ๐ฅ๐ฅ๐๐(๐๐+1). With the Gauss-Seidel method, we
use the new values ๐ฅ๐ฅ๐๐(๐๐+1) as soon as they are known. For example, once
we have computed ๐ฅ๐ฅ1(๐๐+1) from the first equation, its value is then used in
the second equation to obtain the new ๐ฅ๐ฅ2(๐๐+1), and so on.
Example. Use the Gauss-Seidel method to solve
13
5๐ฅ๐ฅ1 โ 2๐ฅ๐ฅ2 + 3๐ฅ๐ฅ3 = โ1โ3๐ฅ๐ฅ1 + 9๐ฅ๐ฅ2 + ๐ฅ๐ฅ3 = 2 2๐ฅ๐ฅ1 โ ๐ฅ๐ฅ2 โ 7๐ฅ๐ฅ3 = 3
Choose the initial guess ๐ฅ๐ฅ1 = 0, ๐ฅ๐ฅ2 = 0, ๐ฅ๐ฅ3 = 0 ๐๐ ๐๐ = 0 ๐๐ = 1 ๐๐ = 2 ๐๐ = 3 ๐๐ = 4 ๐๐ = 5 ๐๐ = 6 ๐ฅ๐ฅ1
(๐๐) 0.000 -0.200 0.167
๐ฅ๐ฅ2(๐๐) 0.000 0.156 0.334
๐ฅ๐ฅ2(๐๐) 0.000 -0.508 -0.429
The Gauss-Seidel Method. For each ๐๐ โฅ 1, generate the components ๐ฅ๐ฅ๐๐
(๐๐) of ๐๐(๐๐) from ๐๐(๐๐โ๐๐) by
14
๐ฅ๐ฅ๐๐(๐๐) =
1๐๐๐๐๐๐
๏ฟฝโ๏ฟฝ(๐๐๐๐๐๐๐ฅ๐ฅ๐๐(๐๐))
๐๐โ1
๐๐=1
โ ๏ฟฝ (๐๐๐๐๐๐๐ฅ๐ฅ๐๐(๐๐โ1))
๐๐
๐๐=๐๐+1
+ ๐๐๐๐๏ฟฝ , for ๐๐
= 1,2, , โฆ๐๐ Namely,
๐๐11๐ฅ๐ฅ1(๐๐) = โ๐๐12๐ฅ๐ฅ2
(๐๐โ1) โโฏโ ๐๐1๐๐๐ฅ๐ฅ๐๐(๐๐โ1) + ๐๐1
๐๐22๐ฅ๐ฅ2(๐๐) = โ๐๐21๐ฅ๐ฅ1
(๐๐) โ ๐๐23๐ฅ๐ฅ3(๐๐โ1) โโฏโ ๐๐2๐๐๐ฅ๐ฅ๐๐
(๐๐โ1) + ๐๐2๐๐33๐ฅ๐ฅ3
(๐๐) = โ๐๐31๐ฅ๐ฅ1(๐๐) โ ๐๐32๐ฅ๐ฅ2
(๐๐) โ ๐๐34๐ฅ๐ฅ4(๐๐โ1) โโฏโ ๐๐3๐๐๐ฅ๐ฅ๐๐
(๐๐โ1) + ๐๐3โฎ
๐๐๐๐๐๐๐ฅ๐ฅ๐๐(๐๐) = โ๐๐๐๐1๐ฅ๐ฅ1
(๐๐) โ ๐๐๐๐2๐ฅ๐ฅ2(๐๐) โโฏโ ๐๐๐๐,๐๐โ1๐ฅ๐ฅ๐๐โ1
(๐๐) + ๐๐๐๐
Matrix form of Gauss-Seidel method.
15
(๐ท๐ท โ ๐ฟ๐ฟ)๐๐(๐๐) = ๐๐๐๐(๐๐โ1) + ๐๐ ๐๐(๐๐) = (๐ท๐ท โ ๐ฟ๐ฟ)โ1๐๐๐๐(๐๐โ1) + (๐ท๐ท โ ๐ฟ๐ฟ)โ1๐๐
Define ๐๐๐๐ = (๐ท๐ท โ ๐ฟ๐ฟ)โ1๐๐ and ๐๐๐๐ = (๐ท๐ท โ ๐ฟ๐ฟ)โ1๐๐, Gauss-Seidel method can be written as
๐๐(๐๐) = ๐๐๐๐๐๐(๐๐โ1) + ๐๐๐๐ ๐๐ = 1,2,3, โฆ Convergence theorems of the iteration methods
16
Let the iteration method be written as ๐๐(๐๐) = ๐๐๐๐(๐๐โ1) + ๐๐ for each ๐๐ = 1,2,3, โฆ
Definition 7.14 The spectral radius ๐๐(๐ด๐ด) of a matrix ๐ด๐ด is defined by
๐๐(๐ด๐ด) = max|๐๐| , where ๐๐ is an eigenvalue of ๐ด๐ด. Remark: For complex ๐๐ = ๐๐ + ๐๐๐๐, we define |๐๐| = โ๐๐2 + ๐๐2. Lemma 7.18 If the spectral radius satisfies ๐๐(๐๐) < 1, then (๐ผ๐ผ โ ๐๐)โ1 exists, and
(๐ผ๐ผ โ ๐๐)โ1 = ๐ผ๐ผ + ๐๐ + ๐๐2 + โฏ = ๏ฟฝ๐๐๐๐โ
๐๐=0
Theorem 7.19 For any ๐๐(0) โ ๐ ๐ ๐๐, the sequence {๐๐(๐๐)}๐๐=0โ defined by
17
๐๐(๐๐) = ๐๐๐๐(๐๐โ1) + ๐๐ for each ๐๐ โฅ 1 converges to the unique solution of ๐๐ = ๐๐๐๐ + ๐๐ if and only if ๐๐(๐๐) < 1. Proof (only show ๐๐(๐๐) < 1 is sufficient condition) ๐๐(๐๐) = ๐๐๐๐(๐๐โ1) + ๐๐ = ๐๐๏ฟฝ๐๐๐๐(๐๐โ2) + ๐๐๏ฟฝ + ๐๐ = โฏ = ๐๐๐๐๐๐(0) + (๐๐๐๐โ1 +โฏ+ ๐๐ + ๐ผ๐ผ)๐๐ Since ๐๐(๐๐) < 1, lim
๐๐โโ๐๐๐๐๐๐(0) = ๐๐
lim๐๐โโ
๐๐(๐๐) = ๐๐ + lim๐๐โโ
(๏ฟฝ๐๐๐๐๐๐โ1
๐๐=0
) ๐๐ = (๐ผ๐ผ โ ๐๐)โ1๐๐
18
Definition 7.8 A matrix norm || โ || on ๐๐ ร ๐๐ matrices is a real-valued function satisfying
(i) ||๐ด๐ด|| โฅ 0 (ii) ๏ฟฝ|๐ด๐ด|๏ฟฝ = 0 if and only if ๐ด๐ด = 0 (iii)๏ฟฝ|๐ผ๐ผ๐ด๐ด|๏ฟฝ = |๐ผ๐ผ|๏ฟฝ|๐ด๐ด|๏ฟฝ (iv) ๏ฟฝ|๐ด๐ด + ๐ต๐ต|๏ฟฝ โค ๏ฟฝ|๐ด๐ด|๏ฟฝ + ||๐ต๐ต|| (v) ๏ฟฝ|๐ด๐ด๐ต๐ต|๏ฟฝ โค ๏ฟฝ|๐ด๐ด|๏ฟฝ||๐ต๐ต||
Theorem 7.9. If || โ || is a vector norm, the induced (or natural) matrix norm is given by
๏ฟฝ|๐ด๐ด|๏ฟฝ = max๏ฟฝ|๐๐|๏ฟฝ=1
||๐ด๐ด๐๐||
Example. ||๐ด๐ด||โ = max
||๐๐||โ=1||๐ด๐ด๐๐||โ, the ๐๐โ induced norm.
||๐ด๐ด||2 = max||๐๐||2=1
||๐ด๐ด๐๐||2, the ๐๐2 induced norm.
19
Theorem 7.11. If ๐ด๐ด = [๐๐๐๐๐๐] is an ๐๐ ร ๐๐ matrix, then
๏ฟฝ|๐ด๐ด|๏ฟฝโ = max1โค๐๐โค๐๐
๏ฟฝ๏ฟฝ๐๐๐๐๐๐๏ฟฝ๐๐
๐๐=1
Example. Determine ๏ฟฝ|๐ด๐ด|๏ฟฝโ for the matrix ๐ด๐ด = ๏ฟฝ1 2 โ10 3 โ15 โ1 1
๏ฟฝ
Corollary 7.20 If ๏ฟฝ|๐๐|๏ฟฝ < 1 for any natural matrix norm and ๐๐ is a given vector, then the sequence {๐๐(๐๐)}๐๐=0โ defined by ๐๐(๐๐) = ๐๐๐๐(๐๐โ1) + ๐๐ converges, for any ๐๐(0) โ ๐ ๐ ๐๐ , to a vector ๐๐ โ ๐ ๐ ๐๐, with ๐๐ = ๐๐๐๐ + ๐๐ , and the following error bound hold:
(i) |๏ฟฝ๐๐ โ ๐๐(๐๐)๏ฟฝ| โค ๏ฟฝ|๐๐|๏ฟฝ๐๐|๏ฟฝ๐๐(0) โ ๐๐๏ฟฝ|
20
(ii) |๏ฟฝ๐๐ โ ๐๐(๐๐)๏ฟฝ| โค ๏ฟฝ|๐๐|๏ฟฝ๐๐
1โ||๐๐|||๏ฟฝ๐๐(1) โ ๐๐(0)๏ฟฝ|
Theorem 7.21 If ๐ด๐ด is strictly diagonally dominant, then for any choice of ๐๐(0), both the Jacobi and Gauss-Seidel methods give sequences {๐๐(๐๐)}๐๐=0โ that converges to the unique solution of ๐ด๐ด๐๐ = ๐๐. Rate of Convergence Corollary 7.20 (i) implies |๏ฟฝ๐๐ โ ๐๐(๐๐)๏ฟฝ| โ ๐๐(๐๐)๐๐|๏ฟฝ๐๐(0) โ ๐๐๏ฟฝ| Theorem 7.22 (Stein-Rosenberg) If ๐๐๐๐๐๐ โค 0, for each ๐๐ โ ๐๐ and ๐๐๐๐๐๐ โฅ 0, for each ๐๐ = 1,2, โฆ ,๐๐ , then one and only one of following statements holds:
(i) 0 โค ๐๐๏ฟฝ๐๐๐๐๏ฟฝ < ๐๐๏ฟฝ๐๐๐๐๏ฟฝ < 1; (ii) 1 < ๐๐๏ฟฝ๐๐๐๐๏ฟฝ < ๐๐๏ฟฝ๐๐๐๐๏ฟฝ; (iii)๐๐๏ฟฝ๐๐๐๐๏ฟฝ = ๐๐๏ฟฝ๐๐๐๐๏ฟฝ = 0; (iv) ๐๐๏ฟฝ๐๐๐๐๏ฟฝ = ๐๐๏ฟฝ๐๐๐๐๏ฟฝ = 1.
21