Much of finite elements revolves around forming matrices and
solving systems of linear equations using matrices. This learning resource
gives you a brief review of matrices.
Suppose that you have a linear system of equations
a
11
x
1
+
a
12
x
2
+
a
13
x
3
+
a
14
x
4
=
b
1
a
21
x
1
+
a
22
x
2
+
a
23
x
3
+
a
24
x
4
=
b
2
a
31
x
1
+
a
32
x
2
+
a
33
x
3
+
a
34
x
4
=
b
3
a
41
x
1
+
a
42
x
2
+
a
43
x
3
+
a
44
x
4
=
b
4
.
{\displaystyle {\begin{aligned}a_{11}x_{1}+a_{12}x_{2}+a_{13}x_{3}+a_{14}x_{4}&=b_{1}\\a_{21}x_{1}+a_{22}x_{2}+a_{23}x_{3}+a_{24}x_{4}&=b_{2}\\a_{31}x_{1}+a_{32}x_{2}+a_{33}x_{3}+a_{34}x_{4}&=b_{3}\\a_{41}x_{1}+a_{42}x_{2}+a_{43}x_{3}+a_{44}x_{4}&=b_{4}\end{aligned}}~.}
Matrices provide a simple way of expressing these equations. Thus,
we can instead write
[
a
11
a
12
a
13
a
14
a
21
a
22
a
23
a
24
a
31
a
32
a
33
a
34
a
41
a
42
a
43
a
44
]
[
x
1
x
2
x
3
x
4
]
=
[
b
1
b
2
b
3
b
4
]
.
{\displaystyle {\begin{bmatrix}a_{11}&a_{12}&a_{13}&a_{14}\\a_{21}&a_{22}&a_{23}&a_{24}\\a_{31}&a_{32}&a_{33}&a_{34}\\a_{41}&a_{42}&a_{43}&a_{44}\end{bmatrix}}{\begin{bmatrix}x_{1}\\x_{2}\\x_{3}\\x_{4}\end{bmatrix}}={\begin{bmatrix}b_{1}\\b_{2}\\b_{3}\\b_{4}\end{bmatrix}}~.}
An even more compact notation is
[
A
]
[
x
]
=
[
b
]
or
A
x
=
b
.
{\displaystyle \left[{\mathsf {A}}\right]\left[{\mathsf {x}}\right]=\left[{\mathsf {b}}\right]~~~~{\text{or}}~~~~\mathbf {A} \mathbf {x} =\mathbf {b} ~.}
Here
A
{\displaystyle \mathbf {A} }
is a
4
×
4
{\displaystyle 4\times 4}
matrix while
x
{\displaystyle \mathbf {x} }
and
b
{\displaystyle \mathbf {b} }
are
4
×
1
{\displaystyle 4\times 1}
matrices. In general, an
m
×
n
{\displaystyle m\times n}
matrix
A
{\displaystyle \mathbf {A} }
is a set of numbers
arranged in
m
{\displaystyle m}
rows and
n
{\displaystyle n}
columns.
A
=
[
a
11
a
12
a
13
…
a
1
n
a
21
a
22
a
23
…
a
2
n
⋮
⋮
⋮
⋱
⋮
a
m
1
a
m
2
a
m
3
…
a
m
n
]
.
{\displaystyle \mathbf {A} ={\begin{bmatrix}a_{11}&a_{12}&a_{13}&\dots &a_{1n}\\a_{21}&a_{22}&a_{23}&\dots &a_{2n}\\\vdots &\vdots &\vdots &\ddots &\vdots \\a_{m1}&a_{m2}&a_{m3}&\dots &a_{mn}\end{bmatrix}}~.}
Practice: Expressing Linear Equations As Matrices
Common types of matrices that we encounter in finite elements are:
a row vector that has one row and
n
{\displaystyle n}
columns.
v
=
[
v
1
v
2
v
3
…
v
n
]
{\displaystyle \mathbf {v} ={\begin{bmatrix}v_{1}&v_{2}&v_{3}&\dots &v_{n}\end{bmatrix}}}
a column vector that has
n
{\displaystyle n}
rows and one column.
v
=
[
v
1
v
2
v
3
⋮
v
n
]
{\displaystyle \mathbf {v} ={\begin{bmatrix}v_{1}\\v_{2}\\v_{3}\\\vdots \\v_{n}\end{bmatrix}}}
a square matrix that has an equal number of rows and columns.
a diagonal matrix which is a square matrix with only the
diagonal elements (
a
i
i
{\displaystyle a_{ii}}
) nonzero.
A
=
[
a
11
0
0
…
0
0
a
22
0
…
0
⋮
⋮
⋮
⋱
⋮
0
0
0
…
a
n
n
]
.
{\displaystyle \mathbf {A} ={\begin{bmatrix}a_{11}&0&0&\dots &0\\0&a_{22}&0&\dots &0\\\vdots &\vdots &\vdots &\ddots &\vdots \\0&0&0&\dots &a_{nn}\end{bmatrix}}~.}
the identity matrix (
I
{\displaystyle \mathbf {I} }
) which is a diagonal matrix and
with each of its nonzero elements (
a
i
i
{\displaystyle a_{ii}}
) equal to 1.
A
=
[
1
0
0
…
0
0
1
0
…
0
⋮
⋮
⋮
⋱
⋮
0
0
0
…
1
]
.
{\displaystyle \mathbf {A} ={\begin{bmatrix}1&0&0&\dots &0\\0&1&0&\dots &0\\\vdots &\vdots &\vdots &\ddots &\vdots \\0&0&0&\dots &1\end{bmatrix}}~.}
a symmetric matrix which is a square matrix with elements
such that
a
i
j
=
a
j
i
{\displaystyle a_{ij}=a_{ji}}
.
A
=
[
a
11
a
12
a
13
…
a
1
n
a
12
a
22
a
23
…
a
2
n
a
13
a
23
a
33
…
a
3
n
⋮
⋮
⋮
⋱
⋮
a
1
n
a
2
n
a
3
n
…
a
n
n
]
.
{\displaystyle \mathbf {A} ={\begin{bmatrix}a_{11}&a_{12}&a_{13}&\dots &a_{1n}\\a_{12}&a_{22}&a_{23}&\dots &a_{2n}\\a_{13}&a_{23}&a_{33}&\dots &a_{3n}\\\vdots &\vdots &\vdots &\ddots &\vdots \\a_{1n}&a_{2n}&a_{3n}&\dots &a_{nn}\end{bmatrix}}~.}
a skew-symmetric matrix which is a square matrix with elements
such that
a
i
j
=
−
a
j
i
{\displaystyle a_{ij}=-a_{ji}}
.
A
=
[
a
11
a
12
a
13
…
a
1
n
−
a
12
a
22
a
23
…
a
2
n
−
a
13
−
a
23
a
33
…
a
3
n
⋮
⋮
⋮
⋱
⋮
−
a
1
n
−
a
2
n
−
a
3
n
…
a
n
n
]
.
{\displaystyle \mathbf {A} ={\begin{bmatrix}a_{11}&a_{12}&a_{13}&\dots &a_{1n}\\-a_{12}&a_{22}&a_{23}&\dots &a_{2n}\\-a_{13}&-a_{23}&a_{33}&\dots &a_{3n}\\\vdots &\vdots &\vdots &\ddots &\vdots \\-a_{1n}&-a_{2n}&-a_{3n}&\dots &a_{nn}\end{bmatrix}}~.}
Note that the diagonal elements of a skew-symmetric matrix have to be zero:
a
i
i
=
−
a
i
i
⇒
a
i
i
=
0
{\displaystyle a_{ii}=-a_{ii}\Rightarrow a_{ii}=0}
.
Let
A
{\displaystyle \mathbf {A} }
and
B
{\displaystyle \mathbf {B} }
be two
m
×
n
{\displaystyle m\times n}
matrices with components
a
i
j
{\displaystyle a_{ij}}
and
b
i
j
{\displaystyle b_{ij}}
, respectively. Then
C
=
A
+
B
⟹
c
i
j
=
a
i
j
+
b
i
j
{\displaystyle \mathbf {C} =\mathbf {A} +\mathbf {B} \implies c_{ij}=a_{ij}+b_{ij}}
Let
A
{\displaystyle \mathbf {A} }
be a
m
×
n
{\displaystyle m\times n}
matrix with components
a
i
j
{\displaystyle a_{ij}}
and let
λ
{\displaystyle \lambda }
be a scalar quantity. Then,
C
=
λ
A
⟹
c
i
j
=
λ
a
i
j
{\displaystyle \mathbf {C} =\lambda \mathbf {A} \implies c_{ij}=\lambda a_{ij}}
Let
A
{\displaystyle \mathbf {A} }
be a
m
×
n
{\displaystyle m\times n}
matrix with components
a
i
j
{\displaystyle a_{ij}}
. Let
B
{\displaystyle \mathbf {B} }
be a
p
×
q
{\displaystyle p\times q}
matrix with components
b
i
j
{\displaystyle b_{ij}}
.
The product
C
=
A
B
{\displaystyle \mathbf {C} =\mathbf {A} \mathbf {B} }
is defined only if
n
=
p
{\displaystyle n=p}
. The matrix
C
{\displaystyle \mathbf {C} }
is a
m
×
q
{\displaystyle m\times q}
matrix with components
c
i
j
{\displaystyle c_{ij}}
. Thus,
C
=
A
B
⟹
c
i
j
=
∑
k
=
1
n
a
i
k
b
k
j
{\displaystyle \mathbf {C} =\mathbf {A} \mathbf {B} \implies c_{ij}=\sum _{k=1}^{n}a_{ik}b_{kj}}
Similarly, the product
D
=
B
A
{\displaystyle \mathbf {D} =\mathbf {B} \mathbf {A} }
is defined only if
q
=
m
{\displaystyle q=m}
. The matrix
D
{\displaystyle \mathbf {D} }
is a
p
×
n
{\displaystyle p\times n}
matrix with components
d
i
j
{\displaystyle d_{ij}}
. We have
D
=
B
A
⟹
d
i
j
=
∑
k
=
1
m
b
i
k
a
k
j
{\displaystyle \mathbf {D} =\mathbf {B} \mathbf {A} \implies d_{ij}=\sum _{k=1}^{m}b_{ik}a_{kj}}
Clearly,
C
≠
D
{\displaystyle \mathbf {C} \neq \mathbf {D} }
in general, i.e., the matrix product is not commutative .
However, matrix multiplication is distributive . That means
A
(
B
+
C
)
=
A
B
+
A
C
.
{\displaystyle \mathbf {A} (\mathbf {B} +\mathbf {C} )=\mathbf {A} \mathbf {B} +\mathbf {A} \mathbf {C} ~.}
The product is also associative . That means
A
(
B
C
)
=
(
A
B
)
C
.
{\displaystyle \mathbf {A} (\mathbf {B} \mathbf {C} )=(\mathbf {A} \mathbf {B} )\mathbf {C} ~.}
Let
A
{\displaystyle \mathbf {A} }
be a
m
×
n
{\displaystyle m\times n}
matrix with components
a
i
j
{\displaystyle a_{ij}}
. Then the transpose of the matrix is defined as the
n
×
m
{\displaystyle n\times m}
matrix
B
=
A
T
{\displaystyle \mathbf {B} =\mathbf {A} ^{T}}
with components
b
i
j
=
a
j
i
{\displaystyle b_{ij}=a_{ji}}
. That is,
B
=
A
T
=
[
a
11
a
12
a
13
…
a
1
n
a
21
a
22
a
23
…
a
2
n
a
31
a
32
a
33
…
a
3
n
⋮
⋮
⋮
⋱
⋮
a
m
1
a
m
2
a
m
3
…
a
m
n
]
T
=
[
a
11
a
21
a
31
…
a
m
1
a
12
a
22
a
32
…
a
m
2
a
13
a
23
a
33
…
a
m
3
⋮
⋮
⋮
⋱
⋮
a
1
n
a
2
n
a
3
n
…
a
m
n
]
{\displaystyle \mathbf {B} =\mathbf {A} ^{T}={\begin{bmatrix}a_{11}&a_{12}&a_{13}&\dots &a_{1n}\\a_{21}&a_{22}&a_{23}&\dots &a_{2n}\\a_{31}&a_{32}&a_{33}&\dots &a_{3n}\\\vdots &\vdots &\vdots &\ddots &\vdots \\a_{m1}&a_{m2}&a_{m3}&\dots &a_{mn}\end{bmatrix}}^{T}={\begin{bmatrix}a_{11}&a_{21}&a_{31}&\dots &a_{m1}\\a_{12}&a_{22}&a_{32}&\dots &a_{m2}\\a_{13}&a_{23}&a_{33}&\dots &a_{m3}\\\vdots &\vdots &\vdots &\ddots &\vdots \\a_{1n}&a_{2n}&a_{3n}&\dots &a_{mn}\end{bmatrix}}}
An important identity involving the transpose of matrices is
(
A
B
)
T
=
B
T
A
T
.
{\displaystyle {(\mathbf {A} \mathbf {B} )^{T}=\mathbf {B} ^{T}\mathbf {A} ^{T}}~.}
The determinant of a matrix is defined only for square matrices.
For a
2
×
2
{\displaystyle 2\times 2}
matrix
A
{\displaystyle \mathbf {A} }
, we have
A
=
[
a
11
a
12
a
21
a
22
]
⟹
det
(
A
)
=
|
a
11
a
12
a
21
a
22
|
=
a
11
a
22
−
a
12
a
21
.
{\displaystyle \mathbf {A} ={\begin{bmatrix}a_{11}&a_{12}\\a_{21}&a_{22}\end{bmatrix}}\implies \det(\mathbf {A} )={\begin{vmatrix}a_{11}&a_{12}\\a_{21}&a_{22}\end{vmatrix}}=a_{11}a_{22}-a_{12}a_{21}~.}
For a
n
×
n
{\displaystyle n\times n}
matrix, the determinant is calculated by expanding into
minors as
det
(
A
)
=
|
a
11
a
12
a
13
…
a
1
n
a
21
a
22
a
23
…
a
2
n
a
31
a
32
a
33
…
a
3
n
⋮
⋮
⋮
⋱
⋮
a
n
1
a
n
2
a
n
3
…
a
n
n
|
=
a
11
|
a
22
a
23
…
a
2
n
a
32
a
33
…
a
3
n
⋮
⋮
⋱
⋮
a
n
2
a
n
3
…
a
n
n
|
−
a
12
|
a
21
a
23
…
a
2
n
a
31
a
33
…
a
3
n
⋮
⋮
⋱
⋮
a
n
1
a
n
3
…
a
n
n
|
+
⋯
±
a
1
n
|
a
21
a
22
…
a
2
(
n
−
1
)
a
31
a
32
…
a
3
(
n
−
1
)
⋮
⋮
⋱
⋮
a
n
1
a
n
2
…
a
n
(
n
−
1
)
|
{\displaystyle {\begin{aligned}&\det(\mathbf {A} )={\begin{vmatrix}a_{11}&a_{12}&a_{13}&\dots &a_{1n}\\a_{21}&a_{22}&a_{23}&\dots &a_{2n}\\a_{31}&a_{32}&a_{33}&\dots &a_{3n}\\\vdots &\vdots &\vdots &\ddots &\vdots \\a_{n1}&a_{n2}&a_{n3}&\dots &a_{nn}\end{vmatrix}}\\&=a_{11}{\begin{vmatrix}a_{22}&a_{23}&\dots &a_{2n}\\a_{32}&a_{33}&\dots &a_{3n}\\\vdots &\vdots &\ddots &\vdots \\a_{n2}&a_{n3}&\dots &a_{nn}\end{vmatrix}}-a_{12}{\begin{vmatrix}a_{21}&a_{23}&\dots &a_{2n}\\a_{31}&a_{33}&\dots &a_{3n}\\\vdots &\vdots &\ddots &\vdots \\a_{n1}&a_{n3}&\dots &a_{nn}\end{vmatrix}}+\dots \pm a_{1n}{\begin{vmatrix}a_{21}&a_{22}&\dots &a_{2(n-1)}\\a_{31}&a_{32}&\dots &a_{3(n-1)}\\\vdots &\vdots &\ddots &\vdots \\a_{n1}&a_{n2}&\dots &a_{n(n-1)}\end{vmatrix}}\end{aligned}}}
In short, the determinant of a matrix
A
{\displaystyle \mathbf {A} }
has the value
det
(
A
)
=
∑
j
=
1
n
(
−
1
)
1
+
j
a
1
j
M
1
j
{\displaystyle {\det(\mathbf {A} )=\sum _{j=1}^{n}(-1)^{1+j}a_{1j}M_{1j}}}
where
M
i
j
{\displaystyle M_{ij}}
is the determinant of the submatrix of
A
{\displaystyle \mathbf {A} }
formed
by eliminating row
i
{\displaystyle i}
and column
j
{\displaystyle j}
from
A
{\displaystyle \mathbf {A} }
.
Some useful identities involving the determinant are given below.
If
A
{\displaystyle \mathbf {A} }
is a
n
×
n
{\displaystyle n\times n}
matrix, then
det
(
A
)
=
det
(
A
T
)
.
{\displaystyle \det(\mathbf {A} )=\det(\mathbf {A} ^{T})~.}
If
λ
{\displaystyle \lambda }
is a constant and
A
{\displaystyle \mathbf {A} }
is a
n
×
n
{\displaystyle n\times n}
matrix, then
det
(
λ
A
)
=
λ
n
det
(
A
)
⟹
det
(
−
A
)
=
(
−
1
)
n
det
(
A
)
.
{\displaystyle \det(\lambda \mathbf {A} )=\lambda ^{n}\det(\mathbf {A} )\implies \det(-\mathbf {A} )=(-1)^{n}\det(\mathbf {A} )~.}
If
A
{\displaystyle \mathbf {A} }
and
B
{\displaystyle \mathbf {B} }
are two
n
×
n
{\displaystyle n\times n}
matrices, then
det
(
A
B
)
=
det
(
A
)
det
(
B
)
.
{\displaystyle \det(\mathbf {A} \mathbf {B} )=\det(\mathbf {A} )\det(\mathbf {B} )~.}
If you think you understand determinants, take the quiz .
Let
A
{\displaystyle \mathbf {A} }
be a
n
×
n
{\displaystyle n\times n}
matrix. The inverse of
A
{\displaystyle \mathbf {A} }
is denoted by
A
−
1
{\displaystyle \mathbf {A} ^{-1}}
and is defined such that
A
A
−
1
=
I
{\displaystyle {\mathbf {A} \mathbf {A} ^{-1}=\mathbf {I} }}
where
I
{\displaystyle \mathbf {I} }
is the
n
×
n
{\displaystyle n\times n}
identity matrix.
The inverse exists only if
det
(
A
)
≠
0
{\displaystyle \det(\mathbf {A} )\neq 0}
. A singular matrix
does not have an inverse.
An important identity involving the inverse is
(
A
B
)
−
1
=
B
−
1
A
−
1
,
{\displaystyle {(\mathbf {A} \mathbf {B} )^{-1}=\mathbf {B} ^{-1}\mathbf {A} ^{-1},}}
since this leads to:
(
A
B
)
−
1
(
A
B
)
=
(
B
−
1
A
−
1
)
(
A
B
)
=
B
−
1
A
−
1
A
B
=
B
−
1
(
A
−
1
A
)
B
=
B
−
1
I
B
=
B
−
1
B
=
I
.
{\displaystyle {(\mathbf {A} \mathbf {B} )^{-1}(\mathbf {A} \mathbf {B} )=(\mathbf {B} ^{-1}\mathbf {A} ^{-1})(\mathbf {A} \mathbf {B} )=\mathbf {B} ^{-1}\mathbf {A} ^{-1}\mathbf {A} \mathbf {B} =\mathbf {B} ^{-1}(\mathbf {A} ^{-1}\mathbf {A} )\mathbf {B} =\mathbf {B} ^{-1}\mathbf {I} \mathbf {B} =\mathbf {B} ^{-1}\mathbf {B} =\mathbf {I} .}}
Some other identities involving the inverse of a matrix are given below.
The determinant of a matrix is equal to the multiplicative inverse of the
determinant of its inverse.
det
(
A
)
=
1
det
(
A
−
1
)
.
{\displaystyle \det(\mathbf {A} )={\cfrac {1}{\det(\mathbf {A} ^{-1})}}~.}
The determinant of a similarity transformation of a matrix
is equal to the original matrix.
det
(
B
A
B
−
1
)
=
det
(
A
)
.
{\displaystyle \det(\mathbf {B} \mathbf {A} \mathbf {B} ^{-1})=\det(\mathbf {A} )~.}
We usually use numerical methods such as Gaussian elimination to compute
the inverse of a matrix.
A thorough explanation of this material can be found at Eigenvalue, eigenvector and eigenspace . However, for further study, let us consider the following examples:
Let :
A
=
[
1
6
5
2
]
,
v
=
[
6
−
5
]
,
t
=
[
7
4
]
.
{\displaystyle \mathbf {A} ={\begin{bmatrix}1&6\\5&2\end{bmatrix}},\mathbf {v} ={\begin{bmatrix}6\\-5\end{bmatrix}},\mathbf {t} ={\begin{bmatrix}7\\4\end{bmatrix}}~.}
Which vector is an eigenvector for
A
{\displaystyle \mathbf {A} }
?
We have
A
v
=
[
1
6
5
2
]
[
6
−
5
]
=
[
−
24
20
]
=
−
4
[
6
−
5
]
{\displaystyle \mathbf {A} \mathbf {v} ={\begin{bmatrix}1&6\\5&2\end{bmatrix}}{\begin{bmatrix}6\\-5\end{bmatrix}}={\begin{bmatrix}-24\\20\end{bmatrix}}=-4{\begin{bmatrix}6\\-5\end{bmatrix}}}
, and
A
t
=
[
1
6
5
2
]
[
7
4
]
=
[
31
43
]
.
{\displaystyle \mathbf {A} \mathbf {t} ={\begin{bmatrix}1&6\\5&2\end{bmatrix}}{\begin{bmatrix}7\\4\end{bmatrix}}={\begin{bmatrix}31\\43\end{bmatrix}}~.}
Thus,
v
{\displaystyle \mathbf {v} }
is an eigenvector.
Is
u
=
[
1
4
]
{\displaystyle \mathbf {u} ={\begin{bmatrix}1\\4\end{bmatrix}}}
an eigenvector for
A
=
[
−
3
−
3
1
8
]
{\displaystyle \mathbf {A} ={\begin{bmatrix}-3&-3\\1&8\end{bmatrix}}}
?
We have that since
A
u
=
[
−
3
−
3
1
8
]
[
1
4
]
=
[
−
15
33
]
{\displaystyle \mathbf {A} \mathbf {u} ={\begin{bmatrix}-3&-3\\1&8\end{bmatrix}}{\begin{bmatrix}1\\4\end{bmatrix}}={\begin{bmatrix}-15\\33\end{bmatrix}}}
,
u
=
[
1
4
]
{\displaystyle \mathbf {u} ={\begin{bmatrix}1\\4\end{bmatrix}}}
is not an eigenvector for
A
=
[
−
3
−
3
1
8
]
.
{\displaystyle \mathbf {A} ={\begin{bmatrix}-3&-3\\1&8\end{bmatrix}}~.}