Jacobi and Guass-Seidel Iteration Update

Background

    Iterative schemes require time to achieve sufficient accuracy and are reserved for large systems of equations where there are a majority of zero elements in the matrix. Often times the algorithms are taylor-made to take advantage of the special structure such as band matrices.  Practical uses include applications in circuit analysis, boundary value problems and partial differential equations.
    
    Iteration is a popular technique finding roots of equations.  Generalization of fixed point iteration can be applied to systems of linear equations to produce accurate results.  The method Jacobi iteration is attributed to Carl Jacobi (1804-1851) and Gauss-Seidel iteration is attributed to  Johann Carl Friedrich Gauss (1777-1855) and Philipp Ludwig von Seidel (1821-1896).

 

    Consider that the n×n square matrix A is split into three parts, the main diagonal D, below diagonal L and above diagonal U.  We have  A = D - L - U.

[Graphics:Images/GaussSeidelMod_gr_1.gif] =

[Graphics:Images/GaussSeidelMod_gr_2.gif]-[Graphics:Images/GaussSeidelMod_gr_3.gif]-[Graphics:Images/GaussSeidelMod_gr_4.gif]  

 

Definition (Diagonally Dominant).  The matrix  [Graphics:Images/GaussSeidelMod_gr_5.gif]  is strictly diagonally dominant if

        [Graphics:Images/GaussSeidelMod_gr_6.gif][Graphics:Images/GaussSeidelMod_gr_7.gif][Graphics:Images/GaussSeidelMod_gr_8.gif][Graphics:Images/GaussSeidelMod_gr_9.gif][Graphics:Images/GaussSeidelMod_gr_10.gif]   for   [Graphics:Images/GaussSeidelMod_gr_11.gif].  

 

Theorem (Jacobi Iteration).  The solution to the linear system  [Graphics:Images/GaussSeidelMod_gr_12.gif]  can be obtained starting with  [Graphics:Images/GaussSeidelMod_gr_13.gif], and using iteration scheme
    
        [Graphics:Images/GaussSeidelMod_gr_14.gif]  
where  

        [Graphics:Images/GaussSeidelMod_gr_15.gif]  and  [Graphics:Images/GaussSeidelMod_gr_16.gif].  

If  [Graphics:Images/GaussSeidelMod_gr_17.gif] is carefully chosen a sequence [Graphics:Images/GaussSeidelMod_gr_18.gif] is generated which converges to the solution  P,  i.e.  [Graphics:Images/GaussSeidelMod_gr_19.gif].  
A sufficient condition for the method to be applicable is that A is strictly diagonally dominant or diagonally dominant and irreducible.  

Proof  Jacobi and Gauss-Seidel Iteration  Jacobi and Gauss-Seidel Iteration  

 

Theorem (Gauss-Seidel Iteration).  The solution to the linear system  [Graphics:Images/GaussSeidelMod_gr_20.gif]  can be obtained starting with  [Graphics:Images/GaussSeidelMod_gr_21.gif], and using iteration scheme
    
        [Graphics:Images/GaussSeidelMod_gr_22.gif]  
where  

        [Graphics:Images/GaussSeidelMod_gr_23.gif]  and  [Graphics:Images/GaussSeidelMod_gr_24.gif].  

If  [Graphics:Images/GaussSeidelMod_gr_25.gif] is carefully chosen a sequence [Graphics:Images/GaussSeidelMod_gr_26.gif] is generated which converges to the solution  P,  i.e.  [Graphics:Images/GaussSeidelMod_gr_27.gif].  
A sufficient condition for the method to be applicable is that A is strictly diagonally dominant or diagonally dominant and irreducible.

Proof  Jacobi and Gauss-Seidel Iteration  Jacobi and Gauss-Seidel Iteration  

 

Computer Programs  Jacobi and Gauss-Seidel Iteration  Jacobi and Gauss-Seidel Iteration  

Mathematica Subroutine (Jacobi Iteration).

[Graphics:Images/GaussSeidelMod_gr_28.gif]

Mathematica Subroutine (Gauss-Seidel Iteration).

[Graphics:Images/GaussSeidelMod_gr_29.gif]

Example 1.  Use Jacobi iteration to solve the linear system  [Graphics:Images/GaussSeidelMod_gr_30.gif].  
Try 10, 20 and 30 iterations.  
Solution 1.

 

Enter the matrix A, vector B and starting vector P.

[Graphics:../Images/GaussSeidelMod_gr_31.gif]



[Graphics:../Images/GaussSeidelMod_gr_32.gif]

[Graphics:../Images/GaussSeidelMod_gr_33.gif]

Use 10 iterations.

[Graphics:../Images/GaussSeidelMod_gr_34.gif]



[Graphics:../Images/GaussSeidelMod_gr_35.gif]
[Graphics:../Images/GaussSeidelMod_gr_36.gif]
[Graphics:../Images/GaussSeidelMod_gr_37.gif]
[Graphics:../Images/GaussSeidelMod_gr_38.gif]
[Graphics:../Images/GaussSeidelMod_gr_39.gif]
[Graphics:../Images/GaussSeidelMod_gr_40.gif]
[Graphics:../Images/GaussSeidelMod_gr_41.gif]
[Graphics:../Images/GaussSeidelMod_gr_42.gif]
[Graphics:../Images/GaussSeidelMod_gr_43.gif]
[Graphics:../Images/GaussSeidelMod_gr_44.gif]
[Graphics:../Images/GaussSeidelMod_gr_45.gif]

Determine if the method has converged.  

[Graphics:../Images/GaussSeidelMod_gr_46.gif]


[Graphics:../Images/GaussSeidelMod_gr_47.gif]

Use 20 iterations.

[Graphics:../Images/GaussSeidelMod_gr_48.gif]



[Graphics:../Images/GaussSeidelMod_gr_49.gif]
[Graphics:../Images/GaussSeidelMod_gr_50.gif]
[Graphics:../Images/GaussSeidelMod_gr_51.gif]
[Graphics:../Images/GaussSeidelMod_gr_52.gif]
[Graphics:../Images/GaussSeidelMod_gr_53.gif]
[Graphics:../Images/GaussSeidelMod_gr_54.gif]
[Graphics:../Images/GaussSeidelMod_gr_55.gif]
[Graphics:../Images/GaussSeidelMod_gr_56.gif]
[Graphics:../Images/GaussSeidelMod_gr_57.gif]
[Graphics:../Images/GaussSeidelMod_gr_58.gif]
[Graphics:../Images/GaussSeidelMod_gr_59.gif]
[Graphics:../Images/GaussSeidelMod_gr_60.gif]
[Graphics:../Images/GaussSeidelMod_gr_61.gif]
[Graphics:../Images/GaussSeidelMod_gr_62.gif]
[Graphics:../Images/GaussSeidelMod_gr_63.gif]
[Graphics:../Images/GaussSeidelMod_gr_64.gif]
[Graphics:../Images/GaussSeidelMod_gr_65.gif]
[Graphics:../Images/GaussSeidelMod_gr_66.gif]
[Graphics:../Images/GaussSeidelMod_gr_67.gif]
[Graphics:../Images/GaussSeidelMod_gr_68.gif]
[Graphics:../Images/GaussSeidelMod_gr_69.gif]

Determine if the method has converged.  

[Graphics:../Images/GaussSeidelMod_gr_70.gif]


[Graphics:../Images/GaussSeidelMod_gr_71.gif]

Use 30 iterations.

[Graphics:../Images/GaussSeidelMod_gr_72.gif]



[Graphics:../Images/GaussSeidelMod_gr_73.gif]
[Graphics:../Images/GaussSeidelMod_gr_74.gif]
[Graphics:../Images/GaussSeidelMod_gr_75.gif]
[Graphics:../Images/GaussSeidelMod_gr_76.gif]
[Graphics:../Images/GaussSeidelMod_gr_77.gif]
[Graphics:../Images/GaussSeidelMod_gr_78.gif]
[Graphics:../Images/GaussSeidelMod_gr_79.gif]
[Graphics:../Images/GaussSeidelMod_gr_80.gif]
[Graphics:../Images/GaussSeidelMod_gr_81.gif]
[Graphics:../Images/GaussSeidelMod_gr_82.gif]
[Graphics:../Images/GaussSeidelMod_gr_83.gif]
[Graphics:../Images/GaussSeidelMod_gr_84.gif]
[Graphics:../Images/GaussSeidelMod_gr_85.gif]
[Graphics:../Images/GaussSeidelMod_gr_86.gif]
[Graphics:../Images/GaussSeidelMod_gr_87.gif]
[Graphics:../Images/GaussSeidelMod_gr_88.gif]
[Graphics:../Images/GaussSeidelMod_gr_89.gif]
[Graphics:../Images/GaussSeidelMod_gr_90.gif]
[Graphics:../Images/GaussSeidelMod_gr_91.gif]
[Graphics:../Images/GaussSeidelMod_gr_92.gif]
[Graphics:../Images/GaussSeidelMod_gr_93.gif]
[Graphics:../Images/GaussSeidelMod_gr_94.gif]
[Graphics:../Images/GaussSeidelMod_gr_95.gif]
[Graphics:../Images/GaussSeidelMod_gr_96.gif]
[Graphics:../Images/GaussSeidelMod_gr_97.gif]
[Graphics:../Images/GaussSeidelMod_gr_98.gif]
[Graphics:../Images/GaussSeidelMod_gr_99.gif]
[Graphics:../Images/GaussSeidelMod_gr_100.gif]
[Graphics:../Images/GaussSeidelMod_gr_101.gif]
[Graphics:../Images/GaussSeidelMod_gr_102.gif]
[Graphics:../Images/GaussSeidelMod_gr_103.gif]

Determine if the method has converged.  

[Graphics:../Images/GaussSeidelMod_gr_104.gif]


[Graphics:../Images/GaussSeidelMod_gr_105.gif]

 

 

Example 2.  Use Jacobi iteration to attempt solving the linear system  [Graphics:Images/GaussSeidelMod_gr_106.gif].
Try 10 iterations.  
Observe that something is not working.  In example 5 we will check to see if this matrix is diagonally dominant.   
Solution 2.

 

Example 3.  Use Gauss-Seidel iteration to solve the linear system  [Graphics:Images/GaussSeidelMod_gr_126.gif].  
Try 10, 20 iterations.  Compare the speed of convergence with Jacobi iteration.
Solution 3.

 

Example 4  Use Gauss-Seidel iteration to attempt solving the linear system  [Graphics:Images/GaussSeidelMod_gr_202.gif].
Try 10 iterations.  
Observe that something is not working.  In example 5 we will check to see if this matrix is diagonally dominant.   
Solution 4.

 

 

Warning.  

    Iteration does not always converge.  A sufficient condition for iteration to Jacobi iteration to converge is that A is strictly diagonally  dominant. The following subroutine will check to see if a matrix is strictly diagonally dominant.  It should be used before any call to Jacobi iteration or Gauss-Seidel iteration is made.  There exists a counter-example for which Jacobi iteration converges and Gauss-Seidel iteration does not converge.  The "true" sufficient condition for Jacobi iteration to converge is that the "spectral radius" of   [Graphics:Images/GaussSeidelMod_gr_221.gif]  is less than 1, where  [Graphics:Images/GaussSeidelMod_gr_222.gif] is the diagonal of  [Graphics:Images/GaussSeidelMod_gr_223.gif].  That is, the magnitude of the largest eigenvalue of M must be less than 1.  This condition seems harsh because numerical computation of eigenvalues is an advanced topic compared to solution of a linear system.  

[Graphics:Images/GaussSeidelMod_gr_224.gif]

Example 5  Test the matrix A of Examples 2 and 4 to see if A is strictly diagonally dominant.
Solution 5.

 

 

More efficient subroutines

    A tolerance can be supplied to either the Jacobi or Gauss-Seidel method which will permit it to exit the loop if convergence has been achieved.  

 

Computer Programs  Jacobi and Gauss-Seidel Iteration  Jacobi and Gauss-Seidel Iteration  

Mathematica Subroutine (Jacobi Iteration).

[Graphics:Images/GaussSeidelMod_gr_243.gif]

Mathematica Subroutine (Gauss-Seidel Iteration).

[Graphics:Images/GaussSeidelMod_gr_244.gif]

Example 6.  Use Jacobi and Gauss-Seidel iteration to solve the linear system  [Graphics:Images/GaussSeidelMod_gr_245.gif].  
Use a tolerance of  [Graphics:Images/GaussSeidelMod_gr_246.gif]  and a maximum of  50  iterations.
Solution 6.

 

 

Subroutines using matrix commands

    In the Jacobi subroutine we can use fix point iteration as suggested by the theory.  

Mathematica Subroutine (Jacobi Iteration).

[Graphics:Images/GaussSeidelMod_gr_296.gif]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值