The multiplication
[ c] = [a] [ b]
of a matrix[a]
times a matrix[ b]
is defined only when the number of columns of matrix[a]
is equal to the number of rows of the matrix[b].
There are no restrictions on the number of rows of
[a]
or the number of columns of[ b] .
The result of the multiplication is a matrix[c]
that has the same number of rows as[a]
and the same number of columns as
[ b] .
So, if matrix[a]
is ( m x q) and matrix[b]
is (q x n)
, then the matrix[c]
is(
m x n)
(Fig.2-13).
For example, as shown in Eq.(2.32),
if[a]
is(3
x4)
and[b]
is(4
x2),
then
[ c]
is (3
x2) .
l Cll C21
C31
(2.32)
The elements of the matrix
[ c]
are calculated by multiplying rows of[a]
by columns of[b].
Starting with the first row, the value of the element
c11
is obtained by multiplying the first row of[a]
by the first col-umn of[ b]
in the following manner:(2.33)
The value of the element
c12
is obtained by multiplying the first row of[a]
by the second column of[b]:
(2.34)
In the second row of
[ c]
, the value of the elementc21
is obtained by multiplying the second row of[a]
by the first column of[b]:
(2.35)
The multiplication procedure continues until the value of the element
c32
is calculated. In general, the multiplication rule is given by:(2.36)
A numerical example of multiplication is shown in Fig.
2-14.
[
2: � -li [
4 9 1-5 2 4 6 [
(2 . 4 +-1 . -5) (2 . 9 + -1 . 2) (2 . 1 +-1 . 4) (2. -3 + -1 . 6)(8. 4 + 3. -5) (8. 9 + 3. 2) (8. 1+3. 4) (8. -3 + 3. 6)1
(6·4+7·-5) (6·9+7·2) (6·1+7·4) (6·-3+7·6)
[
13 16 -2 -1217 78 20 -6'.
-11 68 34 24
Figure 2-14: Numerical example of multiplication of matrices.
2.4.2 Special Matrices
Matrices with special structures or properties arise when numerical methods are used for solving problems. The following is a list of such matrices, with a short description of each.
Square matrix
A matrix that has the same number of columns as rows is called a square matrix. In such matrices, entries or elements along the diagonal of the matrix,
a;;
, i.e.,a
11,a22,
and so on, are known as thediagonal
elements and all other entries are theoff-diagonal
elements. In a square matrix, the entries (or elements) above the diagonal, that is,[aiJ]
forj
> i, are called thesuperdiagonal entries
orabove-diagonal entries.
The entries below the diagonal, that is, [a iJ] for i > j, are called the subdiagonal entries or below-diagonal entries.
Diagonal matrix
A square matrix with diagonal elements that are nonzero and off-diago
nal elements that are all zeros is called a
diagonal matrix
and is denoted by[D].
Upper triangular matrix
A square matrix whose subdiagonal entries are all zero is called an
upper triangular matrix
and is denoted by[ U] .
Lower triangular matrix
A square matrix whose superdiagonal entries are all zero is called a lower triangular matrix and is denoted by [ L] .
Identity matrix
The
identity matrix [I]
is a square matrix whose diagonal elements are all 1 s and whose off-diagonal entries are all Os. The identity matrix is the analog of the number 1 for matrices. Any matrix that is multiplied by the identity matrix remains unchanged:[a][I] = [a]
Zero matrix
The zero matrix is a matrix whose entries are all zero.
Symmetric matrix
(2.37)
A symmetric matrix is a square matrix in which
[au]
=[a1J.
For a symmetric matrix, the transpose of the matrix is equal to the matrix itself:[a] T = [a] (2.38)
2.4.3 Inverse of a Matrix
Division is an operation that is not defined for matrices. However, an operation that is defined and serves an equivalent purpose is the inverse of a matrix. A square matrix
[a]
is invertible provided there exists a square matrix[ b]
of the same size such that[a] [ b]
=[I ]
, where[I ]
is the identity matrix. The matrix[b]
is called the inverse of[a]
and writ-ten as[ar1•
Thus:[a][ar1 = [ar1[a] = [J] (2.39) Example 2-1 illustrates the property expressed by Eq. (2.39).
Example 2-1: Inverse of a matrix.
Show that the matrix
[b]
=f 0.4 O.l 0.2 0.1 0.2
is the inverse of the matrix[a]
=r -1.2 3.2 -0.8 5.6 -1.6 0.4 . 1
SOLUTION
0.2 0.1 0.8 -0.4 -0.6 1.4
To show that the matrix
[ b]
is the inverse of the matrix[a]
, the two matrices are multiplied.r -1.2 3.2 r O.l 0.2 O J
[a][b] = 5.6 -1.6 0.4 0.4 0.1 0.2 = -0.4 -0.6 1.4 0.2 0.1 0.8
[
(1.2. 0.1 + 3.2. 0.4 +-0.8. 0.2) (1.2. 0.2 + 3.2. 0.1 +-0.8. 0.1 ) (1.2. 0 + 3.2. 0.2 +-0.8. 0.8)(5.6. 0.1 +-1.6. 0.4 + 0.4. 0.2) (5.6. 0.2 +-1.6. 0.1+0.4. 0.1 ) (5.6. 0 +-1.6. 0.2 + 0.4. 0.8)]
(-0.4 . 0.1 + -0.6 . 0.4 + 1.4 . 0.2) (-0.4 . 0.2 + -0.6 . 0.1 + 1.4 . 0.1 ) (-0.4 . 0 + -0.6 . 0.2 + 1.4 . 0.8)
l l
0 1 0 o oj
0 0 1
2.4.4 Properties of Matrices
The following are general properties of matrices:
•
[a]+[b]
=[b]+[a]
•
([a]+ [b]) + [c]
=[a]+ ([b] + [c])
•
a.([a] + [b])
=a.[a] + a.[b],
wherea.
is a scalar•
(a.+ j3)[a]
=a.[a] + j3[a],
wherea.
and13
are scalars The properties above apply to subtraction as well.• If
[a]
and[b]
are square matrices, then in general[a][b]
*"[b][a]
(unless one is the inverse of the other). If either
[a]
or[b]
is not square, and the product[a] [ b]
exists, then the product[ b] [a]
is not defined and does not exist. In other words, when matrices are involved, the order of multiplication is important.•
([a]+ [b])[c]
=[a][c] + [b][c],
with the order of multiplication being important.•
[a]([b] + [c])
=[a][b] + [a][c].
•
a.([a][b])
=(a.[a])[b]
=[a](a.[b]),
wherea.
is a scalar.• If
[a]
and[ b]
are matrices for which[a] [ b]
is defined and exists, then([a][b]/
=[b]T[af.
Note that the order of multiplication is changed.F
. rT
• or any matrix
[a], ([a] )
=[a].
• For an invertible matrix
[a], ([ar1f1
=[a].
• If
[a]
and[ b]
are two square, invertible matrices of the same size.then
([a][b])-1
=[br1[ar1.
2.4.5 Determinant of a Matrix
The determinant that is defined for square matrices is a useful quantity that features prominently in finding the inverse of a matrix and provides useful information regarding whether or not solutions exist for a set of simultaneous equations. The determinant of a matrix is often difficult to compute if the size of a matrix is larger than
(3
x3)
or( 4
x4).
The determinant is a number. It is the sum of all possible products formed by taking one element from each row and each column and attaching the proper sign. The proper sign of each term is found by writ
ing the individual terms in each product and counting the number of interchanges necessary to put the subscripts into the order 1, 2, ... , n. If the number of such required interchanges is even, then the sign is + and if the number of interchanges is odd, the sign is - . Formally, the deter
minant of a matrix
[alnxn
is denoted bydet(a)
orlal
and is defined as:det(A) = IAI = '1· a2 1 ' 2 1· ... an '1· n
l
(2.40)
where the sum is taken over all n! permutations of degree n and k is the number of interchanges required to put the second subscripts in the order 1,
2, 3,
... , n. Use ofEq.(2.40)
is illustrated for n = 1, n =2,
andn =
3.
Forn = 1,the matrixis(lxl), [a]=
[
a1J
,and the determinant is:det(a) = a11
For n =
2,
the matrix is(2
x2),
[a] =[
a11 and the determinant is:az1
0 I
det(a) = (-1) a11a22+(-1) a12a21 = a11a22 -a12a21
For n �
3,
the matrix is(3
x3)'
[a] �:�
and thedetermi-nant is:
0 I I
det(A) = (-1) alla22a33 + (-1) alla23a32 + (-1) a12a21a33
2 2 3
+ (-1) a12a23a31 + (-1) a13a21a32 + (-1) a13a22a31
= all (a2za33 -az3a32) -a12(a21 a33 -az3a31) + a13(a21 a32 -azza31) It can be seen that evaluation of a determinant for large matrices is impractical both by hand and by computer because of the large number of operations required to consider the n! permutations.
2.4.6 Cramer's Rule and Solution of a System of Simultaneous Linear Equations
A set of n simultaneous linear equations with n unknowns x1, x2, ... , xn is given by:
allxl + a12X2 + ... + a1nxn = b1 az1X1 + azzXz + · · · + aznxn = bz
... + ... + ... + ...
The system can be written compactly by using matrices:
all a12 · · · aln X1 b1
az1 azz · · · azn Xz bz
... ... ... ...
an! an2 · · · ann xn bn
(2.41)
(2.42)
Equation
(2.42)
can also be written as:[a][ x]
=[b] (2.43)
where
[a]
is the matrix of coefficients,[ x]
is the vector of n unknowns, and[ b]
is the vector containing the right-hand sides of each equation.Cramer's rule states that the solution to Eq.
(2.41),
if it exists, is given by:_
det(a'1) .
_x1 - d
for ;- 1, 2, ...
, net( a) (2.44)
where
a'1
is the matrix formed by replacing thejth column of the matrix[a]
with the column vector[b]
containing the right-hand sides of the original system(2.42).
It is apparent from Eq.(2.44)
that solutions to(2.42)
can exist only ifdet(a)
*"0.
The only way thatdet(a)
can bezero is either if two or more columns or rows of
[a]
are identical or one or more columns (or rows) of[a]
are linearly dependent on other columns (or rows).
Example 2-2: Solving a system of linear equations using Cramer's rule.
Find the solution of the following system of equations using Cramer's rule.
2x+ 3y-z
=5 4x+4y- 3z
=3 - 2x+ 3y-z
=1
SOLUTION
Step
1: Write the system of equations in a matrix form[a][ x]
=[ b] .
[! -2 3 -1 ! =�]
=Step
2: Calculate the determinant of the matrix of coefficients.det(A)
=2[(4x-1)-(-3x3)]- 3[(4x-1)-(-3x-2)]- 1[(4x3)-(4x-2)]
=
2(5)- 3(-10)- 1(20)
=10+30- 20
=20
(2.45)
(2.46)
Step
3: Apply Eq.(2.44)
to find x, y, and z. To findx,
the modified matrixa'x
is created by replacing its first column with[ b] .
x =
[[ 5 3
-l:J
det 3 4 -3 1 3
-l= = 1
20 20
In the same way, to find
y,
the modified matrixa'Y
is created by replacing its second column with[b].
y
=
de{[
_� � 20 J) = 20 2
Finally, to determine the value of z, the modified matrix
a'z
is created by replacing its third column with[b].
z
=
det 4 4[l -2 3 1 2 3 5 3 j) = (2·-5)-(3·10)-(5·20) = 3
20 20
To check the answer, the matrix of coefficients
[a]
is multiplied by the solution:l! ! =� 1 = ! : : = ! =
The right-hand side is equal to
[b],
which confirms that the solution is correct.2.4.7 Norms
In Section
2.3,
vectors were identified as having a magnitude usually specified by Eq.(2.14).
From Euclidean geometry, this magnitude can be seen to be a measure of the length of a vector (not to be confused with the size or number of elements it contains). The magnitude of the vector is useful in comparing vectors so that one may determine that one vector is larger than another. Such an equivalent measure for the"magnitude" of a matrix is also useful in comparing different matrices;
it is called the Norm and denoted as
ll[a]ll.
There is no unique way to measure the "magnitude" or norm of a matrix. Several definitions of norms are presented in Section4.9.
The norm basically assigns a real number to a matrix (or vector).A norm must satisfy certain properties since it is a quantity for a matrix that is analogous to the magnitude or length of a vector. These are:
(1) ll[a]ll
�0
andll[a]ll = 0
if and only if[a] = [O]
(i.e., if[a]
is the zero matrix).(2)
For all numbers a,llu[a]ll = lul ll[a]ll .
(3)
For any two matrices (or vectors)[a]
and[b],
the following must be satisfied:ll[a] + [b]ll
�ll[a]ll + ll[b]ll .
Condition
(1)
states that the "magnitude" of a matrix or vector as measured by the norm must be a positive quantity just as any length that is used to measure the magnitude of a vector. Condition
(2)
states that for matrices, too, just like vectors,ll[a]ll
and11[-a]ll
would have the same"magnitude." This is easy to see in the case of vectors, since the length
of the vector does not change simply because its direction is reversed.
Condition
(3)
is just the triangle inequality and is easily visualized with Euclidean geometry for vectors. The various vector and matrix norms are discussed further in Section 4.10.2.5 ORDINARY DIFFERENTIAL EQUATIONS (ODE)
An ordinary differential equation (ODE) is an equation that contains one dependent variable, one independent variable, and ordinary deriva
tives of the dependent variable. If
x
is the independent variable andy
is the dependent variable, an ODE has terms that containx, y, <.!1!.
,<!....J:., 2 dx dx2 ... ,
ODEs can be linear or nonlinear. An ODE is linear if itsdxn
dependence on
y
and its derivatives is linear. Anylinear
ODE can be written in the followingstandard
orcanonical form:
dn dn-1 d2 d
an+ 1 (x)� + an(x)� + ... + a3(x)� + a2(x)� + a1 (x)y
=r(x)
(2.47)dxn dxn-1 dx2 dx
Note that the coefficients in Eq. (2.47) are all functions only of the inde
pendent variable
x.
Examples of linear OD Es are:dy
=
lOx
dx
dx d2x
c-+kx
=-m-dt dt2
where m,