METE362C
Finite Element Method
ENGR. KEVIN C. EBORA
ME362C – Finite Element Method
Topic 3: Matrix and Application of Matrix
INTENDED LEARNING OUTCOMES
ILO1: Introduce the concept of matrix;
ILO2: Understand the operations involved in matrices;
ILO3: Understand how to use matrix in solving systems of linear equations
using Gauss-Jordan Elimination;
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix
Matrices
1 3 1
2 3 7
𝐴= 𝐵= 2 1 4
1 −1 5
4 7 6
Both A and B are examples of matrix. A matrix is a
rectangular array of numbers enclosed by a pair of bracket.
Why matrix?
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix
Consider the following set of equations:
𝑥+𝑦 =7
ቊ It is easy to show that x = 3 and y = 4.
3𝑥 − 𝑦 = 5
𝑥 + 𝑦 − 2𝑥 = 7
2𝑥 − 𝑦 − 4𝑧 = 2
How about solving
−5𝑥 + 4𝑦 + 10𝑧 = 1
3𝑥 − 𝑦 − 6𝑧 = 5
Matrices can help solve this problem..
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix
A matrix is a rectangular array of elements. The elements can be symbolic
expressions or numbers. Matrix [A] is denoted by
𝑎11 𝑎12 ⋯ 𝑎1𝑛
𝑎21 𝑎22 ⋯ 𝑎2𝑛
𝐴 = ⋮ ⋮ ⋱ ⋮
𝑎𝑚1 𝑎𝑚2 ⋯ 𝑎𝑚𝑛
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix
Each matrix has rows and columns, and this defines the size of the
matrix. If a matrix [A] has m rows and n columns; the size of the
matrix is denoted by m×n. The matrix [A] may also be denoted by
[A]mxn to show that [A] is a matrix with m rows and n columns.
Each entry in the matrix is called the entry or element of the
matrix and is denoted by aij where i is the row number and j is the
column number of the element.
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix
2 4 55
𝐴 = 24 23 63
52 42 21
21 12 23
There are 4 rows and 3 columns, so the size of the matrix is
4×3. In the above [A] matrix, a43 = 23.
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix
Square matrices
When m = n, i.e.,
𝑎11 𝑎12 ⋯ 𝑎1𝑛
𝑎21 𝑎22 ⋯ 𝑎2𝑛
𝐴= ⋮ ⋮ ⋱ ⋮
𝑎𝑚1 𝑎𝑚2 ⋯ 𝑎𝑚𝑛
A is called a “square matrix of order n” or “n-square matrix”
The elements a11, a22, a33,…, ann are called diagonal elements.
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix
Equal matrices
Two matrices A = [aij] and B = [bij] are said to be equal (A = B) iff
each element of A is equal to the corresponding element of B, i.e.,
aij = bij for 1 ≤ 𝑖 ≤ 𝑚, 1 ≤ 𝑗 ≤ 𝑛.
if A = B, it implies aij = bij for 1 ≤ 𝑖 ≤ 𝑚, 1 ≤ 𝑗 ≤ 𝑛;
if aij = bij for 1 ≤ 𝑖 ≤ 𝑚, 1 ≤ 𝑗 ≤ 𝑛, it implies A = B.
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix
Zero matrices
Every element of a matrix is zero, it is called a zero matrix,
i.e.,
0 0 ⋯ 0
0 0 ⋯ 0
𝐴=
⋮ ⋮ ⋱ ⋮
0 0 ⋯ 0
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix
Operations of matrices
Sum of matrices
If A = [aij] and B = [bij] are m x n matrices, then A + B is defined as a matrix C
= A + B, where C= [cij], cij = aij + bij for 1 ≤ 𝑖 ≤ 𝑚, 1 ≤ 𝑗 ≤ 𝑛.
Example:
1 2 3 2 3 0
if 𝐴 = and 𝐵 = then A+B is
0 1 4 −1 2 5
1+2 2+3 3+0 3 5 3
𝐴+𝐵 = =
0 + (−1) 1+2 4+5 −1 3 9
and
1−2 2−3 3−0 −1 −1 3
𝐴−𝐵 = =
0 − (−1) 1−2 4−5 1 −1 −1
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix
Operations of matrices
Scalar multiplication
Let λ be any scalar and A = [aij] is an m x n matrix. Then λA = [λaij] for 1 ≤
𝑖 ≤ 𝑚, 1 ≤ 𝑗 ≤ 𝑛, i.e., each element in A is multiplied by λ.
Example:
1 2 3
𝐴= then 3A is
0 1 4
3x1 3x2 3x3 3 6 9
𝐴= =
3x0 3x1 3x4 0 3 12
If λ = -1, i.e., -A = [-aij]. It’s called the negative of A. Note: A - A = 0 is a zero
matrix
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix
Operations of matrices
Sum of matrices
Two matrices of the same order are said to be conformable for addition or
subtraction.
Two matrices of different orders cannot be added or subtracted, e.g.,
1 3 1
2 3 7
2 1 4
1 −1 5
4 7 6
are NOT conformable for addition or subtraction
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix
Operations of matrices
Properties
If matrices A, B and C are conformable, then
A+B=B+A (commutative law)
A + (B +C) = (A + B) +C (associative law)
λ(A + B) = λA + λB, where λ is a scalar (distributive law)
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix
Operations of matrices
Matrix Multiplication
If A = [aij] is a m x p matrix and B = [bij] is a p x n matrix, then AB is defined
as a m x n matrix C = AB, where C= [cij] with
𝑝
𝑐𝑖𝑗 = 𝑘=1 𝑎𝑖𝑘 𝑏𝑘𝑗 = 𝑎𝑖1 𝑏1𝑗 + 𝑎𝑖2 𝑏2𝑗 + ⋯ + 𝑎𝑖𝑝 𝑏𝑝𝑗 for 1 ≤ 𝑖 ≤ 𝑚, 1 ≤ 𝑗 ≤ 𝑛.
σ
Example:
−1 2
1 2 3
𝐴= , 𝐵 = 2 3 and C=AB, evaluate c21
0 1 4
5 0
c21 = 0x(-1) + 1x2 + 4x5 = 22
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix
Example:
−1 2
1 2 3
𝐴= , 𝐵 = 2 3 , evaluate C=AB,
0 1 4
5 0
c11 = 1x −1 + 2x2 + 3x5 = 18
−1 2 c12 = 1x2 + 2x3 + 3x0 = 8
1 2 3
2 3 →
0 1 4 c21 = 0x −1 + 1x2 + 4x5 = 22
5 0
c22 = 0x2 + 1x3 + 4x0 = 3
−1 2
1 2 3 18 8
𝐶 = 𝐴𝐵 = 2 3 =
0 1 4 22 3
5 0
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix
Properties
If matrices A , B and C are conformable
A(B + C) = AB + AC
(A + B)C = AC + BC
A(BC) = (AB)C
AB BA in general
AB = 0 , NOT necessarily imply A = 0 or B = 0
AB = AC , NOT necessarily imply B = C
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix
Types of matrices
- Identity matrix
- The inverse of a matrix
- The transpose of a matrix
- Symmetric matrix
- Orthogonal matrix
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix
Types of matrices
Inverse of a matrix
If matrices A and B such that AB = BA = I, then B is called the inverse of A
(symbol: A-1); and A is called the inverse of B (symbol: B-1).
Example:
1 2 3 6 −2 −3
𝐴= 1 3 3 𝐵 = −1 1 0
1 2 4 −1 0 1
Show that B is the inverse of matrix A
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix
Types of matrices
Transpose of a matrix
The matrix obtained by interchanging the rows and columns of a matrix A is
called the transpose of A (written AT).
Example:
1 2 3
𝐴=
4 5 6
, then the transpose of A is
1 4
𝑇
𝐴 = 2 5
3 6
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix
Types of matrices
Symmetric matrix
A matrix A such that AT = A is called symmetric, i.e., aji = aij for all i and j.
A + AT must be symmetric. Why?
Example:
1 2 3
𝐴 = 2 4 −5 is symmetric
3 −5 6
A matrix A such that AT = -A is called skew symmetric, i.e., aji = -aij for all i
and j.
A - AT must be skew-symmetric. Why?
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix
Properties
(AB)-1= B-1A-1
(AT)T= A and (λ A)T= λAT
(A + B)T= AT + BT
(AB)T= BTAT
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix
Example:
1 2 3
Determine the inverse of matrix 𝐴 = 0 4 5
1 0 6
𝑤 + 2𝑥 − 𝑦 + 𝑧 = 6
−𝑤 + 𝑥 + 2𝑦 − 𝑧 = 3
2𝑤 − 𝑥 + 2𝑦 + 2𝑧 = 14
𝑤 + 𝑥 − 𝑦 + 2𝑧 = 8
ME362C – Finite Element Method
Topic: Matrix and Application of Matrix