Appendix A. Linear Algebra

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

Appendix A.

Linear Algebra

Since modelling and control of robot manipulators requires an extensive use of matrices
and vectors as well as of matrix and vector operations, the goal of this appendix is to
provide a brush-up of linear algebra.

A.I Definitions
A matrix of dimensions (m x n), with m and n positive integers, is an array of
elements aij arranged into m rows and n columns:

all aIZ aIn]


aZI azz aZn
A = [aijL = 1 m = . . . (A. 1)
""'. .
j = 1, ... ,n'
r amI amz ...
.
amn
If m = n, the matrix is said to be square; if m < n, the matrix has more columns than
rows; if m > n the matrix has more rows than columns. Further, if n = 1, the notation
(A. 1) is used to represent a (column) vector a of dimensions (m x 1)1; the elements
ai are said to be vector components. A square matrix A of dimensions (n x n) is said
to be upper triangular if aij = 0 for i > j:

o
the matrix is said to be lower triangular if aij 0 for i < j.=
An (n x n) square matrix A is said to be diagonal if aij = 0 for i :/= j, i.e.,
o
~ ] =diag{all,azz, ... ,ann}.

o ann

1 According to standard mathematical notation, small boldface is used to denote vectors while

capital boldface is used to denote matrices. Scalars are denoted by roman characters.
336 Modelling and Control of Robot Manipulators

If an (n x n) diagonal matrix has all unit elements on the diagonal (aii 1), the matrix =
is said to be identity and is denoted by In 2• A matrix is said to be null if all its elements
are null and is denoted by O. The null column vector is denoted by O.
The transpose AT of a matrix A of dimensions (m x n) is the matrix of dimensions
(n x m) which is obtained from the original matrix by interchanging its rows and
columns:
all a21

12
AT = a. a22
(A.2)
[
aln a2n

The transpose of a column vector a is the row vector aT.


An (n x n) square matrix A is said to be symmetric if AT = A, and thus aij = aj;:

a1n
a~n
1 .

ann
An (n x n) square matrix A is said to be skew-symmetric if AT = -A, and thus
aij= -aji for i :/= j and aii = 0, leading to

[ -~"
...

A= .
a12
0 ... a,. 1
a2n

-aln -a2n ... 0


A partitioned matrix is a matrix whose elements are matrices (blocks) of proper
dimensions:
All
A21
A12
A22
...
...
A1n
A2n
1
A= ... .. .
[ .
AmI Am2 ... Amn
A partitioned matrix may be block-triangular or block-diagonal. Special partitions of
a matrix are that by columns

A = [al a2 ... an]


and that by rows

ar
A= [ail
..

aTm

2 Subscript n is usually omitted if the dimensions are clear from the context.
Linear Algebra 337

Given a square matrix A of dimensions (n x n), the algebraic complement A(ij)


of element aij is the matrix of dimensions «(n - 1) x (n 1) which is obtained by
eliminating row i and column j of matrix A.

A.2 Matrix Operations


The trace of an (n x n) square matrix A is the sum of the elements on the diagonal:

Tr(A) = L aii· (A.3)


i=1

Two matrices A and B of the same dimensions (m x n) are equal if aij = bij. If
A and B are two matrices of the same dimensions, their sum is the matrix

C=A+B (A.4)

whose elements are given by Cij = aij + bij. The following properties hold:

A+O=A
A+B=B+A
(A + B) + C = A + (B + C).

Notice that two matrices of the same dimensions and partitioned in the same way can
be summed formally by operating on the blocks in the same position and treating them
like elements.
The product of a scalar 0: by an (m x n) matrix A is the matrix o:A whose elements
are given by o:aij' If A is an (n x n) diagonal matrix with all equal elements on the
diagonal (aii = a), it follows that A = a/no
If A is a square matrix, one may write

A = As + Aa (A.5)

where
1
As= (A+AT) (A.6)
2
is a symmetric matrix representing the symmetric part of A, and

(A.7)

is a skew-symmetric matrix representing the skew-symmetric part of A.


The row-by-columnproduct of a matrix A of dimensions (m x p) by a matrix B
of dimensions (p x n) is the matrix of dimensions (m x n)

C=AB (A.8)
338 Modelling and Control of Robot Manipulators

whose elements are given by Cij = L~=1 aikbkj. The following properties hold:

A = Alp = ImA
A(BC) = (AB)C
A(B+C) =AB+AC
(A + B)C = AC + BC
(AB)T = BT AT.

Notice that, in general, AB :/= BA, and AB = 0 does not imply that A = 0 or
B =0; further, notice that AC =
BC does not imply that A B. =
If an (m x p) matrix A and a (p x n) matrix B are partitioned in such a way that
the number of blocks for each row of A is equal to the number of blocks for each
column of B, and the blocks Aik and Bkj have dimensions compatible with product,
the matrix product AB can be formally obtained by operating by rows and columns
on the blocks of proper position and treating them like elements.
For an (n x n) square matrix A, the determinant of A is the scalar given by the
following expression, which holds 'Vi = 1, ... , n:

n
det(A) = I:>ij( -1)i+ j
det(A(ij)). (A.9)
j=l

The determinant can be computed according to any row i as in (A.9); the same result
is obtained by computing it according to any column j. If n = 1, then det( all) = all'
The following property holds:

det(A) = det(AT).

Moreover, interchanging two generic columns p and q of a matrix A yields

As a consequence, if a matrix has two equal columns (rows), then its determinant is
null. Also, it is det(aA) = andet(A).
Given an (m x n) matrix A, the determinant of the square block obtained by
selecting an equal number k of rows and columns is said to be k-order minor of
matrix A. The minors obtained by taking the first k rows and columns of A are said
to be principal minors.
If A and B are square matrices, then

det(AB) = det(A)det(B). (A. 10)

If A is an (n x n) triangular matrix (in particular diagonal), then

n
det(A) = II aii·
i=1
Linear Algebra 339

More generally, if A is block-triangular with m blocks Aii on the diagonal, then

m
det(A) IT det(A ii).
i=l

A square matrix A is said to be singular when det(A) = O.


The rank g(A) of a matrix A of dimensions (m x n) is the maximum integer r so
that at least a non null minor of order r exists. The following properties hold:

a(A) :::;min{m,n}
p(A) = g(AT)
p(AT A) = p(A)
p(AB) :::;min{p(A), p(B)}.

A matrix so that p(A) = min{m, n} is said to befull-rank.


The adjoint of a square matrix A is the matrix

Adj A = [(-l)i+jdet(A(ij»)]~ = 1, .. ,n' (A.ll)


j = 1, .. ,n

An (n x n) square matrix A is said to be invertible if a matrix A -I exists, termed


inverse of A, so that
A-IA = AA-I = In.

Since p(In) = n, an (n x n) square matrix A is invertible if and only if a(A) = n,


i.e., det(A) :/= 0 (nonsingular matrix). The inverse of A can be computed as

A-I _ 1
- det(A) Adj A. (A. 12)

The following properties hold:

(A-I)-I = A
(AT)-l = (A-1)T.

If the inverse of a square matrix is equal to its transpose

(A.B)

then the matrix is said to be orthogonal; in this case it is

(A. 14)

If A and B are invertible square matrices of the same dimensions, then

(A. 15)
340 Modelling and Control of Robot Manipulators

Given n square matrices Aii all invertible, the following expression holds:

(diag{All, ... , Ann}) -1 = diag{A1/, ...,A;;:~}.


where diag{Au, ... ,Ann} denotes the block-diagonal matrix.
If A and C are invertible square matrices of proper dimensions, the following
expression holds:

where the matrix DA -1 B + C-1 must be invertible.


If a block-partitioned matrix is invertible, then its inverse is given by the general
expression

(A.16)

where L\ = B - CA-1 D, E = A-I D and F = CA-I, on the assumption that


the inverses of matrices A and L\ exist. In the case of a block-triangular matrix,
invertibility of the matrix requires invertibility of the blocks on the diagonal. The
following expressions hold:

[~~rl =

[~~rl =

The derivative of an (m x n) matrix A(t), whose elements aij(t) are differentiable


functions, is the matrix

. d
A(t) = -A(t) [d
= -aij(t) ] _ 1 m . (A.l7)
dt dt ~- , ,
j 1, ,n

If an (n x n) square matrix A(t) is so that g(A(t)) =


n Vt and its elements aij(t) are
differentiable functions, then the derivative of the inverse of A( t) is given by

(A.18)

Given a scalar function f(x), endowed with partial derivatives with respect to the
elements Xi of the (n x 1) vector x, the gradient of function f with respect to vector x
is the (n x 1) column vector

(A.19)
Linear Algebra 341

Further, if x(t) is a differentiable function with respect to t, then

. d of T
f(x) = dtf(x(t)) = ax x = gradxf(x)x. (A.20)

Given a vector function g(x) of dimensions (m x 1), whose elements gi are differ-
entiable with respect to the vector x of dimensions (n x 1), the Jacobian matrix (or
simply Jacobian) of the function is defined as the (m x n) matrix

Ogl (x)
ax
Og2(X)
Jg(x) = og(x) ax (A.21)
ax =

If x(t) is a differentiable function with respect to t, then

g(x) = ~g(x(t)) = ;: x = Jg(x)x. (A.22)

A.3 Vector Operations


Given n vectors Xi of dimensions (m x 1), they are said to be linearly independent if
the expression

holds only when all the constants ki vanish. A necessary and sufficient condition for
the vectors Xl, X2 ... ,Xn to be linearly independent is that the matrix

has rank n; this implies that a necessary condition for linear independence is that
n ~ m. If instead g(A) = r < n, then only r vectors are linearly independent and
the remaining n - r vectors can be expressed as a linear combination of the previous
ones.
A system of vectors X is a vector space on the field of real numbers lR if the
operations of sum of two vectors of X and product of a scalar by a vector of X have
values in X and the following properties hold:
342 Modelling and Control of Robot Manipulators

x+y=y+x \fx,y E X
(x + y) + Z = x + (y + z) \fx,y,z E X
30 EX: x +0 = X \fx E X
\fXEX, 3(-x)EX:x+(-x)=0
Ix = x \fx E X
a(j3x) = (aj3)x \fa,j3 E IR \fx E X
(a+j3)x=ax+j3x \fa,j3 E IR \fx E X
a(x + y) = ax + ay \fa E IR \fx,y E X.

The dimension of the space dim(X) is the maximum number of linearly indepen-
dent vectors x in the space. A set {Xl, X2, ... ,xn} of linearly independent vectors is
a basis of vector space X, and each vector y in the space can be uniquely expressed
as a linear combination of vectors from the basis:

(A.23)

where the constants CI , C2, ••• , Cn are said to be the components of the vector y in the
basis {Xl, X2,· .. ,xn}.
A subset Y of a vector space X is a subspace Y ~ X if it is a vector space with
the operations of vector sum and product of a scalar by a vector, i.e.,

ax + j3y E Y \fa,j3EIR \fx,yEY.

According to a geometric interpretation, a subspace is a hyperplane passing by the


origin (null element) of X.
The scalar product < x, y > of two vectors x and y of dimensions (m x 1) is
the scalar that is obtained by summing the products of the respective components in a
given basis:

< x, Y >= XlYl + X2Y2 + ... + XmYm = X l' Y = Y l' x. (A.24)

Two vectors are said to be orthogonal when their scalar product is null:

(A.25)

The norm of a vector can be defined as

IIxli = v'xl'x. (A.26)

It is possible to show that both the triangle inequality

IIx + yll ~ IIxli + Ilyll (A.27)

and the Schwarz' inequality


l'
Ix yl ~ IIxllllyll (A.28)
Linear Algebra 343

hold. A unit vector X is a vector whose norm is unity, i.e., xT x = 1. Given a vector
x, its unit vector is obtained by dividing each component by its norm:

, 1
x= IIxlix. (A.29)

A typical example of vector space is the Euclidean space whose dimension is 3; in this
case a basis is constituted by the unit vectors of a coordinate frame.
The vector product of two vectors x and y in the Euclidean space is the vector

(A.30)

The following properties hold:

xxx=O
x x y = -y x x
x x (y + z) = x x y +x x z.

The vector product of two vectors x and y can be expressed also as the product of
a matrix operator S(x) by the vector y. In fact, by introducing the skew-symmetric
matrix

S(x) =[ ~3 (A.31)
-X2

obtained with the components of vector x, the vector product x x y is given by

x x y = S(x)y = -S(y)x (A. 32)

as can be easily verified. Moreover, the following properties hold:

S(x)x = ST(X)X = 0
S(ax + (3y) = as(x)
+ (3S(y)
S(x)S(y) T T
= yx - x yI
S(S(x)y) = yxT - xyT.

Given three vector x, y, z in the Euclidean space, the following expressions hold
for the scalar triple products:

(A.33)

If any two vectors of three are equal, then the scalar triple product is null; e.g.,
344 Modelling and Control of Robot Manipulators

A.4 Linear Transformations


Consider a vector space X of dimension n and a vector space Y of dimension m with
m ~ n. The linear transformation between the vectors x E X and y E Y can be
defined as
y=Ax (A.34)

in terms of the matrix A of dimensions (m x n). The range space (or simply range)
of the transformation is the subspace

R(A) = {y : y = Ax, x E X} ~ Y, (A.35)

which is the subspace generated by the linearly independent columns of matrix A


taken as a basis of y. It is easy to recognize that

g(A) == dim(R(A)). (A.36)

On the other hand, the null space (or simply null) of the transformation is the subspace

N(A) = {x : Ax = 0, x E X} ~ X. (A.37)

Given a matrix A of dimensions (m x n), the notable result holds:

g(A) + dim(N(A)) = n. (A.38)

Therefore, if g(A) = r ~ min{m,n}, then dim(R(A)) = rand dim(N(A)) =


n - r. It follows that if m < n, then N(A) :/= 0 independently of the rank of A; if
m == n, thenN(A) :/= 0 only in the case of g(A) =
r < m.
If x E N(A) and y E R(AT), then yT x = 0, i.e., the vectors in the null space
of A are orthogonal to each vector in the range space of the transpose of A. It can
be shown that the set of vectors orthogonal to each vector of the range space of AT
coincides with the null space of A, whereas the set of vectors orthogonal to each vector
in the null space of AT coincides with the range space of A. In symbols:

(A.39)

where .1denotes the orthogonal complement of a subspace.


A linear transformation allows defining the norm of a matrix A induced by the
norm defined for a vector x as follows. In view of the property

IIAxll ~ IIAllllxll, (A.40)

the norm of A can be defined as

IIAII = sup IIAxl1 (A.41)


:1:#0 Ilxll
Linear Algebra 345

which can be computed also as


max IIAxll.
Ilxll=l
A direct consequence of (A.40) is the property

IIABII ::; IIAIIIIBII· (A.42)

A.5 Eigenvalues and Eigenvectors


Consider the linear transformation on a vector u established by an (n x n) square
matrix A. If the vector resulting from the transformation has the same direction of u
(with u :/= 0), then
Au=..\u. (A.43)
The equation in (A.43) can be rewritten in matrix form as

(..\1 - A)u = O. (A.44)

For the homogeneous system of equations in (A.44) to have a solution different from
the trivial one u=0, it must be

det(..\I - A) = 0 (A.45)

which is termed characteristic equation. Its solutions "\1, ... ,..\n are the eigenvalues
of matrix A; they coincide with the eigenvalues of matrix AT. On the assumption of
distinct eigenvalues, the n vectors Ui satisfying the equation

(..\iI - A)Ui =0 i = 1, ... ,n (A.46)

are said to be the eigenvectors associated with the eigenvalues ..\i.


The matrix U formed by the column vectors Ui is invertible and constitutes a basis
in the space of dimension n. Further, the similarity transformation established by U:
A = U-1AU (A.47)

is so that A = diag{..\l' ... ,..\n}. It follows that det(A) = n:1


.Ai.
If the matrix A is symmetric, its eigenvalues are real and A can be written as

A=UTAU; (A.48)

hence, the eigenvector matrix U is orthogonal.

A.6 Bilinear Forms and Quadratic Forms


A bilinear form in the variables Xi and Yj is the scalar
m n
B = LL aijxiYj
i=l j=l
346 Modelling and Control of Robot Manipulators

which can be written in matrix form

(A.49)

where x =[Xl X2 ... xmjT,Y=[Yl Y2 ... YnjT,andAisthe(mxn)


matrix of the coefficients aij representing the core of the form.
A special case of bilinear form is the quadratic form

Q(x) = xT Ax (A.50)

where A is an (n x n) square matrix. Hence, for computation of (A.50), the matrix A


can be replaced with its symmetric part As given by (A.6). It follows that if A is a
skew-symmetric matrix, then

xT Ax = 0 \:Ix.

The quadratic form (A.50) is said to be positive definite if

\:Ix:/= 0
(A.51)
x =0.

The matrix A core of the form is also said to be positive definite. Analogously, a
quadratic form is said to be negative definite if it can be written as -Q(x) = _xT Ax
where Q (x) is positive definite.
A necessary condition for a square matrix to be positive definite is that its elements
on the diagonal are strictly positive. Further, in view of (A.48), the eigenvalues of a
positive definite matrix are all positive. If the eigenvalues are not known, a necessary
and sufficient condition for a symmetric matrix to be positive definite is that its
principal minors are strictly positive (Sylvester's criterion). It follows that a positive
definite matrix is full-rank and thus it is always invertible.
A symmetric positive definite matrix A can always be decomposed as

A= U T AU, (A.52)

where U is an orthogonal matrix of eigenvectors (UTU =


I) and A is the diagonal
matrix of the eigenvalues of A.
Let Amin (A) and Amax (A) respectively denote the smallest and largest eigenvalues
of a positive definite matrix A (Amin, Amax > 0). Then, the quadratic form in (A.50)
satisfies the following inequality:

(A.53)

An (n x n) square matrix A is said to be positive semi-definite if

\:Ix. (A.54)

This definition implies that [J(A) = r < n, and thus r eigenvalues of A are positive
and n - r are null. Therefore, a positive semi-definite matrix A has a null space of finite
Linear Algebra 347

dimension, and specifically the form vanishes when x E N(A). A typical example of
a positive semi-definite matrix is the matrix A = HT H where H is an (m x n) matrix
with m < n. In an analogous way, a negative semi-definite matrix can be defined.
Given the bilinear form in (A.49), the gradient of the form with respect to x is
given by
gradxB(x,y) = (OB(X,y))T
ox = Ay, (A.55)

whereas the gradient of B with respect to y is given by

gradyB(x, y) = (oB(X,
oy y)) T = ATx. (A.56)

Given the quadratic form in (A.50) with A symmetric, the gradient of the form with
respect to x is given by

gradxQ(x) = (oQ(X))
ox T = 2Ax. (A.57)

Further, if x and A are differentiable functions of t, then

. d T T'
Q(x) = dtQ(x(t)) = 2x Ax + x Ax; (A.58)

if A is constant, then the second term obviously vanishes.

A.7 Pseudo-inverse
The inverse of a matrix can be defined only when the matrix is square and nonsingular.
The inverse operation can be extended to the case of non-square matrices. Given a
matrix A of dimensions (m x n) with g(A) =
min {m, n },if n < m, a left inverse
of A can be defined as the matrix Al of dimensions (n x m) so that

If instead n > m, a right inverse of A can be defined as the matrix A,. of dimensions
(n x m) so that
AAr = 1m.
If A has more rows than columns (m > n) and has rank n, a special left inverse is the
matrix
(A. 59)

which is termed left pseudo-inverse, since At A = In. If WI is an (m x m) positive


definite matrix, a weighted left pseudo-inverse is given by

(A.60)
348 Modelling and Control of Robot Manipulators

If A has more columns than rows (m < n) and has rank m, a special right inverse
is the matrix
(A.61)

which is termed right pseudo-inverse, since AAt = 1m3. If WT is an (n x n) positive


definite matrix, a weighted right pseUdo-inverse is given by

(A.62)

The pseudo-inverse is very useful to invert a linear transformation y =


Ax with A
a full-rank matrix. If A is a square nonsingular matrix, then obviously x = A-I y and
then At = At = A-I.
If A has more columns than rows (m < n) and has rank m, then the solution x
for a given y is not unique; it can be shown that the expression

(A.63)

with k an arbitrary (n x 1) vector and At as in (A.61), is a solution to the system


of linear equations established by (A.34). The term At y E A(l· (A) == R(AT)
minimizes the norm of the solution Ilxll, while the term (1 - At A)k is the projection
of kin N(A) and is termed homogeneous solution.
On the other hand, if A has more rows than columns (m > n), the equation
in (A.34) has no solution; it can be shown that an approximate solution is given by

x = Aty (A.64)

where At as in (A. 59) minimizes lIy - Axil.

A.S Singular Value Decomposition


For a nonsquare matrix it is not possible to define eigenvalues. An extension of the
eigenvalue concept can be obtained by singular values. Given a matrix A of dimensions
(m x n), the matrix AT A has n nonnegative eigenvalues Al 2': A2 2: ... 2: An 2: 0
(ordered from the largest to the smallest) which can be expressed in the form

The scalars (T1 2': (T2 2': ... 2: (Tn 2: 0 are said to be the singular values of matrix A.
The singular value decomposition (SVD) of matrix A is given by

(A.65)

3 Subscripts 1 and r are usually omitted whenever the use of a left or right pseudo-inverse is
clear from the context.
Linear Algebra 349

where U is an (m x m) orthogonal matrix

U = [Ul U2 Um,], (A.66)

V is an (n x n) orthogonal matrix

v=[ VI V2 . .. Vn] (A.67)

and E is an (m x n) matrix

(A.68)

where 0'1 2: 0'2 2: ... 2: O'r > O. The number of nonnull singular values is equal to
the rank '('of matrix A.
The columns of U are the eigenvectors of the matrix AA T, whereas the columns
of V are the eigenvectors of the matrix AT A. In view of the partitions of U and V
in (A.66) and (A.67), it is: AVi = O'iUi, for i 1, ... ,'(' and Av; = 0, for i =
'('+ 1, ... ,no
Singular value decomposition is useful for analysis of the linear transformation
y = Ax established in (A.34). According to a geometric interpretation, the matrix A
transforms the unit sphere in IRn defined by IIxll = 1 into the set of vectors y = Ax
which define an ellipsoid of dimension '(' in IR m. The singular values are the lengths
of the various axes of the ellipsoid. The condition number of the matrix

is related to the eccentricity of the ellipsoid and provides a measure of ill-conditioning


(fi, » 1) for numerical solution of the system established by (A.34).

Bibliography
Boullion T.L., Odell P.L. (1971) Generalized Inverse Matrices. Wiley, New York.
DeRusso P.M., Roy R.J., Close C.M., A.A. Desrochers (1998) State Variables for Engineers.
2nd ed., Wiley, New York.
Gantmacher F.R. (1959) Theory of Matrices. Vols. I & II, Chelsea Publishing Company, New
York.
Golub G.H., Van Loan C.F. (1989) Matrix Computations. 2nd ed., The Johns Hopkins University
Press, Baltimore, Md.
Noble B. (1977) Applied Linear Algebra. 2nd ed., Prentice-Hall, Englewood Cliffs, N.J.

You might also like