Introduction To Matrices: 2.14 Analysis and Design of Feedback Control Systems
Introduction To Matrices: 2.14 Analysis and Design of Feedback Control Systems
Introduction To Matrices: 2.14 Analysis and Design of Feedback Control Systems
Introduction to Matrices
Derek Rowell October 2002 Modern system dynamics is based upon a matrix representation of the dynamic equations governing the system behavior. A basic understanding of elementary matrix algebra is essential for the analysis of state-space formulated systems. A full discussion of linear algebra is beyond the scope of this note and only a brief summary is presented here. The reader is referred to a text on linear algebra, such as Strang (1980), for a detailed explanation and expansion of the material summarized here.
Denition
A matrix is a two dimensional array of numbers or expressions arranged in a set of rows and columns. An m n matrix A has m rows and n columns and is written
A=
a11 a21 . . .
a12 a22 . . .
am1 am2
(1)
where the element aij , located in the ith row and the jth column, is a scalar quantity; a numerical constant, or a single valued expression. If m = n, that is there are the same number of rows as columns, the matrix is square, otherwise it is a rectangular matrix. A matrix having either a single row (m = 1) or a single column (n = 1) is dened to be a vector because it is often used to dene the coordinates of a point in a multi-dimensional space. (In this note the convention has been adopted of representing a vector by a lower case bold-face letter such as x, and a general matrix by a bold-face upper case letter such as A.) A vector having a single row, for example x= x11 x12 x1n (2)
is dened to be a row vector, while a vector having a single column is dened to be a column vector y11 y21 . . y= . (3) . ym1
Two special matrices are the square identity matrix, I, which is dened to have all of its elements equal to zero except those on the main diagonal (where i = j) which have a value of one: 1 0 0 0 1 0 (4) I = . . .. . , . . . . . . . 0 0 1 0 0 . . . 0 0 . .. . . . 0 0 and the null matrix 0, which has the value of zero for all of its elements:
0=
0 0 . . . 0
(5)
2
2.0.1
The operation of addition of two matrices is only dened when both matrices have the same dimensions. If A and B are both (m n), then the sum C=A+B (6) is also (m n) and is dened to have each element the sum of the corresponding elements of A and B, thus (7) cij = aij + bij . Matrix addition is both associative, that is A + (B + C) = (A + B) + C, and commutative A + B = B + A. (9) The subtraction of two matrices is similarly dened; if A and B have the same dimensions, then the dierence C=AB (10) implies that the elements of C are cij = aij bij . 2.0.2 Multiplication of a Matrix by a Scalar Quantity (11) (8)
If A is a matrix and k is a scalar quantity, the product B = kA is dened to be the matrix of the same dimensions as A whose elements are simply all scaled by the constant k, bij = k aij . 2 (12)
2.0.3
Matrix Multiplication
Two matrices may be multiplied together only if they meet conditions on their dimensions that allow them to conform. Let A have dimensions m n, and B be n p, that is A has the same number as columns as the number of rows in B, then the product C = AB is dened to be an m p matrix with elements
n
(13)
cij =
k=1
aik bkj .
(14)
The element in position ij is the sum of the products of elements in the ith row of the rst matrix (A) and the corresponding elements in the jth column of the second matrix (B). Notice that the product AB is not dened unless the above condition is satised, that is the number of columns of the rst matrix must equal the number of rows in the second. Matrix multiplication is associative, that is A (BC) = (AB) C, but is not commutative in general AB = BA, (16) in fact unless the two matrices are square, reversing the order in the product will cause the matrices to be nonconformal. The order of the terms in the product is therefore very important. In the product C = AB, A is said to pre-multiply B, while B is said to postmultiply A. It is interesting to note in passing that unlike the scalar case, the fact that AB = 0 does not imply that either A = 0 or that B = 0. (15)
3
3.0.4
The rules given above for matrix arithmetic allow a set of linear algebraic equations to be written compactly in matrix form. Consider a set of n independent linear equations in the variables xi for i = 1, . . . , n a11 x1 + a12 x2 + + a1n xn = b1 a21 x1 + a22 x2 + + a2n xn = b2 . . . . ... . . . . . . . . an1 x1 + an2 x2 + + ann xn = bn
(17)
A=
b1 b2 . . . bn
x1 x2 . . . xn
b1 b2 . . . bn
(18)
3.0.5
State Equations
The modeling procedures described in this note generate a set of rst-order linear dierential equations
d x dt 1 d x dt 2
. . . d x dt n
= a11 x1 + a12 x2 + + a1n xn + b11 u1 + b1m um = a21 x1 + a22 x2 + + a2n xn + b21 u1 + b2m um . . . . . ... ... . . . . . . . . . . = an1 x1 + an2 x2 + + ann xn + bn1 u1 + bnm um
(20)
If the derivative of a matrix is dened to be a matrix consisting of the derivatives of the elements of the original matrix, the above equations may be written
d dt
x1 x2 . . . xn
x1 x2 . . . xn
u1 . . .
(21)
um
4
4.1
Functions of a Matrix
The Transpose of a Matrix
The transpose of an mn matrix A, written AT , is the nm matrix formed by interchanging the rows and columns of A. For example, if A= a11 a12 a13 a21 a22 a23
(24)
then in terms of the elements of the above matrix, the transpose is a11 a21 T A = a12 a22 . a13 a23 (25)
Notice that the transpose of a row vector produces a column vector, and similarly the transpose of a column vector produces a row vector. The transpose of the product of two matrices is the reversed product of the transpose of the two individual matrices, (AB)T = BT AT . (26)
The rules of matrix multiplication show that the product of a vector and its transpose is the sum of the squares of all of the elements x(xT ) =
n i=1
(xi )2 .
(27)
4.2
The Determinant
The determinant of an n n square matrix, written det A is an important scalar quantity that is a function of the elements of the matrix. When written using the elements of the matrix, the determinant is enclosed between vertical bars, for example a11 a12 a13 det A = a21 a22 a23 . a31 a32 a33 (28)
The determinant of a matrix of size n n is dened recursively in terms of lower order determinants ((n 1) (n 1)) as follows. The minor of an element aij , written Mij , is 5
another determinant of order (n 1) that is formed by deleting the ith row and the jth column from the original determinant. In the above example, M23 = a11 a12 . a31 a32 (29)
The cofactor ij of an element aij in a determinant is simply its minor Mij multiplied by either +1 or 1, depending upon its position, that is cof aij = ij = (1)i+j Mij . In the case of the (3 3) example above 23 = (1)5 M23 = a11 a12 . a31 a32 (31)
(30)
At the limit, the determinant of a 1 1 matrix (a scalar) is the value of the scalar itself. The determinant of a high order matrix is found by expanding in terms of the elements of any selected row or column and the cofactors of those elements. If the expansion is done by selecting the ith row, the determinant is dened as a sum of order (n 1) determinants as
n
det A =
j=1
aij ij ,
(32)
that is the sum of products of the elements of the row and their cofactors. Similarly, the expansion in terms of the elements of the jth column of the determinant is
n
det A =
i=1
aij ij .
(33)
If a (2 2) determinant is expanded by the top row, the result is det A = a11 a12 a21 a22 = a11 11 + a12 12 = a11 a22 a12 a21 (34)
If A is a (3 3) matrix, and the expansion is done by the rst column, then det A = a11 a12 a13 a21 a22 a23 a31 a32 a33
a22 a23 a a a a a21 12 13 + a31 12 13 a32 a33 a32 a33 a22 a23 = a11 (a22 a33 a32 a23 ) a21 (a12 a33 a32 a13 ) + a31 (a12 a23 a22 a13 ) = a11 6
(35)
4.3
Matrix division is not dened. For a square matrix, multiplication by an inverse may be thought of as an analogous operation to the process of multiplication of a scalar quantity by its reciprocal. For a square n n matrix A, dene its inverse, written A1 , as that matrix (if it exists) that pre- or post-multiplies A to give the identity matrix I, A1 A = I AA1 = I. (36)
The importance of the inverse matrix can be seen from the solution of a set of algebraic linear equations such as Ax = b. (37) If the inverse A1 exists then pre-multiplying both sides gives A1 Ax = A1 b Ix = A1 b (38) (39)
and since pre-multiplying a column vector of length n by the nth order identity matrix I does not aect its value, this process gives an explicit solution to the set of equations x = A1 b. (40)
The inverse of a square matrix does not always exist. If the inverse exists, the matrix is dened to be non-singular, if it does not exist the matrix is singular. The adjoint matrix, adj A, of a square matrix A is dened as the transpose of the matrix of cofactors of the elements of A, that is
adj A =
11 12 21 22 . . . . . . n1 n2
1n 2n . ... . . nn A1 =
11 21 12 22 . . . . . . 1n 2n
n1 n2 . ... . . nn
(41)
The inverse of A is found from the determinant and the adjoint of A, adj A . (42) det A Notice that the condition for the inverse to exist, that is for A to be non-singular, is that det A = 0. For a (2 2) matrix A1 = 1 a11 a22 a12 a21 a22 a12 a21 a11 . (43)
For higher order matrices the elements in the adjoint matrix must be found by expanding out the cofactors of each element. For numerical matrices of order four and greater it is usually expedient to use one of the many computer matrix manipulation packages to compute the inverse. 7
In the study of dynamic systems we are frequently confronted with a set of linear algebraic equations of the form x = Ax (44) where x is a column vector of length n, A is an n n square matrix and is a scalar quantity. The problem to be solved is to nd the values of satisfying this equation, and the corresponding vectors x. The values of are known as the eigenvalues of the matrix A, and the corresponding vectors are the eigenvectors. The above equation may be written as a set of homogeneous equations x Ax = (I A) x = 0, where 0 is a null column vector, and
(I A) = .
(45)
...
a1n a2n . . .
(46)
amn
A theorem of linear algebra states that for a set of homogeneous linear equations a nontrivial set of solutions exists only if the coecient matrix is singular, that is det (I A) = 0. (47)
The determinant, det (I A), is known as the characteristic determinant of the matrix A. Expansion of the determinant results in an nth order polynomial in , known as the characteristic polynomial of A. The n roots of the characteristic equation, formed by equating the characteristic polynomial to zero, will dene those values of that make the matrix (I A) singular. These values are known as the eigenvalues of the matrix A. For example, to nd the eigenvalues of the matrix A= the characteristic equation is given by det (I A) = 5 4 = 2 7 + 6 = 0 1 2 5 4 1 2 ,
and has roots (and hence eigenvalues) 1 = 6 and 2 = 1. The eigenvectors corresponding to each of these values may be found by substituting back into the original equations, for example if = 6 the equations become x1 + 4x2 = 0 x1 4x2 = 0 8
which has the non-unique solution x1 = 4x2 . Any vector maintaining this ratio between its two elements is therefore an eigenvector corresponding to the eigenvalue = 6. In general, if x is an eigenvector of A then so is kx for any scalar value k.
Cramers Method
Cramers method is a convenient method for manually solving low-order non-homogeneous sets of linear equations. If the equations are written in matrix form Ax = b (48)
then the ith element of the vector x may be found directly from a ratio of determinants xi = det A(i) det A (49) column of A with the column vector = 2 = 5 . = 3
where A(i) is the matrix formed by replacing the ith b. For example, solve x2 + 2x3 2x1 x1 + 10x2 3x3 x2 + x3 x1 + Then
2 1 2 1 10 3 = 46 det A = 1 1 1 2 1 2 5 10 3 3 1 1
and x1 1 = 46 = 2
x2
1 = 46 = 0
2 2 2 1 5 3 1 3 1
x3 =
1 46
2 1 2 1 10 5 1 1 3
= 1 9