0% found this document useful (0 votes)
37 views

Chapter - 4 Matrices

The document summarizes key concepts related to matrices and systems of linear equations. It defines types of matrices like identity, unit, lower triangular, upper triangular, diagonal, tridiagonal matrices. It also discusses operations on matrices like transpose, determinant, addition, and multiplication of matrices. Methods for solving systems of linear equations are covered, including Gauss elimination method and iterative methods like Jacobi and Gauss-Seidel methods. An example demonstrates solving a system of equations using the Gauss method.

Uploaded by

Mustafa Yılmaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Chapter - 4 Matrices

The document summarizes key concepts related to matrices and systems of linear equations. It defines types of matrices like identity, unit, lower triangular, upper triangular, diagonal, tridiagonal matrices. It also discusses operations on matrices like transpose, determinant, addition, and multiplication of matrices. Methods for solving systems of linear equations are covered, including Gauss elimination method and iterative methods like Jacobi and Gauss-Seidel methods. An example demonstrates solving a system of equations using the Gauss method.

Uploaded by

Mustafa Yılmaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

CHAPTER 4

SOLVİNG LINEAR SETS OF


EQUATIONS AND MATRICIES
A is a n×m matrix:n row, m cloumn

A   aij  i=1,2,…,n j=1,2,…,m

 a1,1 a1,2 ....... a1,m 


a a ....... a2,m 
A   aij    2,1 2,1

 ....... 
 
 an ,1 an ,2 ....... an ,m 

2
The Identity Matrix Of Order n: In
1 0 0 0
0 1 0 0 
I4  
0 0 1 0
 
0 0 0 1
Unit Vector Lower Triangula Matrix

1   0   0   1 0 0
0  , 1  or 0  L   4 6 0 
     
0  0  1   2 1 4 

Upper Triangular Matrix


1 2 3
U  0 1 0
0 0 1 
3
Diagonal Matrix Tridiagonal Matrix
4 0 0 0 4 2 0 0 0 
0 4 0 0 
1 4 1 0 0 
  
0  0 1 4 1 0
0 4 0  
   0 0 1 4 1 
0 0 0 4  0 0 0 2 4 

Transpose Of A

3 1 4   3 0 1
A  0 2 3  AT   1 2 1 
1 1 2   4 3 2 

4
The Determinant Of Square Matrix

 5 3 
A  Det ( A)  (5).(2)  (3).(7)
 7 2

5
Ex: Calculate determinant of given matrix.
3 0 1 2 
4 
1 3 2 
A
0 2 1 3 
 
1 0 1 4
1 3 2 4 3 2
Det ( A)  (1)11 (3) 2 1 3  ( 1)1 2 (0) 0 1 3
0 1 4 1 1 4

4 1 2 4 1 3
 (1)13 (1) 0 2 3  ( 1)1 4 (2) 0 2 1
1 1 4 1 0 1

6
Ex: Calculate determinant of given matrix. 3 0 1 2 
4 1 3 2 
A
0 2 1 3 
 
1 0 1 4

 11 1 3 1 2 2 3 1 3 2 1 
Det ( A)  3 (1) (1)  (1) (3)  (1) (2) 
 1 4 0 4 0 1 

 11 2 3 1 2 0 3 1 3 0 2
1 (1) (4)  (1) (1)  (1) ( 2) 
 1 4 1 4 1 0

 11 2 1 1 2 0 1 1 3 0 2
2 (1) (4)  (1) (1)  (1) (3) 
 0 1 1 1 1 0 

=-146 7
Calculate determinant of given matrix.
2 1 3 0 2 1 3
4 2 7 0 
A Det ( A)  (1)3 4 (5) 4 2 7
 3 4 1 5
  6 6 8
6 6 8 0

 11 2 7 1 2 4 7 1 3 4 2 
 5 (1) (2)  (1) (1)  (1) (3) 
 6 8 6 8 6 6 

Det(A)=-5 2(−28 + 67) + 1(48 − 76) +

8
Summation Of Two Matrices

C=A+B

cij  aij  bij

 a11 a12   b11 b12   a11  b11 a12  b12 


c     
 a21 a22  b21 b22   a21  b21 a22  b22 

9
Multiplication of Two Matrices

 aik   bkj   cij  i=1,2,…n


j=1,2,…,m

m
cij   aik bkj
k 0

10
 a1,1 a1,m   b1,1 b1,r 
   
A(n, m) xB(m, r )    
a an,m   bm,1 bm,r 
 n,1

 (a1,1b1,1  a1,2b2,1  a1,3b3,1   a1,mbm,1 ) (a1,1b1,r  a1,2b2,r  a1,3b3,r   a1,mbm,r ) 


 
 
 (a b  a b  a b   a b ) (an,1b1,r  an,2b2,r  a1,3b3,1   an,mbm,r ) 
 n,1 1,1 n,2 2,1 n,3 3,1 n , m m ,1

1 3 5   2 1 6   1 2  3  3  5  3 11  3  2  5  7 1 6  3  4  5 1   26 42 23
 2 4 5   3 2 4    2  2  4  3  5  3 2 1  4  2  5  7 2  6  4  4  5 1   31 49 33
      
 2 3 6   3 7 1   2  2  3  3  6  3 2 1  3  2  6  7 2  6  3  4  6 1  31 50 30 

11
Consider Sets of Linear Equations
a1,1 x1  a1,2 x2   a1, n xn  b1
a2,1 x1  a2,2 x2   a2, n xn  b2

an ,1 x1  an ,2 x2   an , n xn  bn

 a1,1 a1,2 a1,3 a1, n   x1   b1 


a a2,2 a2,3 a2, n   x2  b2 
 2,1   
    
    
 an ,1 an ,2 an ,3 an ,n   xn  bn 

12
Methods of Solution of System of
Linear Equations
• There are two classes of methods for solving
system of linear, algebraic equations:
• 1) direct methods
• 2) iterative methods.
• direct methods are that they transform the
original equation into equivalent equations
(equations that have the same solution) that
can be solved more easily.

13
• Iterative or indirect methods, start with a
guess of the solution x, and then repeatedly
refine the solution until a certain convergence
criterion is reached.

• Direct Methods:
– Gauss Elimination Method
– Gauss-Jordan Method
– Matrix Inverse Method
– Crout’s Method
14
• Indirect or Iterative Methods:
– Jacobi’s Iteration Method
– Gauss-Seidal Iteration Method
– SOR Method

• Gauss elimination is a popular technique for solving


simultaneous linear algebraic equations. It reduces the
coefficient matrix into an upper triangular matrix through
a sequence of operations carried out on the matrix.
• Gauss elimination with Pivoting:
In this method, we select at each stage the numerically
largest coefficient of the complete matrix of coefficients.
This procedure leads to an interchange of the rows as
well as interchange of the position of variables.

15
Gauss Method:
Ex: Solve the given sets of equations by applying Gauss Method.

4 x1  2 x2  x3  15  4 2 1  x1  15 
    
3 x1  x2  4 x3  8  3 1 4 x 
   
2 8
 1 1 3  x   13 
x1  x2  3 x3  13   3   
Augmented Matrix
1) We may multiply any row of

 4 2 1
augmented matrix by a constant.
15 
  2) We can add one row to a multiple of
 3 1 4 8 any other row.
 1 1 3 13 
 3) We can interchange the order of two
rows.

16
Augmented Matrix
 4 2 1 15   4 2 1 15 
   
 3 1 4 8 3R1  4 R2   0 10 19 77 
 1 1 3
 13   R1  4 R3   0 2 11 37 

 4 2 1 15 
 
 0 10 19 77 
2 R2  10 R3   0 0 72 216 

 72 x3  216  x3  3
 10 x2  19 x3  77  x2  2
4 x1  2 x2  x3  15  x1  2
17
Ex:
Solve the given sets of equations by applying Gauss method with pivoting
2 x2  x4  0
2 x1  2 x2  3 x3  2 x4  2
0 2 0 1 0
 
4 x1  3 x2  x4  7 2 2 3 2 2 

6 x1  x2  6 x3  5 x4  6  4 3 0 1 7 
 
 6 1 6 5 6

interchange 1st and 4th rows ,then it becomes

 6 1 6 5 6
 
2 2 3 2 2 
 4 3 0 1 7 
 
0 2 0 1 0
18
Ex:
Solve the given sets of equations by applying Gauss method with pivoting

6 1 6 5 6 
 
(1/ 3) R1  R2   0 1.6667 5 3.667 4 
(4 / 6) R1  R3   0 3.6667 0 4.333 11
 
0 2 0 1 0 

interchange 2nd and 3th rows


6 1 6 5 6 
 
 0 3.6667 0 4.333 11
 0 1.6667 5 3.667 4 
 
0 2 0 1 0  19
interchange 2nd and 3th rows
6 1 6 5 6 
 
 0 3.6667 0 4.333 11
 0 1.6667 5 3.667 4 
 
0 2 0 1 0 

6 1 6 5 6 
 
 0 3.6667 4 4.3333 11 
( R2 1.6667) / 3.6667  R3   0 0 6.8182 5.6364 9.0001 
 
( R2  2) / 3.6667  R4   0 0 2.1818 3.3638 5.9999 

20
6 1 6 5 6 
 
 0 3.6667 4 4.3333 11 
0 0 6.8182 5.6364 9.0001 
 
0 0 2.1818 3.3638 5.9999 

6 1 6 5 6 
 
 0 3.6667 4 4.3333 11 
0 0 6.9182 5.6362 9.001 
 
( R3  2.1818) / 6.8182  R4   0 0 0 1.56 3.1199 

1.56 x4  3.1199  x4  1.9999


6.8182 x3  5.6364 x4  9.001  x3  0.33325
3.6667 x2  4 x3  4.3333x4  11  x2  1.000
6 x1  x2  6 x3  5 x4  6  x1  0.5000

21
• Gauss-Jordan method is an extension of the
Gauss elimination method. The set of
equations Ax = b is reduced to a diagonal set
Ix = b', where I is a unit matrix. This is
equivalent to x = b'. The solution vector is
therefore obtained directly from b'.

22
GAUSS-JORDAN METHOD 3x1  0.1x2  0.2 x3  7.85
Ex: Use the Gauss-Jordan to solve
0.1x1  7 x2  0.3x3  19.3
0.3x1  0.2 x2  10 x3  71.4

 3 0.1 0.2  x1   7.85 


    
 0.1 7 0.3  x2    19.3 
 0.3 0.2 10  x   71.4 
  3   

 3 0.1 0.2 7.85 


 
 0.1 7 0.3 19.3 
 0.3 0.2 10 71.4 

23
GAUSS-JORDAN METHOD 3x1  0.1x2  0.2 x3  7.85
Ex: Use the Gauss-Jordan to solve
0.1x1  7 x2  0.3x3  19.3
0.3x1  0.2 x2  10 x3  71.4

R1  R1 / 3   1 0.0333 0.0666 2.6166 


 
 0.1 7  0.3 19.3 
 0.3 0.2 71.4 
 10

 1 0.0333 0.0666 2.61667 


 
R2  0.1R1  R2   0 7.0033 0.2983 19.5619 
R3  0.3R1  R3   0 0.19 10.02 70.615 

24
 1 0.0333 0.0666 2.61667 
R2  
R2   0 1 0.0418843 2.7932 
7.00333 
 0 0.19 10.02 70.616 

R1  0.0333R2  R1   1 0 0.0680 2.52356 


 
 0 1 0.0418 2.7932 
R3  0.19 R2  R3   0 0 10.012 70.0843 

25
 1 0 0.0680 2.5236 
 
 0 1 0.0418 2.7932 
R3  R3 /10.012   0 0 1 7.0003 

R1  0.0680 R3  R1   1 0 0 3 
 
R2  0.0418R3  R2   0 1 0 2.50001
0 0 1 7.00003 

then x1  3; x2  -2,50001; x3  7, 00003
26
• MATRIX INVERSION METHOD
• The requirements for obtaining a unique inverse
of a matrix are:
• 1. The matrix is a square matrix
• 2. The determinant of the matrix is not zero (the
matrix is non-singular)
• The inverse of a matrix is also defined by the
relationship:

• Linear set of equations can be expressed in the
matrix form Ax=b
• Premultiplying by the inverse we obtain the
solution of x as

27
MATRIX INVERSION METHOD
Ax  b
A1 Ax  A1b
 A / I    I / A 1

x  A1b
Example: Find numerical solution of the system of linear equations by
applying matrix inversion method.
2x  y  7
x  2 y  z  1
 y  2z  1

 2 1 0  x   7   2 1 0 1 0 0
      
 1 2 1 y    1    1 2 1 0 1 0
 0 1 2  z   1   0 1 2 0 0 1 
     
28
R1 R2  1 2 1 0 1 0
 
 2 1 0 1 0 0
 0 1 2 0 0 1 

R1  R1  1 2 1 0 1 0 
 
 2 1 0 1 0 0
 0 1 2 0 0 1 

 1 2 1 0 1 0 
 
R2  2 R1  R2  0 3 2 1 2 0
 0 1 2 0 0 1 

29
 1 2 1 0 1 0 
 
R2 R3  0 1 2 0 0 1
 0 3 2 1 2 0 

 1 2 1 0 1 0 
 
 0 1 2 0 0 1
R3  3R2  R3  0 0 4 1 2 3 

 1 2 1 0 1 0 
 
 0 1 2 0 0 1 
R3  R3 / 4  0 0 1 0.25 0.5 0.75 
30
R1   R3  R1  1 2 0 0.25 1.5 0.75 
 
R2  2 R3  R2  0 1 0 0.5 0 0.5 
0 0 1 0.25 0.5 0.75 

R1  2 R2  R1  1 0 0 0.75 0.5 0.25 


 
 0 1 0 0.5 1 0.5 
0 0 1 0.25 0.5 0.75 

31
 0.75 0.5 0.25 
1   Ax  b
A   0.5 1 0.5  1 1
 0.25 0.5 0.75  A Ax  A b
  x  A1b

 x   0.75 0.5 0.25  7   6 


      
y
   0.5 1 0.5 1  5
   
 z   0.25 0.5 0.75  1   3 
      
x  6; y  5; z  3

32
• L-U DECOMPOSITION METHOD
• This method is based on the fact that every
square matrix A can be expressed as the
product of a lower triangular matrix and an
upper triangular matrix.
• We factorise the given matrix as A = LU, where
L is a lower triangular matrix and U is an upper
triangular matrix with unit diagonal elements.

33
L-U DECOMPOSITION METHOD

Ax=b; A=LxU
Ax  b
LUx  b; Let Ux  t  Lt  b

Let Lt  b, then find t


Ux  t ; then find x
34
A=LxU  a11 a12 a13 
 
A   a21 a22 a23 
a a33 
 31 a32
CROUT METHOD

 l11 0 0  1 u12 u13 


   
L   l21 l22 0 U  0 1 u23 
l 0 0 1 
 31 l32 l33  

35
Ex: Consider the matrix A find lower triangular
(L) and upper triangular (U) matrices.

3 1 2 
 
A  1 2 3
2 2 1

 l11 0 0   1 u12 u13   3 1 2 
     
 l21 l22 0    0 1 u23    1 2 3 
l l32 l33   0 0 1   2 2 1
 31
36
• In the following calculations:
(1r ,1c)  l11 1  3  l11  3

• (1r,1c) presents multiplacion of first row of


lower triangular matrix with the 1 column of
upper triangular matrix. Result equals to the
element at first row, first column (1r,1c) of
matrix A.

37
(1r ,1c)  l11 1  3  l11  3
1
(1r , 2c)  l11  u12  1  u13 
3
2
(1r ,3c)  l11  u13  2  u13 
3

(2r ,1c)  l21 1  1  l21  1


(2r , 2c)  l21  u12  l22 1  2
7
1 (1/ 3)  l22  2  l22 
3
(2r ,3c)  l21  u13  l22  u23  3
1 (2 / 3)  (7 / 3)  u23  3  u23  1
38
(3r ,1c)  l31 1  1  l31  2
(3r , 2c)  l31  u12  l32 1  2
4
2  (1/ 3)  l32  2  l32 
3
(3r ,3c)  l31  u13  l32  u23  l33 1  1
2  (2 / 3)  (4 / 3) 1  l33  1  l33  1

3 0 0  1 1/ 3 2 / 3 
   
L  1 7 / 3 0  U  0 1 1 
 2 4 / 3 1 0 
   0 1 

39
Ex: Find the solution of the systems of equations
by using L-U decomposition method.

3x  y  4 z  6; y  z  2; 2x  y  z  3

3 1 4  x   6 
    
0 1 1  y    2 
2 1 1    3
    
z
 l11 0 0  1 u12 u13   3 1 4 
    
l
 21 l22 0  0 1 u23    0 1 1 
l l32 l33   2 1 1 
 31  0 0 1   
40
(1r ,1c)  l11 1  3  l11  3
1
(1r , 2c)  l11  u12  1  u13 
3
4
(1r ,3c)  l11  u13  4  u13 
3

(2r ,1c)  l21 1  0  l21  0


(2r , 2c)  l21  u12  l22 1  1
0  (1/ 3)  l22  1  l22  1
(2r ,3c)  l21  u13  l22  u23  1
0  (4 / 3)  (1)  u23  1  u23  1

41
(3r ,1c)  l31 1  2  l31  2
(3r , 2c)  l31  u12  l32 1  1
1
2  (1/ 3)  l32  1  l32 
3
(3r ,3c)  l31  u13  l32  u23  l33 1  1
2  (4 / 3)  (1/ 3)  (1)  l33  1  l33  4

42
 3 0 0  1 1/ 3 4 / 3 
   
AX  b L  0 1 0 U  0 1 1 
 2 1/ 3 4  0 0 
   1 

Ax  b
LUx  b; Let Ux  t  Lt  b

Let Lt  b, then find t


Ux  t ; then find x
43
 3 0 0  t1   6 
    
 0 1 0 t 
   
2 2  t1  2, t 2  2, t3  0.4167
 2 1/ 3 4  t   3 
  3   

Ux  t
 1 0.3333 1.3333  x   2 
    
0 1 1  y    2 
0  z   0.4167 
 0 1    
 z  0.4167, y  1.3833, x  0.9167
44
ILL CONDITONED MATRICES
• When there are many equations, the effects of
round-off (the term is applied to the error due to
chopping as well as when rounding is used) may
cause large effects. In certain cases, the
coefficients are such that the results are
particularly sensitive to round off, such systems
are called ill-conditioned.
• When a system is ill-conditioned, the solution is
very sensitive to changes in the right-hand vector.
It is also sensitive to small changes in the
coefficients.

45
ILL CONDITONED MATRICES
det( A)
if 1, then the matriceis ill conditioned matrice
n n

 ij
a 2

i 1 j 1
Ax  R
Ax '  R '
A( x  x ')  R  R '
x  x'  E
R  R'  r
then, A  E  r
E=A 1  r
x  x ' =E
 x  E  x'
46
Example: Examine if the following linear equation system is ill
conditioned. If it is, solve it to overcome the ill conditioning.

By applying Gauss elimination method, we obtain a=1 ve b=4


We apply the criterion given for ill conditioned matrix.

det( A)
if 1, then the matrice is ill conditioned matrice
n n

 ij
a 2

i 1 j 1

47
The system of equations is ill conditioned.
If we write a2,2=1.343 instead of a2,2=1.344.

 2.3 4.015  a   18.36 


     
 0.77 1.343  b   6.146 
We obtain
a  7.0604; b  0.5283

 2.3 4.015  7.0604   18.36 


R  A x  
' '
  
 0.77 1.344  0.5283   6.14654 
 18.36   18.36   0 
RR 
'
  r
 6.146   6.14653   0.00053 
A E  r
48
 2.3 4.015   e1   0   e1   6.0546 
 e      e    
 0.77 1.344  2   0.00053   2  3.4684 
x  x'  E
 7.0604   6.0546   1.0058 
   
 0.5283   3.4684   3.9967 

If this process is repeated one more


time, we obtain
a=0.99996 and b=4.00014

49

You might also like