Chapter Three
Chapter Three
Chapter Three
Systems of linear algebraic equations and the solutions
In more complicated modeling situations it may be that there are many linear relationships,
each involving a large number of variables. For example, in the stress analysis of a structure
such as a bridge or an aeroplane, many hundreds (or indeed thousands) of linear relationships
may be involved. Typically, we are interested in determining values for the dependent variables
using these relationships.
In this chapter various methods are compared for solving linear systems of equations. Both
direct and indirect methods are considered. Direct and Indirect methods are widely used for
solving large sparse and dense problems. In direct methods, two methods will be considered:
Gaussian Elimination and
When the number of equations (and consequently the number of variables in those equations)
becomes large it can be tedious to write the system out in full. In any case, we need some
notation which will allow us to specify an arbitrary linear system in compact form so that we
may conveniently examine ways of solving such a system. Hence we write linear systems using
matrix and vector notation as Ax = b; Where A is a matrix, known as the coefficient matrix (or
matrix of coefficients), b is the vector of right-hand sides and x is the vector of unknowns to
be determined.
Solution
Solution of the linear system (3) is a sequence of n numbers s1,s2,s3,...,sn , which satisfies
system (3) when we substitute x1 =s1,x2 =s2,x3 =s3,..., xn =sn .
-2x + 6y = 6
2x + y =8
+7y= 14⟹y = 2
From equation 1 x = -3 +3=x = -3 + 6 = 3
Solution is x = 3 and y = 2
x - 3y = -7 →1
2x - 6y = 7 →2
Solution: 2R1 - R2=
2x - 6y = -7
- 2x - 6y = -14
0 + 0 = -21
NOTE:
Consistent, the system of equations is consistent if the system has at least one solution
Note: 1. A system will have unique solution (only one solution) when number of unknowns is
equal to number of equations
Note:2. A system is over determined; if there are more equations then unknowns and it will be
mostly inconsistent.
Note:3. A system is under determined if there are less equations then unknowns and it may
turn inconsistent.
Augmented Matrix
Linear Algebraic Equations;
Collections of linear equations are called linear systems of equations. They involve same set
of variables. Various methods have been introduced to solve systems of linear equations. There
is no single method that is best for all situations. These methods should be determined
according to speed and accuracy. Speed is an important factor in solving large systems of
equations because the volume of computations involved is huge. Another issue in the accuracy
problem for the solutions rounding off errors involved in executing these computations.
1. Direct Methods
2. Iterative Methods
Direct methods are not appropriate for solving large number of equations in a system,
particularly when the coefficient matrix is sparse, i.e. when most of the elements in a matrix
are zero.
For small (n ≤ 3), linear algebra provides several tools to solve such systems of linear equations:
Direct substitution
Graphical method
Cramer’s rule
Method of elimination
X1 + X3 =4 4X +4Y =2
X1 + X2 + X3 =0
B. Gauss -Elimination Method
A linear system may be reduced to upper triangular form by means of successively subtracting
multiples of the first equation from the second, third, fourth and so on, then repeating the process
using multiples of the newly-formed second equation, and again with the newly-formed third
equation, and so on until the penultimate equation has been used in this way. Having reduced
the system to upper triangular form backward substitution is used to find the solution. This
systematic approach is known as Gaussian elimination. It has two parts:
A. Forward Stage
B. Backward Stage
Forward Stage: First part is linked with the manipulation of equations in order to eliminate
some unknowns from the equations and constitute an upper triangular system or echelon
form. It reduces Ax=b to an upper triangular system Tx=b’
a 11
a 12
a 13
b 1
a 21
a 22
a 23
b 2
a 31
a 32
a 33
b 3
Forward
⇓ Elimination
a 11
a 12
a 13
b 1
' ' '
0 a 22
a 23
b 2
'' ''
0 0 a 33
b 3
To proceed we ignore (R1) and repeat the process on (R2) to (R4). We eliminate X2 from
(R3) and (R4) by subtracting suitable multiples of (R2). We take (−3)/ (− ) times (R2) from
(R3) and (−17)/(−7) times (R2) from (R4)to give (after the removal of common
denominators) the system
2X1 + 3X2 +4X3 − 2X4 = 1
Finally we subtract 62/75 times (R3) from (R4) to give the system
2X1 + 3X2 +4X3 − 2X4 = 1
We now have an upper triangular system which may be solved by backward substitution.
From (R4) we have X4 = 3.Substituting this value in (R3) gives X3 = 2. Substituting the
known values for X4 and X3 in (R2) gives X2 =−1. Finally using (R1) we find X1 = 1.
Division by zero: It is possible that during both elimination and back-substitution phases a
division by zero can occur. It occur in A zero on diagonal term
For example:
0X1+2X2 + 3X3 = 8 0 2 3
4X1 + 6X2 + 7X3 = -3 A= 4 6 7
2X1 + X2 + 6X3 = 5 2 1 6
Round-off errors: Because computers carry only a limited number of significant figures,
round off errors will occur and they will propagate from one iteration to the next. This
problem is especially important when large numbers of equations (100 or more) are to be
solved. Since round off errors can induce small changes in the coefficients, these changes
can lead to large solution errors in ill-conditioned systems.
System may be ill-conditioning, i.e. det[A] 0
No solution or an infinite # of solutions, i.e. det[A] = 0
Pivoting - If a pivot element is zero, normalization step leads to division by zero. The
same problem may arise, when the pivot element is close to zero. Problem can be
avoided:
Scaling - used to reduce the round-off errors and improve accuracy
C. LU Decomposition Methods
LU-Factorization is based on the fact that it is a matrix decomposition and non-singular square
matrix ’A’ can be replaced as the product of lower triangular and upper triangular matrices.
That is why this method is known as LU-Factorization method. This method is also known as
LU-Decomposition method. LU-Factorization is actually variant of Gaussian Elimination
method. Consider the following linear systems of equations.
LUX= b
Lij
L L L
Example Consider the following matrix
1 2 3 1 2 3 1 2 3
A= 2 -3 2 -7 -4 -7 -4
3 1 -1 -5 -10 -50/7
And thus 1 0 0 1 2 3
L= 2 1 0 and U= 0 -7 -4
3 5/7 1 0 0 -50/7
If we can compute the factorization A = LU, then
Ax = b , LUx = b , Ly = b, where Ux = y.
To find 21and 31, find the multiplier that was used to make the a21 and a31 elements zero in
the first step of forward elimination of the Naïve Gauss elimination method. It was
64
ℓ21 = = 2.56
25
144
ℓ31 = = 5.76
25
To find32 , what multiplier was used to make a32 element zero? Remember a32 element was
made zero in the second step of forward elimination. The [𝐴]matrix at the beginning of the
second step of forward elimination was
25 5 1
[0 − 4.8 − 1.56 ]
0 − 16.8 − 4.76
−16.8
So 32 = −4.8 =3.5
1 0 0
The triangular matrices L and U determined using the relations (1.30) are equal to
The determinant of the matrix of coefficients satisfies the equation detA = detL· det U =
84 · 1 = 84. The solution obtained by using the LU decomposition method is x1 = 1.0, x2 =
0.7, x3 = 0.4, and x4 = 0.1.
1 1 2 8
[0 1 − 5 − 9 ]10R2+R3
0 0 − 52 − 104
1 1 2 8
[0 −1 5 9] -R2,
0 0 1 2 -R3/52
1 1 0 4 -2R3+R1,
[0 1 0 1] 5R3+R2
0 0 1 2
1 0 0 3 -R2+R1
[0 1 0 1]
0 0 1 2
Equivalent system of equations form is: x1 = 3, x2 = 1, x3 = 2 is the solution of the system.
The method of inverse matrix also finds an application for the task of repeatedly solving the
system of linear equations
A·X=B (1)
For which the matrix of coefficients A remains unchanged. In other words, the equation system
is being solved for different values of the free terms forming the vector B.
As we know from the extensive literature on the subject, application of the above method is
legitimate, if the number of solution processes applied to the equation system (1) is greater than
2n, where n is the rank of the matrix A, equal to the number of equations in the system. The
inverse A−1 of a nonsingular square matrix A (having the determinant D different from zero) is
also the nonsingular square matrix of the same rank. Product of these matrices, i.e.
is equal to the unitary matrix E, having also the same rank. The equation system
(1) Will remain unchanged after multiplication of both sides by an inverse matrix, i.e.,
X = A−1 · B (5)
Expressing the essence of the method under consideration. It follows from the above equation
that the solution vector X can be found by simple multiplication of the inverse matrix A−1 by
the vector of free terms B. Determination of the inverse matrix A−1 therefore constitutes an
essential and most difficult problem, which must be solved in the first stage. Different
algorithms available in the literature on linear algebra can be used for this purpose. In case of
the matrix of a small rank (n ≤ 3), the relations given in Appendix B may prove to be useful.
One of the most popular algorithms used for calculating the inverse matrix is presented below.
Assume that a square nonsingular matrix A is given. Denote the elements of this matrix by aij,
where 1 ≤ i ≤ n,1 ≤ j ≤ n. Elements (terms) of the inverse matrix
A−1 are denoted by xij, where 1 ≤ i ≤ n,1 ≤ j ≤ n. Product of this two matrices, i.e.,
A · A−1 = E (6)
ij (7)
Where δij is the Kronecker symbol taking the value 1 for i = j and the value 0 for i . It
follows from Eq. (1.37) that, if we want to determine elements of the column j of the matrix
A−1, the following system of equations should be solved:
Example 1.4 Solve the following system of equations using the method of inverse matrix
The inverse A−1 of the coefficients matrix A of the system given below is equal to (see
Appendix B)
A
Iterative methods for solving general, large sparse linear systems have been gaining popularity
in many areas of scientific computing. A number of efficient iterative solvers were discovered
and the increased need for solving very large linear systems triggered a noticeable and rapid
shift toward iterative techniques in many applications. Also, iterative methods are gaining
ground because they are easier to implement efficiently on high-performance computers than
direct methods.
Those methods are called direct that terminate after finitely many operations with an exact
solution (up to rounding errors).Because of round-off errors, direct methods become less
efficient than iterative methods when they applied to large systems. In addition, the amount of
storage space required for iterative solutions on a computer is far less than the one required for
direct methods when the coefficient matrix of the system is sparse. Thus, especially for sparse
matrices, iterative methods are more attractive than direct methods.
A. Jacobi method
Jacobi calculates all new values of Xi’s to calculate a set of new xi values If any of the aii = 0
and the matrix A is nonsingular, then the equations can be reordered so that all aii = 0.
Convergence (if possible) is accelerated by taking the aii as large as possible. Because necessary
condition for convergence is that the set be diagonal dominant. Starting with
AX=b
a11x1 + a12x2 + a13x3+ ...+ a1nxn = b1
a21x1+ a22x2+a23x3+ ... + a2nxn = b2
:
an1x1+ an2x2 + an3x3 + ... + annxn = bn
Start with solution guess X [0] = -1, Y [0]= -1 and start iterating on the solution
This is a converging process keep on going until the desired level of accuracy is achieved X [k]
= 2.00000, Y [k] = 0.00000
B. Gauss–Seidel Method
The Gauss-Seidel Method allows the user to control round-off error. Elimination methods such
as Gaussian elimination and LU decomposition are prone to prone to round-off error. Also: If
the physics of the problem are understood, a close initial guess can be made, decreasing the
number of iterations needed. This method is very similar to the Jacobi method except that
Gauss Seidel uses the most recently computed values for in its computations. Using all
updated values of increases the convergence rate (twice as fast as Jacobi)
Starting with AX=b
Iterative convergence
Is the (k+1)th solution better than the kth solution? Iterative process can be
convergent/divergent
A necessary condition for convergence is that the set be diagonal.
o This requires that one of the coefficients in each of the equations be greater
than all others and that this “strong coefficient” be contained in a different
position in each equation.
o We can re-arrange all strong elements onto diagonal positions by switching
column
A poor first guess will prolong the iterative process but will not make it diverge if the
matrix is such that convergence is assured.
o Therefore better guesses will speed up the iterative process
Criteria for ascertaining convergence:
x j - x j-1
∈a , i = i i x100<𝜀 s
xj
i
10x1 - x2 + 2x3 = 6
– x1 + 11x2 – x3 + 3x4 = 25
2x1 - x2 + 10x3 – x4 = –11
3x2 - x3 + 8x4 = 15
The equations can be written as follows:
= 0.8789