You are on page 1of 54

Matrices and their Applicatio ns

Matrix : is an array contains of rows and columns


 a11 a12 a13 ....... ........ a1n
 a a22 a23 ...... 
......... a2 n
 21 
A   a31 a32 a33 ...... .....  a3n
 
 : : : : : : 
 am1 am 2 am 3 .... .... amn 
Amn m  No. of rows, and n  No. of Cols.
 
A  aij i  No. of rows, and j  No. of Cols.
Tikrit University-Civil Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Types of Matrices
1  Square Matrix : m  n or i  j
2  Diagonal Matrix : is a square matrix, all elements
are equal zero except elements of the main diagonal
[aij  0 in all cases i  j ]
3  Identity Matrix :is a square matrix, which elements
of the main diagonal are one, and other elements
are zero, denoted by I .
4  Symmetric Matrix : [aij  a ji ]
5  Sub  Matrix
Tikrit University-Civil Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
The Null Matrix
The Upper  Triangular Matrix
The Lower  Triangular Matrix
The Upper  Unit  Triangular Matrix

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Operations on Matrices
1  Addition and Subtractio n
An m  Bk l o.k . if and only if n  k and m  l
2  Multiply by cons tan t and divide on cons tan t
Ex :
 4 0  8 0
2   1 5   2 10
 6 1  12 2 

 
 4 0  2 0 
1 
  6 8   3 4 
2  5
 6 
5  3 
 Tikrit University-Civil
2  Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Deter min ant : is the value of a square matrix.
A det er min ant of first order consists of a sin gle
element like a and its value equal a.

Ex : Det. of 20  20  20

A det er min ant of sec ond order consists of 22  4 elements


 a1 b1 
Ex : A   Det. of A  a1b2  a2b1
a2 b2 

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Third order
a1 b1 c1
A  a2 b2 c2
a3 b3 c3
b2 c2 a2 c2 a2 b2
A  a1  b1  c1
b3 c3 a3 c3 a3 b3
 a1 (b2c3  b3c2 )  b1 (a2c3  a3c2 )  c1 (a2b3  a3b2 )

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Note

  
  
  
Tikrit University-Civil Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Example
1 2 3
A 0 2 1
3 2 3
* Use first row :
2 1 0 1 0 2
A 1 2  ( 3)
2 3 3 3 3 2
 1(6  2)  2(0  3)  3(0  6)
 8  6  18  20
Tikrit University-Civil Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
* Use sec ond row :
2 3 1 3 1 2
A  0  (  2) 1
2 3 3 3 3 2
 0  2(3  9)  1( 2  6)
 24  4  20
* Use third row :
2 3 1 3 1 2
A3 2 3
2 1 0 1 0 2
 3( 2  6)  2(1  0)  3( 2  0)
 12  2  6  20
Tikrit University-Civil Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Minor and Co  factors
The min or of an element of a det er min ant ( of one
order smaller ) lift out on the row and column deleting
with through that element .
a1 b1 c1
D  a2 b2 c2
a3 b3 c3
a1 b1 a1 c1
Minor of c2  and Minor of b2 
a3 b3 a3 c3

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Example : Let
1 3 4 5
3 0 1 6
D
4 2 2 6
5 7 9 8

1 3 5
The Minor of 9  3 0 6  ...........
4 2 6
Tikrit University-Civil Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
The Co  factor of any element of a det er min ant ( Aij )
that is (1)i  j times the min or of aij .
i j
Co  factor  (1)  the min or of that element .
Example :
a1 b1 c1
D  a2 b2 c2
a3 b3 c3
23
a1 b1
Co  factor of c2  (1)  (1)(a1b3  a3b1 )
a3 b3

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Other method to evaluate the value of det er min ants
Example

3 2 1 3 2
A  1 0 5 1 0
0 2 4 0 2

Det. of A  2  22  24
Tikrit University-Civil Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Tikrit University-Civil Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Re duction formula for evaluating the det er min ants
The formula for the det er min ant of an (n  n) matrix
A  (aij ) is

a11 a12 a11 a13 a11 a1n


.... ......
a21 a22 a21 a23 a21 a2 n
a11 a12 a11 a13 a11 a1n
..... ......
1 n  2 a31 a32 a31 a33 a31 a3n
Det. A  ( )
a11   
  
a11 a12 a11 a13 a11 a1n
 
an1 a n2 a a
n1Engineering
Tikrit University-Civil n3 an1 ann
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Example :
1 0 2 1
3 2 6 4
5 4 3 0
2 2 5 6
1 0 1 2 1 1
3 2 3 6 3 4
1 42 1 0 1 2 1 1
( )
1 5 4 5 3 5 0
1 0 1 2 1 1
2Tikrit University-Civil
2 2
Engineering
5 2 6
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
2 0 7
1 4 7 5
2 9 8
2 0 2 7
1 3 1 4 7 4 5
( )
2 2 0 2 7
2 9 2 8
1 14  38

2 18  30
1
  ( 420  684)  132
2
Tikrit University-Civil Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Useful Facts about determinants
1- If two rows or (columns) of a matrix are
identical, the determinant is zero.

2- Interchanging two rows or (columns) of a


matrix, change the sign of its determinant.

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
3- The determinant of a matrix is the sum of the
products of the elements of the ith row (column)
by their cofactors, for any i.

4-The determinant of the transpose of a matrix is


equal to the original determinant. ("Transpose"
means to write the rows as columns).

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
5- If each element of some row or (column) of a
matrix are multiplied by a constant C, the
determinant is multiplied by C.

6- If all elements of a matrix above the main


diagonal (or all below it) are zero, the determinant
of a matrix is [the product of the elements on the
main diagonal].
Tikrit University-Civil Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
7- If the elements of any row (or column) of a matrix
are multiplied by the cofactors of the corresponding
elements of a different row (or column) and these
products are summed. The sum is zero.

8- If each element of a row (column) of a matrix is


multiplied by a constant, C, and the results added to a
different row (or column) the determinant is not
changed.
Tikrit University-Civil Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Example : Pr ove without actual exp ansion that the
following det er min ant vanishes.
1 a bc
1 b ca
1 c ab
Solution
1 a bca
Col. 2  Col.3  1 b c  a  b
1 c abc
1 a 1
 (a  b  c) 1 b 1  Zero (becouse Col.1  Col.3)
Tikrit University-Civil Engineering
1Department
c Third 1 Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Multiplica tion of Matrices
Amn  Bkl is o.k . if and only if n  k
A B  B  A
Amn  Bnk  Cmk
A  A  A is o.k . if A is a square matrix
2

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
a b c  1 2 3
A  d e f  and B  4 5 6
 g h i  7 8 9

 1a  4b  7c 2a  5b  8c 3a  6b  9c 
A  B  1d  4e  7 f 2d  5e  8 f 3d  6e  9 f 
 1g  4h  7i 2 g  5h  8i 3g  6h  9i 

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Example :
1 3
 
3 1 2 5  0 5
A  and B 
1 0 3 1 2 6
 
1 0

3  0  4  5 9  5  12  0 12 26
A B     
 1  0  6  1 3  0  18  0   8 21
Tikrit University-Civil Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Matrices Multiplica tion has the following properties :

( AB )C  A( BC ) ( Associativ e Law)
A( B  C )  AB  AC ( Left distributi on Law)
( A  B)C  AC  BC ( Right distributi on Law)
( AT )T  A
( A  B)  A  B
T T T

( AB )T  BT AT

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Inverse of Square Matrices
If M n n  Pn n  Pn n  M n n  I
We call P the inverse of M , P  M 1
To find the inverse of a matrix whose det er min ant is
not zero, ( Det. formula )
 a1 b1 c1 
A  a2 b2 c2 
 a3 b3 c3 

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
1  Construct the matrix of cofactors of A:
 A1 B1 C1 
Cof . A   A2 B2 C2 
 A3 B3 C3 
Such that :
11
b2 c2
A1  (1)
b3 c3
1 2
a2 c2
B1  (1)
a3 c3
1 3
a2 b2
C1  (1)
a3 bUniversity-Civil
Tikrit 3 Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
2  Construct the transpose matrix of cofactors ,
(called the adjo int of A)
 A1 A2 A3 
Adj. A  (Cof . A)T   B1 B2 B3 
C1 C2 C3 
3  Then
1 1
A   Adj. A
Det. A

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Example : Use the det er min ant formula to find the inverse
of the following matrix :
 2 3  4
A  1 2 3 
3  1  1 
Solution :
 2 3 1 3 1 2 
   
 1 1 3 1 3 1
 3 4 2 4 2 3 
Cof . A     
 1 1 3 1 3  1
 3 4 2 4 2 3 
2 3

1 3

1 2 
 Tikrit University-Civil Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
1 10  7
Cof . A  
7 10 11 


17  10 1 

 1 7 17 
Adj . A  
 10 10  10


 7 11 1 

Det. A  60

 1 7 17 
 1 7 17   60 60 60 
1    10 10  10 
 A1   10 10  10   
60
  60 60 60 
  7 Tikrit11 1    7 11 1 
University-Civil Engineering
Department Third Stage Eng.Anal.&Num. 
 60 60 60 
Meth. Dr.Adnan Jayed Zedan
Simul tan eous linear a lg ebraic equations :

The general forms of these type of equations are :


a11x1  a12 x2  a13x3  ............................a1n xn  b1
a21x1  a22 x2  a23x3  ............................a2 n xn  b2
a31x1  a32 x2  a33x3  ............................a3n xn  b3


an1 x1  an 2 x2  an 3 x3  ............................ann xn  bn

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
There are ( n) equations and ( n) unknowns;
( x1 , x2 , x3 ............................. xn )
It can be written [ Ax  B ]
Such that ;
 a11 a12 a13   a1n 
a a22 a23   a2 n 
 21 
 a31 a32 a33   a3 n 
A 
     
     
 

 an1 an 2 an 3   ann 
 x1   b1 
x  b 
 2  2
x   x3  and B  b3 
   
  

 xn 
 
b
Tikrit University-Civil
n

Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Methods of Solution
1  Cramer ' s Rule
a11x1  a12 x2  a13x3  b1 ...................................(1)
a21x1  a22 x2  a23x3  b2 ...................................(2)
a31x1  a32 x2  a33x3  b3 ...................................(3)
a11 a12 a13
Let D  a21 a22 a23
a31 a32 a33
This method is used when D  0
Tikrit University-Civil Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
b1 a12 a13
b2 a22 a23
b3 a32 a33
x1 
D
a11 b1 a13
a21 b2 a23
a31 b3 a33
x2 
D
a11 a12 b1
a21 a22 b2
a31 a32 b3
x3 
D
If D  Department
0,TikritDonot use this method
University-Civil Engineering
Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
2  Gauss method (Gauss e lim ination , or Gauss reduction )
a11x1  a12 x2  a13x3  ...............a1n xn  b1 ............(1)
a21x1  a22 x2  a23x3  ...............a2 n xn  b2 ...........(2)
a31x1  a32 x2  a33x3  ...............a3n xn  b3 ...........(3)

an1 x1  an 2 x2  an 3 x3  ...............ann xn  bn ...........(n)
The equations reduced to upper triangular matrix

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Pr ocedure :
1  Normalization
2  Divide Eq. (1) by a11 to get ( x1 ), after normalization.
3  E lim inate ( x1 ) from Eq. (2) to Eq. (n) .
4  Re peat by dividing Eq. (2) by new (a22 ) to get ( x2 )
5  From bottom get ( xn , xn 1 , ........., x1 ) (back substituti on)

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
OR : Gauss method
a11x1  a12 x2  a13x3  b1 ............(1)
a21x1  a22 x2  a23x3  b2 ...........(2)
a31x1  a32 x2  a33x3  b3 ...........(3)

From Eqs. (1) & (2) and from Eqs. (1) & (3), e lim inate
x1 from Eqs. (2) & (3).
a11x1  a12 x2  a13x3  b1 ............(1a)
c22 x2  c23x3  d 2 ...........(2a)
c32 x2  c33x3  d 3 ...........(3a )
Tikrit University-Civil Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
From Eqs. (2a) & (3a) , e lim inate x2 from Eq. (3a).
a11x1  a12 x2  a13x3  b1 ............(1b)
c22 x2  c23x3  d 2 ...........(2b)
e33x3  f 3 ...........(3b)
From Eq. (3b), get the value of x3
From Eq. (2b), get the value of x2 after Subst. the value of x3
From Eq. (1b), get the value of x1 after Subst. the value of x3 & x2

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
3  Inverse matrix method :
Ax  B
AA 1 x  A1B
Ix  A1B
 x  A1B
 a11 a12 a13   a1n 
a   x1   b1 
 21 a22 a23   a2 n  x  b 
 a31 a32 a33   a3n   2  2
A , x   x3  and B  b3 
         
  
     
   xn  bn 
an1 an 2 an 3   ann 

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Example : Solve the system of these equations u sin g :
(1) Cramer ' s rule, (2) Gauss method and (3) Invese
matrix method .
2 x  3 y  4 z  3 ....................................(1)
x  2 y  3z  3 .....................................( 2)
3x  y  z  6 ......................................(3)

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Solution
(1) Cramer ' s rule,
2 3 4
D 1 2 3  60
3 1 1
3 3 4 2 3 4
3 2 3 1 3 3
6  1  1 120 3 6 1  60
x   2, y    1
60 60 60 60
2 3 3
1 2 3
3 1 6 60
z  1
60 60
 x  2, y  1 and z  1 Engineering
Tikrit University-Civil
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
(2) Gauss method ,
x  2 y  3 z  3.........................(1)
2 x  3 y  4 z  3.....................(2)
3 x  y  z  6............................(3)
Eq. (1) x  2 y  3 z  3.........................(1a)
2 Eq. (1)  Eq. (2) y  10 z  9.........................( 2a)
3Eq. (1)  Eq. (3) 7 y  10 z  3.........................(3a)
x  2 y  3 z  3.........................(1b)
y  10 z  9.........................( 2b)
7 Eq. (2a)  Eq. (3a) 60 z  60.........................(3b)

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
x  2 y  3 z  3.........................(1b)
y  10 z  9.........................( 2b)
7 Eq. (2a)  Eq. (3a) 60 z  60.........................(3b)

From Eq. (3b)  z  1


From Eq. (2b)  y  10(1)  9  y  9  10  1
From Eq. (1b)  x  2(1)  3(1)  3  x  3  3  2  2

 x  2, y  1 and z  1

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
OR, ( 2) Gauss method ,
1 2 3  3
2 3 4   3 2 R1  R 2
3 1 1  6 3R1  R3

1 2 3  3
0 1 10  9
0 7 10  3 7 R 2  R3

1 2 3  3 x  3  2( 1)  3(1)  2
0 1 10  y  9  10(1)  1
9 
0 0 60  60 60 
 z 1
60
Tikrit University-Civil Engineering
 x  2, y  1 and Third
Department z 1 Eng.Anal.&Num.
Stage
Meth. Dr.Adnan Jayed Zedan
(3) Inverse matrix method
2 3  4  3  x
A  1 2 3  , B   3  and x   y
 
3  1  1   6   z 
1 10  7
Cof . A   7 10 11 
17  10 1 
 1 7 17 
Adj . A   10 10  10
 7 11 1 
2 3 4
Det. A  1 2 3  60
3  1Department
 1Third Stage Eng.Anal.&Num.
Tikrit University-Civil Engineering

Meth. Dr.Adnan Jayed Zedan


1 7 17 
1 1  
A  10 10  10
60  
 7 11 1 
 x 1 7 17   3
 
  y  A B 1 1 
10 10  10  3 
60   
 z   7 11 1   6 
  3  21  102   120   2 
1   1     1
  30  30  60   60
60   60    
 21  33  6   60   1 
 x  2, y  Tikrit
1 University-Civil
and z 1
Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
4  Iteration Method :
(i ) Jacobi method
In this method the equations are written as :
1
x1  [b1  a12 x2  a13x3 ......................  a1n xn ]
a11
1
x2  [b2  a21x1  a23x3 ......................  a2 n xn ]
a22
1
x3  [b3  a31x1  a32 x2 ......................  a3n xn ]
a33


1
xn  [bn  an1 x1  an 2 x2 ......................  an ( n 1) xn 1 ]
ann Tikrit University-Civil Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Strart with ( x1( o ) , x2( o ) , x3( o ) ,.........................xn( o ) )
in the above equations to get improved estimation
for ( x1(1) , x2(1) , x3(1) ,.........................xn(1) )
and repeat for (k ) cycles .

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Example : Solve the following equations :
5 x1  x2  2 x3  17 ....................................(1)
x1  3x2  x3  8 .....................................(2)
2 x1  x2  6 x3  23 ......................................(3)

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
Solution :
1  Normalization (o.k )
2
1
x1  (17  x2  2 x3 ) ........................................ (1)
5
1
x2  (8  x1  x3 ) ............................................ (2)
3
1
x3  (23  2 x1  x2 ) ........................................ (3)
6
3
Start with x (o)
1 x 2
(o)
x
Tikrit University-Civil
(o)
1
3Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
cycles 0 1 2 3 4 5 6 7

x1 1 2.8 1.667 2.25 1.88 2.08

x2 1 2 0.622 1.255 0.859 1.08

x3 1 3.333 2.567 3.174 2.874 3.06

 x1  2, x2  1 and x3  3

Tikrit University-Civil Engineering


Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan
(ii ) Gauss  Sedal method
This method is the most powerful and most popular
method of solution . In fact it is extension to the
Jacobi method . The iterative equations are :
i 1 1
x 1  [b1  a12 x2i  a13x3i ......................  a1n xni ]
a11
1
x2i 1  [b2  a21x1i 1  a23x2i ......................  a2 n xni ]
a22
i 1 1
x 3  [b3  a31x1i 1  a32 x2i 1......................  a3n xni ]
a33


i 1 1
x n  [bn  an1 x1i 1 Department
aTikrit x i 1
..........
University-Civil ..........
Engineering
n 2 2Third Stage Eng.Anal.&Num. ..  a i 1
n ( n 1) xn 1 ]
ann Meth. Dr.Adnan Jayed Zedan
1
x1  (17  x2  2 x3 ) ........................................ (1)
5
1
x2  (8  x1  x3 ) ............................................ (2)
3
1
x3  (23  2 x1  x2 ) ........................................ (3)
6
cycles 0 1 2 3 4 5 6 7

x1 1 2.8 2.05 1.99

x2 1 1.4 1.09 1.01

x3 1 2.67 2.97 3.002

 x1  2, x2  1 and x3  3
Tikrit University-Civil Engineering
Department Third Stage Eng.Anal.&Num.
Meth. Dr.Adnan Jayed Zedan

You might also like