Numerical Methods, 402303 Mechanical Engineering Department, The Hashemite University
MATRICES
A matrix is a rectangular array of elements in which the value and position of each element is important. The size of a matrix is described by the number of rows and columns in the matrix.
MATRIX NOTATION
Matrices are generally represented by a bold upper case letter A or an upper case letter between two square brackets [A]. The elements of a matrix are indexed by a double subscript indicating the row and column location of an element a(row)(column).
a11 a 21 A= M a n1 a12 a 22 M an2 L a1m L a 2m = [aij ] O M L a nm
i = 1, 2, K , n
j = 1, 2, K , m
where n and m are the number of rows and columns, consecutively. Single column matrices such as
b11 b 21 B= M bn1
Matrices
[Link]
Numerical Methods, 402303 Mechanical Engineering Department, The Hashemite University
are referred to as vectors and represented by a bold lower case letters. The elements are enclosed in either square or curly brackets.
b1 b1 b b 2 2 b= = M M bn bn
MATRIX OPERATIONS
Addition Matrices have to have the same size.
A+B =B+A (A + B) + C = A + (B + C)
Multiplication Matrix multiplication is defined as
a i1 AB = ai 2 L aim b1 j b2 j M bmj = [cij ] = C
cij = ai1b1 j + ai 2 b2 j + ai 3b3 j + K + aim bmj =
AB BA size of ( AB) size of (BA )
Matrices
k =1
aik bkj
[Link]
Numerical Methods, 402303 Mechanical Engineering Department, The Hashemite University
A(B + C) = AB + AC A(BC) = ( AB)C
Identity Matrix The identity matrix is a square matrix (I), such that
IA = AI = A
The identity matrix has 1s on the diagonal and zeros everywhere else.
1 0 I= M 0
0 1 M 0
L L O L
0 0 M 1
Matrix Inverse If a matrix B exists such that
AB = BA = I
then matrix B is defined as the inverse of matrix A ( B = A 1 ). ie,
AA 1 = A 1 A = I
Matrix Transpose To transpose a matrix, the rows and columns are interchanged. Example for
a11 a 21 A= M a n1
Matrices
a12 a 22 M an2
L a1m L a 2m O M L a nm
[Link]
Numerical Methods, 402303 Mechanical Engineering Department, The Hashemite University
the transpose of the A matrix is
a11 a 12 T A = M a1m
a 21 a 22 M a 2m
L a n1 L an2 O M L a nm
or
A T = [aij ]T = [a ji ]
Matrix Trace The trace of a square matrix is the sum of all the elements on its principal diagonal. Example for
a11 a 21 A= M a n1
a12 a 22 M an2
L a1m L a 2m O M L a nm
n i =1
trace ( A) = a11 + a 22 + K + a nn = aii
Matrix Augmentation Two matrices of the same row size can be horizontally augmented as
Matrices
[Link]
Numerical Methods, 402303 Mechanical Engineering Department, The Hashemite University
a11 a 21 A= M a n1
a12 a 22 M an2
L a1m b11 b12 b L a 2m 21 b22 and B = M O M M L a nm bn1 bn 2
a12 a 22 M an2
L b1k L b2k O M L bnk
a11 a 21 A MB = M a n1
L a1m b11 b12 L a 2 m b21 b22 O M M M L a nm bn1 bn 2
L b1k L b2k O M L bnk
Row operations are applied to both matrix A and matrix B at the same time without interaction between the elements of the A and B matrices. Special Matrices
a11 0 A= M 0 a11 0 A= M 0 a11 a 21 A= M a n1
Matrices
0 a 22 M 0 a12 a 22 M 0 0 a 22 M an2
L 0 L 0 Diagonal matrix. O M L a nm L a1m L a 2m Upper triangular matrix. O M L a nm L 0 L 0 Lower triangular matrix. O M L a nm
[Link]
Numerical Methods, 402303 Mechanical Engineering Department, The Hashemite University
a11 a 21 0 A= 0 M M 0 a12 a 22 a32 0 0 a 23 a33 O 0 0 a34 O O 0 L L 0 O O a ( m1)( m2) 0 0 O a ( m1)( m1) a m( m1) L L M M 0 Tri-diagonal matrix. 0 a ( m1) m a mm 0
Matrices
[Link]