# Matrix Algebra

Solution to Simultaneous Algebraic Equations – Gauss Elimination
Method:
Consider n simultaneous
a 11 x 1 + a 12 x 2 +, a 13 x 3
a 21 x 1 + a 22 x 2 + a 23 x 3
a 31 x 1 + a 32 x2 + a 33 x 3

equations ,
………… + a 1n x n = b1
…………+ a 2n x n = b2
………… + a 3n x n = b3

an1 x 1 + a n2 x 2 + a n3 x 3 ……… + a nn x n = bn
write the given set of equations in matrix form,
a 11
a 21
a 31
.
.
.
.
a n1

a 12
a 22
a 32
.
.
.
.
a n2

a 13
a 23
a 33
.
.
.
.
a n3

….
….
….
….
….
….
….
….

a 1n
a 2n
a 3n

a nn

x1
x2
x3

xn

=

b1
b2
b3

bn

In Gauss elimination method the variables x2, … ………… …… x n-1, will be
successively eliminated using Row Operations. This step is called forward elimination
. The given matrix will be converted to into an upper triangular matrix, Lower triangular
elements become zeros.
After forward elimination the nth equation (last equation) become simple , it as an
equation with one variable xn , determine xn. Now using (n-1)th equation xn-1 can be
determined. Similarly using (n-2)nd equation xn-2 can be determined. Using (n-3)rd
equation xn-3 can be determined. Continue up to first equation until all the unknowns are
determined. This is called backward substitution.
Forward Elimination
Step 1 : a11 becomes pivot, eliminate x1 from row2 , row3, row4,

Row2 a 21 = a 21 - ( a 21 / a 11) a 11
a 22 = a 22 - ( a 21 / a 11) a 12
a 23 = a 23 - ( a 21 / a 11) a 13

row n etc

a 21 becomes 0
a 22 changes
a 23 changes
1

row n following the same method Now. First row . Now. row5.( a n1 / a 11) a 13 a n3 changes etc up to a nn = a nn ..( a n1 / a 11) a 1n a nn changes b3 = b3 .( a 21 / a 11) b1 b2 changes whatever we did to make a 21 = 0 applied the same to other elements of that row Row3 a 31 = a 31 . eliminate x3 from row4 . row6.( a 31 / a 11) a 1n a 3n changes b3 = b3 . re-write the whole matrix equation. Second row . re-write the whole matrix equation. First row remains same.( a 31 / a 11) b1 b3 changes whatever we did to make a 31 = 0 applied the same to other elements of that row ……………………………………………………………………………… ……………………………………………………………………………… ……………………………………………………………………………… Row n a n1 = a n1 . x4 … ………………………. Step2 : : a22 becomes pivot. Third row remains same.( a 31 / a 11) a 13 a 33 changes etc up to a 3n = a 3n .( a n1 / a 11) a 11 a n1 becomes 0 a n2 = a n2 .( a n1 / a 11) a 12 a n2 changes a n3 = a n3 .( a 31 / a 11) a 11 a 31 becomes 0 a 32 = a 32 ..( a 21 / a 11) a 1n a 2n changes b2 = b2 . etc.( a 31 / a 11) b1 b3 changes whatever we did to make a n1 = 0 applied the same to other elements of that row. row4. row n following the same method Now. elements of other rows will be different.( a 31 / a 11) a 12 a 32 changes a 33 = a 33 . eliminate x2 from row3 .… x n-1 will be successively eliminated and all the lower triangular elements becomes zero.etc up to a 1n = a 2n . etc. elements of other rows will be different Continue until the variables x2. 2 . Second row remains same. elements of other rows will be different Step3 : : a33 becomes pivot. First row . row5. x3. re-write the whole matrix equation.

Different Methods used to Solve Set of Simultaneous Equations in FEM. 5x1 + 3x2 + 2x3 + x4 = 4 4x1 + 3x2 . using (n-1)th equation xn-1 can be determined. Solve the following set of equation by Gaussian elimination technique. it as an equation with one variable xn .2x4 = 5 x1 + 2x2 .2x3 + 3x4 = 6 -4x1 + 3x2 – 5x3 + 2x4 = 7 Solution : Write the given equations in Matrix Form 5 3 2 1 x1 4 4 3 -3 -2 x2 5 1 2 -2 3 -4 3 -5 2 * x3 = x4 6 7 [ CO ] [ X ] = [ CONS ] [ a ] [x] = [b] 3 . Using (n-3)rd equation xn-3 can be determined. Continue up to first equation until all the unknowns are determined. Now .3x3 . determine xn. Similarly using (n-2)nd equation xn-2 can be determined. After forward elimination the nth equation (last equation) become simple . The method is best understood by solving problems.Backward substitution. Method of Matrix Inversion Gauss elimination method Cholesky Decomposition Technique Gauss-Seidal Iteration Technique Relaxation Method Numerical examples illustrating Gauss elimination method : Problem 1.

3.2 i = 4 b4 = 7 – (-4/5)4 = 10.4 -4 – ( -4 / 5)5 = 4 .8 x4 10.2.4 -5 – ( -4 /5) 2 = -5 + 1.4 = 5.4 -2 – (1/5) 2 = -2– 0.8 i = 3 b3 = 6 – (1/5)4 = 5.6 = 1.4 2.4 4 – (4/5) 5 = 4 – (4) = 0.3.4 = 0.3.8 * x3 = 5.6 -2.6 = -3 . j = 1.Step 1 : a i j = a i j – (a i1 / a 11) a 1j i = 2. 3rd and 4th equations.8 Row 4 : i = 4 j = 1.8 b i = b i – (a i1/ a11) b 1 i = 2 b2 = 5 – (4/5)4 = 1.2.4 2.4 -2.8 = -2.2 = 2.6 = -4.6 -4.0 2 – (1/5)3 = 2 -0 .6 -3 – (4/5)2 = -3 –1.8 x2 1.2.4= -2.0 3 – (4/5) 3 = 3 – 2.4 b i = b i – (a i1 / a 11 ) b 1 Row 2 i = 2 j = 1.6 -2 – (4/5) 1 = -2 – 0.2 = 2.2 4 .2. 5 3 2 1 x1 4 0 0.8 Row 3 i = 3 j = 1.4 3 – (1/5) 1 = 3 – 0.2 0 5.8 0 1.4 = 0 3 – ( -4 / 5)3 = 3+2.4 2 – ( -4 /5) 1 = 3 – 0. after eliminating x1 from 2nd .4 -3.4 1 – (1/5)5 = 1 – 1 = 0.2 The modified matrix equation .3.

4 – 1.8 x2 1.4 5.2 .8 = 5.(1.4/0.6) (-4.6) = -3.6) 1.33 = 38 – 38 = 0.2 = 1 i = 4 b4 = b4 – (a42/a22)b2 10.8 = 10.8) = -2.6)2.2 – 4.0 5 .(5.3.33 9.4/0.73 =8.4 – (1.6) = – 2.6 -4.8 = 2.0 j = 2 -3.4-5.4/0.2 = -6 The modified matrix after step 2 eliminating x2 from 3rd and 4th equations.6 = 5.6)1.8 0 0 8. 5 3 2 1 x1 4 0 0.4 – (5.8 – (5.4/0.4/0.4/0.8 +25.Step 2 : To eliminate x2 from Row 3 and Row 4 a i j = a i j – (a i2 / a 22) a 2j b i = b i – (a i2 / a 22 ) b 2 i = 3.4/0. j = 2.4+10.6)0.33 j = 3 2.0 j = 2 -2.2 .2 = 28 j = 4 b i = b i – (a i2/ a22) b 2 i = 3 b3 = b3 – (a32/a22)b2 5.4/0.8 – 6.4 Row 3 i =3 j = 2.32 * x3 0 0 x4 38 28 Step 3 : To eliminate x3 from Row 4 a i j = a i j – (a i3 / a 33) a 3j = 1 -6 b i = b i – (a i3 / a 33 ) b 3 i = 4.8 – (1.6)(-2.4 = 0.4 a43 = a43 – (a43/ a33) a33 = 38 – (38 / 8.4 = 38 j = 3 2.4+41.33) 8. j = 3.6)(-4.6 =1.4 = 0.3.3.6 -2.6) 0.4 1.4 – (1.53 = 9.2 -16.4– (5.33 j = 4 Row 4 i=4 j = 2.

1878 + 2.52 x4 1 10.3.32 = 28 – 42.8 0.8 .1878 + 2.727 ) = 1 x3 = (1 .693 x4= 0.32 (0.33) 1 = . b4 = b4 .693 0.0.8 .33 = .693) -2. after step 3 .0356) x2 = (1.8 0 0 8.(a43/ a33) a34 = 28 .0.56/ -1 4.33 x3 + 9.3 (1.079) + 2 ( .8 8.(a43/ a33) b3 b4 = -6 .8 x4 = 1.693) + 0.52 b i = b i – (a i3/ a33) b 3 i = 4.693) .32 * x3 = 0 0 0 14.0.6 = 1.727 6 .33 9.776) / 8.3.6 x2 – 4.52 = -1 4.4.0.56 The modified matrix.6 -2.727 = 4 x1 = ( 4 .727 ) / 5 = 0. eliminating x3 from 4th equation.33) 9.52 x4 = -10.0356) / 0.6 x3 .(38 / 8. 5 3 2 1 0 0.155 x2=1.56 x4 = ( -1 0.8 x1 4 x2 1.6( .32 x4 = 1 -14.33 x3 + 9.155 x1= 0.6 x2 – 4.079) + 2 (0.0.6 x2 = (1.52) = 0.(38 / 8.6 -4.a44 = a44.079 x3= .727 8.6 .727) = 1.56 = .56 Back Substitution: The modified equations are 5 x1 + 3 x2 + 2 x3 + x4 = 4 0.8 (0.2.10.079 5x1 + 3 (1.6.

Prob2 : Solve using gauss elimination method x1.(2/1)* 1 = 0 -1.3 j = 2.(a i1 / a11) b1 3 – (2/1) *0 = 3 2 – (-1/1) *0 = 2 Modified Matrix After step1 1 -2 6 x1 0 6 -9 x2 0 1 6 x3 Step 2 : a ij = 0 3 2 = a i j – (a i2 / a22) a2j i = 3 j = 2.(a i2 / a22) b2 2 – (1/6) 3 = 1.3 2.2x2 + 6 x3 = 0 ij 2x1 +2x2 + 3x3 = 3 1 -2 6 x1 2 2 3 x2 -1 3 0 x3 -x 1 + 3x2 = 2 = 0 3 2 Step 1 : = a i j – (a i1 / a11) a1j I = 2.(-1/1) 1 = 0 a 2 – (2/1) (-2) = 6 3 – (2/1) (6) = -9 3 – (-1/1) (-2) = 1 0 – (-1/1) 6 = 6 bi = bi .5 7 .5 bi = bi .3 1 – (1/6)* (6) = 0 6 – (1/6) (-9) = 7.

5 x3 = 1.(a i1 / a11) b1 4 – (8/4) 2 = 0 6 – (6/4) 2 = 3 8 .3 j = 2.5 x3 = 1.Modified Matrix After step2 1 -2 6 x1 0 6 -9 x2 0 0 7.(8/4)* 4 = 0 6 -( 6/4) 4 = 0 4 – (8/4) (6) = -8 2 – (6/4 (6) = -7 6 -( 8/4)8 = -10 4 – (6 /4) 8 = -8 bi = bi .5 x3 = 0 3 1.4 Prob 3 :Solve using gauss elimination method 4x1 +6x2 +8x3 = 2 8x1 +4x2 + 6x3 = 4 6x1 + 2x2+4x3= 6 Solution : writing the equations in matrix form 4 6 8 8 4 6 6 2 4 Step 1 : a ij = x1 2 x2 4 x3 6 = a i j – (a i1 / a11) a1j i = 2.8)–6(0.3 8 .5 = 0.2 6 x2 – 9x3 = 3 x2=(3 + 9(0.5 Back Substitution : 7.2))/6 =0.5 / 7.8 x2 = 0.8 x1 – 2x2 +6x3 = 0 x1 = 2(0.4 x1 = 0.2 x3 = 0.2) = 0.

75 x3 3 0.3 -7 – (-7/-8) (-8) = 0 -8 -(-7 / -8 )( -10) = -8 +70/8 = -8 + 8.75 = 4 -8 x2 -10 x3 = 0 4x1+6x2 + 8x3 = 2 -8x2 -10 (4) = 0 x3 = 4 -8x2 = 40 x2 = -5 4x1+ 6(-5) +8(4) = 2 x1 = (2+30 -32 ) / 4 =0 x1 = 0 x2 = -5 x3= 4 9 .75 x3 = 3 x3 = 3/0.75 = 0.(a i2 / a22) b2 3 – (-7/-8) 0 = 3 Modified matrix equation after step 2 : 4 6 8 X1 2 0 -8 -10 X2 0 0 0 0.Modified matrix equation after step 1 4 6 8 0 -8 -10 0 -7 -8 Step 2 : a ij = X1 2 X2 0 X3 3 = a i j – (a i2 / a22) a2j i = 3 j = 2.75 bi = bi .

333) = 4+ 2.(a i1 / a11) b1 6 – (2/3) 5 = 6-10/3 = 2.483 /4 = 0.333 3 -3 0 4 0 0 -2 4.33 4 7 – (3/3) 5 = 2 5 2.667 3.504 4x2 + 4.333 (0.33 3 -( 3/3) 3 = 0 -5 – (3/3 (-3) = -2 2 – (3/3)(-2) = 4 bi = bi .667 = 2+(2.667 2 Step 2 : a i j = a i j – (a i2 / a22) a2j i = 3 j = 2.166 x3 = 3.(-2/4)(4.667 .(a i2 / a22) b2 2 – (-2/4) 2.5x2+2x3= 7 3 -3 -2 2 2 3 3 -5 2 5 6 7 Step 1 : a i j = a i j – (a i1 / a11) a1j i = 2.504) 10 .Prob 4 : Solve using gauss elimination method 3x1 -3x2 -2x3 = 5 2x1+2x2+3x3= 6 3x1 .667 Modified matrix is 3 -3 0 4 0 -2 -2 4.333x3 = 2.333 x3 = ( 3.667/2) = 2+1.333 = 3.3 -2 .(2/3)(-3) = 4 3 -( 2/3)(-2) = 4.(-2/4)4 = 0 4 .3 2 .166 bi = bi .333 6.166 5 2.166) = 0.120 4x2 = 2.3 j = 2.333/6.166 = 6.667 x2 = 0.(2/3)3 = 0 2 .33 6.4.

120 x3 = 0.008) / 3 = 2.122 x1 = 2.504 THUS COMPLETE GAUSSIAN ELIMINATION TECHNIQUE 11 .504) = 5 x1 = (5 + 0.3x1 -3x2 – 2x3 = 5 3x1 -3(0.360 +1.120) -2(0.122 x2 = 0.

12 .

13 .

14 .

Sign up to vote on this title