Solution of Systems of Linear Eq
Solution of Systems of Linear Eq
……………………………………..
a n 1 x 1+ an 2 x 2 +… ..+a nn x n=b n
Adding the above equation to the second equation of Eq. (2), we obtain
¿
Which can be written as
á 22 x 2+ á23 x 3 +…+ á2 n x n= b́2,
a21
wherea´22=(a 22−a12 a ). Similarly we can multiply the first equation by (−a31 /a11 ) and
11
add it to the third equation of the system (2). This eliminates the unknown x 1 from
the third equation of Eq.(2) and we obtain
á 32 x 2+ á33 x 3 +…+ á3 n x n= b́3
We can eliminate x 1from the remaining equations and after eliminating x 1 from the
last equation of Eq.(2), we obtain the system
a 11 x 1 +a 12 x 2+ a13 x 3 +…+ a1 n 1 x n=b 1
a´22 x 2+ á23 x 3 +…+ á2 n x n= b́2
……………………………………..
a´n 2 x 2+ a´n 3 x3 + …+ a´nn x n=b́n
Now, to eliminate x 2 from the third equation of (3), we multiply the second
equation by −a´32/ a´22 and add it to the third equation. Repeating this process with the
remaining equations, we obtain the system
……………………………………..
a¨n 3 x 3 +…+ a¨nn x n=b¨n
It is easily seen that this procedure can be continued to eliminate x 3 from the fourth
equation onward, x 4 from the fifth equation onwards etc., till we finally obtain the
upper-triangular form:
a 11 x 1 +a 12 x 2+ a13 x 3 +…+ a1 n 1 x n=b 1
a´22 x 2+ á23 x 3 +…+ á2 n x n= b́2
……………………………………..
(n−1) (n−1)
a nn xn =bn
Where a(n−1)
nn indicates that the element a nn has changed (n-1) times.
Step2:we now have to obtain the required solution from the system (5) . From the
last equation of this system , we obtain
(n−1)
bn
x n= (6)
a(n−1)
n
Next we have to eliminated y from second and third equation of the systems(8).
For this multiplying second by (-7) and add to third, this gives
−4 z=−20
then we find the largest available coefficient in the columns below the pivot
equation and then interchanging the two rows. In this way, we obtain a new pivot
equation with a nonzero pivot. Such a process is called partial pivoting, since in
this case we search only the column below for the largest below.
If on the other hand, we search both column and rows for the largest element, the
procedure is called complete pivoting. It is obvious that that complete pivoting
involves more complexity in computations since interchanging of columns means
change of order of unknowns which invariably requires more programming effort.
In comparison, partial pivoting i.e., row interchanges, is easily adopted in
programming. Due to this reason, complete pivoting is rarely used.
Example2: Solve the system using partial pivoting
2 x+ y+ z =10
3 x+ 2 y +3 z=18
x +4 y+ 9 z =16
Solution:
3 x+ 2 y +3 z=18
2 x+ y+ z =10
x +4 y+ 9 z =16 (1)
We first eliminate x from the second and third equations. For this we multiply the
first equation by(-2/3) and ad to the second to get
−1
y−z=−2
3
Similarly, we multiply the first equation by (-1/3) and ad to the third to get
10
y +8 z=10
3
We have the following derived system
3 x+ 2 y +3 z=18
1
y−z =−2
3
10
y +8 z=10 (2)
3
The system written as
3 x+ 2 y +3 z=18
10
y +8 z=10
3
1
y−z =−2 (3)
3
Next we have to eliminate y from second and third equation of the systems (3). For
this multiplying second by (-1/10) and add to third, this gives
−18/10 z=−3
x +3 y+ z=10
0+ y+ 4 z=14
0+ 0+ z=3 (5)
Step 6: Eliminate z from the first and second equations. We get
x +0+0=1
0+ y+ 0=2
0+ 0+ z=3 (6)
Hence the solution ( x , y , z )=( 1, 2 , 3)
LU Decomposition Method:
Consider a system of equation
a 11 x 1 +a 12 x 2+ a13 x 3=b 1
a 21 x 1+ a22 x 2 +a23 x3 =b2 (1)
a 31 x 1+ a32 x 2+ a33 x 3=b3
( ) ( ) ( )
a11 a12 a13 1 0 0 u 11 u12 u 13
Where, A= a21 a22 a23 , L= l 21 1 0 and U = 0 u22 u 23
a31 a32 a33 l 31 l32 1 0 0 u 33
( )( )( )
a11 a12 a13 1 0 0 u11 u12 u13
a21 a22 a23 = l 21 1 0 0 u22 u23
a31 a32 a33 l 31 l 32 1 0 0 u33
( )( )
a11 a12 a13 u 11 u12 u13
a21 a22 a23 = l 21 u 11 l 21 u12 +u22 l 21 u 13+u23
a31 a32 a33 l 31 u 11 l 31 u12 +l 32 u22 l 31 u 13+l 32 u 23
( )( ) ( )
a11 a12 a13 3 2 1 1 0 0
where A= a21 a22 a23 = 2 3 2 , L= l 21 1 0
a31 a32 a33 1 2 3 l 31 l 32 1
( )
u 11 u12 u 13
and U = 0 u22 u 23 .
0 0 u 33
a21 2
l 21= = , l 22=1
a11 3
2 5 2 4
u22=a22−l 21 a12=3− ×2= , u23=a23−l 21 a 13=2− ×1=
3 3 2 3
( ) ( )
1 0 0 3 2 1
Thus we have, L= 2/3 1 0 and U = 0 5/3 4 /3
1/3 4 /5 1 0 0 24 /15
[ ]
a11 a12 a13 ⋮ 1 0 0
a21 a22 a23 ⋮ 0 1 0
a31 a32 a33 ⋮ 0 0 1
[ ]
1 0 0 ⋮ á11 á12 á13
0 1 0 ⋮ á21 á22 á23
0 0 1 ⋮ á31 á32 á33
The right-hand side of the augmented matrix is the inverse of A . Now we can
obtain the solution as follow:
x 1=á 11 × b1 + á 12 ×b 2+ á13 × b3
x 2=á 21 ×b 1+ á22 × b2 + á23 ×b 3
x 3=á 31 ×b 1+ á32 × b2 + á33 ×b 3