Jacobi's Iteration Method
Jacobi's Iteration Method
AX = B
Where
Further, the matrix A can be decomposed into a diagonal component (D), a strictly
lower triangular part (L) and a strictly upper triangular component (U) as:
A=D + L + U
Where
1
Ref: developed with the help of online study material for Methods of Matrix Inversion
Moreover, the solution can be obtained iteratively via using the following relation:
( )
Where and are the kth and (k+1)th iteration of X. The elements
of can be computed using the element-based formula:
( ∑ )
Thus new value of X is calculated after putting the previous iterative value of X in
the above equation till the required accuracy is achieved. However, we overwrite,
with . The important thing is that the method should be converging for
having a solution. And the sufficient but not necessary condition for the method to
converge is that the matrix is strictly diagonally dominant. That means for each
row the absolute value of diagonal term is greater than the sum of the absolute
values of the other terms:
| | ∑| |
However, the method sometimes converges even if these conditions are not
satisfied. Moreover, the standard convergence condition for any iterative method is
defined in terms of the spectral radius, ρ() of the iteration matrix. And the spectral
radius of the matrix is equal to the largest absolute value of its eigenvalues. The
convergence condition for the method is when the spectral radius, ρ() of the
iteration matrix is less than 1; thus
2
Ref: developed with the help of online study material for Methods of Matrix Inversion
( )
The method is simple and numerically robust and each iterations quite fast.
However, the method is computing the independent variables of the linear
equations in parallel and independent way. Therefore the method might require
much iteration as well as good memory power of computational system. In-order to
understand the process completely, we start with a motivational example as given
below.
3
Ref: developed with the help of online study material for Methods of Matrix Inversion
Python script is given below to solve the set of linear equations using Jacobi’s
iteration method.
……………………………………………………………………………….
import numpy as np
from scipy.linalg import solve
'''___Main___'''
x = Jacobi(A, B, x, n)
# Direct command that is solve to find the solution of a set of linear equations
print ('Solution using the solve command:', solve(A, B))
……………………………………………………………………………………….
After compiling the above python script and for the different matrices we have the
following out puts:
…………………………………………………………
Enter the matrix A:np.array([[2,1],[3,7]])
Enter the matrix B:[3,5]
Enter guess of x:[0,0]
Enter the number of Iterations:25
[1.5 0.71428571]
[1.14285714 0.07142857]
[1.46428571 0.2244898 ]
[1.3877551 0.08673469]
[1.45663265 0.11953353]
[1.44023324 0.09001458]
[1.45499271 0.0970429 ]
[1.45147855 0.09071741]
[1.4546413 0.09222348]
[1.45388826 0.09086802]
5
Ref: developed with the help of online study material for Methods of Matrix Inversion
[1.45456599 0.09119075]
[1.45440463 0.09090029]
[1.45454986 0.09096945]
[1.45451528 0.0909072 ]
[1.4545464 0.09092202]
[1.45453899 0.09090869]
[1.45454566 0.09091186]
[1.45454407 0.090909 ]
[1.4545455 0.09090968]
[1.45454516 0.09090907]
[1.45454546 0.09090922]
[1.45454539 0.09090909]
[1.45454546 0.09090912]
[1.45454544 0.09090909]
[1.45454545 0.0909091 ]
Solution using the solve command: [1.45454545 0.09090909]
…………………………………………………………
8
Ref: developed with the help of online study material for Methods of Matrix Inversion