Professional Documents
Culture Documents
Email address
emmasfad2006@yahoo.com, sunday.fadugba@eksu.edu.ng
Citation
Fadugba Sunday Emmanuel. On Some Iterative Methods for Solving Systems of Linear Equations.
Computational and Applied Mathematics Journal. Vol. 1, No. 2, 2015, pp. 21-28.
Keywords
Iterative Method,
Jacobi Method,
Modified Jacobi Method
Abstract
This paper presents some iterative methods for solving system of linear equations
namely the Jacobi method and the modified Jacobi method. The Jacobi method is an
algorithm for solving system of linear equations with largest absolute values in each row
and column dominated by the diagonal elements. The modified Jacobi method also
known as the Gauss Seidel method or the method of successive displacement is useful
for the solution of system of linear equations. The comparative results analysis of the
two methods was considered. We also discussed the rate of convergence of the Jacobi
method and the modified Jacobi method. Finally, the results showed that the modified
Jacobi method is more efficient, accurate and converges faster than its counterpart the
Jacobi Method.
1. Introduction
In computational mathematics, an iterative method attempts to solve a system of
linear equations by finding successive approximations to the solution starting from an
initial guess. This approach is in contrast to direct methods, which attempt to solve the
problem by a finite sequence of some operations and in the absence of rounding errors.
These direct methods lead to exact solution. Iterative methods are usually the only
choice for nonlinear problems involving a large number of variables where there is no
closed form solution or where the problems cannot be solved analytically. Probably the
first iterative method for solving a linear system appeared in a letter of Gauss to his
student. He proposed a method of solving a 4x4 system of equations. The theory of
stationary iterative methods was established with the work of D.M. Young starting in
the 1950s. The most well-known and accepted method for solving a system of linear
equations is the so called The Cramers Rule. However, there are other direct
methods for solving systems of linear equations such as the Gauss Elimination, the
Gauss Jordan method, LU Decomposition and Tridiagonal matrix algorithm.
But, when solving a system of linear equations with more than four unknown variables
(that is, when dealing with a higher order matrix) all these methods become very lengthy
and tedious to solve by hand. Therefore there is need for the use of a dedicated coding
language like MATLAB.
The paper is structured as follows: Section 2 gives a brief overview of iterative
methods for solving systems of linear equations. Section 3 presents some numerical
experiments, discussion of results and conclusion.
a
j =1
Ax = b
(1.1)
an1 x1 + an 2 x2 + ... + ann xn = bn
where
(1.2)
algebraic
equations
in
n-unknown
x j = bi , i = 1, 2, n
(2.1)
x2 =
( b2 a21 x1 ... a2n xn )
a 22
1
xn =
( bn an1 x1 ... ann1 xn1 )
a nn
x1 =
1
( b1 a12 x2 ... a1n xn )
a 11
(2.2)
xi =
variables
ij
22
n 1
1
bi a ij x j , i = 1, 2 n
a ii
j =1
x11 =
1
b1 a12 x20 ... a1n xn0
a 11
x12 =
1
b2 a21 x10 ... a2 n xn0
a 22
xn1 =
1
bn an1 x10 ... ann1 xn01
a nn
(2.3)
x12 =
1
b1 a12 x21 ... a1n x1n
a 11
x22 =
1
b2 a21 x11 ... a2 n x1n
a 22
xn2 =
1
bn an1 x11 ... ann 1 x1n 1
a nn
(2.4)
23
Fadugba Sunday Emmanuel: On Some Iterative Methods for Solving Systems of Linear Equations
xik =
n 1
1
k 1
bi a ij x j , i = 1, 2, n
a ii
j =1
k = 1, 2,3,...
(2.5)
xik +1 =
1
a ii
When solving for x2(1), insert the just computed value for x1(1).
In other words, for each calculation, the most current
estimate of the parameter value is used. The Gauss-Seidel
method (Modified Jacobi Method) converges about twice as
fast as Jacobi, but may still be very slow.
In the Jacobi method, all values of x(k) are based on x(k-1).
The modified Jacobi method is similar to the Jacobi method,
except that the most recently computed values of all x1 are
used in all computations. Like the Jacobi method, the
modified Jacobi method requires diagonal dominance to
ensure convergence. Thus, in the modified Jacobi method,
each equation of the system is solved for the component of
the solution vector associated with the diagonal element, that
is, xi as follows:
x2 =
( b2 a21 x1 ... a2 n xn )
a 22
1
xn =
( bn an1 x1 ... ann 1 xn 1 )
a nn
x1 =
k
bi a ij x j , i = 1, 2, , n
(2.6)
j =1
k = 0,1, 2,
n 1
1
( b1 a12 x2 ... a1n xn )
a 11
(2.8)
aii >
j: j i
ij
, i
(2.7)
xi =
1
a ii
n 1
i a ij x j , i = 1, 2 n
j =1
x11 =
1
b1 a12 x20 a13 x30 ... a1n xn0
a 11
x12 =
1
b2 a21 x11 a23 x30 ... a2 n xn0
a 22
x1n =
1
bn an1 x11 an 2 x12 ... ann1 x1n1
a nn
(2.9)
x12 =
1
b1 a12 x12 a13 x31... a1n x1n
a 11
x22 =
1
b2 a21 x12 a23 x31... a2n x1n
a 22
xn2 =
1
bn an1 x12 an 2 x22 ... ann1 xn21
a nn
(2.10)
1
a ii
bi
i 1
k 1
ij x j
j =1
= 1, 2, n,
(2.11)
k = 1, 2,3,...
k 1
ij x j , i
j =i +1
2.2.1. Theorem 2
The modified Jacobi method is said to be convergent if the
matrix A is strictly diagonally dominant i.e.
aii >
j: j i
ij
, i
(2.12)
2.2.2. Comments
An n n matrix A is said to be strictly diagonally
dominant if the absolute value of each entry on the main
diagonal is greater than the sum of the absolute values
of each of the other entries in the same row. i.e.
24
3. Numerical Experiments
+ a23 + ... + a2 n
+ an 2 + ... + ann 1
(2.13)
(2.14)
3.1.1. Problem 1
Let us consider the systems of linear equations of the form:
We consider the system of linear equations of the form
5 x1 2 x2 + 3 x3 = 1
3 x1 + 9 x2 + x3 = 2
2 x1 x2 7 x3 = 3
(2.15)
3.1.2. Problem 2
2 x1 + x2 = 5
x1 2 x2 + x3 = 1
x2 2 x3 + x4 = 0
x3 2 x4 = 8
(2.16)
25
Fadugba Sunday Emmanuel: On Some Iterative Methods for Solving Systems of Linear Equations
0
0.000
0.000
0.000
1
-0.200
0.222
-0.429
2
0.146
0.203
-0.517
3
0.192
0.328
-0.416
4
0.181
0.328
-0.421
5
0.185
0.329
-0.424
6
0.186
0.331
-0.423
7
0.186
0.331
-0.423
0
0.000
0.000
0.000
1
-0.200
0.156
-0.508
2
0.167
0.334
-0.429
3
0.191
0.323
-0.422
4
0.186
0.331
-0.423
5
0.186
0.331
-0.423
x1
[0.0000]
[-2.5000]
[-2.7500]
[-3.3750]
[-4.0000]
[-4.3125]
[-4.7656]
[-4.9609]
[-5.2617]
[-5.3887]
[-5.5859]
[-5.6689]
[-5.7981]
[-5.8524]
[-5.9370]
[-5.9725]
[-6.0278]
[-6.0511]
[-6.0873]
[-6.1025]
[-6.1262]
[-6.1362]
[-6.1517]
[-6.1583]
[-6.1684]
[-6.1727]
[-6.1793]
[-6.1821]
[-6.1865]
[-6.1883]
[-6.1911]
[-6.1923]
[-6.1942]
[-6.1950]
[-6.1962]
[-6.1967]
[-6.1975]
[-6.1979]
[-6.1984]
[-6.1986]
[-6.1989]
[-6.1991]
[-6.1993]
[-6.1994]
[-6.1995]
x2
[0.0000]
[-0.5000]
[-1.7500]
[-3.0000]
[-3.6250]
[-4.5313]
[-4.9219]
[-5.5234]
[-5.7773]
[-6.1719]
[-6.3379]
[-6.5962]
[-6.7048]
[-6.8739]
[-6.9450]
[-7.0557]
[-7.1022]
[-7.1746]
[-7.2051]
[-7.2525]
[-7.2724]
[-7.3035]
[-7.3165]
[-7.3368]
[-7.3454]
[-7.3586]
[-7.3642]
[-7.3729]
[-7.3766]
[-7.3823]
[-7.3847]
[-7.3884]
[-7.3900]
[-7.3924]
[-7.3934]
[-7.3950]
[-7.3957]
[-7.3967]
[-7.3972]
[-7.3979]
[-7.3982]
[-7.3986]
[-7.3988]
[-7.3991]
[-7.3992]
x3
[0.0000]
[0.0000]
[-2.2500]
[-2.8750]
[-4.0625]
[-4.5313]
[-5.2813]
[-5.5938]
[-6.0820]
[-6.2871]
[-6.6064]
[-6.7407]
[-6.9497]
[-7.0376]
[-7.1744]
[-7.2319]
[-7.3214]
[-7.3591]
[-7.4177]
[-7.4423]
[-7.4807]
[-7.4968]
[-7.5219]
[-7.5325]
[-7.5489]
[-7.5558]
[-7.5665]
[-7.5711]
[-7.5781]
[-7.5811]
[-7.5857]
[-7.5876]
[-7.5906]
[-7.5919]
[-7.5939]
[-7.5947]
[-7.5960]
[-7.5965]
[-7.5974]
[-7.5977]
[-7.5983]
[-7.5985]
[-7.5989]
[-7.5990]
[-7.5993]
x4
[0.0000]
[-4.0000]
[-4.0000]
[-5.1250]
[-5.4375]
[-6.0313]
[-6.2656]
[-6.6406]
[-6.7969]
[-7.0410]
[-7.1436]
[-7.3032]
[-7.3704]
[-7.4749]
[-7.5188]
[-7.5872]
[-7.6160]
[-7.6607]
[-7.6795]
[-7.7088]
[-7.7212]
[-7.7403]
[-7.7484]
[-7.7609]
[-7.7662]
[-7.7744]
[-7.7779]
[-7.7833]
[-7.7855]
[-7.7891]
[-7.7905]
[-7.7928]
[-7.7938]
[-7.7953]
[-7.7959]
[-7.7969]
[-7.7973]
[-7.7980]
[-7.7983]
[-7.7987]
[-7.7989]
[-7.7991]
[-7.7993]
[-7.7994]
[-7.7995]
n
[45]
[46]
[47]
[48]
[49]
[50]
[51]
[52]
[53]
[54]
[55]
[56]
[57]
[58]
[59]
x1
[-6.1996]
[-6.1997]
[-6.1997]
[-6.1998]
[-6.1998]
[-6.1999]
[-6.1999]
[-6.1999]
[-6.1999]
[-6.1999]
[-6.2000]
[-6.2000]
[-6.2000]
[-6.2000]
[-6.2000]
x2
[-7.3994]
[-7.3995]
[-7.3996]
[-7.3997]
[-7.3997]
[-7.3998]
[-7.3998]
[-7.3999]
[-7.3999]
[-7.3999]
[-7.3999]
[-7.3999]
[-7.4000]
[-7.4000]
[-7.4000]
x3
[-7.5994]
[-7.5995]
[-7.5996]
[-7.5997]
[-7.5997]
[-7.5998]
[-7.5998]
[-7.5999]
[-7.5999]
[-7.5999]
[-7.5999]
[-7.5999]
[-7.5999]
[-7.6000]
[-7.6000]
x4
[-7.7996]
[-7.7997]
[-7.7998]
[-7.7998]
[-7.7998]
[-7.7999]
[-7.7999]
[-7.7999]
[-7.7999]
[-7.7999]
[-7.8000]
[-7.8000]
[-7.8000]
[-7.8000]
[-7.8000]
x1
[0.0000]
[-2.5000]
[-3.3750]
[-3.8125]
[-4.5859]
[-5.1387]
[-5.5049]
[-5.7450]
[-5.9022]
[-6.0051]
[-6.0724]
[-6.1165]
[-6.1453]
[-6.1642]
[-6.1766]
[-6.1847]
[-6.1900]
[-6.1934]
[-6.1957]
[-6.1972]
[-6.1982]
[-6.1988]
[-6.1992]
[-6.1995]
[-6.1997]
[-6.1998]
[-6.1999]
[-6.1999]
[-6.1999]
[-6.2000]
[-6.2000]
[-6.2000]
x2
[0.0000]
[-1.7500]
[-2.6250]
[-4.1719]
[-5.2773]
[-6.0098]
[-6.4900]
[-6.8044]
[-7.0102]
[-7.1448]
[-7.2330]
[-7.2907]
[-7.3285]
[-7.3532]
[-7.3694]
[-7.3799]
[-7.3869]
[-7.3914]
[-7.3944]
[-7.3963]
[-7.3976]
[-7.3984]
[-7.3990]
[-7.3993]
[-7.3996]
[-7.3997]
[-7.3998]
[-7.3999]
[-7.3999]
[-7.3999]
[-7.4000]
[-7.4000]
x3
[0.0000]
[-0.8750]
[-3.5313]
[-4.9688]
[-5.8809]
[-6.4751]
[-6.8638]
[-7.1181]
[-7.2846]
[-7.3936]
[-7.4649]
[-7.5116]
[-7.5421]
[-7.5621]
[-7.5752]
[-7.5838]
[-7.5894]
[-7.5930]
[-7.5955]
[-7.5970]
[-7.5981]
[-7.5987]
[-7.5992]
[-7.5995]
[-7.5996]
[-7.5998]
[-7.5998]
[-7.5999]
[-7.5999]
[-7.6000]
[-7.6000]
[-7.6000]
x4
[0.0000]
[-4.4375]
[-5.7656]
[-6.4844]
[-6.9404]
[-7.2375]
[-7.4319]
[-7.5591]
[-7.6423]
[-7.6968]
[-7.7324]
[-7.7558]
[-7.7711]
[-7.7811]
[-7.7876]
[-7.7919]
[-7.7947]
[-7.7965]
[-7.7977]
[-7.7985]
[-7.7990]
[-7.7994]
[-7.7996]
[-7.7997]
[-7.7998]
[-7.7999]
[-7.7999]
[-7.7999]
[-7.8000]
[-7.8000]
[-7.8000]
[-7.8000]
26
Appendix
The Jacobi Method for 4x4 Matrix Using Matlab
1- clc;
2- close all;
3- N0=1000;
4- count=1;
5- % JACOBI ITERATIVE METHOD FOR 3 BY 3 MATRICES
6- X1{1} = input('ENTER THE INITIAL VALUES OF X1 = ');
7- X2{1} = input('ENTER THE INITIAL VALUES OF X2 = ');
8- X3{1}= input('ENTER THE INITIAL VALUES OF X3 = ');
9-X4{1}=input('ENTER THE INITIAL VALUES OF X4 = ');
10- % ENTER VALUES FOR THE FIRST EQUATION
11- % X11+X12+X13+X14=A1
12- disp('Enter in this form a11X1+a12X2+a13X3=A1');
13- a11=input('Enter a11=');
14- a12=input('enter a12=');
15- a13=input('enter a13=');
16- a14=input('enter a14=');
17- A1=input('enter A1=');
18- % ENTER VALUES FOR THE SECOND EQUATION
19- % X21+X22+X23+X24=A2
20- disp('Enter in this form a21X1+a22X2+a23X3=A2');
21- a21=input('Enter a21=');
22- a22=input('enter a22=');
23- a23=input('enter a23=');
24- a24=input('enter a24=');
25- A2=input('enter A2=');
26- % ENTER VALUES FOR THE THIRD EQUATION
27- % X31+X32+X33+X34=A3
28- disp('Enter in this form a31X1+a32X2+a33X3=A1');
29- a31=input('enter a31=');
30- a32=input('enter a32=');
31- a33=input('enter a33=');
32- a34=input('enter a34=');
33- A3=input('enter A3=');
34- % ENTER VALUES FOR THE FOURTH EQUATION
35- % X31+X32+X33+X34=A3
27
Fadugba Sunday Emmanuel: On Some Iterative Methods for Solving Systems of Linear Equations
28
References
[1]
[2]
[3]
[4]
[5]
[6]