Ee 701 Lecture Notes
Ee 701 Lecture Notes
Linear Algebra
Linear Algebra
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Contents
. . . . . . . . . . . . . 24
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2
Transpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3
1.3.1
Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.4.1
Commutative property . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.4.2
Associative property . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.4.3
Distributive property . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.4.4
Identity Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.4.5
. . . . . . . . . . . . . . . . . .
1.5
1.6
Determinant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.4
1.6.1
1.6.2
1.6.3
1.7
Rank
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.8
1.9
1.8.1
1.9.1
Example norms
2.2
35
Algebraic Equations, y = A b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.1.1
2.1.2
Case 2: Where n > p, we have more equations than unknowns, the over
constrained case (Left pseudo-inverse case): . . . . . . . . . . . . . . . . 39
2.1.3
Case 3: Where n < p we have fewer equations than unknowns, the underconstrained case (Right pseudo-inverse case): . . . . . . . . . . . . . . . 41
Differential Equations, . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3 Summary
45
. . . . . . . . . . . . . . . . . . . 12
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Page 1
Page 2
Section 1.2.0
Section 1.3.0
A=
v (t)
1 0 7
31
,
x
(t)
R
x (t) =
A
=
w (t)
4 5 0
z (t)
2 3 6
A R33
1 2
3 4
B=
x=
2
3
1 1
w=
C = 4 1
5 2
3 4
Vectors are special cases of Matrices, with only one row or column,
x is a column vector,
h
i
w = 3 4 R12 is a row vector
Scalar values (numbers or functions with one output variable) can also be
treated as matrices or vectors:
3 = [3] R11
A+B =
0 3
5 7
AB =
2 1
1 1
1.2 Transpose
Transposing an array rearranges each column to a row:
#
"
3 1
3 4 5
T
C
C=
=
4 1
1 1 2
5 2
C R32 , CT R23
Lecture: Basics of Linear Algebra
Page 3
Page 4
Section 1.3.1
Section 1.4.2
1.3.1 Multiplication
For multiplication, the operation is by row on the left and column on the
right.
To produce one element of the result, go across each row on the left and
multiply with elements of the column on the right,
A B = AB =
"
(1 (1) + 2 2) (1 1 + 2 3)
(3 (1) + 4 2) (3 1 + 4 3)
"
3 7
5 15
"
1 2
3 4
#"
2
3
"
(1 2 + 2 3)
(3 2 + 4 3)
"
18
AC =
1 2
3 4
3 7
5 15
BA =
11 16
3 1
4 1 = undefined
5 2
(n = 3 , m = 2 , j = 2 , k = 2)
"
#
6 10
3 1
1 2
=
CA =
1 4
4 1
3 4
11 18
5 2
AB =
"
Example:
Examples:
Properties
(A + B) + C = A + (B + C)
(A + B) C = A + (B C)
(A B) C = A (B C)
Page 5
Page 6
Section 1.4.4
Section 1.4.5
(A + B) C = A C + B C
We can add, subtract or multiply on the left or right by any allowed term
and get a new equation.
C (A B) = C A C B
Examples, given:
A+B = C
Then
(A + B) + D = C + D
IL C = C IR = C
E (A + B) = E A + E B = E C
Examples:
1 0 0
3
0 1 0 4
0 0 1
5
3 1
4 1
0
5 2
3 1
=
1 4 1
2
5 2
3 1
=
4 1
1
5 2
(A + B) F = C F
1 0
0 1
1 2
3 4
1 2
3 4
1 0
0 1
1 2
3 4
Page 7
Page 8
Section 1.5.0
Section 1.6.0
1.6 Determinant
The determinant is a scalar measure of the size of a square matrix.
is linearly dependent if there exists a set of scalars {ai } , i = 1...p , not all
of which are zero, such that:
p
..
a1 v1 + a2 v2 + + a p v p = ai vi = 0 0 = .
(1)
i=1
0
Linear Independence: The set of vectors is said to be linearly independent if
there is no set of values {ai } which satisfies the conditions for Linear
Dependence. In other words,
p
ai vi = 0
(2)
(5)
(a)
1 2 3
4 5 6 =0
10 14 18
(b)
1 2 3
4 5 6
7 8 9
= 54
(6)
i=1
Notice that in case (a), the third row is given by 2xRow1 + 2xRow2.
Written another way, vectors {vi } are linearly independent if and only if
(iff)
p
ai vi = 0
ai = 0 , i
Always for a square matrix, if the columns are dependent, the rows
will be dependent.
(3)
i=1
| |
v1 v2
| |
a1
| |
a
2
=0
vp
...
| |
ap
iff
a
1
a2
.. = 0
.
ap
(4)
Page 9
Page 10
Section 1.6.1
ai j i j
(7)
j=1
where Mi j is called a minor. Mi j is the same matrix as A, with the ith row and jth
column removed.
For example, with i = 1,
j=2
j=3
a b c
d f
e f
d e
+ c det
b det
det d e f = a det
g i
h i
g h
g h i
Closed-form expressions for 1x1, 2x2 and 3x3 matrices are sometimes
handy. They are:
det [a] = a ,
det M A M 1 = det (M) det (A) 1/ det (M) = det (A)
det
a b
c d
= ad bc
0
d1
T
d1
d2
d2
, or Al =
Au =
...
...
T
dn
0
dn
Then det (Au ) = nk=1 dk , or det (Al ) = nk=1 dk .
Example:
>> A = [ 1 2 3 ; 0 4 5 ; 0 0 6]
A = 1
2
3
0
4
5
0
0
6
2. A diagonal matrix is special case of 1).
a b c
det d e f = a e i a h f b d i + b g f + c d h c g e
g h i
Lecture: Basics of Linear Algebra
(a) det M 1 = 1/ det (M)
where ai j is the element from the ith row and jth column of A; and i j is called the
cofactor, given by:
(8)
i j = (1)i+ j det Mi j
Section 1.6.3
Page 11
>> det(A)
ans = 24
Page 12
Section 1.7.0
1.7 Rank
Section 1.8.0
A Rnm
Example:
1 2 3 4
rT1
r =
A = rT2 = 5 6 7 8
1
6 8 10 12
rT
3
(9)
number of
(10)
The norm of a vector, written ||x|| is a measure of the size of the vector. A norm is
any function of a vector x with these properties, for any vector x and scalar a, then
1. Positivity, the norm of any vector x is a non-negative real number
Rn 7 R
||x|| 0
2. Triangle inequality
||x + v|| ||x|| + ||v||
3. Positive homogeneity or positive scalability
||a x|| = |a| ||x||
rank (A) = 2
where |a| is the absolute value of a .
Actually, property 1 follows from properties 2 and 3, so 2 and 3 are sufficient for
the definition.
The rank of a matrix can not be greater than the number of rows or columns
rank (A) min (n , m)
A matrix is said to be full rank if rank (A) takes its maximum possible value,
that is
rank (A) = min (n , m)
Otherwise the matrix is said to be rank deficient.
A square matrix is invertible if it is full rank.
The determinant of a square matrix is zero if the matrix is rank deficient.
Lecture: Basics of Linear Algebra
Page 13
if and only if x = 0
That is, the norm is zero only if the vector is a vector of all zeros
(called the null vector). Technically, a norm with property 4 is
called a seminorm, but this distinction will not be important
for us.
Lecture: Basics of Linear Algebra
Page 14
Section 1.8.1
Section 1.9.0
||x||2 =
x2i
(11)
r
22 + (3)2 + (4)2 = 5.39 (12)
Other common norms are the 1-norm and the -norm, these are all special
cases of the p-norm
We can write the 2-norm as:
x2i
||x||2 =
|xi|
||x|| p =
||x||1 =
|xi|
i
!1
||x|| = lim
Examples:
h
i
2 3 4 = 9
1
|xi|
i
1
4
7
2
2
5
6
1
3
6
5
1
>> S = svd(A)
S = 14.1542
2.5515
0.3857
(13)
!1
(14)
= |xi |
v3 = 0.3724
-0.8184
0.4375
(15)
>> y1 = A*v1
y1 = -3.4700
-8.6660
10.3862
-2.3083
>> y3 = A*v3
y3 = 0.0482
0.0227
-0.1159
0.3640
A =
!1
For example:
i=1
= max |xi |
(16)
h
i
2 3 4 = 4
Page 15
Page 16
Section 1.10.0
rank (A) = 3
Section 1.10.1
But suppose the ideal values y are unknown, and instead we have
measurements y given by:
y = y + e
y
(20)
Where
y is a measurement of y,
We will be looking at the SVD in detail in several weeks (cf. Bay, Chap. 4).
e
y represents measurement noise,
For example e
y = N (0, y ) are samples with a normal (Gaussian) random
distribution, with zero mean and y standard deviation.
Then what we can compute is
x = A1
1
The condition number of a matrix indicates how errors may be scaled when
the matrix inverse is used.
For example if we have these two equations in two unknowns,
7
= 3 x1 + 4 x2
y = Ax
becomes
x :
x :
x = A1
1 y=
0.2 0.4
1 2
x1
x2
One answer is
(18)
In the worst case, the error is amplified by the condition number of A1
max
01.
0.3
e
x = x x
e
x: Misadjustment of estimates
(21)
(17)
9 = x1 + 2 x2
7
9
5
2
||e
x||
||e
y||
= cond (A1 )
||x||
||y ||
or
(19)
Page 17
||e
x|| ||x|| cond (A1 )
Lecture: Basics of Linear Algebra
(22)
||e
y||
||y||
Page 18
Section 1.10.1
Example:
Section 1.10.3
>> A1 = [3 4 ;-1 2]
A1 =
ybar =
3
-1
4
2
2 = 2 x1 + 4 x2
198 = 200 x1 + 401 x2
7
-9
Then x is estimated by:
x 2 = A1
2 y2
2
200
4,
401
ystar2 =
2
198
If ||e
y|| = 0.01 , then
max (||e
x|| / ||x ||) = 2.6180 (0.01/11.4) = 0.0023 , or
(23)
||e
x|| 2.6180 (0.01/11.4) 5.39 = 0.012
ans =
Estimating x 2 using A2
1.0041e+05 = 100410.
A2 =
Page 19
%% An example measurement of Y
2.0121
197.9860
Page 20
Section 1.10.3
Section 1.11.0
v1 =
%% cond(A1) = 2.618
1
2
, v2 =
1.5
3.0
, v3 =
1.58
1.58
v3
x1
y4 = A v4
What matrices have condition numbers:
Singular values are defined for any matrix, and so condition number can
be computed for any matrix.
y4 = A v4 =
2.0 0.5
1.0
0.5
1
1
2.5
0.5
v2
x2
y4
x1
v4
Page 21
Page 22
Section 1.11.0
For any square matrix A, certain vectors have the property that the matrix
changes magnitude only, not direction. That is, writing
Section 1.11.1
C1
(25)
y = Av
then if v is an example special vector, y and v have the same direction, but
possibly different magnitude. If the directions are the same,
y = v or
v = Av
1.11.1 Some properties of Eigenvectors and Eigenvalues
1.5
1.5
2.0 0.5
1.0
0.5
1
1
2.0 0.5
1.0
0.5
1
2
A vi i vi = 0
1.5
1.5
1
2
2.0 0.5
1.0
0.5
2.0 0.5
1.0
0.5
1
1
1
2
det (A i I) = 0
= 1.5
= 1.0
1
1
1
2
, so v1 =
, so v2 =
, 1 = 1.5
(26)
(A i I) vi = 0
, 2 = 1.0
Page 23
Page 24
Student
Exercise
Section 1.11.1
det
a b
c d
= ad bc
A=
and plugging in
det
2.0 0.5
1.0
0.5
1 0
0 1
= det
Section 1.11.1
2.0
0.5
1.0
0.5
1.0
0.5
V=
2.0 0.5
v1 v2
1 1
1.5 0
1 2
U=
1 0
0 2
det (A I) = (dk )
(27)
k=1
A defective matrix can only arise when there are repeated eigenvalues.
Page 25
In this case, a special tool called the Jordan Form is required to solve
the equation x (t) = A x (t) + B u (t).
Lecture: Basics of Linear Algebra
Page 26
Section 1.11.1
Section 1.11.2
>> A =
3
1
3 ]
0.5267 - 0.0250i
-0.1294 + 0.1030i
0.8335
-2.4563
0
0
0
5.2282 + 0.5919i
0
0.5267 + 0.0250i
-0.1294 - 0.1030i
0.8335
0
0
5.2282 - 0.5919i
2.0000
68.0000
3 8 2 + 2 + 68 = 0
(28)
As with many things, wikipedia has a very nice article on eigenvectors and
eigenvalues:
Everything you wanted to know about the eigensystem of A, in 3 pages.
(Revised: Sep 06, 2012)
det (A) = i
i=1
Example:
>> aa = [ 1 2 3 ; 4 -1 -3; 5 2 1]
aa =
1
2
3
4 -1 -3
5
2
1
>> [Evecs, Evals] = eig(aa)
Page 27
Evecs = 0.6128
0.0136
0.7901
0.4667
-0.8751
-0.1276
0.2146
-0.8542
0.4734
>> prod(diag(Evals))
ans = 6.0000
>> det(aa)
ans = 6.0000
Lecture: Basics of Linear Algebra
Evals = 4.9126
0.0000
0.0000
0.0000
-3.5706
0.0000
0.0000
0.0000
-0.3421
Page 28
Section 1.11.2
Section 1.11.2
(29)
Matlab actually goes the other way, and solves for the roots of a polynomial
by forming a matrix and finding the eigenvalues of that ! The polynomial
gives a polynomial in
1 3 8 2 + 2 + 68 = 0
+ an1
n
n1
+ + a1 + a0 = 0
(30)
is represented in Matlab as the vector
Eqn (29) is useful for theoretical results, but generally not a practical method
for calculating the eigenvalues, for n > 2:
>> roots(Poly)
Once you get Eqn (30), how are you going to find the roots of the
polynomial ? (Answer on the next page)
Working with the determinant does not lead to a numerically stable
algorithm.
Actually under the hood Matlab forms a matrix (called the companion
matrix) and applies the eigenvalue routine to that:
>> compan(Poly)
ans =
8.0000
1.0000
0
-2.0000
0
1.0000
-68.0000
0
0
Going from Eqn (29) to Eqn (30) by solving the determinant involves
symbolic manipulation of matrix A. It is a lot of work.
>> eig(compan(Poly))
ans = [ 5.2282 + 0.5919i
5.2282 - 0.5919i
-2.4563 ]
Page 29
3 + a2 2 + a1 + a0 = 0
a2 a1 a0
C= 1
0
0
0
1
0
(Revised: Sep 06, 2012)
Page 30
Section 1.11.2
Relationship
Section 1.11.3
If the A matrix has poles in the right half plane, the system is unstable.
Note: I havent told you an algorithm for eig(A).
b = T A T 1
A
T must be invertible
(31)
b
eig (A) = eig(A)
Proof: starting with Eqn (26),
det (A I) = 0
Left multiplying by T and right multiplying by T 1
det T (A I ) T 1 = det (T ) det (A I)
1
=0
det (T )
(32)
Where the right hand equality arises because det (A I) = 0 and det (T ) is finite.
From (32) it follows that
b I = 0
det T (A I ) T 1 = det T A T 1 T I T 1 = det A
Page 31
b
Therefore any value that is an eigenvalue of A is an eigenvalue of A.
Lecture: Basics of Linear Algebra
QED
Page 32
Section 1.11.3
V=
A vi = i vi
AV = A
v1 , v2 , , vn
1 v1 , 2 v2 , , n vn
1 v1 , 2 v2 , , n vn
v1 , v2 , , vn
1 0 0
0 2 0
.. .. . . . ..
.
. .
0
0 n
1 0
0.2320 0.7858
16.1168
1.1168
0.0000
= VU
b = U.
Equation (33) is a similarity transform with T = V1 and A
V1 A V =
16.1168
1.1168
0.0000
1 2 3
V U V1 = 4 5 6
7 8 9
VU = AV
V1 V U = U = V1 A V
0.4082
We have:
So
v1 v2 v3
U = 0 2 0 =
0 0 3
And so
h
1 2 3
A= 4 5 6
7 8 9
U = V1 A V
Section 1.11.3
(33)
(and, of course,
=U
=A
i vi = A vi )
QED
Page 33
Page 34
Section 2.0.0
y, A : known;
Section 2.1.0
solve for: b
(34)
A, B, x (t = 0) : known;
v (k) v2 (k)
b1
b2
(36)
(k) =
For example, if b =
2 3
iT
y (1) = (1) b =
T
y (2) = T (2) b =
..
.
y (n) = (n) b =
T
. See Strang for a nice treatment of the two problems of linear algebra.
Page 35
h
h
h
v (k)
v2 (k)
(37)
2 4
3 9
1 1
= 2 2 + 4 3 = 16
= 3 2 + 9 3 = 33
2
3
= 1 2 + 1 3 = 1
(Revised: Sep 06, 2012)
Page 36
Section 2.1.0
y (1)
T (1)
..
y = ... =
b = Ab
.
T
y (n)
(n)
Vocabulary
(38)
Example
b=
b1 b2
iT
y
b
y
e
y
: Measured values
b
b
e
b
: Estimated values
: Misadjustment
(left multiply by A
Example,
y = A1 A b
(39)
(40)
T (k) =
v (k) v2 (k)
i
Page 37
b
b = A1 y
12.75
43.5
y (1)
y (2)
b
b=
(Revised: Sep 06, 2012)
and so
A1 y = I b = b
e
y=b
yy
y = Ab
(original equation)
Notation
y b : True values
Section 2.1.1
T (1)
T (2)
1.5 2.25
3.0 9.0
b
b = Ab
b=
y,
b
b=
2.5
4.0
1.5 2.25
3.0 9.0
b
b
Page 38
Section 2.1.2
2.1.2 Case 2: Where n > p, we have more equations than unknowns, the
over constrained case (Left pseudo-inverse case):
This is a common case. For example, a model has 3 parameters, and we run
an experiment and collect 20 data. We have 20 equations in 3 unknowns.
b.
In this case there is generally no value of b which exactly satisfies y = A b
Define e
y = y Ab
b,
minimizing ||e
y||2
Section 2.1.2
h
:
AT
AT
y = Ab
b
: [] =
[]
Note that AT A is an p p matrix, for example a 3 3 matrix when
there are 3 unknowns.
1
2. When AT A R pp is full rank, left multiply each side by AT A
gives:
1
1
b
(41)
AT A b
b = Ib
AT A
AT y = AT A
3. Which gives
1
b
AT y = A# y
b = AT A
(42)
1 T
A is called the left pseudo-inverse of A .
where A# = AT A
Lecture: Basics of Linear Algebra
Page 39
Page 40
Section 2.1.3
2.1.3 Case 3: Where n < p we have fewer equations than unknowns, the
under-constrained case (Right pseudo-inverse case):
In the under-constrained case, A is a row matrix, so our equation has the
shape:
h
i
y = Ab
: [] =
Section 2.1.3
Remarks
1. For each of cases 1, 2, and 3 we had the requirement that A , AT A or
A AT must be full rank. When these matrices are not full rank, a more
general method based on the Singular Value Decomposition (SVD) is
needed.
2. With the SVD and four fundamental spaces of matrix A we will be able to
find the set of all vectors b
b which solve
y = Ab
1
T
A+
A AT
R = A
AT
When A AT Rnn is full rank then:
AT
We will see the SVD and four fundamental spaces of a matrix in Bay,
Chapter 4.
1
T
A AT
=I
A A+
R = AA
(43)
(44)
b
b = A+
Ry
1
= AT A AT
y
1
y = A AT A AT
y = Iy
Demonstrating that b
b = A+
R y is a solution.
Page 41
Page 42
Section 2.2.0
Section 2.2.0
The state-variable model is the topic of the second half of the course.
The linear state variable model is a very general form for modeling dynamic
systems in control theory, economics and operations research, biology and
other fields.
The state-variable model is a differential equation with the form:
x (t) = A x (t) + B u (t)
(45)
where
y = Ab
and involves the eigensystem of the system matrix A and using a similarity
transform and transformation to modal coordinates to determine the
solution.
Equation Type
Just as solving an algebraic equation,
Algebraic
Differential
Nature of Solution
A value
A function of time
Main Tools:
Gaussian Elimination
Matrix Inverse
SVD
Eigenvalues
Eigenvectors
Singular Matrix
Problems,
Solution requires
SVD
O.K.
Not important
Important
Rectangular matrix
OK
Impossible
3x = 7
is very different from solving a scalar differential equation,
3 x (t) = 2 x (t) + 7 u (t)
Page 43
Page 44
Section 3.0.0
3 Summary
Basics of linear algebra have been reviewed.
The two problems of linear algebra have been discussed.
Algebraic equations
y = Ab
(46)
(47)
Page 45
28
4.1.3
30
4.2
. . . . . . . . . . . . . . . . . . . . .
31
4.3
Change of basis . . . . . . . . . . . . . . . . . . . . . . . . . . .
32
Contents
1 Introduction
4.1.2
4.3.1
33
1.1
4.3.2
34
1.2
. . . . . . . . . . . . . . . . .
4.3.3
34
1.2.1
Parallel . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2.2
36
1.2.3
Norm (magnitude) . . . . . . . . . . . . . . . . . . . . .
4.4.1
. . . . .
37
1.3
Direction Cosine . . . . . . . . . . . . . . . . . . . . . . . . . .
10
4.4.2
1.4
11
38
Summary . . . . . . . . . . . . . . . . . . . . . . . . . .
40
4.4
4.4.3
2 Vector Spaces
12
2.1
14
2.2
15
3.2
17
5.1
5.2
41
43
5.1.1
45
46
19
5.2.1
46
3.1.1
20
5.2.2
47
3.1.2
20
21
23
Page 1
48
6.1
Projection Theorem . . . . . . . . . . . . . . . . . . . . . . . . .
50
6.2
51
6.2.1
51
54
24
6 Projection Theorem
6.3
Page 2
Projection Matrices . . . . . . . . . . . . . . . . . . . . . . . . .
56
6.4.1
57
9.1
87
6.4.2
60
9.2
88
6.4.3
61
9.3
Study tip: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
89
7 Gram-Schmidt ortho-normalization
7.1
63
7.1.1
63
7.1.2
67
7.2
68
7.3
Projection Coefficients . . . . . . . . . . . . . . . . . . . . . . .
69
7.4
70
7.5
71
8 Additional Topics
8.2
72
72
8.1.1
74
8.1.2
78
8.1.3
80
8.1.4
81
8.1.5
83
83
84
8.1.6
86
62
8.1
Page 3
Page 4
Section 1.0.0
1 Introduction
Section 1.1.0
A 3-vector: x = 1
An n-vector: z =
z1
z2
..
.
zn
sin (2k/4)
cos (2k/4)
A 4-vector: x (k) =
sin (4k/4)
cos (4k/4)
A 2-vector: u (t) =
vi wi
where v , w , Rn
(1)
i=1
hv, wi = vT w = (a scalar)
v >< w = v wT = (a matrix)
Example:
v= 2
3
w= 3
1
hv , wi = 11
2 3 1
v >< w = 4 6 2
6 9 3
Page 5
2eb = e
be
bT
Page 6
Section 1.1.0
Section 1.2.2
1.2.1 Parallel
vw = z
(2)
w = av
(4)
where a is a scalar.
(3)
Example:
v = 2 , w = 6 ,
3
9
w=3 2 ,
3
so
vkw
hv, wi = 0
(5)
v = 2 , w = 5 ,
3
3
vT w =
1 2 3
so
5 = 1 10 + 9 = 0
vw
Part 2: Vectors and Vector Spaces
Page 7
(6)
(Revised: Sep 10, 2012)
Page 8
Section 1.2.3
Section 1.3.0
The inner prod. indicates how closely two vectors are related.
hv, wi = 0
||v|| p =
or
hv, wi
=0
||v|| ||w||
1
p
1.0
hv, wi
= 1.0 or
||v|| ||w||
or
(8)
hv, wi
= cos ()
||v|| ||w||
(10)
The L2 norm is the default, throughout the literature, ||v|| refers to ||v||2,
unless expressly defined to be a different norm (or any norm).
||v||2 = hv, vi =
vT v
v2i
w
(9)
Page 9
Page 10
Section 1.4.0
Section 2.0.0
2 Vector Spaces
(4, repeated)
When we talk about vector spaces we talk about sets of vectors. Closure is
the first important property of sets.
Rn is the most basic vector space. It is the set of all vectors with n elements.
0
0
= w = 0v
..
.
0
Examples:
The integers are closed under addition, subtraction and multiplication.
The integers are not closed under division.
with a = 0 .
(5, repeated)
So in a formal sense, we can say that every vector is both parallel and
perpendicular to the zero vector.
S : {a set of vectors}
if
then
x1 , x2 S
x3 = a1 x1 + a2 x2 S
(12)
The central topic of Bay, chapter 2, is describing the ai , xi and S in the most
general possible way.
Lets start with a specific example, S = R3, the space in which we live.
Part 2: Vectors and Vector Spaces
Page 11
Page 12
Section 2.0.0
Section 2.1.0
Defining a vector x:
x
1
x = x2
x3
x1 , x2 , x3 R
(13)
The scalars must be elements of a field. For a set with operations to form a
field, it must have:
1. An additive identity 0:
a+0 = a
(15)
a1 = a
(16)
2. A multiplicative identify 1:
Examples:
2 ,
1 ,
5
0
0
1
2
0
2.0 2 + 1.0 1 = 5
1
5
3
(14)
a + a = 0
(17)
Page 13
Page 14
Section 2.2.0
Section 2.2.0
4. Closure under scalar multiplication: For all x S and for all a F, the
vector y = a x must be an element of S.
x S,
a F , y = ax S
(23)
: for all
5. Associativity of scalar multiplication:
2. The linear vector space S must contain a zero element, 0 such that:
x+0 = x,
xS
(18)
(24)
a (b x) = b (a x)
(19)
(a + b) x = a x + b x
(25)
a (x + y) = a x + a y
(26)
: there exists
The vector space (a set of vectors) and its operations must also have the properties:
1. The vector space S must be closed under addition:
if x + y = v, then v S
(20)
Projection
x+y = y+x
(21)
length
etc.
For 99% of what we will do in EE/ME 701, we will work with vectors in Rn
over the field of the real numbers.
(x + y) + z = x + (y + z)
(22)
Which is to say the familiar vectors and scalars, such as in Eqn (14).
Page 15
Page 16
Section 3.0.0
(27)
Example:
V=
1
2 ,
0
0 ,
0
1 ,
1
Section 3.0.0
b1
| | |
|
b2
v p = v1 v2 v p1 .
=V b
..
| | |
|
b p1
(29)
1
1
1
R3
bi vi = 0
i=1
We shall shortly see that a finite set of vectors can define a Vector Space.
Notation for a finite set of vectors: let V connote a set with p vectors:
V = v1 , v2 , ..., v p ,
or equivently ,
V = v1 v2 v p (28)
| | | |
Page 17
Page 18
Section 3.1.0
Section 3.1.2
2
1
S1 = x : x = a1 1 + a2 0 , a1, a2 R
1
2
(30)
S = x : x = a1v1 + a2v2 + ... + a pv p
(31)
Given an arbitrary set of p n-dimensional vectors V = v1 , v2 , v p , vi Rn ,
the set of vectors defines a vector space
Any set of vectors, at least one of which is non-zero, spans a vector space.
x = a1 1 + a2 0
1
2
A span is a very general concept, perhaps a bit too general. The concept of a basis
for a vector space is more restrictive. It works like a span, we write that the set of
basis vectors {vi } defines a vector space according to Eqn (31) , but for a set {vi }
to be a set of basis vectors they must additionally be linearly independent. When
the vectors vi are independent and we write
(32)
S1 =
Vector space S1 is
{}
the set
of vectors x
A set of basis vectors is the minimum set of vectors that spans a space
such that
For a given vector space S, the choice of basis vectors is not unique.
x =
there is a unique solution {a1, a2... ar } for every vector x S. Because the basis
vectors vi are linearly independent, there is exactly one solution for Eqn (32).
Page 19
Page 20
Section 3.2.0
Example:
Universe is R3
S1 is 2-D
2
1
3
S1 = x : x = a1 1 + a2 0 , a1, a2 R , xi R
1
2
2
1
3
S1 = x : x = a1 1 + a2 0 , a1 , a2 R , xi R
(33)
1
2
Section 3.2.0
z = b1 v + b2 w ,
z S1 ,
b1 , b2 R
Consider the properties of a vector space one by one, you will see that
they all hold.
The dimension of S1 is the number of linearly independent vectors that can
be selected from S1 .
Note that even though v, w, z R3 , it is still true that dim (S1 ) = 2.
1
0
1
2
3
3
2
1
0
2
Y
2
3
Page 21
Page 22
Student
Exercise
Section 4.0.0
Section 4.1.0
x = a1 v1 + a2v2 + ... + ar vr
x = a1 v1 + a2 v2 + + ar vr
(35)
Since V is r-dimensional and the set of vectors {x, v1, v2, ..., vr } contains
r + 1 vectors, the set must be linearly dependent. Since the set is linearly
dependent there exists a set of scalars ai (called the basis coefficients) such
that x + a1 v1 + a2 v2 + + ar vr = 0, which gives
Or written mathematically,
Example basis:
x, v1 ..vr Rn
Proof:
Existence:
x V,
Uniqueness:
s.t. x = a1v1 + + ar vr
1
2
BV = 1 , 0
1
2
(36)
Suppose the ai giving vector x were not unique. This means there is a second
set of basis coefficients {bi } distinct from the values {ai } such that
x = b1 v1 + b2 v2 + + br vr .
(37)
(34)
Subtracting Eqns (36) and (37) gives
(38)
Page 23
But since the vi are linearly independent, Eqn (38) is possible only if each
of the (ai bi) = 0, which is to say that {ai } = {bi }, and so the basis
coefficients representing vector x on {vi } are unique.
Part 2: Vectors and Vector Spaces
Page 24
Section 4.1.0
x = 2
8
Inspection shows that
x = 2 v1 + 3 v2 =
Definition:
The vector a =
2
3
1
2
V = {v1 , v2 } = 1 , 0
1
2
v1 v2
2
3
Given a vector space S1 of vectors sx Rn with a basis V = [v1 , v2] and also
with a different basis W = [w1 , w2 ], then a vector sx S1 can be represented
3 ways:
s
x , Vx , Wx
(39)
where the left superscript indicates the basis on which the vector is
represented.
The vector sx is represented on the standard or Euclidean basis. This is
the ordinary representation of the vector (more on this later).
Example: given the bases V and W for vector subspace S1 , and given the
vector sx below, find the representation for sx on each of bases V and W .
x = 2 ,
aR
Page 25
V = [v1 , v2 ] = 1
0 ,
x = a1 v1 + a2 v2 = [v1 , v2]
a1
a2
=V
W = [w1 , w2 ] = 1 2
3 4
Solution: since the columns of V are one basis for S1 , we know there exist
basis coefficients a1 and a2 to represent sx on V . The relationships can be
written:
Section 4.1.1
Example:
x,
so V x =
a1
a2
Page 26
Section 4.1.1
When r < n , we can solve for the basis coefficients with the left-pseudo
inverse. Recalling that it is given that sx S1 , then
Since sx = V V x ,
Example:
1
V
x = V TV
V T sx
>> x
x =
-1
0
2
x = b1w1 + b2 w2 = [w1 , w2 ]
(40)
Solving, we find
2
3
Wx =
b2
=W
1
x = WTW
WT x
2.4
0.2
b1
, which gives.
2 = 2.4 1 0.2 2
8
7
4
%% should give sx
A basis that we have been using all along is the standard basis in Rn. For R3
the basis vectors are:
>> Vx = inv(V*V) * V * x
Vx =
2
3
1
-2
8
Section 4.1.2
so
>> V
V =
2
-1
1
Page 27
1 0 0
S3 = 0 1 0
0 0 1
h
i
= s1 s2 s3
(41)
Page 28
Section 4.1.2
Section 4.1.3
We are chiefly concerned with vectors of numbers, but there are other types
of vectors and vector spaces, and our notions of basis and representation
carry over.
x = a1 v1 + a2 v2
x=W
x = b1w1 + b2w2
n
o
P = p (s) : p (s) = a1 + a2s + a3s2
If we choose the set of basis functions
Basis Facts:
A representation is always on a specific basis.
representation of vector x on basis V .
such as
Vx
is the
You cant talk about the representation of a vector without specifying the
basis.
vi , wi
R3 ,
whereas
with
a1
x = a2
a3
Even when the vectors of the vector space are not vectors of numbers, a
representation of a vector will be (because the representation is always an
r-dimensional vector of basis coefficients).
V x, W x R2 .
This is because, for this example, the universe has dimension n = 3, while
the vector subspace has dimension r = 2.
p (s) = P px
sx ,
o
n
P = p1 (s) = 1 , p2 (s) = s , p3 (s) = s2
Page 29
Page 30
Section 4.2.0
Just as a set of basis vectors defines a vector space, a set of spanning vectors
v1, v2, , v p defines a vector space:
Vector Space V = x : x = a1v1 + a2v2 + + a pv p
(42)
The vector space spanned by vectors v1 , v2 , , v p is the set of all vectors
given as linear combinations of the spanning vectors
A vector space V is spanned by a set of vectors {vi } if every x V can be written
as a linear combination of the vi s .
3
2 1
V Vx = 1 0 = sx = 4
14
1 2
Find
We can say that the vi s span Vector Space V ,
Write V = span {vi }
Section 4.3.0
Wx
1 7
W = 1 2
3 4
with
We actually know how to solve this problem, since we know how to find
from sx using W (see Eqn (40) in section 4.1.1).
Wx
All bases are a spans, but not all spans are bases, the difference:
A span is any set of vectors, for example:
1
0
3
1
,
,
V = span ,
2
5
1
1
(43)
Since
Compare Eqn (42) with Eqn (43), both define vector space V
The example shows that a span may have redundant vectors
1
1
x = WTW
W T sx = W T W
WTV
Page 31
(44)
1
0.60
0.40
= W
WTV =
WTW
VT
0.20 0.20
x=W
VT x=
0.60
0.40
0.20 0.20
Vx =
4.4
0.2
Page 32
Section 4.3.1
Wx
Section 4.3.3
V
sT
= V 1
(46)
The symbol
s
VT
with
1
x = V TV
V T sx ,
so
V
sT
=V
1
= V TV
VT
(47)
G
sT
(48)
it follows that
F
=G
FT s T
(45)
which gives:
V
F s
x= G
FT s T x
For the transformation from s to V , weve seen that the basis coefficients
are given by:
V
F
sT
Solution, since
x=
find G
sT
W
V T2
G
FT
10
s
x= 4 ,
11
2 2
F = 1 2 ,
1 3
2 4
G = 4 1
1 4
x = Vs T sx
(Revised: Sep 10, 2012)
Page 33
Page 34
Section 4.3.3
Section 4.4.0
Fx = FT sx
s
and
and
G
FT
In section 4.3 we saw vectors represented on the standard basis and two
particular bases,
s
x , Fx , and Gx
Gx = GT Fx.
F
with
%% Find the two transformation matrices
>> FsT = inv(F*F)*F
FsT =
0.3117
-0.3506
0.0260
0.0260
0.2208
0.1688
>> GFT = inv(G*G)*G*F
GFT =
0.3333
-0.3333
0.3333
0.6667
F = 1 2 ,
1 3
G = 4 1
1 4
(49)
1
GT G
GT F
(50)
>> Fx = FsT * sx
Fx =
2
3
>> Gx = GFT * Fx
Gx =
-0.3333
2.6667
>> G*Gx
ans = 10.0000
4.0000
11.0000
Page 35
Page 36
Section 4.4.1
sf
sf
G=
sg
sg
(51)
We can form G
F T by representing the F basis vectors on the G basis:
h
i
F = G G f1 G f2
Section 4.4.2
Now
h
x = F Fx = G
Gf
Gf
i
x=G
h
Gf
Gf
x = G Gx (52)
Gf
Gf
(53)
(54)
|
|
|
A
A
AY
AZ
(55)
BR = X B
B
B
|
|
|
Part 2: Vectors and Vector Spaces
Page 37
Page 38
Section 4.4.3
Section 4.4.3
4.4.3 Summary
%% Transformation from F to G
>> GFT = [Gf1 Gf2]
GFT =
0.3333
-0.3333
0.3333
0.6667
%% Representation of x on F
>> Fx = [ 2
3 ]
Fx =
2
3
Gf
Gf
%% Representation of x on G
>> Gx = GFT * Fx
Gx =
-0.3333
2.6667
1
= GT G
GT F
=
=
Gf
Gf
1 T s
G f1 ,
GT G
1
h
GT s f1
GT G
sf
1 T s i
GT G
G f2
1
GT F
= GT G
>> sx = G * Gx
sx = 10.0000
4.0000
11.0000
Page 39
Page 40
Section 5.0.0
Section 5.0.0
Recall the terminology from set theory: subset and proper subset.
From the set of colors (the universe) {blue, green, red},
Vector subspace: A vector space of dimension r , comprising vectors of ndimensional elements, where r n.
{blue,green,red} Colors
{blue, red}, is both a subset and a proper subset.
{blue,red} Colors
A vector subspace is defined by a basis or a span, for example
1
2
S1 = x : x = a1 1 + a2 0 ,
2
1
Then B =
1 ,
1 ,
B = 1 ,
B =
a1 , a2 R
is a basis for S1 .
S2 R3
1
1
2
3
0
1
0
x : x = a1 0 + a2 1 + a3 0 ,
=
0
1
0
Page 41
Exercise:
Make up
Another
span
and basis
for S1 .
a1 , a2 , a3 R
S1
2
1
x : x = a1 1 + a2 0 ,
=
1
2
S1 R3
a1 , a2 R
Page 42
Section 5.1.0
Section 5.1.0
Terminology
2
1
S1 = x : x = a1 1 + a2 0 ,
1
2
a1 , a2 R
1
0
B is a 2-D subspace in R7 ,
1
2
If dim (B) = r:
3
3
B is a r-D subspace in Rn .
1
0
2
Y
2
3
Page 43
Page 44
Section 5.1.1
Section 5.2.1
When B A, and thus r = dim (B) < dim (A), there must be vectors in A
not lying in B.
Student
Exercise
Actually, when dim (B) < dim (A), almost all vectors in A are
outside B.
Consider a class room with the origin in the center of the top of the
desk in front. Almost all vectors in R3 (the class room) do not lie in the
surface of the desktop (a 2-D subspace). The surface of the desktop
has zero volume, and so 0% of the volume of the room.
5.2.1 The set-theoretic meaning of almost all
Page 45
Page 46
Section 5.2.2
6 Projection Theorem
s.t.
hx, yi =
6 0
(58)
hx, yi = 0
x B then
Section 6.0.0
y B
(59)
vw
Or, equivalently,
hv, wi = 0
(63)
Student
exercise
hv, bi = 0 b B
(64)
(60)
(61)
BU
hb, ui = 0
b B u U
(65)
Page 48
then
yB
(62)
Page 47
Section 6.0.0
Section 6.1.0
u U
(66)
w = xu
w U
Page 49
Page 50
Section 6.2.1
Starting with
, u1 =
f=
hw, u1 i = 0
(70)
hf, u1 i
hf, u1 i
=
hu1 , u1 i ||u1 ||2
(71)
1 =
(67)
The inner product gives us the projection of one vector onto another.
Projection onto a vector is illustrated in figure 5.
hf, u1 i 1 hu1 , u1 i = 0
we can solve 1 :
Because the inner product operation is linear, Eqn (69) can be broken into two
parts. Keeping in mind that w = (f PU f) and for the 1-D case PU f = 1 u1
hw, u1 i = h(f PU f) , u1 i = hf, u1 i hPU f, u1 i = hf, u1 i 1 hu1 , u1 i = 0
Consider vectors in
Section 6.2.1
In section 6.1 the projection theorem is laid out. The question arises: given
S, U and x, how can u and w be determined.
R4,
(69)
u1
Pf
Pf
w
u1
Page 51
Page 52
Section 6.2.1
i
h
4 0 2 1
PU f =
2
PU f =
0.1
0.2
4 0 2 1
0.2
0.1
PU f =
2
0.1
0.2
0.2
0.1
0.7
2 1.4
2
= 7 =
10
2 1.4
2
1
0.7
1
||u1 ||2
u1
(72)
hf, u1 i
Section 6.3.0
0.1
0.7
0.2 1.4
0.2
0.7
=
0.1
0.2 1.4
0.2
0.1
0.1
0.7
0.1
(73)
and the projection coefficient is simply the inner product. This property is
sufficiently handy that we need to call it something:
Normal basis vector: a basis vector with length 1 is said to be normal,
and is sometimes written with a hat : u 1 .
Normalization: the process of making a vector normal.
Matlab example:
>> u1 = [ 1 2 2 1 ];
>> u1hat = u1 / norm(u1);
Page 53
Page 54
Section 6.3.0
Normalized :
Now
0.316
Section 6.4.0
One more interesting fact about projecting f onto U: since hf, u 1 i is a scalar,
Eqn (73) can be written:
0.632
u1
=
u 1 =
||u1 ||
0.632
0.316
(74)
PU f = hf, u 1 i u 1 = u 1 hu 1 , fi = u 1 u T1 f = u 1 u T1 f
(76)
M = u 1 u T1 is thus a term that multiplies a vector to give the projection of
the vector onto a subspace:
||u 1 || = 1
And so
PU f =
hf, u 1 i
||u 1 ||2
u 1 = hf, u 1 i u 1
(75)
0.316
0.316
0.316
0.70
0.632 0.632
0.632 1.40
= (2.214)
=
PU f =
4
0
2
1
0.632 0.632
0.632 1.40
0.316
0.316
0.316
0.70
Also, defining
0.316
i
0.632 h
0.2 0.4 0.4 0.2
M=
0.632
0.2 0.4 0.4 0.2
0.316
0.1 0.2 0.2 0.1
Now
0.70
Mf =
W = U
notice that
3.3
1.4
W
w = f PU f =
0.6
1.7
Page 55
Student
exercise
Page 56
Section 6.4.1
then:
0
2
0
, u1 = , u2 =
f=
2
2
1
1
1
1
(77)
and also:
Solution:
and so:
Since PU f U , PU f can be written:
PU f = 1 u1 +2 u2
1 , 2 R
u1 , u2 R4 ,
U = span {u1 , u2 }
(78)
Writing f = 1 u1 + 1 u1 + w, and using Eqn (78) and the linearity of
inner product
hf , u1 i = h1 u1 + 2 u2 + w , u1 i = 1 hu1 , u1 i + 2 hu2 , u1 i + 0
1
2
hu1 , u1 i hu2 , u1 i
hu1 , u2 i hu2 , u2 i
hf , u1 i
hf , u2 i
hu1 , u1 i hu2 , u1 i
hu1 , u2 i hu2 , u2 i
hf , u1 i
hf , u2 i
hu1 , u1 i hu2 , u1 i
hu1 , u2 i hu2 , u2 i
= UT U
hu1 , fi
hu2 , fi
(82)
= UT f
hf , u1 i
hf , u2 i
(83)
(84)
1
= UT U
U T f (85)
(80)
(79)
hf , u2 i = h1 u1 + 2 u2 + w , u2 i = 1 hu1 , u2 i + 2 hu2 , u2 i + 0
hu1 , u1 i hu2 , u1 i
hf , u1 i
1
hf , u2 i
hu1 , u2 i hu2 , u2 i
2
U = u1 u2
| |
Section 6.4.1
PU f = 1 u1 + 2 u2 = U
1
2
1
= U UT U
UT f
(86)
1
M = U UT U
UT
(87)
Page 58
Student
Exercise
Section 6.4.1
1 0
1 0
1
2
2
1
2
0
10
3
=
UT U =
0 0 1 1 2 1
3 2
1 1
hf , u1 i
1
2
2
1
0
7
=
= UT f =
hf , u2 i
0 0 1 1 2
1
or
1
2
10 3
3 2
7
1
1
1
w = f Pf = (I M) f
w = M f
where M = I M is the projection matrix for projecting a vector onto the
orthogonal complement, and w U .
Using the data of the example,
(88)
0.091 0.091
0.182 0.182
,
0.545 0.455
0.455 0.545
Since
1
2
PU f = 1.0 u1 1.0 u2 =
1
0
1
M = U UT U
UT
0.182 0.364
0.364 0.727
M =
0.091 0.182
0.091 0.182
w = f PU f =
Section 6.4.2
2 0
U =
2 1
1 1
1.0
2.0
PU f = M f =
1.0
0.0
Page 59
0.818
0.364 0.091
0.091
0.364
0.273
0.182
0.182
M = I M =
3 2 1 1
iT
(Revised: Sep 10, 2012)
Page 60
Section 6.4.3
It would be nice to get rid of the matrix inversion step in projecting a vector
onto a subspace
b=
bT U
U
0.671
0.671
For many reasons, not least because the matrix inverse can be badly
conditioned.
Starting with
hf , u 1 i
0.316 0.632 0.632 0.316 0
2.214
T
=
b f =
=U
0
0
0.707 0.707 2
0.707
hf , u 2 i
1
1
0.671
3.162
2.214
=
=
2
0.671
1
0.707
1.414
1.0
2.0
PU f = 3.16 u 1 1.414 u 2 =
1.0
0.0
1
0.364 0.727 0.182 0.182
b
bT =
b U
bT U
U
M =U
Section 7.0.0
7 Gram-Schmidt ortho-normalization
0.316
0
0.632
0
b =
U
0.632 0.707
0.316 0.707
the basis
(90)
UT U = I
so that
Since
1
M = U UT U
UT = U I 1 UT = U UT
hu1 , u1 i hu2 , u1 i
UT U = hu1 , u2 i hu2 , u2 i
..
..
...
.
.
(91)
(92)
hu1 , u2 i = hu2 , u1 i = = ui , u j , i 6= j = 0
If
1
UT
M = U UT U
Page 61
Orthonormal: Basis vectors which are both orthogonal and normal are
called orthonormal.
Page 62
Section 7.1.1
Section 7.1.1
u1 =
2
1
In broad terms, the process to make orthogonal basis vectors works this way:
1. Start with zero basis vectors
2. Choose any vector u in the subspace
Choosing, for example, a vector from any spanning set.
V=
1
0
2 0
S = span
, ,
1
1
0.316
0.632
u1
v1 = =
u
0.632
1
0.316
2
3
4. If a sufficient vector remains after the subtraction (if u1 > tol), normalize
the remaining bit and add it to the set of basis vectors.
be spanned by vectors A =
2 0 2
u1 =
=
2 0 2
1
0
1
V = {v1} =
0.632
0.632
0.316
0.316
5. Repeat
Page 63
Page 64
Section 7.1.1
0
0
u2 =
,
1
1
V=
0.632
0.632
0.316
0.3
u3
0.286
0.572
u2
,
v2 = =
u
0.381
2
0.667
V = {v1 , v2} =
(93)
0.286
0.632 0.572
,
0.632 0.381
0.316
0.667
0.316
0.182
0.364
0.091 0.091
If u2 > tol, u2 can not perpendicular to u2 either.
4. If a sufficient vector remains after the subtraction (if u2 > tol), normalize
the remaining bit and add it to the set of basis vectors.
0.286
0.632 0.572
,
0.632 0.381
0.316
0.667
0.316
V=
1
2
u3 =
,
3
2
0.316
0.6
0.2 0.4 0.4 0.2
u2 =
u2 = u2 V V u2 = u2
0.4
0.2 0.4 0.4 0.2
0.7
0.1 0.2 0.2 0.1
Section 7.1.1
= 10
0.444
0.888
0.444
0.444
15
4. If a sufficient vector remains, normalize the remaining bit and add it to the set
of basis vectors.
u3 < tol, u3 lies in V = span (v1, v2)
No vector added to V
5. Repeat
Part 2: Vectors and Vector Spaces
Page 65
Page 66
Section 7.1.2
include ui / ui
Using
S = span
(94)
is given by:
where
A=
u1 u2 u p
0.316
0.286
One possible answer is a value that scales with the number and size of
vectors and the machine precision,
0.632 0.572
0.632 0.381
0.667
0.316
V=
Section 7.2.0
if ui > tol
0 2
1 3
2
1
2
2
1
0.182
0.364
0.091 0.091
0.364
0.727
0.182
0.182
M = V VT =
(95)
1.0
0
2.0
= Mf =
PU f = P
2
1.0
1
0.0
(96)
Page 67
Page 68
Section 7.3.0
PU f = 1 v1 + 2 v2 = V
1
2
= V VT f = V VT f
and so the projection coefficients to project f onto V are given simply by:
1
2
= VT f
x2 = x2 V V T x2 = I V V T x2
(98)
1
2
Section 7.4.0
hu1 , u1 i hu2 , u1 i
hu1 , u2 i hu2 , u2 i
hf , u1 i
hf , u2 i
hu1 , u1 i hu2 , u1 i
hu1 , u2 i hu2 , u2 i
UT f
M = I V V T
x2 = M x2
(99)
But for singular, poorly conditioned or even just large matrices (50x50
or larger)
inv(X*X)
may not exist, or the computation may lead
to large errors.
Gram-Schmidt is one of the most scalable and robust algorithms in linear
algebra.
Page 69
Page 70
Section 7.5.0
Section 8.1.0
8 Additional Topics
with
b Rp
y Rn , b
1
b
AT y ,
b = AT A
b ,
y = A b
= y y
The model set (also called the reachable set) is set of outputs, y , given
by the model for any possible tuning of parameters b
b.
For a linear model, the model set forms a linear vector space:
The columns of A are the spanning set for the r-dimensional model
set in the n-dimensional output space.
b are the projection coefficients of the data y onto the
The parameters b
basis vectors of the model set (namely the columns of A).
The G-S algorithm applied to the columns of A gives a basis for the
model set.
0
1
1
y = Ab
(101)
2. Output space: y Rn
It turns out that each of these spaces is further divided in 2, so there are a total of
four fundamental spaces of a matrix. For an n p matrix:
Input Space:
1. Null Space: Set of vectors b R p such that A b = 0
2. Row Space:
Orthogonal complement of the Null Space.
The row space is spanned by the columns of AT
A basis for the row space is given by Vrow = GS AT
Output Space:
3. Column space:
b Rp
2
A=
(100)
Page 71
Page 72
Section 8.1.0
Space of b vectors
Space of y vectors
Ro
w
row Sp
(A) ace
A b=y
br
Ab
ft N
lnu ull S
ll(A pac
)
e
b
0=A n
bn
Input Space, Rp
0
2
= A bn =
0
2
0
1
Le
Nu
l
Nu l Spa
ll(A ce
)
b=br+bn
Y=
Section 8.1.1
Co
lu
co mn
l(A Sp
)
ac
Y=A br
0
0
1
1
1
2
1
3
1
2
1
1 null (A)
(102)
Row Space: Vectors with a component from the row space give a nonzero output
Output Space, Rn
3
1
6
=A
1
9
2
6
1
1 contains a component from row (A)
2
(103)
A part from the Row space and a part from the Null space.
Outputs lie in the Column space
Any component from the null space adds to length ||b||2 , but
contributes nothing to the output.
y = Ab
Page 73
Page 74
Section 8.1.1
Section 8.1.1
3
1
2
=A
2 =A 1
9
2
1
6
b1 = 2 = br +bn = 1 + 1 ,
1
1
2
Vector b1 has a component from the row space and from the null space.
The contribution
1
6
=A
1
9
2
6
6
col (A)
9
6
(104)
b1r = 1
2
The contribution
col A = {y : y = A b }
b1n = 1
Left-Null Space
The Left-Null Space is the set of vectors in the output space that can
not be reached by
y = Ab
and
Page 75
Page 76
Section 8.1.1
Row Space:
1
lnull A
yln =
h
iT
Since 1 1 1 1 lies in the Left Null space of A , then the choice
for b which minimizes
is
1
1
1
1
Section 8.1.2
e
y =
(105)
b= 0
0
where
(107)
y=
(106)
, gives b Vr , y Rn
0
than b = 0
0
Since the Row Space is spanned by the rows of A, every vector in the
row space is given by:
b = AT y
What Eqns (106) and (105) are saying is that there is no choice for b
which gets any closer to
R = GS AT
Note: Recall that the GS algorithm takes any set of vectors, and returns an
ortho-normal basis on the space spanned by the vectors.
A b
Column Space:
The Column Space is spanned by the columns of A
C = GS (A)
(108)
Page 78
Section 8.1.2
Null Space:
Section 8.1.3
Note that
Using the GS algorithm, we can determine bases for the four fund. spaces
Mr = R RT
(109)
(110)
Since the columns of any projection matrix span the space onto which
the matrix projects, a basis set for the null space is given by:
null (A) = GS (Mn) = GS I R RT
(111)
>> A = [ 1 0 1; 2 0 2 ; 2 1 3; 1 1 2]
A =
1
0
1
2
0
2
2
1
3
1
1
2
n = 4
p = 3
r = 2
dim Col =
dim Row =
rank A = 2
Left-Null Space
The Left-Null Space is the orthogonal complement of the Column Space.
The projection matrix onto the column space is given as
Mc = CCT
(112)
(113)
And finally, a set of basis vectors for the left-null space is given by:
lnull (A) = GS (Mln) = GS I CCT
(114)
Page 79
dim Null =
p - dim Row = 1
dim LNull =
n - dim Col = 2
Page 80
Section 8.1.4
Section 8.1.4
Space of b vectors
Space of y vectors
Ro
w
row Sp
(A) ace
A b=y
Co
lu
co mn
l(A Sp
)
ac
Y=A br
br
Ab
b=br+bn
0=A
bn
Input Space, Rp
bn
Le
Nu
l
Nu l Spa
ll(A ce
)
ft N
lnu ull S
ll(A pac
)
e
Y=
Output Space, Rn
(117)
Page 81
Page 82
Section 8.1.6
8.1.5 Questions that can be answered with the four fundamental spaces
Given y = A b
Section 8.2.0
Using the Gram-Schmidt algorithm, we can find a set of basis vectors for
the column space (or row space) of A, to determine the rank of A.
Ortho normalize the rows of A to get the row space, the null space is the
orthogonal complement.
Range: The range of any function is the set of all possible outputs of that
function.
The range space of matrix A is another name for the column space of A.
It is the range of function y = A b. It is the vector space spanned by the
columns of A.
Page 83
Page 84
Section 8.2.0
The nullity of a matrix is the dimension of its null space, denoted by q (A)
with A Rnp ,
q (A) = p r (A)
Part 2 offers many definitions and concepts. However, as is often the case
with mathematical domains, there are only a few essential ideas:
(118)
A vector space is a set of vectors, and in general will not include all
vectors of the universe.
Degeneracy
If rank (A) = min (n, p) we say the matrix is full rank. (It has the greatest
possible rank).
The matrix has lost rank (if something happened that made it rank
deficient, such as a robot has reached a singular pose)
(119)
Naturally, there are a variety of details fleshing out each of these essential
ideas.
(120)
(121)
The rank and dimension of the Null Space of C are determined by how the
column space of B falls on the row space of A .
rank (C) = dim intersection (col (B) , row (A))
Part 2: Vectors and Vector Spaces
Section 9.0.0
Page 85
Student
Thought
Problem
Part 2: Vectors and Vector Spaces
Page 86
Section 9.1.0
Section 9.2.0
||x|| R
It follows that:
3. Triangle Inequality:
The length of the sum of two vectors can not be greater than the
individual lengths of the vectors.
Page 87
Page 88
Section 9.3.0
Section 9.3.0
Hyperplane, Hypersurface
Terms appear in italic bold where they are introduced and defined.
Working together and talking about the subject mater will help toward this
goal.
Flash cards and drill may also be useful.
Orthogonality of subspaces
Representation of a vector
Transformation from one representation to another
Vocabulary :
Projection
Vector
Euclidean vector
Non-orthogonal projection
Ortho-normal vectors
Gram-Schmidt orthogonalization
Orthogonality
Rank, degeneracy
Page 89
Page 90
4.3.2
4.4
Contents
. . . . . . . . . . . . . . .
46
47
1 Linear Operator
5.1
Operator Norms
. . . . . . . . . . . . . . . . . . . . . . . . . .
49
49
50
5.1.1
5.2
48
2.1
5.2.1
50
2.2
5.2.2
52
2.3
14
5.2.3
53
2.4
. . . . .
15
5.2.4
54
18
20
2.4.1
2.4.2
21
22
25
4.1
28
4.2
. . . . . .
37
4.2.1
42
4.2.2
43
4.3
. . . . . . . . . . . .
44
44
Page 1
5.3
Boundedness of an operator
. . . . . . . . . . . . . . . . . . . .
55
5.4
. . . . . . . . . . . . . . . . . . .
55
5.5
Adjoint Operators . . . . . . . . . . . . . . . . . . . . . . . . . .
56
57
58
7.1
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8 Conclusion
59
60
Page 2
Section 1.0.0
1 Linear Operator
Section 2.0.0
(2)
(1)
x1 x2 Rn
(3)
(4)
Reflection Matrix:
1. Reflection matrices preserve length
2. Reflection matrices preserve angles
3. Handedness: Reflection matrices reverse handedness, for reflection
matrix Q
det (Q) = 1
Part 3: Linear Operators
Page 3
Page 4
Section 2.1.0
cos () sin ()
R=
sin () cos ()
(5)
Section 2.1.0
>>
>>
>>
>>
>> det(Rot2)
ans =
1.0000
sin () cos ()
sin () cos ()
0 1
(6)
Add a reflection to R2 , det (Q) = 1
Page 5
-0.7660
0.6428
>> det(Rot2PlusReflection)
ans =
-1.0000
0.6428
0.7660
Page 6
Section 2.1.0
THEOREM 3.1: A rotation matrix must have the property that RT = R1.
Proof: Because lengths must be preserved, the angles condition can be rewritten:
hx1, x2i = xT1 x2 = xT1 RT R x2 = hR x1, R x2i
(7)
For Eqn (7) to be true x1 , x2 Rn, RT R must be the identity matrix, ergo
RT = R1.
QED
Example: Rotation matrices are linear operators
For a rotation of [degrees] in R2, the rotation matrix is:
C
S
R =
S C
Section 2.2.0
Original
(8)
0.5
0.94
0.34
R=
0.34 0.94
Rotated by 40 deg
0.5
1
0.8
0.6
0.4
0.2
0.2
0.4
0.6
0.8
Verify that R given by Eqn (8) is a ortho-normal matrix for any value of .
Page 7
Page 8
Student
Exercise
Section 2.2.0
ii)
ii)
1
0
0
T
A A= 0 1 0
0 0 1
ii)
To show that
A=
then
v1 v2 v3
hR x1 , R x2 i
hx1, x2i
=
||x1|| ||x2 || ||R x1 || ||R x2 ||
(9)
0
0
hv1, v1i
AT A =
0
0
hv2, v2i
0
0
hv3 , v3 i
q
q
p
Let x2 = A x1, then ||x2 || = hx2, x2i = xT1 AT A x1 = xT1 x1 = ||x1||,
where the AT A is eliminated in the 3 step because AT A = I .
iii) hR x1 , R x2 i = xT1 RT R x2
(11)
x1 , x2 = R x1 , R x2
AT A = I
Section 2.2.0
(10)
Since AT A = I, it follows that det AT det (A) = det (I) = 1. But since
det AT = det (A), it follows that det (A) = 1, thus, given that A is a square
ortho-normal matrix, det (A) = +1 or 1.
QED
~
Page 9
Page 10
Section 2.2.0
0 1 0
Section 2.2.0
Proof:
(13)
ii)
be at least one pair vi , v j , i 6= j such that vi , v j = ai j 6= 0. Therefore
RT R 6= I.
Next we need to show that since RT R 6= I ,
x1 , x2 s.t.
(12)
Note: In a proof, it is not enough to simply assert Eqn (12). Even though
RT R 6= I, how do we know there are allowed choices for x1 and x2 such
that xT1 x2 6= xT1 RT R x2 . The last step of the proof gives a prescription to
construct such a x1 and x2.
ii.b) If one or more columns are not normalized, show that R can not preserve
angles.
Page 11
Page 12
Section 2.2.0
THEOREM 3.4: Any two ortho-normal coordinate frames (sets of basis vectors)
A and B in Rn are related by a rotation matrix R and at most one reflection.
Proof: We can transform vectors represented in either coordinate frame to the
standard frame by
s
s
x = A ax ,
x = B bx
Section 2.3.0
and so
a
bT
= A1 B
and so
det ( abT ) =
1
det (B)
det (A)
Thus RT = R1.
det A1 = 1/ det (A) ,
Even in Rn !
Page 13
Page 14
Section 2.4.0
Section 2.4.0
Za
Za
1
0.5
0.5
0.5
0.5
Ya
Pitch, roll and yaw rotations are seen in figure 2. These are the rotations
about the three axes, and can also be referred to as:
Yb
0
0
0.5 0.5
0.5
0.5
0.5
1
Y
0.5
0
0
1
1.5 1.5
Ya
Xa
0.5
0.5
1
Y
1
1.5 1.5
Z
b
Z
Zb Za
0
0.5
0.5
Xa
0.5
0.5
Z
Multi-axis rotations preserve length and angles (so a Euclidean basis set
such as the X, Y, Z axes, remain orthogonal).
Xb
0
0.5
0.5
1
Y
1
1.5 1.5
0.5 0.5
0.5
0.5
0
0
0.5
0.5
1
Y
1
1.5 1.5
Page 15
Page 16
Section 2.4.0
Section 2.4.1
2.4.1 Rotation matrix in terms of the from-frame axes expressed in toframe coordinates
Above view
Z
Side View
Pitch: 30.00, Roll: 20.00, Yaw: 25.00
1
0.5
0.866 0.500
C S
A
=
BR =
0.500 0.866
S C
XX
b
0.5
Xa
Ya
0.5
0.5
0
0.5
0.5
0.5
1
Y1.5
1.5
0.5
0.5
0 0.5
1 1.5 1.5 1
Y
0.5 0
0.5
Point Pa is given as
Pa =
0.7
0.5
Pa = AB R BPa =
0.356
0.783
Pa
a
YB
xis
Y axis
0.5
xis
Top View
Pitch: 30.00, Roll: 20.00, Yaw: 25.00
a
XB
0
X axis
0.5
1
1
0.5
0
0.5
1.5
Y
1
Za
0.5
0.5
Z
0
0.5 0.5
0.5
1.5
0.5
Look at figure 4,
|
|
A
A
AY
BR = X B
B
|
|
Look at the B axes in figure 4, expressed in the A coordinate frame.
Page 17
Page 18
Section 2.4.1
3-D example
Section 2.4.2
The rotation from the B frame to the A frame in figure 3 is given by:
0.85
0.49
0.17
A
B R = 0.31 0.74 0.60
By convention, the rotation from the camera frame to the target frame is
given by rotations about the three axes, corresponding to three angles pitch,
roll and yaw: Rx (pitch, ) Rz (roll, ) Ry (yaw, ).
0.85
A
X B = 0.31
0.42
c
tR =
A
A
BR = X B
AY
AZ
= tc R cPa + tPc.
tP
a
(14)
c
tR
1 0
1 0
0
0
0 Rz Ry Rx
0 1
1
C S 0
0 S
= 0 1 0 S C 0 0 1 0 0 C S
0 0 1
0
0 1
S 0 C
0 S C
CC +C S CS S S S CC S
= SC
(15)
S SS +CC C SS CS
S
C S
CC
Compare Eqn (15) with Bay, Eqn (3.16). Bay uses a different ordering for
the rotations.
Because matrix multiplication does not commute, Bays the 3-axis
rotation matrix - while similar - is not exactly the same as tcR.
There are at least 48 ways to put together a 3-Axis rotation matrix, and
they are all found somewhere in the literature.
Page 19
Page 20
Section 3.0.0
U=
u1 u2
The vector f =
1 0
=
,
0 0.5
0.5 1
T
V=
v1 v2
y1 = A x1
0.8 1
=
0.8 0
f=U f=
u1 u2
y2 = By y1
(17)
0.8
1
or f = 1.25
+0.5
0.8
0
where Bx and By are basis transformations in the input and output spaces,
respectively, and must be square and invertible.
Rewriting Eqn (16) with the change of basis
y1 = A x1
y2 = A x2
(16)
can be represented
0.5
1
0
f=
= 0.5 +2.0
1.0
0
0.5
Section 3.1.0
0.5
,
2.0
or f = V f =
v1 v2
1.25
0.5
or
y1 = B1
y A Bx x1
(19)
Using the uniqueness of Eqns (16) and (18), Eqn (19) implies that
A = B1
y A Bx
or, equivalently
A = By A B1
x
Page 21
Page 22
Section 3.1.0
Section 3.1.0
y2 = By y1
where the input and output bases of linear operator A have changed.
Which brings up this point: implicit in any linear operator are the bases
in which the input and output are expressed.
We normally assume these to be the standard Euclidean bases for Rm
and Rn .
x2 = Bx x1
the transformation matrices By and Bx must be square matrices, and full rank
to be invertible. By Rnn , Bx Rmm
A special case of basis transformation arises when A is a square matrix, or
A : Rn Rn . In this case the input and output transformations can be the
same,
y2 = B y1 , x2 = B x1
Combining with Eqns (16)-(19) above, we can write
y1 = A x1 = B1 A B x1
Which gives:
A = B1 A B
1
BAB
(20)
= A
(21)
When A and B are square and B is invertible, Eqn (20) has a special name.
It is called a similarity transformation.
Similarity transformations preserve the eigenvalues, in other words
eig (A) = eig A , where eig (A) is the vector of eigenvalues of A
Page 23
Page 24
Section 4.0.0
Section 4.0.0
Bay homework problems 3.4, 3.5, 3.6, 3.7, 3.9, 3.10 and 3.11 are all
addressed by a change of basis.
Example:
Example:
And applications
Just throw out the coefficients for basis vectors that make
little difference for human perception
Reconstructing MR images
jpeg image compression
Speech compression for cell-phone transmission
And for control systems, a change of basis is necessary to solve
x (t) = A x (t) + B u (t)
at all.
Part 3: Linear Operators
Page 25
Page 26
Section 4.0.0
2
l= 1 .
1
A = sF T
Problem expressed
in s basis
(Problem is generally
unsolvable on the s basis)
F
sT
(22)
Solution expressed
in s basis
Alternative, F, basis
Solve
Problem
Section 4.1.0
(Problem is solvable
on the F basis)
Alternative, F, basis is
sine and cosine functions
Solve
Problem
Heat conduction can
be solved for sin(x)
initial distrubtion.
Solution expressed
in s basis.
Non-orthogonal projection is a standard operation in computer graphics.
Rendering systems do shading and compute reflections by representing
complex surfaces as many flat triangular tiles, and computing the
intersection point of many rays with these tiles.
Page 27
Page 28
Section 4.1.0
The origin For the plane to be a 2-D vector subspace, the origin must lie in the
plane. In practical systems with many tiles (planes), the origin is offset to
a point in each plane as it is processed, so that a projection operator can be
used.
y1
ne
Section 4.1.0
x1
Pla
Surface Normal The plane is specified by its surface normal, a vector that is
orthogonal to the plane. This is a standard way to specify an n 1
dimensional hyper-surface in Rn .
x2
~n: Surface normal
y2
It is necessary to find basis for vectors for plane P . We can use the fact
that all vectors in plane P are orthogonal to n.
is a projection of a point (x) onto the surface (to point y) . Since x and y are
both 3-vectors, A is a 3x3 matrix.
x
x= y ,
z
2
l= 1
1
Where does the ray strike a plane defined by the surface normal n = 1 ?
2
Being able to cast the relation as a linear operator, of course,
greatly simplifies and accelerates the calculation.
A Play Station 3 can perform this calculation several billion times per
second.
Part 3: Linear Operators
Page 29
Page 30
Section 4.1.0
(b): to verify that syi is the shadow of sxi consider what it means to be the shadow:
yi sxi = l
Example Data:
1. Given a point sxi and a point syi in the plane, derive the calculation to verify:
sx
2
2.67
s
1 = 3 which projects onto y1 = 0.67
4
1.67
Verifying that syi lies in plane P: One way to check that sy1 lies in P is to form
the projection of sy1 onto P, and verify that it equals sy1 .
(24)
Section 4.1.0
Considering that n = 1 ,
1 0
(23)
>> P = [ 2 1 ; 0
P =
2
1
0
1
-1
0
1 ; -1 0 ]
sy1 = -2.67
0.67
1.67
>> sy1hat-sy1
ans =
1.0e-15 *
-0.8882
0
-0.1665
1
PT syi
y = P PT P
Page 31
Page 32
Section 4.1.0
Verifying that syi is the shadow of sxi : To show that sy1 is the shadow of sx1,
show that ( sy1 sx1 ) is parallel to l . For the example data we find:
%% Difference Vector
>> ll = sy1-sx1
ll = -4.6667
-2.3333
-2.3333
%% Term-by-term ratio
>> ll ./ l
ans = -2.3333, -2.3333, -2.3333
%% Projection ray l
l =
2
1
1
Section 4.1.0
2
1
2
s
xi = a1 0 + a2 1 + a3 1 = F F xi
1
0
1
sy1-sx1 = -2.3333 l
with
f1 f2 l
where f1 and f2 are basis vectors in the plane, and l is the projection ray.
Given P above, the set of basis vectors for F is:
F=
f1 f2 l
b1
yi = b2
b3
so that
2 1 2
= 0 1 1
1 0 1
a1
xi = a2
a3
This gives:
b1 1 0 0
F
yi = b2 = 0 1 0
0 0 0
0
Page 33
2
1
2
yi = b1 0 + b2 1 + b3 1 = F F yi
1
0
1
(25)
F
xi
Page 34
Section 4.1.0
b2 = a2
b1 1 0 0
b2 = 0 1 0
0 0 0
0
Or
yi = FA Fxi
FA
with
Section 4.1.0
1. Starting with FA, find the operator sA that determines sy1 corresponding to
a point sx represented on the standard basis.
b1 = a1
a1
a2
a3
1
0
0
F
A= 0 1 0
0 0 0
(26)
yi = F Fyi ,
s
FT
so
=F
(28)
note
F
sT
= F 1
(29)
y =
s
FT
F
sT
xi
= sA sx
(30)
Page 35
Page 36
Section 4.2.0
F () =
f (t) =
2 j t
f (t) e
dt
F () e+2 j x d
f ( j) =
(31)
(32)
F (k) =
1
f ( j) =
N
Inverse DFT:
f ( j) e
j=1
N
2i
N ( j1)(k1)
F (k) e
2i
N ( j1)(k1)
(34)
k=1
f(j)
2
0
20
40
60
80
j [sample number]
100
120
140
real F(k)
100
50
0
50
0
10
20
30
40
50
60
70
imag F(k)
50
50
0
10
20
30
40
k [wave number]
50
60
70
F (k) e
2i
N ( j1)(k1)
(Eqn 34 , repeated)
k=1
2i
N (11)(k1)
2i (21)(k1)
eN
vk =
..
2i
e N (N1)(k1)
(33)
1
N
For the Discrete Fourier Transform (DFT), the DFT and Inverse DFT are
given by summations in the place of integrals:
DFT:
Section 4.2.0
ei k (11)
i (21)
e k
=
..
.
ei k (N1)
(35)
where
2 (k 1)
N
is the frequency corresponding to component F (k).
k =
(36)
Using the vk , the inverse DFT of Eqn (34) takes the form:
f=
1
(F (1) v1 + F (2) v2 + + F (N) vN )
N
(37)
T
where f = f (1) f (2) f (N)
is the time-domain signal, and
T
is the frequency-domain signal.
F = F (1) F (2) F (N)
Eqn (37) has the form of expanding f on a set of basis vectors.
The 1/N term is a normalization.
Page 37
Page 38
Section 4.2.0
v1 v2 vN
(38)
f=
We find
1
VF
N
(where F is the Fourier transform of f).
f=
1
V VTf
N
(42)
(39)
Section 4.2.0
or, V T = N V 1
(40)
(41)
Summary:
Eqn (35) defines an orthogonal basis of N- element vectors (or functions,
for the continuous time FT)
>> w0 = 2*pi/N
>> for kk = 1:N,
>>
for jj = 1:N,
>>
V(jj,kk) =
>>
end
>> end
V =
1.00
1.00
1.00
1.00
1.00
1.00
1.00
0.50
-0.50
-1.00
-0.50
+
+
+
-
0.87i
0.87i
0.00i
0.87i
0.50 - 0.87i
%% Fundamental frequency
%% Build the N basis vectors
%% The N elements of each vec
exp(j*w0*(jj-1)(kk 1));
1.00
-0.50
-0.50
1.00
-0.50
+
+
0.87i
0.87i
0.00i
0.87i
-0.50 - 0.87i
1.00
-1.00
1.00
-1.00
1.00
+
+
-
0.00i
0.00i
0.00i
0.00i
-1.00 + 0.00i
1.00
-0.50
-0.50
1.00
-0.50
+
-
0.87i
0.87i
0.00i
0.87i
-0.50 + 0.87i
1.00
0.50
-0.50
-1.00
-0.50
+
+
0.87i
0.87i
0.00i
0.87i
0.50 + 0.87i
Page 39
Page 40
Section 4.2.0
6
0
0
0
0
0
0
6
0
0
0
0
Section 4.2.1
>> V*V
ans =
0
0
6
0
0
0
0
0
0
6
0
0
0
0
0
0
6
0
1. The matrix multiply form only works for sampled signals (discrete
signals, or the discrete Fourier transform). Continuous signals require
integrals (and can be defined in terms of inner products).
2. Matrix multiplication is conceptually simple, but computationally
inefficient. For a 1024 element FFT, a 1024x1024 matrix V would be
required.
Fourier actually focused on the columns of V . Fouriers insight contained 2
parts:
1. He could solve the problem of heat conduction for an initial heat
distribution given by a basis vector vk
2. The basis vectors of the Fourier transform are orthogonal !
Ordinarily given basis vectors V and data f, to find the basis
coefficients we need to solve
1 T
F = V 1 f ,
or V T V
V f
But the Fourier basis vectors are orthogonal, with a very simple
normalizing factor,
F =VTf
0
0
0
0
0
6
Page 41
Page 42
Section 4.2.2
Section 4.3.1
A VT f
(43)
(action of V T )
(action of FA)
(action of V )
A V
(44)
And so
y = sA f
(45)
1
4
1
{x1 , x2 , x3} =
2 , 5 , 2
3
0
6
0
4
1
{y1 , y2 , y3} =
2 , 1 , 0
2
6
1
y = Ax
The key to finding a good basis for solving the problem is to realize that a
basis F is found so that the x data are
1 0 0
F
x1 , Fx2 , Fx3 = 0 , 1 , 0 , with
0
1
0
F
y1, Fy2 , Fy3
A = Fy1 , Fy2 , Fy3
1
0
so that
F
y1 = FA Fx1 = FA 0 , Fy2 FA Fx2 = FA 1
0
0
Part 3: Linear Operators
Page 43
etc.
Page 44
Section 4.3.1
1
F
x1 = 0 ,
0
Section 4.3.2
0
F
x2 = 1 , etc.
0
(46)
4 -1
5 2
6 0]
>> Y = [ 0
2
-2
4 -1
1 0
6 1]
Double checking:
>> sFT = X;
which gives
x1 = F Fx1 = [x1 , x2 , x3] 0 ,
0
s
FT
F
sT
=F,
etc.
= F 1
(47)
On the F basis:
F
y =
A x
with
A = Fy1 , Fy2 , Fy3 = FsT [ sy1, sy2 , sy3 ]
A = sF T
F
sT
(48)
-0.4000
0.2000
0.4000
0.8667
-0.2667
-0.2000
1.6000
0.2000
-1.6000
1.6667
-0.6667
0
-0.8667
1.4667
-3.5333
>> sA * X(:,1)
ans =
0.0000
2.0000
-2.0000
>> sA * X(:,2)
ans =
4.0000
1.0000
6.0000
>> sA * X(:,3)
ans =
-1.0000
-0.0000
1.0000
y = sA sx
Page 45
Page 46
Section 4.4.0
Section 5.0.0
The set of linear operators from one vector space into another (or into itself)
also forms a vector space.
Working with the space of all operators A : Rm Rn , and with
y1 = A1 x , y2 = A2 x
then
A1 x + A2x = (A1 + A2) x
and all the required properties of a vector space are satisfied
1. The 0 operator is included in the set
2. For every operator there is the additive inverse operator
Page 47
Page 48
Section 5.1.1
Section 5.2.1
Just as there are several vector norms, each induces an operator norm.
5.2.1 The L1 norm of an operator
y = Ax
with suitable norms ||y|| and ||x||. Then the operator norm ||A||op is defined
by:
||y||
(49)
= sup ||y||
||A||op = sup
x6=0 ||x||
||x||=1
where sup, supremum, indicates the least upper bound.
The operator norm is induced by the vector norms ||y|| and ||x||.
An operator matrix does not have to be square or full rank, it can be any
matrix, A Rnm
5.1.1 Operator norm properties
1 4
y = Ax = 2 5 x,
3 6
For the moment lets consider x with ||x||1 = 1 . (Through linearity, ||y||1
just scales with ||x||1 ) .
It turns out that the choice for x that gives the largest possible 1-norm
for the output, is to put all of ||x||1 on the element corresponding to the
largest column vector A . (Largest in the L1 sense.)
Choose:
(scalar multiplication)
so
0
x=
1
then
||x||1 = 1 , ||y||1 = 15
||A||1op = 15
Part 3: Linear Operators
Page 49
Page 50
Section 5.2.1
Example:
A=
Section 5.2.2
1
4
,
a2 =
2
5
3 6
a1
y = Ax ,
0.5
for x =
,
0.5
0
for x = ,
1
||a2||1 = 15
||A||2 = sup
x6=0
1
y= 2 ,
3
1
for x = ,
0
||a1||1 = 6 ,
||y||1 = 6
||A||2 =
max
||x||2 =1
xT A A x
o1/2
yT y
(52)
||A||1 = max a j 1
j
(53)
V =
S =
0.408
-0.816
0.408
9.508
0
0
0
0.773
0
-0.386
-0.922
(50)
2.5
4.5
4
y = 5 , ||y||1 = 15
6
then
(51)
Given
A = [a1 , a2 ... , am ]
||y||2
||A x||2
= sup
= sup ||A x||2
||x||2 x6=0 ||x||2
||x||2 =1
Page 51
Page 52
-0.922
0.386
Section 5.2.3
Section 5.2.4
||y||
||A x||
= sup
= sup ||A x||
||x|| x6=0 ||x||
||x|| =1
(54)
n
||A||opp =
||A|| = max
i
j=1
ai j
i=1 j=1
p
ai j
!1
(56)
Note, care must be taken with notation, because the normal notion of the
operator norm is induced, as in section 5.2.2, not given by Eqn (56)
(55)
A special case of these so-call entry-wise norms is the Frobenius norm
n
The L -norm is given by the row vector of A with the greatest L1 -norm.
||A||F =
i=1 j=1
!1
2
2
ai j
(57)
The Frobenius norm has the properties a norm (described in section 5.1)
r
1 4
1
A = r2 = 2 5 ,
3 6
r3
r1 =
r2 =
r3 =
h
h
h
1 4
2 5
3 6
i
i
i
||r1 ||1 = 5
,
||r2 ||1 = 7
||r3 ||1 = 9
So ||A|| = 9
0
1
1
1
1
= =
=
= = 1
1
1
1
1
0
||A||F
Page 53
i1/2
h
T
tr A A
v
umin(n,m)
u
= t 2i (A)
(58)
(59)
i=1
where tr () denotes the trace of a matrix, which is the sum of the elements
on the diagonal; and the i in Eqn (59) are the singular values.
Part 3: Linear Operators
Page 54
Section 5.4.0
Section 5.5.0
The adjoint
operator is just the complex-conjugate
of a complex-valued
T
transpose A = A
Example:
A=
Matlab:
Part 3: Linear Operators
Page 55
4 j
2
5
3+ j 6
1
A =
2 3 j
4+ j 5 6
1
is A
Page 56
Section 6.0.0
When A = A
e.g., A =
3+ j 7
A is a symmetric matrix for the real case,
2
Section 7.0.0
W = UV
(60)
When U = [u1 , u2 , ..., unu ] and V = [v1 , v2 , ..., vnv ], for vectors lying in W,
it must be the case that there are representations on both U and V , that is
Page 57
a
1
a2
.
..
an
u
[U, V ]
=0
b1
b
2
.
..
bnv
Page 58
(62)
Section 7.1.0
a
1
wi = U ...
anu
(63)
8 Conclusion
For finite vectors, linear operators are matrices
7.1 Example
>> U = [
Section 8.0.0
b
1
wi = V ...
bnv
or equivalently
1
2
3
4
5
6 ]
>> V = [ 2
3
5
3
4
4 ]
>> w1 = U*Null(1:2)
w1 = 2.5000
3.5000
4.5000
>> V*inv(V*V)*V*w1
ans = 2.5000
3.5000
4.5000
(Revised: Sep 10, 2012)
Page 59
Page 60
6 Determining the rank of A and the four fundamental spaces with the
SVD
28
6.1
Contents
1 Introduction
Example: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
31
1.1
Rotation+ Matrices . . . . . . . . . . . . . . . . . . . . . . . . .
7.1
34
1.2
Scaling Matrices . . . . . . . . . . . . . . . . . . . . . . . . . .
7.2
36
2.1
Numerical Example: . . . . . . . . . . . . . . . . . . . . . . . .
2.2
2.2.1
12
3.2
13
3.3
15
3.4
. . . . . . . . . . . . . . . . . . . . .
16
3.5
19
40
42
10 Conclusions
43
20
23
4.1.1
24
5 SVD Conclusion
12
3.1
4.1
. . . . . . .
27
Page 1
Page 2
Section 1.0.0
1 Introduction
Section 1.1.0
y Rn ,
x Rm ,
A Rnm
(1)
Ax=y
y
Output Space, Rn
As we shall see, in all cases, the linear transformation from Input Space
to Output Space is made up of 3 parts:
1. An ortho-normal transformation from input coordinates to singular
coordinates
2. Scaling (in singular coordinates)
3. An ortho-normal transformation from singular to output coordinates
As we saw in the previous section, an orthonormal matrix gives either a
rotation (det R = +1) or reflection (det R = 1). Some authors use the term
rotation matrix for actions 1 and 3, because it captures the intuition of
what is going on, but rotation alone is not sufficiently complete.
Input Space, Rm
1
1
1
X
1
1
1
X
Page 3
Page 4
Section 1.2.0
1 0
0.5 0
=
(2)
=
0 2
0 3
15
10
10
Scaled by 3.0
5
5
5
5
5
X
10
15
1 0
0 2
15
15
10
10
(3)
Scaled by 0.0
Scaled by 0.5
0.5 0
15
Section 1.2.0
0
5
5
5
X
10
15
Scaled by 0.5
5
X
10
5
5
15
5
X
10
15
Figure 4: Action of a scaling matrix with a singular value of zero for the Y axis.
Figure 3: Action of a scaling matrix.
A Scaling matrix does not have to be square. The matrices
Figure 4 was generated with:
FF = [ A collection of 2-vectors (specifying points) ]
Scale = [ 0.5, 0; 0 3.0];
FF1 = Scale * FF;
0.5 0 0
0
3 0
0.5 0
= 0
Scaling Matrices:
1. Are diagonal
2. Have zero or positive scaling values
A negative value flips the configuration, well do this with rotations+.
Page 5
1 0 0
1 0
0 2 0
3 = 0 2
0 0
0
(4)
(5)
Page 6
Section 2.0.0
Section 2.1.0
-2 ]
U =
-0.5661
-0.7926
-0.2265
-0.1622
-0.1622
0.9733
S =
6.2450
0
0
0
4.3589
0
A = U VT
-0.8082
0.5878
-0.0367
(6)
and so
y = Ax =U V x
T
(7)
V =
-0.7071
-0.7071
0.7071
-0.7071
where:
1. V T is an rotation+ from input coordinates onto singular coordinates.
2. is a scaling matrix.
3. U is an rotation+ from singular coordinates onto output coordinates.
Uniqueness:
Remarks:
Page 7
Page 8
Section 2.2.1
Section 2.2.1
(8)
A=
uk k vTk
(9)
| | | |
0 0
T
A = U V = u1 u2 un 0 2 0
0 0 ...
| | | |
k=1
where uk are the columns of U, vk are the columns of V , and r is the rank of
A.
Eqn (8) is a decomposition into matrices, while Eqn (9) is a decomposition
into individual component vectors.
vT1
vT2
(12)
..
T
vm
Recall
p = min (n, m)
r = rank (A)
Because of the zeros in the scaling matrix, Eqn (12) reduces to one of
Eqn (13) or (14), below.
A=
uk k vTk
(10)
k=1
(11)
Page 9
And when n < m, then A is given by Eqn (14), where the rows of V for
i = n + 1..m multiply zero columns in , and are omitted.
A =
A =
1 vT1
| |
|
T
2 v2
u1 u2 um
..
| |
|
m vTm
|
|
|
1 u1 2 u2 n un
|
|
|
when p = m < n
,
keep only p columns of U (13)
vT1
vT2
when p = n < m
,
keep only p rows of V T (14)
..
vTn
(Revised: Sep 10, 2012)
Page 10
Section 2.2.1
A = 1 u1 2 u2
|
|
Section 3.1.0
vT1
vT
2
(15)
p up
..
|
vTp
|
Going across the rows on the right, and down the columns on the left, the
elements of 1 u1 form a vector outer product with the elements of vT1 ,
2 u2 with vT2, etc.
The mechanics of multiplying the terms of Eqn (15) give the result
A=
uk k vTk = U V T
(18)
k=1
can be derived.
Then we show how to determine the v j satisfying a necessary condition.
A=
k uk vTk
(16)
k=1
If r < p then the k , k = {r + 1 , ... p} are zero, and those terms can be
dropped from Eqn (16), giving the sought after form:
r
A=
k uk vTk
(17)
k=1
Avj =
uk k vTk
k=1
v j = u j j vTj v j = u j j
(19)
(20)
Eqn (20) immediately solves for all of the j and vectors u j corresponding
to j > 0:
j = A v j
uj =
Page 11
(21)
1
Avj
j
(22)
(Revised: Sep 10, 2012)
Page 12
Section 3.2.0
V =
0.39 0.92
0.92
0.39
4.08
A v1 = 5.38
6.69
u1 =
1
1
9.51
0.43
1.00 4.00
0.39 0.92
=
2.00 5.00
0.77
0.92 0.39
0
3.00 6.00
(23)
5.38 = 0.57
6.69
0.70
9.51 0
= 0 0.77 ,
0
0
0.43 0.81 |
U = 0.57 0.11 ?
0.70 0.58 |
0.81
Remarks:
4.08
1 = 5.38 = 9.51
6.69
4.08
0.43
A = 0.57 0.11 ? 0
0.70 0.58 |
0
1 4
A= 2 5
3 6
Choose:
Section 3.2.0
Then A = U V T gives:
Page 14
Section 3.3.0
0.49 +
* 0.36
0.55 , 0.57 = 0.99 6= 0
0.66
0.75
V =
0.94 0.34
0.34
0.94
2.31
2.31
1 = 3.59 = 6.48
4.87
A v1 = 3.59
4.87
2.31
0.36
This requires:
u1 =
3.59 = 0.55
1
4.87
0.75
For j 6= i ,
6.48 0
= 0 7.00 ,
0
0
(24)
0.36 0.49 |
U = 0.55 0.57 ?
0.75 0.66 |
uTj ui = 0, and so
1 1
uTj ui = vTj AT
(A vi ) = 0
j i
Section 3.4.0
vTj AT (A vi ) = vTj AT A vi = 0
Page 15
(25)
Page 16
Section 3.4.0
(26)
Section 3.4.0
in which case vTj AT A vi = i vTj vi = 0
There may not even be a complete set of eigenvectors (in which case we
say the matrix is defective)
Proof:
Necessary: Because the vi are ortho-normal, vectors v j , j 6= i span the
entire m 1 dimensional space orthogonal to vi , therefore if AT A vi must
lie in the 1-D space spanned by vi .
Sufficient: Since
v j vi .
AT
A vi = i vi , then
vTj AT
A vi =
vTj i vi
= 0, because
QED
Q = AT A.
1
1
2
2
= 2
1
1
(27)
Remarks:
1. A symmetric matrix, such as Q = AT A , is a real Hermitian matrix.
2. Further discussion is deferred until our in-depth discussion the eigen-system
of a matrix.
These special vectors are called eigenvectors and the scale factors are
called the eigenvalues.
For an m m matrix, there can be at most m eigenvectors.
Eigenvectors can be scaled (considering multiplying left and right of Eqn
(26) by a scale factor). We usually normalize eigenvectors.
Part 4a: Singular Value Decomposition
Page 17
Page 18
Section 3.5.0
A=
Section 4.0.0
With A and y given. We are looking for a particular solution that solves
y = A x p
where
y is the projection of y onto the column space of A
uk k vTk
= U V
(28)
k=1
1
=
Avj
j
(29)
(30)
Page 19
(31)
y = Uc UcT y =
uk uTk y
(32)
k=1
uT
| |
|
| |
|
uT
2
y=
y = u1 u2 ur
u1 u2 ur
..
| |
|
| |
|
uTr
a
1
| |
|
a2
= u1 u2 ur
. = a1 u1 + a2 u2 + + ar ur
..
| |
|
ar
Part 4a: Singular Value Decomposition
uT1 y
uT2 y
...
uTr y
(33)
Page 20
Section 4.0.0
Eqn (33) shows that the projection of y onto the column space of A can be
written
y = a1 u1 + a2 u2 + + ar ur
(34)
Section 4.0.0
(40)
with
ak = uTk y
(35)
So far there is nothing surprising about Eqns (33-35). They say that we
can write the output of
y = A x p
(36)
as a linear combination of basis vectors on the column space of A.
Without the SVD, the analysis would stop here, there is no way to
discover contributions of x to give the basis coefficients ak .
With the SVD there is a way to discover the contributions of x to each term !
bk = (1/k ) ak = (1/k ) uk T y
uk k vTk
y = Ax =
k=1
xp =
x
(42)
(41)
k=1
k=1
vk bk = vk (1/k ) uk
y=
vk (1/k ) uk
k1
y = A# y
(37)
= a1 u1 + a2 u2 + + ar ur
(43)
with
ak = k vTk x
(38)
A# =
vk (1/k) uk T
(44)
k=1
(39)
>> Asharp = pinv(A)
Page 21
Page 22
Section 4.1.0
Section 4.1.1
(45)
vk (1/k) uk T
(46)
A = [ 1
2
3
4
5
6
7
8
6
8
10
12 ]
ybar =
6
5
5
3
k=1
With y = A x, find x p
And the solution
x p = A#
(47)
(48)
Before proceeding, lets find the correct y , the projection of y onto col (A)
>> W = GramSchmidt(A)
W = 0.1826
0.8165
0.3651
0.4082
0.5477
0.0000
0.7303
-0.4082
>> A*xp1,
ans = -5.4375
-9.6250
-13.8125
-18.0000
Page 23
Page 24
Section 4.1.1
Now with the generalized inverse (also called the pseudo inverse)
>> [U,S,V] = svd(A)
U = -0.3341
0.7671
-0.4359
0.3316
-0.5378
-0.1039
-0.6396
-0.5393
S =
V =
-0.4001
0.2546
0.6910
-0.5455
23.3718
0
0
0
0
1.3257
0
0
0
0
0.0000
0
-0.2301
-0.5634
-0.7935
-0.7834
0.5910
-0.1924
-0.5774
-0.5774
0.5774
Section 4.1.1
or
-0.3741
0.7970
-0.4717
0.0488
>> xp=pinv(A)*ybar
xp = -2.3500
2.0500
-0.3000
A Rnm
Case
Size of A
Exactly constrained
n=m
Matrix Inverse
Tool
Over constrained
n>m
Left Pseudo-Inverse
Under constrained
n<m
Right Pseudo-Inverse
(49)
Must Exist
A1
1
ATA
1
A AT
xp =
k=1
k=1
with
A# =
(50)
vk (1/k ) uTk
k=1
0.0667
-0.0333
0.0333
0.3250
-0.2250
0.1000
Page 25
Page 26
Section 5.0.0
5 SVD Conclusion
:
U:
Section 6.0.0
The singular value decomposition gives us an expansion for any real matrix
A of the form
A = U V T
V T:
rotation+
from input
i coordinates to singular coordinates, where
h
V = v1 vm Rmm
rotation+ from
singular icoordinates to output coordinates,
h
where U = u1 un Rnn
A=
uk k vTk
k=1
We have seen that if the vi are the eigenvectors of AT A then the k and uk
are straight-forward to compute.
Since Q = AT A is a Hermitian matrix, the eigenvectors exist and are
orthogonal.
Note: if n < m it may be numerically more convenient to compute the
..
.
..
.
..
.
..
.
..
.
..
.
U V T = u1 ur ur+1 un
..
..
..
...
...
...
.
.
.
1
..
.
r
vT1
..
.
0
vT
vT
0
r+1
..
..
.
.
vTm
0
where 1 ... r are the singular values greater than the tolerance, and the
rest of the diagonal elements of are effectively zero.
As we are about to see, bases for the four fundamental spaces of a matrix
are given directly from the singular value decomposition.
Page 27
Page 28
Section 6.0.0
.. .. ..
. . .
u1 ur
.. .. ..
. . .
.. ..
..
. .
.
ur+1 un
..
.. ..
.
. .
0
...
r
vT1
..
vr
vTr+1
..
T
vm
Section 6.0.0
0
...
where the columns of Uand V provide bases for the Column, Left-Null,
Row and Null spaces:
..
.
..
.
..
.
Uc = u1 ur ,
.. .. ..
. . .
..
.
..
.
..
.
Uln = ur+1 un ,
..
.. ..
.
. .
Part 4a: Singular Value Decomposition
..
.
..
.
..
.
..
.
Vr = v1 vr
.. .. ..
. . .
..
.
..
.
Vn = vr+1 vm
..
..
..
.
.
.
(Revised: Sep 10, 2012)
Page 29
Page 30
Section 6.1.0
6.1 Example:
Section 6.1.0
Consider
2
A=
0
0
1
1
The four fundamental spaces of matrix A can be found through the SVD:
>> r = sum(ss > norm(A)*max(n,m)*eps)
r = 2
0.8987
-0.3615
-0.1757
0.1757
5.3718
0
0
0
0
1.0694
0
0
0
0
0.0000
0
V = -0.5774
-0.2113
-0.7887
0.5774
-0.7887
-0.2113
0.5774
0.5774
-0.5774
-0.1030
0.3769
-0.6509
0.6509
= V(:, 1:r)
-0.5774
0.5774
-0.2113
-0.7887
-0.7887
-0.2113
Page 31
= V(:, (r+1):NRows)
0.5774
0.5774
-0.5774
Page 32
Section 6.1.0
Since the rank is 2, a basis for the column space is given by the first 2
columns of U
>> Uc
= U(:, 1:r)
Uc = -0.2543
0.3423
-0.5086
0.6846
-0.6947
-0.2506
-0.4405
-0.5928
Section 7.1.0
(52)
Exact Solution: An exact solution is one that exactly satisfies Eqn (52). Recall
that if x is over-constrained (more ys than xs), then we can get a solution
which is not an exact solution.
Homogeneous Solution: A homogeneous solution is a solution to:
A xh = 0
There is the trivial homogeneous solution, x = 0. To have more interesting
homogeneous solutions, matrix A must nhave a non-trivial onull space.
Suppose the null space is given by a basis n1 , n2 , , nn :
xh = n1 n1 + n2 n2 + + nn nn
A xh = 0
(53)
Page 33
Page 34
Section 7.1.0
Particular Solution: A particular solution is one that solves Eqn (52), either
exactly or in a least squared error sense. x p is the particular solution, and
y = A x p. The residual,
e
(54)
y = y y
may be zero (an exact solution) or may be minimal.
Section 7.2.0
'
Keep in mind:
0.3423
0.6846
-0.2506
-0.5928 ]
A = Uc
0.5774
-0.7887
-0.2113 ]
r VrT
e
y lies in the left-null space.
>> Y = [ 1 2 3 4 ]
x p is given as
xp = A y
(55)
y = A xg
(56)
>> Yhat = Uc * Uc * Y
Yhat = [ 0.8182
1.6364
3.9091
3.0909 ]
If the null space and any particular solution is known, then all of the general
solutions are given by Eqn (56).
Page 35
Page 36
Section 7.2.0
Section 7.2.0
Now compute x p
>> Xp = Vr* inv(SigmaR) * Uc * Y
Xp = [ -0.2121
1.2424
1.0303 ]
ytilde =
0.1818
0.3636
-0.9091
0.9091
e
y should lie in the left-null space. The basis for the left null space is Un
>> Un = U(:, (r+1):NCols)
Un = [ 0.8987
-0.1030
-0.3615
0.3769
-0.1757
-0.6509
0.1757
0.6509
Checking that e
y lies in Un :
>> ytilde2 =
0.1818
0.3636
-0.9091
0.9091
Un * Un * ytilde
A * Xp
-------0.8182
1.6364
3.9091
3.0909
Yp
-----0.8182
1.6364
3.9091
3.0909
Y
----1
2
3
4
Page 37
Page 38
Section 7.2.0
Section 8.0.0
xg = x p + xh
In some cases the null space will be empty, so xg = x p . But in this case
dim null (A) = 1
.577
xh = a1 vm = a1 .577
.577
||A||2 =
By writing y = rk=1 uk k vTk x , it is clear that the largest ||y||2 is given
when x corresponds to the largest singular value of A. Choosing x = v1
gives y = 1 u1 and ||y||2 = 1 .
The condition number of A is given as
So xg is given as:
cond (A) =
0.2121
.577
xg = 1.2424 + a1 .577
1.0303
.577
0.2121
.577
1.0303
.577
>> Xg = Xp - 0.42*Xh
Xg = [ -0.455
1.000
1.273 ]
(57)
The condition number is a measure of how much round off errors can be
expanded by multiplying a matrix by A.
if there are noise components in y, when they hit the large terms in A#
they will give large errors.
Example: A problem with cond (A) = 10 is said to be well conditioned,
if cond (A) = 10000 the problem is said to be poorly conditioned.
>> A * Xg = Yhat
= 0.8182
1.6364
3.9091
3.0909
Page 39
Page 40
Section 8.0.0
The absolute value of the determinant of any matrix is the product of its
singular values
p
|det (A)| = k
(58)
k=1
det (A) = k
k=1
n
p
k = k
k=1 k=1
Section 10.0.0
Page 41
Page 42
Section 10.0.0
10 Conclusions
The Singular Value Decomposition gives us a geometric picture of matrixvector multiplication, comprised of
A rotation+
Scaling
A rotation+
Using the SVD we can find basis vectors for the four fundamental spaces.
And the basis sets are ortho-normal
And the basis vectors of the row and column spaces are linked by the
singular values
Numerically, computation of the SVD is robust because computation of the
eigenvectors of a symmetric matrix is robust.
The SVD can be used to compute:
rank (A)
||A||2
cond (A)
Ortho-normal basis vectors for the four fundamental spaces
The solution to y = A x for the general case, without matrix inversion.
Page 43
3.2.4
3.3
27
33
3.3.1
Contents
3.4
1 Introduction
1.1
Repeated eigenvalues . . . . . . . . . . . . . . . . . . . .
2.2
2.3
10
2.3.1
Example: 3D Rotation . . . . . . . . . . . . . . . . . . .
11
13
3 The Jordan-form
3.1
3.2
41
42
4 Conclusions
43
45
16
16
3.1.1
17
20
3.2.1
. . . . . . . . . .
20
3.2.2
22
3.2.3
26
3.4.1
. . . . . . . . . . . . . . . . . . .
2.1
2.4
35
1.1.2
1.2
Page 1
Page 2
Section 1.1.0
1 Introduction
Section 1.1.2
(k I A) vk = 0
(1)
In this chapter we will elaborate the relevant concepts to handle every case.
(4)
det (k I A) = 0
(2)
or, said another way, the eigenvector is a vector in the null space of the
matrix (k I A) .
Notes:
Example:
(5)
Page 3
>> A = [ 2 1;
0 2]
A =
2
0
U = 2
0
1
2
0
2
(Revised: Sep 10, 2012)
Page 4
Section 1.1.2
Section 1.2.0
1. Group the into k sets of repeated eigenvalues (one set for each unique
)
Definitions:
The algebraic multiplicity of an eigenvalue is the number of times the
eigenvalue is repeated.
0 2]
A =
2
0
1
2
U = 2.0000
0
0
2.0000
1 q (k I A) mk
Eigenvalue: 2.0
Algebraic multiplicity: 2
(6)
3. If mk > gk for any k, the Jordan form and generalized eigenvectors are
required.
Geometric Multiplicity: 1
Number of missing eigenvectors: 1
k k mk gk
1
2
..
.
A = V U V 1
The eigen-decomposition only exists if V is invertible. That is if there is a
complete set of independent eigenvectors.
Part 4b: Eigenvalues and Eigenvectors
Page 5
Page 6
Section 1.2.0
Section 2.1.0
Example,
>> A = [ 2 3 4 ; 0 2 1 ; 0 0 2 ]
A =
2
3
4
0
2
1
0
0
2
Recall: for triangular and diagonal matrices, the eigenvalues are the
diagonal elements
2
0
0
0
2
0
1.0000
-0.0000
0.0000
>> RoundByRatCommand(V)
ans = 1
-1
1
0
0
0
0
0
0
0
0
2
(7)
D = E
(8)
( I A) v = 0
Av = v
Eqn (8) shows that the Eigenvectors lie in the null space of ( I A)
v Av = 0
k k mk gk
where E is the electric field vector, D is the electric flux density (also called the
displacement vector) and is the dielectric constant.
Page 7
Page 8
Section 2.2.0
D
1 11 12 13
D2 = 21 22 23
D3
31 32 33
Section 2.3.0
E
1
E2
E3
Find the directions, if any, in which the E-field and flux density are collinear.
Examples: Consider the basic rotation matrix:
Solution:
For the E-field and flux density to be collinear they must satisfy D = E,
R=
C S
S
Eigenvalues:
(9)
( I R) =
det (I R) = 2 2C +C2 + S2 = 2 2C + 1 = 0
which solves to give
q
4C2 4
2
2C
q
2
4 S2
= C j S
2C
Page 9
Page 10
Section 2.3.1
Section 2.3.1
The matrix R of Eqn (11) also describes a rotation of 600 about the axis v
c
tR
CC +C S CS S S S CC S
= SC
S SS +CC C SS CS
S
CS
CC
0.577
v3 = 0.577
0.577
(10)
w
y
Rw
x
z
(11)
Corresponds to
= 135o ,
= 135o ,
= 19.47o
This matrix (like all 3D rotation matrices with general angles) has one real
eigenvalue and a complex conjugate pair
>> [V, U] = eig(R)
V = -0.5774
0.2887 + 0.5000i
0.2887 - 0.5000i
U =
0.5000 + 0.8660i
0
0
-0.5774
0.2887 - 0.5000i
0.2887 + 0.5000i
0.5774
0.5774
0.5774
0
0.5000 - 0.8660i
0
0
0
1.0000
x (t) = V eU t V 1 x (0)
(12)
the complex eigenvalue and eigenvector pair combines to give solutions that
can be written
x (t) = a1et cos (t + ) w1 + a2et sin (t + ) w2
(13)
Page 11
(imaginary part)
(Revised: Sep 10, 2012)
(15)
Page 12
Section 2.4.0
Section 2.4.0
Q v1 = 1 v1
(16)
Q v2 = 2 v2
(17)
y = (x A x) = x A x = x A x
v1 Q = 1 v1 = 1 v1
(18)
v1 Q v2 = 1 v1 v2 = 1 v1 v2
(19)
(20)
1 v1v2 = 2 v1 v2
(21)
v Q v = v v = v v = ||v||
So we find
By property 1,
v Q v
v Q v
||v||2
must be real.
Part 4b: Eigenvalues and Eigenvectors
Page 13
Page 14
Section 2.4.0
Section 3.1.0
3 The Jordan-form
(22)
Q = Q , and
V 1 = (V ) = V
(23)
Remarks:
Since T = T , the diagonal elements (the eigenvalues) must be real
(see property 2).
When Q is real (symmetric), V will be real.
(Revised: Sep 10, 2012)
(25)
U =
0
2
...
and
(26)
eU t =
e1 t
0
e2 t
...
(27)
Such matrices can arise with repeated eigenvalues and do not have a
complete set of eigenvectors. Such matrices are called defective.
If we generated A matrices randomly, defective matrices would be quite
rare.
But repeated poles (eigenvalues) are relatively common in the analysis
of dynamic systems, and sometimes even a design goal.
eAt = V eU t V 1
Q=V TV
(24)
T = V Q V 1 = V 1 QV = T
Page 15
Page 16
Section 3.1.1
Section 3.1.1
J=
1
0
(31)
y (t) = c1 e1 t + c2 t e1 t .
For example,
y (t) + 6 y (t) + 9y (t) = 0
(28)
(29)
J2 t 2
Jk t k
eJ t = I + J t +
+ +
+
(32)
2!
k!
2
3
1 0
1
2 2
3 32
+ t
+ t
+
+ t
=
1! 0
2 ! 0 2
3 ! 0 3
0 1
t k k k k1
+
(33)
+
k! 0
k
The (1,1) and (2,2) elements give the series
But Eqn (27) for eAt has no terms of the form t e3t . And yet Eqn (28) is
simply represented in state space with:
x (t) =
y (t)
y (t)
d y (t) 6 9 y (t)
x (t) =
=
dt y (t)
1 0
y (t)
(30)
And the solution to Eqn (30) is (as always for x (t) = A x (t))
1 k k
t = et
k
!
k=1
1+
1
t
+
k k1 t k =
1 ! k=2 k !
t 1+
k=2
1
k1t k1
(k 1) !
= t 1+
k=1
1 kk
t
k!
= t et
Jt
(34)
Page 17
e = exp
1
0
t =
et t et
0
et
(35)
Page 18
Section 3.1.1
et t et
1 0
exp 0 1 t = 0 et
0
0
0 0
1 2 t
2t e
t et
et
(36)
1 0 0
(37)
A=
M=
And
6 9
(39)
0 1 0
t
exp
0 0 1
0 0 0
Matrix A has been transformed to the Jordan form (sometimes called the
Jordan canonical form) when
J = M 1 A M
with
Section 3.2.1
0.949
0.316
eAt = M eJ t M 1 = M
(38)
0.0316
0.0949
, J=
e3t t e3t
0
e3t
3
0
1
3
A v = k v
or
(A k I) v = 0
(40)
From Eqn (40), a set of independent regular eigenvectors is given as the null
space of (A k I).
M 1
So the solution x (t) = eAt x (0) will have terms of the form e3t and t e3t ,
as need !
Part 4b: Eigenvalues and Eigenvectors
Page 19
Page 20
Section 3.2.1
(41)
l
(A k I) Vk,l+1
j = Vk, j
(42)
Or, rearranging
In this notation,
(43)
The l
be a regular eigenvector.
Section 3.2.2
Where Vk,l+1
j
Vk,1 j
>> U = eig(A)
U = 3.0000
6.0000
3.0000
%% This command rounds-off values to nearby rational numbers
%% which may be integers
>> U = RoundByRatCommand(U)
U =
3
6
3
A has a repeated eigenvalue, we can make a table analyzing the structure of
the eigensystem of A
k k mk
1
2
3
6
2
1
gk
1 or 2
1
0 or 1
0
Page 21
Page 22
Section 3.2.2
In this case for k = 1 we have only one regular eigenvector, so it must serve
as the first element, or anchor, of the chain of generalized eigenvectors
regular eigenvector:
generalized eigenvector:
The geometric multiplicity is the dimension of the null space in which the
eigenvectors lie. For 1, g1 = 1. Putting this information into the table
k k mk gk
1
2
3
6
2
1
1
1
1
0
Section 3.2.2
Page 23
1
V1,1
solves
2
V1,1
solves
1
(A 1 I)V1,1
= 0
(44)
2
1
(A 1 I)V1,1
= V1,1
In Matlab
>> lambda1=1; lambda2=2; I = eye(3);
%% Find the first regular eigenvector,
>> V111 = null(A-lambda1*I); V111=V111/V111(1)
V111 = 1.0000
1.0000
-1.0000
%% Find the generalized eigenvector by solving Eqn (44)
>> V112 = pinv(A-lambda1*I)*V111
V112 = -1.0000
1.0000
0.0000
%% Find the regular eigenvector for lambda2
>> V211 = null(A-lambda2*I); V211=V211/V211(2)
V211 =
0
1.0000
-1.0000
Page 24
Section 3.2.2
..
.
..
.
..
.
..
.
>> J = inv(M) * A * M
>> J = RoundByRatCommand(J)
J =
3
1
0
0
3
0
0
0
6
0
,
i
h
1 V2 V1
M = V1,1
1,1
2,1
3 1
0 3
J=
0 0
a regular eigenvector
(45)
For a system governed by x (t) = A x (t), and considering the J matrix, the
output of the system will have solutions of the form
y (t) = c1 e3t + c2 t e3t + c3 e6t
(46)
Using the Vk,l j notation, if we look at the structure of the M matrix, we can
determine the layout of Jordan blocks. For example,
h
i
1 V1 V2 V1 V2
M = V1,1
1,2
1,2
2,1
2,1
Then the blocks of J are arranged:
1x1
J=
where the first two terms correspond to the first Jordan block, and the last
term to the second Jordan block.
Part 4b: Eigenvalues and Eigenvectors
Section 3.2.3
Page 25
2x2
2x2
Page 26
Section 3.2.4
3
1
0
0
0
0
-1
1
0
0
0
0
1
-1
2
0
0
0
1
-1
0
2
0
0
0
0
1
-1
1
1
0
0
1
-1
1
1
>> U = eig(A)
U = 2.0000
2.0000
2.0000
2.0000
2.0000
0
0
0.7071
0
0.7071
-0.7071
0.0000
0.7071
0.0000
0.0000
0
0.0000
0
For convenience, scale the eigenvectors to get integer values
>> V211 = Null(:,1)/Null(3,1)
V211 =
0
0
1
-1
0
0
Part 4b: Eigenvalues and Eigenvectors
1 = 0 , 2 = 2 is repeated 5 times.
Null
Section 3.2.4
0
2
1
5
1
2
Page 28
Section 3.2.4
Section 3.2.4
2
Find V2,1
(47)
(48)
Page 29
2
Now evaluate V2,2
Page 30
Section 3.2.4
V223 =
0.00
-0.00
0.25
0.25
-0.00
-0.00
0
0
0
1
2
0
0
0
0
0
1
2
V111 =
0
0
0
0
1
-1
Put in the chains of E-vecs, starting each chain with its regular E-vec
>> J = inv(M)*A*M;
>> J = RoundByRatCommand(J)
J =
0
0
0
0
0
2
1
0
0
0
2
0
0
0
0
2
0
0
0
0
0
0
0
0
Interpreting the result
Section 3.2.4
Now find J
0.50
-0.50
0
0
0
0
0
0
0.25
0.25
0
0
0
| 0
0 |
0
0
0
----------------0
| 2
1 |
0
0
0
0
| 0
2 |
0
0
0
----------------------------0
0
0 |
2
1
0
0
0
0 |
0
2
1
0
0
0 |
0
0
2
0
0
0
0
1.00
-1.00
|
0
|
0
| 1.00
| -1.00
|
0
|
0
0
0
0
0
0.50
0.50
|
|
|
|
|
|
1.00
1.00
0
0
0
0
0.50
-0.50
0
0
0
0
0
0
0.25
0.25
0
0
Page 32
Section 3.3.0
Section 3.3.0
When gk 2, we have the freedom to choose the anchor for the chain of
generalized eigenvectors
1 , V 1 , ...
Not just from a list, Vk,1
k,2
In this case,
dim null (A k I) = gk 2
and any vector from the 2-dimensional (or larger) null space of (A k I) is
an eigenvector.
W = col (A k I) null(A k I) ,
Vk,1 j W
(50)
(49)
Page 33
Page 34
Section 3.3.1
3.3.1 Example where regular E-vecs do not lie in the column space of
(A k I)
Consider the matrix
2 1
0 4
A=
0 1
0 1
>> NIsInColumnSpaceV1 =
NIsInColumnSpaceV1 =
>> NIsInColumnSpaceV2 =
NIsInColumnSpaceV2 =
-0.7118
-0.2468
-0.4650
-0.4650
norm( Col*Col*v1-v1 )
0.6325
norm( Col*Col*v2-v2 )
0.6325
But what about the possibility that there exists another eigenvector which
lies in the null space and column space of (A k I):
Null =
0
0.8165
-0.4082
-0.4082
1
0
0
0
Null(3,1) )
A first choice for eigenvectors are the two basis vectors of the null space of
(A k I)
Col =
Section 3.3.1
2 2
0 0
x1 = a1 v1 + a2 v2
First, consideration of the possibilities
The universe is R4 , or 4D, with dim col (A k I) = 2, and
dim null (A k I) = 2. So there are 3 possibilities:
1. Two 2D spaces can fit in a 4D universe and not intersect, so it is
possible
col (A k I) null (A k I) = 0
Page 35
Page 36
Section 3.3.1
That is
w1 =
1
2
-1
-1
Section 3.3.1
(51)
Are solutions to
a1 anu , b1
(52)
i
a1 anu , b1 anv .
i
anv must solve
a
1
[U, V ] ... = 0
bnv
(A k I) has only one regular eigenvector that can anchor a chain. So the
chain must have length 3 (2 generalized E-vecs).
2 as solution to
Compute a candidate for the first generalized eigenvector, V1,1
2 = V1
(A k I) V1,1
1,1
(53)
h
i
The coefficient vector must lie in the null space of Col, Null , where
[Col] and [Null] are sets of basis vectors on the column and null spaces.
>> CoeffVec = null([Col, -Null])
CoeffVec =
0.7033
-0.0736
0.6547
0.2673
h
i
Since the null space of Col, Null is one dimensional, the intersection
of the column and null spaces is 1D
Part 4b: Eigenvalues and Eigenvectors
Page 37
v3 =
0
0.3333
0.3333
0.3333
3 , V 2 must be in the
To find the remaining generalized eigenvector, V1,1,
1,1
column space of (A k I)
Page 38
Section 3.3.1
2 must solve
Going back to the generating Eqn, V1,1
Section 3.3.1
2
1
(A k I) V1,1
= V1,1
(54)
v3 is a particular solution to Eqn (54), but it is not the only solution. Any
vector
2
V1,1
= v3 + b1 n1 + b2 n2
(55)
is a solution to (54), where n1 and n2 are basis vectors for the null space of
(A k I).
2 that is in the column space of (A I), we need a
To find a value for V1,1
k
solution to
2
= v3 + b1 n1 + b2 n2 = a1 c1 + a2 c2
(56)
V1,1
Or
c1 c2 n1
a
1
i
a2
= v3
n2
b1
b2
(57)
v3b = 0.5714
0.1429
0.4286
0.4286
1.0000
0
0
0
Page 39
Page 40
Section 3.4.0
Section 3.4.1
y (t) = a1 e1 t + a2 t e1 t + a3 t 2 e1 t ...
(58)
21/107 52/12
A=
Page 41
119/120
1/1
11/12
3/2
8/5
13/14
Page 42
Section 4.0.0
4 Conclusions
Section 5.0.0
To solve
l+1
l
(A i I) vk,
j = vk, j
For the l th generalized eigenvector, of the jth Jordan block, of the kth distinct
eigenvalue
v1k, j is a regular eigenvector, corresponding to k
l+1
l
For vk,
j to exist, vk, j must lie in the column space of (A k I)
The Jordan form leads to solutions of the differential equation in the form
t et , t 2 et , etc. For example:
Page 43
..
.
..
.
..
.
.. 2 t
. e
t e2 t
..
. 0 e2 t
..
. 0
0
..
1 1 .
1 ..
...
J =
..
. 2 1
..
.
2 1
..
.
2
(59)
eJt
1 t t e1 t
e
0 e1 t
1 2 2 t
2t e
t e2 t
e2 t
Page 44
Section 5.0.0
Page 45
4.1.1
4.2
Contents
1 Differential Eqns, Transfer Functions & Modeling
4.3
27
. . . . . . .
28
4.2.1
29
4.2.2
. . .
30
4.2.3
33
35
4.3.1
36
4.3.2
36
4.3.3
36
1.1
1.2
Block diagram
. . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3
1.3.1
Laplace transform . . . . . . . . . . . . . . . . . . . . .
1.3.2
5 Design
1.3.3
5.1
Design methods
. . . . . . . . . . . . . . . . . . . . . . . . . .
38
1.3.4
10
5.2
38
1.3.5
12
1.3.6
15
16
2.1
20
2.2
21
2.3
22
. . . . . . . . . . . . . . . . . . . . . . .
3 Analysis
4 Working
4.1
37
6 Summary
39
7 Glossary of Acronyms
40
25
with
the
pole-zero
constellation
26
26
Page 1
Page 2
Section 1.1.0
Section 1.2.0
Example (adapted from Franklin et al. 4thed., problem 5.41, figure 5.79)
Mp(t)
Elevator
servo
v(t)
GNA
7
s + 10
Aircraft
Dynamics
+
Me(t)
+
Mt(t)
Integrator
(t)
s+3
s2 + 4 s + 5
(t)
1
s
(t), (t)
d Mt (t)
d 2 (t)
d (t)
+ 5 (t) = 1
+ 3 Mt (t)
+4
dt 2
dt
dt
(t) =
(1)
d (t)
dt
(2)
d Me (t)
+ 10 Me (t) = 7 v(t)
dt
(3)
Page 3
Signal Symbol
Units
v (t)
[volts]
Me (t)
[N m]
M p (t)
(t)
[N m]
[rad/sec]
[radians]
(t)
When analyzing a problem from basic principals, we would also have a list
of parameters.
Parameter Symbol
Value
Units
b0
[N-m/volt]
...
...
...
Page 4
Section 1.3.1
Section 1.3.2
L{f(t)}
Scaled Impulse:
F(s)
f(t)
L-1{F(s)}
Unit step:
F (s) = b
1
s
f (t) = t, t 0
F (s) =
1
s2
n!
Decaying Exponential:
"Time Domain"
Space of all
functions of s
"Frequency Domain"
f (t) = t n , t 0
F (s) =
(t) = b et
F (s) =
Sinusoid:
Sinusoidal oscillation:
s2 +2
c s+Bs
F (s) = sB2 +0
s+2
Bc s+(Bc +Bs )
F (s) = s2 +2 s+2
n
2 + 2
Answers:
U(s)
u(t)
Solve
Algebraic
Eqn.
Solve
Diff Eq.
Y(s)
y(t)
1/
Area = 1.0
1+(t)
t=0
t=0
t=0
(t) , impulse function
Unit ramp
e-t
Space of all
functions of s
t=0
t=0
Decaying expon.
Page 5
t=0
A Sinusoid
sn+1
b
s+
F (s) =
n =
f (t) = b (t)
F (s) =
Higher Powers of t:
F (s) = 1
Unit ramp:
f (t) = (t)
Unit Impulse:
Laplace transform
Page 6
Section 1.3.2
then
then
Given:
then
d x (t)
dt
Section 1.3.2
Eqns (5)-(7) tell us something about the ratio of the LT of the output to the
LT of the input:
a2 s2 + a1 s + a0 Y (s) = (b1 s + b0) U (s)
(7, repeated)
(b1 s + b0)
Output LT
Y (s)
=
=
= G p (s)
U (s)
(a2 s2 + a1 s + a0)
Input LT
(8)
G p (s) =
= s X (s)
(b1 s + b0)
,
(a2 s2 + a1 s + a0)
(9)
u(t)
System
y(t)
Gp(s)
The transfer function is like the gain of the system, it is the ratio of the
output LT to the input LT.
Consider a system that takes in the signal u (t) and gives y (t), governed by
the Diff Eq:
a2
Important fact:
d 2 y (t)
d y (t)
d u (t)
+ a1
+ a0 y (t) = b1
+ b0 u (t)
dt
dt
dt 2
(4)
(Notice the standard form: output (unknown) on the left, input on the right.)
Whatever signals y (t) and u (t) are, they have Laplace transforms. Eqn (4)
gives:
d 2 y (t)
d y (t)
+ a1
+ a0 y (t)
L a2
dt 2
dt
d u (t)
= L b1
+ b0 u (t)
dt
(5)
(6)
(7)
Page 7
e(t)
Controller
u(t)
ys(t)
Plant
y(t)
Gp(s)
KcGc(s)
Sensor Dynamics
Hy(s)
Page 8
Section 1.3.3
Section 1.3.4
GNA
G p (s) =
(t), (t)
Mp(t) Me(t)
d 2 (t)
d (t)
d Mt (t)
+4
+ 5 (t) = 1
+ 3 Mt (t)
dt 2
dt
dt
N (s)
2 s2 + 8 s + 6
= 3
D (s) s + s s2 + 4 s + 0
The roots of the numerator are called the zeros of the TF, and the roots of
the denominator are called the poles of the TF. For example:
>> num = [2 8 6]
>> den = [1 2 4 0 ]
num =
2
8
6
den =
1
2
4
(10)
From (10) we get the TF, take LT of both sides, and rearrange:
s2 + 4 s + 5 (s) = (s + 3) Mt (s)
(s)
s+3
= 2
Mt (s)
s +4s +5
(11)
We can also use Matlabs system tool to find the poles and zeros
>> Gps = tf(num, den)
Transfer function:
Note:
We can write down the TF directly from the coefficients of the differential
equation.
We can write down the differential equation directly from the coefficients
of the TF.
Transfer functions, such as Eqn (11), are ratios of two polynomials:
s+3
numerator polymonial
(s)
=
:
Mt (s) s2 + 4 s + 5
denominator polynomial
>> zero(Gps),
>> pole(Gps),
(12)
ans = -3
-1
ans =
0
-1.0000 + 1.7321i
-1.0000 - 1.7321i
Page 10
Section 1.3.4
Interpreting the poles (p1, p2, ..., pn) and zeros (z1, ..., zm)
Section 1.3.5
We can use the poles and zeros to write the TF in factored form:
Just as a differential equation can be scaled by multiplying the left and right sides
by a constant, a TF can be scaled by multiplying the numerator and denominator
by a constant.
2 s2 + 8 s + 6
b2 (s z1) (s z2)
=
s3 + 2 s2 + 4 s (s p1) (s p2) (s p3)
2 (s + 3) (s + 1)
=
(s 0) (s + 1 1.732 j) (s + 1 + 1.732 j)
G (s) =
2 (s + 3) (s + 1)
s (s + 1 1.732 j)
1st
order terms
2 (s + 3) (s + 1)
s (s2 + 2 s + 4)
G p (s) =
The zeros are values of s at which the transfer function goes to zero
(14)
The poles are values of s at which the transfer function goes to infinity
We can plot a pole-zero map:
2 s2 + 8 s + 6
s3 + s s2 + 4 s + 0
G3 (s) =
PZ Map
2 (s + 3)/ (s)
(s2 + 2 s + 4)/ (s + 1)
(15)
imaginary
By clearing the fractions within the fraction, T3 (s) can be expressed in rational
polynomial form
1
0
G3 (s) =
1
2
4
2 (s + 3)/ (s)
(s2 + 2 s + 4)/ (s + 1)
(s) (s + 1)
2 s2 + 8 s + 6
2 (s + 3)(s + 1)
= 3
= 2
(s) (s + 1) (s + 2 s + 4)(s) s + 2 s2 + 4 s
Note the middle form above, which can be called factored form.
2
real
Page 11
Page 12
Section 1.3.5
G (s) =
sm + b
sm1 + b
bm
m1
1 s + b0
ansn + an1 sn1 + + a1 s + a0
(16)
So, for example, the aircraft transfer function from elevator input to pitch
rate gives a type 0 system:
(s)
s+3
=
Me (s) s2 + 4 s + 5
poles : s = 2 1 j ,
type : 0
But the TF from the elevator to the pitch angle gives a type I system:
s+3
(s)
=
Me (s) s (s2 + 4 s + 5)
Section 1.3.5
System Type: A property of transfer functions that comes up often is the system
type. The type of a system is the number of poles at the origin.
G4 (s) =
note: m = 2,
n=1
poles : s = 0, 2 1 j ,
type : I
If we put a PID controller in the loop, which adds a pole at the origin, the
system will be type II.
G4 (s) =
2s2 + 5 s + 4 2 s (s + 1) 3 s + 4
3s +4
1
=
+
= 2 s+
= (2s + 3)+
s+1
(s + 1)
s+1
s+1
s+1
Page 13
Page 14
Section 2.0.0
Section 2.0.0
u(t)
Gp(s)
r(t) + u(t)
y(t)
y(t)
Gp(s)
sensor
(17)
A unit impulse input is a very short pulse with an area under the curve of
the pulse of 1.0.
Since the Laplace transform of a unit-impulse is 1, then the Laplace
transform of the impulse response is the transfer function
Open Loop
Closed Loop
Figure 8: A plant with TF G p (s) in open and closed loop. Closed loop requires a
sensor.
Feedback is the basic magic of controls. A feedback controller can
Make an unstable system stable . . . . . . . . . . . . . . . . . . Helicopter autopilot
Make a stable system unstable . . . . . . . . . . . . . . . . Early fly-ball governors
u(t)
y(t)
t
u(t): impulse
U(s)=1
t
System
Gp(s)
Open loop:
Closed loop:
Figure 7: The transfer function is the Laplace transform of the impulse response.
The connection between the impulse response and TF can be used to
determine the TF
Apply an impulse and measure the output, y (t). Take the LT and use
G p (s) = Y (s).
The connection between the impulse response and TF helps to understand
the mathematical connection between an LT and a TF
Part 1A: Controls Review-By-Example
Y (s)
= G p (s)
U (s)
Page 15
(18)
Y (s)
Forward Path Gain
=
= Try (s)
R (s)
1 + Loop Gain
(19)
Page 16
Mt(t)
+
s+3
s +4s+5
(t)
s+3
G p (s)
(s)
s (s2 +4 s+5)
=
=
R (s) 1 + G p (s) 1 + 2 s+3
s (s +4 s+5)
(20)
(s)
s (s2 +4 s+5)
=
R (s) 1 + 2 s+3
s (s +4 s+5)
s s2 + 4 s + 5
s+3
=
(21)
s (s2 + 4 s + 5) s (s2 + 4 s + 5) + (s + 3)
The closed-loop TF is still not quite in Rat Poly form, here is the final step:
(s)
s+3
=
R (s) s3 + 4 s2 + 6 s + 3
(22)
The open-loop
system is type I
The closed-loop
system is type 0
r(t)
(s)
2.5
1.5
1
Closedloop
(t)
0.5
R(s)
0
0
The response
completely
changes !
, pitchrate
r(t)
Section 2.0.0
oo
p
n
l
Section 2.0.0
O
pe
3
t [seconds]
Figure 11: Open and Closed loop response of the aircraft, the two responses have
very different characteristics.
Page 17
Page 18
Section 2.0.0
e(t)
Kc
Mt(t)
Section 2.1.0
s+3
s2 + 4 s + 5
(t)
0]+Kc*[0 0 1 3])
0]+Kc*[0 0 1 3])
0]+Kc*[0 0 1 3])
3. A sensor
r(t)
e(t)
Controller
KcGc(s) =
Nc(s)
Kc D (s)
c
u(t)
Plant
Gp(s) =
y(t)
Np(s)
Dp(s)
ys(t)
lo
op
The TF is given as
pe
2
O
2.5
, pitchrate
Try (s) =
Kc =10
1.5
Kc =3
Kc Gc G p
Y (s)
Forward Path Gain
=
=
R (s)
1 + Loop Gain
1 + Kc Gc G p Hy
1
Closedloop, Kc =1
Often, for the controls engineer the plant, G p (s), is set (e.g., the designer of
a cruise-control does not get to change the engine size).
0.5
0
0
3
t [seconds]
Figure 13: Open and Closed loop response of the aircraft, with Kc = 1.0,
Kc = 3.0, and Kc =10.0 .
Part 1A: Controls Review-By-Example
Page 19
Page 20
Section 2.2.0
PID
Proportional-Derivative
Prop.-Integral
Prop.-Int.-Deriv.
Gc (s) =
k p s +ki
s
Section 2.3.0
PD
Gc (s) = kd s + k p
Gc (s) =
kd s2 +k p s +ki
s
d(t)
Lead-Lag
Disturbance Filter
Nd
Gd(s) = D
d
(s+z ) (s+z )
Gc = Kc (s+p11 ) (s+p22 )
r(t)
Input Shaping
Hr(s)
Common Applications
PID: Many many places, Astrom has estimated that 80% of controllers are
PID (good, speed accuracy, stability)
Lead-Lag: Used where a pole at the origin is unacceptable, can be as good
as PID (notice, 5 parameters rather than 3)
e(t)
Controller
N
KcGc(s) = Kc Dc
c
uc(t)
Plant
up(t)
Gp(s) =
y(t)
Np
Dp
Sensor Dynamics
Ny
Hy(s) = D
y
ys(t)
PI: Velocity control of motor drives, temperature control (good speed and
accuracy, acceptable stability)
PD: Position control where high accuracy is not required (good speed and
stability, so-so accuracy)
Figure 15: Basic loop with a disturbance input, d (t) , and sensor noise, Vs (t)
added.
In some cases we may want to consider additional inputs and outputs.
Many systems have a disturbance signal that acts on the plant, think of
wind gusts and a helicopter autopilot.
All systems have sensor noise.
Any signal in a system can be considered an output. For example, if we
want to consider the controller effort, uc (t), arising due to the reference
input
Tru (s) =
Hr (s) Kc Gc (s)
Uc (s) Forward Path Gain
=
=
R (s)
1 + Loop Gain
1 + Kc Gc (s) G p (s) Hy (s)
(23)
Page 21
Vs(t)
(24)
Page 22
Section 2.3.0
(25)
The example transfer functions, Eqns (23), (24) and (25) show some
interesting properties. The TFs are repeated here (omitting the many (s)s)
Try (s) =
Hr Kc Gc G p
1 + Kc Gc G p Hy
Tru (s) =
Hr Kc Gc
1 + Kc Gc G p Hy
Ted (s) =
Gd G p Hy (1)
1 + Kc Gc G p Hy
Tvy (s) =
Hy (1) Kc Gc G p
1 + Kc Gc G p Hy
Section 2.3.0
Kc Gc G p
1
=
Kc Gc G p Hy Hy
Tde (s)
Gd G p Hy (1) Gd v
=
Kc Gc G p Hy
Kc Gc
Tru (s)
,
Kc Gc
1
=
Kc Gc G p Hy G p Hy
Tvy (s)
Hy (1) Kc Gc G p
= 1
Kc Gc G p Hy
Try (s) 1/Hy (s) shows that the TF of the plant can be compensated, it
disappears from the closed-loop TF as Kc .
Try (s) 1/Hy (s) also shows that the TF of the sensor can not be
compensated. If the characteristics of Hy (s) are bad (e.g., a cheap sensor)
there is nothing feedback control can do about it !
Tde (s) 1/Kc Gc shows that disturbances can be compensated, as Kc ,
errors due to disturbances go to zero ;)
Tru (s) 1/G p Hy shows that U1 (s) does not go up with Kc , and also, if the
plant has a small gain (G p (s) is small for some s = j ) then a large control
effort will be required for a given input.
Tvy (s) 1 shows that there is no compensation for sensor noise. If there
is sensor noise, it is going to show up in the output !
Summary:
Feedback control can solve problems arising with characteristics of the
plant, G p (s), and disturbances, d (t).
Feedback control can not solve problems with the sensor, Hy (s), or
sensor noise, vs (t) .
Page 23
Page 24
Section 3.0.0
3 Analysis
Section 4.1.0
The performance criteria any controls engineer should be aware of are seen
in table 4.
A real pole gives the terms of Eqn (27), as seen in figure 16.
Amplitude
1
0
(26)
Impulse response
PoleZero Map
()
y (t) = C1 et
2
Imaginary Axis [sec1]
Speed
Degree of Stability Accuracy
Time
Rise Time
Stable / Unstable
Steady-State Error
Domain
Settling Time
Overshoot
ISE ()
IAE ()
Peak Time
Damping Factor
Frequency Pole Locations
Pole Locations
Disturbance Rejection
Noise Rejection ()
Domain
Bandwidth ()
Phase Margin ()
()
()
(Or S-plane) Cross-over Freq.
Gain Margin
Tracking Error ()
Table 4: A range of controller specifications used in industry.
Note: () marks items developed in 2nd semester controls.
3
C1
=
s+2 s+
Faster
h(t) =
t
t/
2 t
e
=e =e
C1 / e
Splane
2
3
2
1
0
1
Real Axis [sec ]
0
0
1
2
Time (secs)
Page 25
The pole-zero constellation does not show either the KDC or the Krlg of
the TF or the amplitude of the impulse response.
Part 1A: Controls Review-By-Example
Page 26
Section 4.1.1
Case:
= 16 [sec1]
= 1/4 [sec]
A complex pole pair gives the terms of Eqn (27), as seen in figure 19.
= 1/16 [sec]
Bc s + (Bc + Bs )
f (t) = et (Bc cos (t) + Bs sin (t))
s2 + s s + 2n
one finds
Y (s)
Faster Decay
5
15
10
5
0
Real Axis [sec1]
y (t)
Figure 17: A change in pole location changes the decay rate and damping.
2 s + 14
b1 s + b0
=
s2 + 2 s + (2 + 2) s2 + 3 s + 18.25
PoleZero Map
0.5
0.5
2
t
0.5
Time (secs)
0
0
0.5
Time (secs)
6 4 2
0
Real Axis [sec1]
t/
=e
1.5t
=e
0
1
5
8
0
0
Impulse response
3
Splane
Amplitude
(27)
Amplitude
20
Section 4.2.0
4 [sec1]
2
0
2
4
Time (secs)
Page 27
Page 28
Section 4.2.1
*
p1, p1
=1.5 j 4
p1
X Case: 1
Case: 4
[sec1]
PO
[Dim less]
44%
[Dim less]
4%
1
0
Real Axis [sec1]
Description
Given by
Units
Decay Rate
Damped Nat. Freq.
Natural Freq.
Pole Angle
Damping Factor
p1 = + j
p1 = + j
2n = 2 + 2
= atan2 (, )
= /n
[sec1]
[rad/sec]
[rad/sec]
[deg]
Dimless, []
4
2
Faster Decay
0
2
4
6
8
4 2
0
2
1
Real Axis [sec ]
0.7
2
0
Amplitude
Polar
2
4
0.9
0.7 0.5 0.3
6 4 2
0
2
1
Real Axis [sec ]
6
8
p1 = + j
p1 = n (90 + )
= n
= sin ()
p
= 1 2 n
= / n
p
n 1 2
H (s) =
H
(s)
=
s2 + 2 n s + 2n
(s + )2 + 2
Table 6: The terms of table 5 relate to rectangular or polar form for the poles.
0.5 0.3
4 0.9
6
Imaginary Axis [sec1]
Splane
p1
= 0.24
46 % Overshoot
0.5
0
0
1.5
Amplitude
or
or d
n
or
[sec1]
6
3
Term
6
4
Section 4.2.2
2
4
Time (secs)
= 0.71
4 % Overshoot
0.5
0
0
2
4
Time (secs)
Page 29
Page 30
Section 4.2.2
X Case: 4 [sec1]
4 [rad/sec]
4%
Faster
Oscillation
0
10
20
0.5 0.3
0.9
20
12
10
0.9
20
20 10
0
10
Real Axis [sec1]
30
0.5
0
0
1
Time (secs)
4%
[Dim less]
4%
5.66 [rad/sec]
10
0
10
20
0.7 0.50.3
20
0.9
10
0
28 20 12
= 0.24
46 % Overshoot
0.5
0.9
20
0.7 0.50.3
30 20 10
0
10
1
Real Axis [sec ]
= 0.71
4 % Overshoot
0.5
0
0
1
Time (secs)
= 0.71
4 % Overshoot
0.5
= 0.25 [sec]
1
Time (secs)
10
0
0
0.71
4 [rad/sec]
20
1.5
Amplitude
1.5
= 0.71
4 % Overshoot
PO
Figure 25: A radial change in pole location changes the decay rate and oscillation
frequency, but not the damping.
Amplitude
Amplitude
1.5
[Dim less]
30 20 10
0
10
1
Real Axis [sec ]
[sec1]
10
28
[sec1]
Case: 16
0.7
20
Imaginary Axis [sec1]
20
30
X Case:
10
PO
5.66 [rad/sec]
Section 4.2.2
Amplitude
= 0.06 [sec]
2
0
0
0.2
0.4
Time (secs)
Page 31
Page 32
Section 4.2.3
b0
b0
=
s2 + s a1 + a0 s2 + 2 n s + 2n
(29)
value
System characteristic
<0
=0
Unstable
Marginally Stable (poles on imaginary axis)
0<<1
giving:
Section 4.2.3
a1
a1
=
=
2 n 2 a0
(30)
As illustrated in figure 24, above, on the range 0.0 < < 1.0, the damping
factor relates to percent overshoot. For a system with two poles and no
zeros, the percent overshoot is given by Eqn (31) and plotted in figure 27
q
P.O. = 100 e / 1 2
(31)
S-plane
Stable Region
( >0 )
Unstable Region
( <0 )
90
80
Percent Overshoot
70
60
50
40
30
20
10
0
0
0.1
0.2
0.3
0.4
0.5
0.6
Damping factor [.]
0.7
0.8
0.9
Figure 27: Percent overshoot versus damping fact. Exact for a system with two
complex poles and no zeros, and approximate for other systems.
Part 1A: Controls Review-By-Example
Page 33
Page 34
Section 4.3.0
Section 4.3.3
Settling time
Peak time
Overshoot
Output y(t)
Output y(t)
ss
0.5
| |
T : 1090%
r
Rise Time
yp
r (1)
ss
2%
4 |
6
8
Ts: 98% Settling Time
tr =
1.8
n
y (1)
ss
1.5
Time [sec]
(32)
|
tp
90
y (0)
0
ss
tp =
Mp
0.5
rss(0) y10
1.8
Overshoot
1
tr =
2nd order:
ts =
0 |
t
10
| 1
t
90
2
Time [sec]
(33)
b0
s2 + 2 n s + 2n
Page 35
Page 36
Section 5.0.0
5 Design
Section 5.2.0
Root locus
Analysis
Completed
Controller
Design
Performance
Specifications
Frequency response
()
Design
Gut feeling
Trial and error
()
Page 37
Page 38
Section 6.0.0
6 Summary
Section 7.0.0
7 Glossary of Acronyms
Every input or output signal of the system has a unique Laplace transform
The ratio of Laplace transforms, however, does not depend on the signals.
The ratio depends only on properties of the system. We call it the transfer
function. For example:
b1 s + b0
Guy (s) = 2
s + a1 s + a0
(34)
Control system
* Steady-state error
* Step response
* Bode plot
Design =Analysis1
Page 39
Page 40
1.3
1.4
1.2.1
1.2.2
10
11
12
21
3.6
22
3.7
3.8
24
3.9
25
26
27
27
4 State, revisited
14
4.1.2
4.1.3
30
31
32
. . . .
35
18
37
2.2
3.1
Admissible signal . . . . . . . . . . . . . . . . . . . . . . . . . .
18
3.2
19
3.3
20
3.4
21
4.1.1
30
16
15
33
4.1
28
2.1
Realizable system . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2.3
3.5
Page 1
7.1
. . . . . . . . . . . . . . . . . .
37
43
45
7.2.1
53
7.1.1
7.2
. . . . . .
Page 2
7.4
59
60
7.3.1
61
7.3.2
. .
64
66
73
73
8.1.1
. . . . . . . . . . . . .
74
8.1.2
77
1 System modeling,
classical vs. state-variable modeling
To introduce state modeling, lets first look at an example. Consider the
RLC circuit of figure 1. The parameters and signals of the circuit are:
Parameters
8.2
Interpreting D . . . . . . . . . . . . . . . . . . . . . . . .
77
78
8.2.1
81
. . . . . . . .
85
9.2
87
9.2.1
. . . . . . . . . .
90
9.2.2
LQR Design . . . . . . . . . . . . . . . . . . . . . . . .
92
volts
amp
volts
amp/sec
amps
volt/sec
Units
Signals
Units
Vs (t)
[volts]
VL (t)
[volts]
iS (t)
[amps]
iL (t)
[amps]
VR (t)
[volts]
VC (t)
[volts]
iR (t)
[amps]
iC (t)
[amps]
iR
+
is
Vs(t)
10 Conclusions
Signals
84
9.1
Units
L
8.1.3
Section 1.0.0
iL
+
L
iC
+
C
VC(t)
95
Page 3
Page 4
Vs(t)
iL
+
Section 1.1.0
iR
is
Section 1.0.0
iC
VC(t)
(1)
Where known quantities are on the right and unknowns on the left.
(2)
In Equation (5) we have unknown signals VC (t) and iL (t) on the left, we
must eliminate one of them, to have one equation in one unknown.
Take the derivative of Eqn (5) to produce iL (t), and use inductor
constituent relation and VC (t) = VL (t) to give:
(3)
VC (t) VL (t) = 0
is (t) iR (t) = 0
iR (t) iL (t) iC (t) = 0
(5)
(4)
1
1
1
VC (t) +
VC (t) + iL (t) =
Vs (t)
RC
C
RC
1
1
1
VC (t) +
VC (t) =
Vs (t)
VC (t) +
RC
LC
RC
(6)
2. State-variable modeling
Page 5
Page 6
Section 1.2.0
Section 1.2.1
x (t) =
VC (t)
iL (t)
Systems generally have many signals. Table 2 shows 8 signals for this
simple circuit. Only 2 are states, and 1 is an input, so 5 are just signals
within the system.
A Deep Property of state variable modeling: all of the signals in the
system have a unique expression in terms of the states and inputs.
If no expression exists, the model does not have enough states, and
If there are multiple possible expressions, the model has redundant
states that should be removed from the state vector.
Examples of using Eqns (1) - (4) to write other signals in terms of the
states, VC (t) and iL (t) and the input Vs (t)
(7)
VL (t) = VC (t)
VR (t) = Vs (t) VL (t) = Vs (t) VC (t)
Starting with differential equations that come directly from the model:
1
VC (t) =
iC (t)
C
(8)
1
iL (t) = VL (t)
L
(9)
Note that the derivative is written on the left, and all signals that
determine the derivative are on the right.
n
o
All signals on the right must be states, VC (t) , iL (t) , or inputs, Vs (t)
1
(Vs (t) VC (t)) iL (t)
R
(10)
1
1
iL (t) = VL (t) = VC (t)
L
L
(11)
Notice that in Eqns (8) and (9), the right hand terms including iC (t) and
VL (t), neither of which is a state or an input.
Part 5: Models of Linear Systems
Page 7
Page 8
Section 1.2.2
Input
u(t)
A, B, C, D
(12)
(13)
(14)
(16)
(17)
VC (t)
iL (t)
1
RC
1
L
C1
VC
x(t)
Output
y(t)
System
The right hand side written with states and inputs as the only signals
1
1
1
VC (t) =
VC (t) iL (t) +
VS (t)
RC
C
RC
1
iL (t) = VC (t)
L
Section 1.2.3
(t) +
1
RC
iL
0
0
h
i VC
(t) + [0] Vs (t)
y (t) =
1 0
iL
Signals
Vs (t)
x (t)
Name
State
Vector
u (t)
(15)
Input
Units
"
[volts]
[amps]
Parameters
#
A=
"
C1
0
"
1
L
B=
[volts]
C=
Vector
y (t)
Output Vector
1
RC
D = [0]
x (t) =
VC (t)
iL (t)
[volts]
[amps]
Name
1
RC
[volts]
x (t0 )
Initial Condition :
System Matrix
Input Matrix
Output Matrix
Feed-forward
Units
i
h
volts/sec
sec1
i amp
h
amps/sec
1
sec
volt
" 1 #
h sec i
amps/sec
volt
[]
volts
amp
[]
i i
Matrix
Table 2: List of parameters and signals of the State-Variable Model. Each of the
seven elements has a name, and each has physical units, which depend
on the details of the system.
Page 9
Page 10
Section 1.3.0
Section 1.4.0
Signal processing
And more
In fact, the only models which can be worked out in a general way are linear.
Many truly nonlinear results are known, but they are applicable only in
specific cases.
Page 11
Page 12
Section 1.4.0
The computational tools to work with vectors and matrices were being
introduced at about the same time
Section 2.0.0
u(t)
y(t)
Aircraft
Outputs:
- Pitch
- Roll
- Yaw
- Velocity
Inputs:
- Aileron
- Rudder
- Elevator
- Throttle
Starting Point
What is a system ?
What are the properties of a system ?
Page 13
Page 14
Section 2.1.0
Section 2.2.0
System
N{}
u(t)
.y(t)
+
+
u(t)
y(t)
Vc(t)
Space of All
Possible Input Signals
Space of All
Possible Output Signals
1+(t)
y(t) = N [u(t)]
(18)
0 t<0
u(t) = 1+ (t) =
1 t0
Components
Signals
Rocket, engine,
v(t) , (t)
Rocket Guidance
steering hydraulics
(t) , (t)
(19)
t=0
y1 (t) = 1 e RC t
y2
1
(t) = 1 + 2 e RC t
t >0
t >0
Economy
Biosphere
Part 5: Models of Linear Systems
Page 15
Page 16
Section 2.2.0
Section 3.1.0
2.5
2
y (t)
y(t)
1.5
Characteristic
* Admissible
* Linear
* Time Invariant
* Causal (Non-anticipative)
* Realizable
* Lumped
* Continuous
* Discrete
* Quantized
* Deterministic
y (t)
0.5
0
0
0.5
1.5
Time [sec]
Signal System
Write:
y(t) = N [u(t), x(t0 )]
(20)
ii)
t0
iii)
The selection of state variables is not unique (more on this and state-variable
transformations later)
iv)
u (t) is a vector of the correct dimension (e.g., for aircraft inputs [aileron,
rudder, elevator, throttle], u (t) R4).
Page 17
s.t.
u (t) 0 t t0
( :
there exists;
for all)
Page 18
Section 3.2.0
Section 3.3.0
System: a system is linear if and only if (iff) it obeys the superposition rule (which
incorporates scaling and homogeneity).
A system is time invariant if a time shifted input gives the time-shifted output.
Given:
Given:
y = N [u]
y1 = N [u1]
y2 = N [u2 ]
N [u (t T )] = y(t T )
and
Examples:
u3 = c1 u1 + c2 u2
Then:
y3 = c1 y1 + c2 y2
Or
Related:
Scaling:
N [c1 u1 ] = c1 y1
Homogeneity:
N [0] = 0
Page 19
Page 20
Section 3.5.0
Section 3.6.0
Causal Example:
iR
y(t) = 2 u(t 1)
is
Vs(t)
iL
+
iC
+
VC(t)
y(t) = 2 u(t + 1)
Figure 7: An RLC circuit.
When the frequency is not too high, the circuit of figure 7 is characterized
by:
1
1
1
vc (t) +
(21)
vc (t) +
vc (t) =
vs (t)
RC
LC
RC
When the frequency is high enough wave phenomena become important
At some high frequency, lumped parameter models break down
Page 21
Page 22
Section 3.7.0
Section 3.8.0
and systems
x(t)
= 2 x(t) + 3 u(t)
(22)
y(t) = x(t)
0.9
0.8
0.7
u(t)
0.6
0.5
0.4
0.3
0.2
0.1
0
0
0.5
1.5
Time [sec]
2.5
xk = 2 xk1 1 xk2 + 3 uk
u (t) = 0.5 + 0.2 cos t/3 +
6
+0.2 cos (2t/3)
+0.2 cos (2t + )
yk = xk
t (k) =
0.3
0.6
0.9
1.2
1.5
1.8
2.1
2.4
(23)
u (k) =
0.805
0.297
0.235
0.400
0.128
0.0937
0.5247
0.528
Page 23
Usage: generally we say sampled signal and discrete system, though all
combinations are sometimes seen.
Any computer-based data acquisition results in sampled signals; any
computer-based signal processor is a discrete system
Some mathematical results are more straight-forward or intuitive (or
possible) for one time or the other.
Page 24
Section 3.9.0
Section 3.10.0
if t t1 ,
then
u (t) u (t1 )
(25)
N [u ] = lim N [ui ]
(26)
then
i
Page 25
Page 26
Section 3.12.0
Section 4.0.0
4 State, revisited
Deterministic signal:
u(t) = 1+ (t)
y1 (t) = 1 e RC t
Case 1: vc (t = t0 ) = 0 [volts]
Non-deterministic signal:
y2
1
(t) = 1 + 2 e RC t
t >0
t >0
System: A deterministic system does not introduce random components into the
output signals
System
2.5
R
+
2
u(t)
Vc(t)
RLC circuit
y (t)
y(t)
y(t)
Deterministic:
1.5
y (t)
0.5
Non-deterministic:
0
0
0.5
economy,
1
Time [sec]
Page 27
Page 28
1.5
Section 4.0.0
Section 4.1.1
Examples of states
Elementary dynamics:
Circuits:
4.1.1 For direct application of Superposition and Scaling, state must be zero
Fluid system:
Economy:
For superposition and scaling to apply to a system in the simple way, the
internal states must be zero, consider:
y (t) = N [u (t) , x (t0 )] = u (t) + x (t0 )
(28)
so with u3 = u1 + u2
(29)
(30)
d Amount Stored
= f (x, u,t)
dt
The definition of the states of a system is not unique, consider analyzing
a circuit for a voltage, or for a current.
Keep in mind that the state variables must be independent. Consider the
circuit of figure 11
R1
iL1(t)
(31)
L1
Va (t)
iL2(t)
L2
Figure 11: Circuit with inductors in series. This system has only one state, iL1 (t) .
Part 5: Models of Linear Systems
Page 29
Page 30
Section 4.1.2
Definition:
Then system N [] is linear if and only if, for any two admissible inputs
signals u1 and u2 , and for any scalar k,
k (N [u1, x (t0 )] N [u2 , x (t0 )]) = N [k (u1 u2) , 0 (t0)]
Section 4.1.3
x (t0 ) Rn
(32)
(33)
NT (u (t)) = u (t T ) .
(34)
Interpretation:
Eqn(33) says that there exists a possibly different initial condition x1 (t + T )
such that the delayed output of the original system with IC x (t0 ) is identical
to the output of the system with a delayed input and the new IC x1 (t + T ) .
Study question:
For a linear time-invariant system, what is the relationship between x (t0 )
and x1 (t0 + T )
Page 31
Page 32
Section 5.0.0
Section 5.0.0
The notation for a state model depends on its properties, whether it is linear
or nonlinear, time invariant or time varying, continuous or discrete, etc.
Most general continuous case, nonlinear and time varying
State equation:
(35)
Output equation:
(36)
(41)
(42)
The discrete-time system does not have derivatives, the system equation
gives x (k) at the next sample instant:
x (k + 1) = A x (k) + B u (k)
(43)
(44)
all models have x (t0 ) as the IC. Also, see DeCarlo example, Eqn (1.24).
For the nonlinear, time invariant system, time is no longer an argument of
f () and g ()
State equation:
(37)
(45)
Output equation:
(38)
(46)
(40)
nx1
u(t)
+
B
nxm
n: number of states
m: number of inputs
p: number of outputs
x(t)
px1
y(t)
=
C
pxn
u(t)
+
D
pxm
mx1
Output equation:
(39)
A
nxn
nx1
State equation:
x(t)
mx1
.
x(t)
nx1
Page 33
Page 34
Section 6.0.0
Section 6.0.0
(c) All signals on the right-hand side must be expressed in terms of the states
and inputs
4. Write the equation of the output signal (or signals) using the states and
inputs
(c) Record the units, verify that units balance in the equations
5. Check units throughout, to verify correctness.
The equations express laws of physics, the units must balance
Essential things to keep in mind:
Signals are functions of time and change when the input (signals) change.
Parameters are generally constant (or slowly varying) and are
properties of the system.
Both have physical units
2. Pay special attention to the states
Page 35
Page 36
Section 7.1.0
Section 7.1.0
v1(t)
Is(t)
d
Vc (t)
dt 1
d
VL1 (t) = L1 IL1 (t)
dt
IR1(t) VR1(t)
+
R1
Ic1 (t) = C1
IL1(t) VL1(t)
v2(t)
+
Ic1(t)
L1
+
+
VIs(t)
Vc1(t) C1
IR2(t)
+
VR2(t)
R2
(c) Record the units, verify that units balance in the equations
Signals
Is (t)
IR1 (t)
Sup. current
[Amps]
Vs (t)
Sup. voltage
Parameters
[volts]
R1 voltage
[volts]
R1 , R2
Resistance
VR2 (t)
R2 voltage
[volts]
C1
Capacitance
Vc1 (t)
C1 voltage
[volts]
L1
Inductance
VL1 (t)
L1 voltage
[volts]
R1 current
[Amps]
VR1 (t)
IR2 (t)
R2 current
[Amps]
Ic1 (t)
C1 current
[Amps]
IL1 (t)
L1 current
[Amps]
i
volts
amp
h
i
amp-sec
h volt i
volt-sec
amp
Ic1 (t) = C1
d
Vc (t)
dt 1
[amps] =
VL1 (t) = L1
d
IL (t)
dt 1
[volts] =
h amp-sec i volt
volt
second
volt-sec h amp i
amp
second
Page 37
Page 38
Section 7.1.0
(a) Higher order differential eqns are written as a chain of first-order eqns.
(b) Put derivative in the left-hand side, these must be the state derivatives
Vc1 (t)
x (t) =
IL1 (t)
x2 (t) =
VR1 (t)
IR2 (t)
x3 (t) =
1
d
Ic (t)
Vc (t) =
dt 1
C1 1
1
d
VL (t)
IL (t) =
dt
L1 1
(47)
VIs (t)
VR2 (t)
(48)
(49)
This step shows why Vc1 (t) and IL1 (t) are natural choices for the
states.
Section 7.1.0
(c) All signals on the right-hand side must be expressed in terms of the states
and inputs
Later, we will see how to convert the state model into a state model
with any of these state vectors.
If we wanted a model based on x3 (t), it is probably easiest to derive
the model based on the physical coordinates, Eqn (47), and then
make a change of basis to transform the model to x3 (t).
Illegal choices
In Eqn (48) we need to express Ic1 (t) in terms of {Vc1 (t) , IL1 (t) , Is (t)}
This involves using the constituent and continuity equations that
describe the system.
From
=
=
x4 (t) =
VR1 (t)
IR1 (t)
, x5 (t) =
Vc1 (t)
VR2 (t)
VL1 (t) = VR1 (t) = R1 IR1 (t) = R1 (Is (t) IL1 (t))
Using Eqns (50) and (51) in Eqns (48) and (49)
x6 (t) =
Vc1 (t)
Is (t)
(51)
Page 39
d
1
1
1
(Is Vc1 (t) /R2) =
Vc (t) + 0 IL1 (t) + Is (t)
Vc (t) =
dt 1
C1
C1 R2 1
C1
R1
R1
1
d
R1 (Is (t) IL1 (t)) = 0Vc1 (t) IL1 (t) + Is (t)
IL (t) =
dt
L1
L1
L1
Part 5: Models of Linear Systems
(Revised: Sep 10, 2012) Page 40
Section 7.1.0
d Vc1 (t) C11R2 0 Vc1 (t)
=
+
x (t) =
dt IL (t)
0
RL11
IL1 (t)
1
1
C1
R1
L1
[volts/sec]
[volts]
, x (t) :
x (t) :
[amps/sec ]
[amps ]
(52)
Is (t)
sec1
A:
1 ,
sec
x (t) =
Vc1 (t)
IL1 (t)
A=
C11R2
0
0
RL11
4. Write the equation of the output signal (or signals) using the states and
inputs
Suppose the output were VR1 (t). In Eqn (51) we have already derived
that VR1 (t) = R1 (Is (t) IL1 (t)), so
y (t) =
0 R1
Vc1 (t)
IL1 (t)
0 R1
h h
i i [volts]
volts
+ volts [amps]
[volts] = amp
amp
[amps ]
Units check in the output equation.
We need to find a way to express Vs (t) in terms of the states and inputs,
{Vc1 (t) , IL1 (t) , Is (t)}. Going back to the original equations,
, D = [R1 ]
h
i
volt
sec1
[volts/sec]
[volts]
=
+ amp-sec
1
1 [amps]
sec
[amps/sec ]
[amps ]
sec
Notice, the output is made up of a signal, and the output and feed-forward
matrices are made up of parameters.
Part 5: Models of Linear Systems
1
C1
R1
L1
i
volt
amp-sec
B:
1
sec
h
+ [R1 ] Is (t)
B=
Notice, the state and input are made up of signals, and the system and
input matrices are made up of parameters.
Section 7.1.0
Page 41
Vs (t) = VR1 (t) +Vc1 (t) = R1 (Is (t) IL1 (t)) +Vc1 (t)
(53)
Page 42
Section 7.1.1
Section 7.1.1
(54)
a =
with
C =
1 R1
, D = [R1 ]
x1
x2
x1
-500
0
y1
x1
0
x2
0
-1000
b =
x1
x2
(55)
c =
A deep property of state models: just as with Eqns (54) and (55) we can find
a row for the C and D matrices to give any signal in the system.
x2
-100
d =
u1
y1 100
Continuous-time model.
>>
>>
>>
>>
%%
R1
R2
L1
C1
Bode Diagram
Step Response
40
100
30
Magnitude (dB)
90
80
Amplitude
70
10
0
50
10
90
Phase (deg)
40
30
20
60
20
u1
1e+05
1000
Page 43
45
10
0
3
Time (sec)
6
3
x 10
0
1
10
10
10
Frequency (rad/sec)
10
10
Page 44
Section 7.2.0
zv(t)
vcar
ks
bs
m1
zw(t)
kw
Road Surface
r(t)
m1
kw
wheel mass
[kg]
ks
i
Newtons
h meter i
Newtons
Suspension damping meter/sec
Suspension stiffness
[kg]
bs
i
Newtons
tire stiffness
meter
Table 5: Parameters of the mechanical quarter suspension.
h
F (t) = m x (t)
(56)
Hooks law:
(57)
Damper Eqn:
(58)
ii. Continuity constraints (for how elements are linked into a system)
Inerial Reference
Section 7.2.0
Signals
zv (t)
Height of vehicle
[m]
zw (t) Height for tire center [m]
Page 45
Page 46
Section 7.2.0
Section 7.2.0
Forces on wheel
Forces on 1/4 vehicle
(59)
(60)
zw (t) =
zw (t)
zw (t)
x (t) =
zv (t)
zv (t)
[m]
[m/sec]
[m]
[m/sec]
zw (t)
zv (t) =
i
zw (t)
+ [__] r (t)
__ __ __ __
zv (t)
zv (t)
(61)
Page 47
zw (t)
zw (t)
d x (t)
=
x (t) =
dt
zv (t)
zv (t)
- The system order will almost always be sum of the orders of the
contributing differential equations -
(63)
(62)
zw (t)
i
zw (t)
+[kw ] r (t)
+bs /m1
zv (t)
zv (t)
(64)
z (t)
w
i
zw (t)
+ [0] r (t)
bs /m2
zv (t)
zv (t)
(65)
(Revised: Sep 10, 2012)
Page 48
Section 7.2.0
Eqns (64) and (65) gives two of the rows of the A matrix.
zw (t) =
zw (t)
d x (t)
=
x (t) =
dt
zv (t)
zv (t)
zw (t)
zw (t)
i
zw (t)
+ [__] r (t)
__ __ __ __
zv (t)
zv (t)
zw (t) =
Likewise
z (t)
i
zw (t)
+ [0] r (t)
0 1 0 0
zv (t)
zv (t)
zw (t)
h
i
zw (t)
+ [0] r (t)
zv (t) = 0 0 0 1
zv (t)
zv (t)
Part 5: Models of Linear Systems
Page 49
Section 7.2.0
0
1
0
0
(kw +ks )
bs
ks
m1 + m1 + mbs1
m1
x (t) =
0
0
0
1
ks
bs
ks
+ m2 m2 mbs2
+ m2
(66)
0
z (t)
zw (t) mkw
+ 1 r (t)
zv (t) 0
zv (t)
0
4. Write the equation of the output signal (or signals) using the states and
inputs
If the output of interest is the vehicle response
y1 (t) = zv (t) =
zw (t)
i
zw (t)
+ [0] r (t)
0 0 1 0
zv (t)
zv (t)
(67)
Suppose the desired output is the force in the suspension spring. Since
Fs (t) = ks (zw (t) zv (t))
The output equation is given as:
y2 (t) = Fs (t) =
ks 0 ks
zw (t)
i
zw (t)
+ [0] r (t)
zv (t)
zv (t)
(Revised: Sep 10, 2012)
(68)
Page 50
Section 7.2.0
Suppose the desired output is the road force on the tire. Since
Section 7.2.0
y3 (t) = Fw (t) =
kw
zw (t)
kw
:
m1
i
zw (t)
+ [kw ] r (t)
0 0 0
zv (t)
zv (t)
(69)
y (t) = Fs (t)
Fw (t)
zw (t)
0 0 1 0
zw (t)
= ks 0 ks 0
zv (t)
kw 0 0 0
zv (t)
(70)
kg-m 1
sec2 m
kg-m 1
sec2 m/s
1
kg
1
kg
=
=
i
h
sec2
i
h
sec1
bs
:
m2
0
+ 0
r (t)
kw
[]
[1]
[]
[]
[m/sec]
1 2 1
sec2
m/sec2
sec
sec
sec
=
x (t) :
[]
[m/sec]
[]
[]
[1]
1 2 1
2
2
sec
sec
sec
m/sec
sec
[]
sec2
[m]
+
[]
[]
Page 51
[m/sec]
[m]
[m/sec]
Units check !
[m]
Page 52
Section 7.2.1
%%
%%
%%
%%
%%
N/m
N/m
N/m/s
kg
kg
>> A = [ 0
1
0
0
-(kw+ks)/m1 -bs/m1
ks/m1
bs/m1
0
0
0
1
ks/m2
bs/m2 -ks/m2 -bs/m2 ]
>> B = [ 0; kw/m1; 0 ; 0]
>> C1 = [ 0, 0, 1, 0];
D1 = [0]
>> SSmodel2a = ss(A, B, C1, D1)
%% Fast mode
%% Lightly damped mode
%% Slow mode
Bode Diagram
Step Response
50
1.8
Magnitude (dB)
kw
ks
bs
m1
m2
1.6
Amplitude
1.4
50
100
1.2
150
200
0
0.8
Phase (deg)
>>
>>
>>
>>
>>
Section 7.2.1
0.6
0.4
90
180
0.2
0
a =
b =
x1
x2
x3
x4
x1
0
-500
0
10
x2
1
-400
0
40
x3
0
100
0
-10
c =
x4
0
400
1
-40
x1
x2
x3
x4
u1
0
400
0
0
d =
y1
x1
0
x2
0
x3
1
x4
0
y1
u1
0
6
Time (sec)
10
12
14
270
1
10
10
10
10
Frequency (rad/sec)
10
10
rho =
1.0000
0.0687
0.0687
1.0000
Continuous-time model.
Part 5: Models of Linear Systems
Page 53
Page 54
Section 7.2.1
%%
kw
ks
bs
m1
m2
2nd parameter
= 10000
%%
= 1000
%%
= 1000
%%
= 25
%%
= 250
%%
set
N/m
N/m
N/m/s
kg
kg
%% Softer spring
%% Softer shock absorber
x1
x2
x3
x4
x1
0
-440
0
4
x2
1
-40
0
4
x3
0
40
0
-4
x4
0
40
1
-4
%% Fast Mode
%% Oscillatory mode,
%%
now alpha>omega
%% Slow mode
The slow mode is faster, the fast mode is much slower, and the oscillatory
mode is better damped
>> A = [ 0
1
0
0
-(kw+ks)/m1 -bs/m1
ks/m1
bs/m1
0
0
0
1
ks/m2
bs/m2 -ks/m2 -bs/m2 ]
>> B = [ 0; kw/m1; 0 ; 0]
>> C1 = [ 0, 0, 1, 0]; D1 = [0]
>> SSmodel2b = ss(A, B, C1, D1)
a =
Section 7.2.1
b =
x1
x2
x3
x4
Z =
1.0000
0.9724
0.9724
1.0000
u1
0
400
0
0
Step Response
50
1.4
x3
1
x4
0
d =
y1
u1
0
50
100
Continuous-time model.
0.8
150
0
0.6
Phase (deg)
x2
0
Amplitude
y1
x1
0
Magnitude (dB)
1.2
c =
0.4
0.2
0.5
1.5
Time (sec)
2.5
3.5
90
180
270
1
10
10
10
Frequency (rad/sec)
10
10
Page 55
Page 56
Section 7.2.1
A, B, C, D
Section 7.2.1
zv(t)
Fs(t)
y(t)
Transfer function:
1600 s + 1600
-------------------------------------s^4 + 44 s^3 + 444 s^2 + 1600 s + 1600
x(t)
Fw(t)
n: states
m: inputs
p: outputs
mxp: TFs
x1
0
-440
0
4
x1
0
1000
-1e+04
x2
1
-40
0
4
x3
0
40
0
-4
x2
0
0
0
x3
1
-1000
0
x4
0
40
1
-4
b =
x1
x2
x3
x4
x4
0
0
0
u1
0
400
0
0
d =
y1
y2
y3
u1
0
0
1e+04
Continuous-time model.
Part 5: Models of Linear Systems
Page 57
#2:
#3:
Page 58
Section 7.2.2
equation
Given a differential equation, such as
Step Response
1.5
0.5
0
To: Out(2)
(71)
T (s) =
1000
Amplitude
Section 7.3.0
To: Out(1)
b2 s2 + b1 s + b0
3
a3 s + a2 s2 + a1 s + a0
(72)
500
A. In Matlab
500
>> num = [b2, b1, b0]; den = [a3, a2, a1, a0]
>> TFmodel = tf(num, den);
>> SSmodel = ss(TFmodel)
To: Out(3)
10000
5000
0
0.5
1.5
2
Time (sec)
2.5
3.5
First, the Diff Eq must be monic. That means that the an coefficient is 1.0
It is straight forward to
test various parameter configurations
Page 59
Page 60
Section 7.3.1
Section 7.3.1
(74, repeated)
Parameters
h
i
1
y
Signals
a2 Coefficient sec
b2 Coefficient
u sec
h
i
y (t) Output y
y
a1 Coefficient sec2 b1 Coefficient
2
u (t) Input u
h u sec i
y
a0 Coefficient sec3 b0 Coefficient
u sec3
Table 7: Signals and Parameters for the Differential Equation.
Units result from
dividing through by a3 , which has units of sec3 .
3rd order
(b) Select the state variables
Considering Eqn 74, select the state variables to be the output variable
and its derivatives up to the n 1 derivative
y(t)
B(s)
A(s)
(a) Original TF
u(t)
1
A(s)
z(t)
(76)
The derivative of the last phase variable is given by Eqn (74), re-written
as Eqn (77) (cf. Bay Eqn (1.25))
(74)
(75)
x1 (t)
x (t) = x2 (t)
x3 (t)
(c) Record the units, verify that units balance in the equations
See table 7.
(Revised: Sep 10, 2012)
x (t) = z (t)
z(t)
z (t)
y(t)
B(s)
z (t)
x (t) = z (t)
,
z (t)
Page 61
z (t)
= z (t)
z(t)
= 0
0
1
a0 a1 a2
z (t)
z (t)
z (t)
(77)
+ 0 u (t)
1
(78)
Page 62
Section 7.3.1
(75, repeated)
4. Write the equation of the output signal (or signals) using the states and
inputs
z (t)
h
i
z (t)
x (t) : u-sec2
u-sec3
(Note: Bays development includes a b3 term. Eqn (1.25) show how the b3
term is incorporated).
z (t)
x (t) = z (t)
z (t)
[u]
x (t) : u-sec1
u-sec2
[]
1
[]
A : []
[]
1
2 1
3
sec
sec
sec
C:
h
y
u
i h
y-sec
u
i
y-sec2
u
[]
B : []
sec3
y
u
y
u
i h
[]
[]
[u]
= []
u-sec1
[]
1
2 1
u-sec2
sec
sec
sec3
[]
+ [] [u]
sec3
y-sec
u
i
[u]
y-sec2
u-sec1
u
u-sec2
Page 63
>> a2 = 5; a1 = 7; a0=8;
>> b2= -2; b1 = 3; b0 = 4;
>> A = [ 0
1
0 ;
0
0
1;
-a0, -a1, -a2];
>> B = [ 0;0; 1];
>> C = [ b0, b1, b2];
D = 0;
y
+ [u]
D:
y (t) : [y] =
h
Section 7.3.2
Page 64
Section 7.3.2
x1
x2
x3
x1
0
0
-8
x2
1
0
-7
x3
0
1
-5
b =
u1
0
0
1
x1
x2
x3
Bode Diagram
Step Response
10
1.2
0
Magnitude (dB)
a =
y1
x1
4
x2
3
x3
-2
d =
u1
0
y1
0.8
10
20
30
Amplitude
c =
Section 7.4.0
0.6
40
360
Phase (deg)
0.4
0.2
0.2
4
5
Time (sec)
270
180
90
1
10
10
10
10
Frequency (rad/sec)
1.5
b3
y(t)
Imaginary Axis
0.5
b1
b2
b0
u(t)
0.5
.
x3
.
x2
x3
x2
.
x1
x1
1.5
4
-a2
Real Axis
-a1
-a0
a3=1
Page 65
Page 66
Section 7.4.0
Integrators, gain blocks and summing junctions are built with Op-Amps
C1
Integrators:
Vin(t)
+
iR1(t)
R1
V-(t)
V+(t)
Gain Blocks:
Rf
Vin(t)
Vo(t)
Ra
V+(t)
(105..107),
iRf(t)
+
Vol(t)
V (t)
iRa(t)
Section 7.4.0
iC1(t)
V (t) V + (t)
V0 (t) =
Rf
Vin (t)
Ra
(83)
Summing junctions:
Rf
(80)
(81)
Va(t) i
Ra
Ra
+
Vb(t) i
Rb
V-(t)
Rb
V+(t)
iRf
+
Vol(t)
d
1
d
1
Vin (t) +C1 Vo (t) = 0 , Vo (t) =
Vin (t)
R1
dt
dt
R1 C1
Giving
Vo (t) =
Part 5: Models of Linear Systems
Z t
t0
1
Vin (t) dt
R1 C1
(Revised: Sep 10, 2012)
(82)
Page 67
V0 (t) =
Part 5: Models of Linear Systems
Rf
Rf
Va (t) + Vb (t) + ...
Ra
Rb
(Revised: Sep 10, 2012)
(84)
Page 68
Section 7.4.0
Z t
t0
1
Vin (t) dt
R1 C1
Section 7.4.0
Returning to the simulation diagram, we can write down the state model
directly from the simulation diagram (and vice-versa)
(82, repeated)
b3
In each of Eqns (82), (83) and (84) the output voltage is inverted relative
to the input voltage.
This is an inherent property of the virtual ground configuration.
b1
b2
u(t)
.
x3
.
x2
x3
x2
y(t)
b0
.
x1
x1
-a1
-a0
a3=1
(Controllable Canonical Form, Notation follows Bay)
Parameters
b0..b3 Numerator Coefficients
a0..a2 Denominator Coefficients
Page 69
Page 70
Section 7.4.0
b3
b1
b2
u(t)
.
x3
.
x2
x3
-a2
x2
y(t)
.
x1
-a1
y3(t)
b3
b0
Section 7.4.0
b1
b2
x1
u(t)
.
x3
.
x2
x3
-a0
-a2
a3=1
b0
.
x1
x2
y(t)
x1
-a1
-a0
a3=1
(Controllable Canonical Form, Notation follows Bay)
(85)
x2 (t) = x3 (t)
(86)
x (t)
1
x (t) = x2 (t)
x3 (t)
(87)
(88)
0
1
0
= 0
0
1
a0 a1 a2
x (t)
1
x2 (t)
x3 (t)
0
+ 0 u (t) (89)
1
4. Write the equation of the output signal (or signals) using the states and
inputs (cf. Bay Eqn (1.25))
3rd order
x1 (t)
x (t) = x2 (t)
x3 (t)
y (t) =
x (t)
i 1
x3 (t)
(90)
+ [b3] u (t)
(91)
Page 71
Page 72
Section 8.1.0
Section 8.1.1
8.1.1 InterpretingYthe
(s)transfer function
= C (s I A)1 B+D
U (s)
(96, repeated)
Eqn (96) can be solved symbolically by Cramers rule, to give the symbolic
transfer function.
Recall from basic linear algebra that Cramers rule gives the matrix
inverse as:
1
U 1 =
adj U
(97)
det U
Where U is an n n matrix, and adj U is the adjugate of matrix U.
Defining
(98)
adj U = V T
(99)
Then
(92)
(93)
(s I A) X (s) = B U (s)
Examples:
or
X (s) = (s I A)1 B U (s)
(94)
(95)
If m = 1 (one input) and p = 1 (one output), then Eqn (95) gives the transfer
function:
Y (s)
= C (s I A)1 B + D
(96)
U (s)
Mi, j is the i, jth minor of matrix U and is the determinant of the matrix by
removing the ith row and jth column from U.
Page 73
U2 =
a b
c d
a b c
U3 = d e f
g h i
adj U2 =
e f
+
h i
adj U3 =
..
.
b c
h i
...
Page 74
Section 8.1.1
(s I A)
It follows that
Section 8.1.1
Multiplying out
adj (s I A)
=
det (s I A)
h
1
Y (s)
= 2
U (s) s + 7 s + 10
(100)
Y (s)
1
=
C adj (s I A) B + D
U (s) det (s I A)
(101)
2 s + 19
3s +6
= 28 s + 131
s2 + 7 s + 10
(103)
Today, we wouldnt want to apply Cramers rule by hand for any case larger
than 3x3.
Under the hood, this is how Matlab finds the TF from a state-variable model.
Example
A=
C=
B=
2
3
D = [0]
>> A = [ -2 3 ; 0 -5] B = [ 2 ; 3 ] C = [ 5
>> SSmodel = ss(A, B, C, D)
>> tf(SSmodel)
Transfer function:
Then
(s + 2)
(s + 5)
= (s + 2)(s + 5) 0 = s2 + 7 s + 10
(s + 2)
(s + 5)
h
Y (s)
1
= 2
U (s) s + 7 s + 10
(s + 5)
(s + 2)
i (s + 5)
3
2
+ [0] (102)
6
0
(s + 2)
3
(Revised: Sep 10, 2012)
Page 75
6 ] D = 0
28 s + 131
-------------s^2 + 7 s + 10
Note:
The denominator is given by det (s I A), showing the the poles are the
eigenvalues of the A matrix.
The B, C, and D matrices play no role in determining the poles, and thus
the stability
If we had additional inputs (additional columns in B) or outputs (additional
rows in C) the term
C adj (s I A) B
would give an array of numerator polynomials, one for each input/output
pair.
Part 5: Models of Linear Systems
Page 76
Section 8.1.3
s j 0
Section 8.2.0
KDC = lim
Y (s)
= lim C (s I A)1 B + D = C (A)1 B + (D104)
U (s) s j 0
C A1 B + D (105)
(106)
(107)
8.1.3 Interpreting D
z (t) = T x (t)
(108)
If D =0 , then
We can say that we have transformed the system from the coordinate
system of x (t) to the coordinate system of z (t).
x (t) = T 1 z (t)
x (t) = T
z (t)
(109)
(110)
Plugging (108) and (109) into Eqns (106) and (107) gives
T 1 z (t) = A T 1 z (t) + B u (t)
(111)
T A T 1 z (t) + T B u (t)
y (t) = C T
Part 5: Models of Linear Systems
Page 77
(112)
z (t) + D u (t)
(Revised: Sep 10, 2012)
Page 78
Section 8.2.0
b z (t) + Bb u (t)
z (t) = A
b = T A T 1
A
(113)
with
Section 8.2.0
(114)
b = T A T 1
A
(115)
Cb = C T 1
(117)
Bb = T B
b
eig (A) = eig A
The poles of system II are the same as the poles of the original system.
(116)
D : unchanged
(118)
We can convert a given model with x (t) to an equivalent model with z (t)
by choice of any invertible matrix T
u(t)
A, B, C, D
y(t)
u(t)
A, B, C, D
x(t)
y(t)
z(t)
Page 79
Page 80
Section 8.2.1
zv(t)
If our interest was such that we wanted a state model with zs (t) and zs (t)
directly as states, we could introduce the transformation
vcar
ks
bs
m1
zs (t)
kw
r(t)
Inerial Reference
zw (t)
,
x (t) =
zv (t)
zv (t)
1 0 1
x (t) =
y1 (t) = zv (t) =
(kw +ks )
m1
mbs1 + mks1
+ mks2
+ mbs2
mks2
zw (t)
kw
m
+ mbs1
x (t) + 1 r (t)
0
1
0
mbs2
1
0
zw (t)
1 zw (t)
= T x (t)
0 zv (t)
zv (t)
1
(120)
(119)
a =
x1
x2
x3
x4
c =
y1
Page 81
1 0 1
0
1
0
i
zw (t)
+ [0] r (t)
0 0 1 0
zv (t)
zv (t)
0 1
T =
0 0
0 0
zs (t) 0 1
=
z (t) =
zv (t) 0 0
zv (t)
0 0
zw(t)
Road Surface
Section 8.2.1
x1
0
-440
0
4
x1 x2
0
0
x2
x3
1
0
-40
40
0
0
4
-4
x3 x4
1
0
x4
0
40
1
-4
b =
x1
x2
x3
x4
d =
y1
u1
0
400
0
0
u1
0
Page 82
Section 8.2.1
x1
x2
x3
x4
c =
y1
x1
0
-444
0
4
x1 x2
0
0
x2
x3
1
0
-44 -400
0
0
4
0
x3 x4
1
0
x4
0
0
1
0
b =
u1
0
400
0
0
u1
0
x1
x2
x3
x4
d =
y1
Output
y(t)
x(t)
Figure 33: State-variable model of the open-loop system. This is the plant before
feedback control is applied, u (t) as input, and y (t) as output.
r(t)
r(t)
Nf
u(t)
y(t)
x(t)
x(t)
-K
Bode Diagram
Step Response
(121)
The control signal depends on the state vector and a reference input.
Section 9.0.0
50
1.4
New System
0
Magnitude (dB)
1.2
Figure 34: State-variable model of the closed-loop system with feed-forward gain
in input. The closed-loop system has r (t) as input and y (t) as output.
50
Amplitude
100
0.8
150
0
Phase (deg)
0.6
0.4
0.2
r(t)
90
0.5
1.5
Time (sec)
2.5
3.5
270
1
10
10
10
Frequency (rad/sec)
10
Of course, the step and frequency response are unchanged. The model
transformation changes only the internal representation of the system.
(Revised: Sep 10, 2012)
x(t)
10
y(t)
180
Page 83
Figure 35: State-space model of the closed-loop system, with r (t)as input and
y (t) as output.
Feedback control fundamentally transforms the system. Changing the statevariable model from figure 33 to 35.
Part 5: Models of Linear Systems
Page 84
Section 9.1.0
Section 9.1.0
(16, repeated)
(17, repeated)
So we can write
y (t) = Ccl x (t) + Dcl r (t)
(125)
Ccl = C p D p K
(126)
Dcl = D p N f
(127)
with
(121, repeated)
= (A p B p K) x (t) + B p N f r (t)
So we can write
(122)
Acl = A p B p K
(123)
Bcl = B p N f
(124)
with
Page 85
Page 86
Section 9.2.0
Section 9.2.0
(t)
Ff=B z(t)
z (t)
0
Ap =
z (t)
,
x (t) =
(t)
(t)
z(t)
F(t)
(I+m l 2 )
p
Bp =
ml
p
Cp =
(I+m l 2 ) b
p
( m2 g l 2 )
mpl b
m g l (M+m)
p
1 0 0 0
0 0 1 0
Dp =
0
0
Parameters
Mass of cart
[kg]
z (t)
Cart position
[m]
Mass of pendulum
[kg]
(t)
Pendulum Angle
[deg]
Length of Pendulum
F (t)
Applied force
[N]
Friction coef.
Inertial of pendulum
g = 9.8
Accel. of gravity
[m]
kg m
2
[m/s2 ]
N
m/s
Page 87
Page 88
Section 9.2.0
Example Data:
M = 0.5;
i = 0.006;
m = 0.2;
g = 9.8;
>>
p = i*(M+m)+M*m*l^2,
>>
Ap = [
0
0
0
0
Ap =
0
0
0
0
b = 0.1;
l = 0.3;
p =
1
-(i+m*l^2)*b/p
0
-(m*l*b)/p
1.0000
-0.1818
0
-0.4545
>> Bp = [0;
(i+m*l^2)/p;
0;
m*l/p]
Bp =
Section 9.2.1
0
1.8182
0
4.5455
0.0132
0
(m^2*g*l^2)/p
0
m*g*l*(M+m)/p
0
2.6727
0
31.1818
0;
0;
1;
0]
0
0
1.0000
0
1
0
7.0310
>> Acl = Ap - Bp * K
Acl =
0
1.0000
0
14.6939
13.9592 -63.2776
0
0
0
36.7347
34.8980 -133.6939
0
-12.7837
1.0000
-31.9592
>> Nf = 1/(Cp*inv(-Acl)*Bp)
Nf =
-8.0816
0
>> Cp = [ 1 0 0 0 ;
0 0 1 0 ]
Cp =
0
0
0
1
0
0
>> Dp = [ 0 ; 0 ]
Dp =
0
0
x1
x2
x3
x4
u1
0
-14.69
0
-36.73
Continuous-time model.
Page 89
Page 90
Section 9.2.1
With linear time-invariant systems there is a very nice optimal control result.
Consider the cost function
Step Response
1
0.5
J=
(130)
t=0
0
Amplitude
Section 9.2.2
>> step(SScl)
To: Out(1)
0.5
0.4
To: Out(2)
0.2
0.2
0.4
0.5
1.5
Time (sec)
2.5
3.5
Q =
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
>> R = 1
R = 1
>> K = lqr(Ap, Bp, Q, R)
K =
-1.0000
-2.0408
>> Acl = Ap - Bp * K
Acl =
0
1.0000
1.8182
3.5287
0
0
4.5455
8.8217
20.3672
0
-34.3585
0
-61.3961
3.9302
0
-7.1458
1.0000
-17.8646
>> Nf = 1/(Cp*inv(-Acl)*Bp)
Nf =
-1.0000
0
Part 5: Models of Linear Systems
Page 91
Page 92
Section 9.2.2
Step Response
1.5
To: Out(1)
0.5
Amplitude
0.5
0.1
0.05
Step Response
1.5
0.05
1
0
4
Time (seconds)
To: Out(1)
0.1
Section 9.2.2
To: Out(2)
0.5
Amplitude
0.5
0.4
0.2
To: Out(2)
Brysons rules: choose elements of Q and R to be 1/ x2i , where xi is the
allowed excursion of the ith state.
0.2
0.4
4
Time (seconds)
Page 93
Page 94
Section 10.0.0
10 Conclusions
Weve seen
Some of the basic properties of system models, and classification of signals.
How to build a state-variable model in 5 steps:
1. Write the relevant relations for the system
2. Identify the differential equations
3. Write the differential equations in state-variable form
4. Write the equation of the output signal (or signals) using the states and
inputs
5. Check units throughout, to verify correctness.
Advantages of state-variable modeling
List at least three reasons why state-variable models are advantageous
relative to differential equation modeling
Construction of several example state-variable models
Basic operations on a state variable model, including
Determining the transfer function
Coordinate transformation
State feedback control.
Page 95
Student
exercise
Section 1.1.0
1 Modal coordinates
1.1 Derivation of modal coordinates
Contents
1 Modal coordinates
1.1
(1)
(2)
1.1.2
1.1.3
. . . . . . . . . . .
10
. . . . . . . . . . . . . . . . . . .
12
1.2
1.3
18
1 (t)
(t) = ...
n (t)
19
2.1
2.2
23
2.3
25
2.4
27
(3)
19
e1 , e2 en
o
,
x (t) = M (t)
e1 , e2 en
o
.
so (t) = M 1 x (t)
(4)
30
4 Conclusions
Part 6: Response in Modal Coordinates
x (t) = i (t) ei
16
17
Given a state vector x (t) Rn and a set of basis vectors {ei } for Rn , we
know that we can represent x (t) on basis {ei } by
i=1
31
(Revised: Sep 10, 2012)
Page 1
Page 2
Section 1.1.0
Likewise, we can represent the input signal, B p u (t) on the same basis:
Section 1.1.1
1.1.1 Choose the basis vectors to be the columns of the modal matrix
i (t) ei = B p u (t)
(5)
i=1
However, when the ei are the columns of the modal matrix of A p (assuming
for now a complete set of independent eigenvectors), then the terms
where the i (t) are the basis coefficients representing B p u (t) on {ei }.
Writing
i (t) A p ei
i (t) i ei
become
i (t) ei = M (t)
(6)
And Eqn (7) becomes
i=1
then
B p u (t) = M (t)
so (t) = M 1 B p u (t)
i=1
i (t) ei
i=1
i=1
i=1
i (t) A p ei + (t) ei
(7)
i=1
i=1
= 0
(8)
i=1
Even though the i (t) and i (t) terms in Eqn (8) are scalar, because of the
middle term, with matrix A p, Eqn (8) leads in general to the vector equation
n
i=1
i=1
i=1
(10)
Since the ei are independent, Eqn (10) is verified only if each term in
parenthesis is zero, which gives a set of simultaneous scalar equations (see
Bay Eqn (6.25))
i (t) i (t) i i (t) = 0
n
i (t) ei i (t) i ei i (t) ei = i (t) i (t) i i (t) ei = 0
(8, repeated)
i=1
t0
e (t) i () d
(12)
i=1
Z t
(9)
x (t) = M (t)
(11)
Representing the state and input on the modal matrix of A p , an nth order
coupled differential equation becomes a set of n first order uncoupled
differential equations !
i=1
!
n
n
i (t) I
i (t) A i (t) I ei = 0
or
Page 3
Page 4
Section 1.1.1
The basis vectors ei that decouple the system are the columns of the modal
matrix
i
h
1
(13)
e1 e2 en = M , recall A p = M J M
Eqn (13) is the general form.
eigenvectors exists, then
M =V ,
J =U
and
A p = V U V 1
(14)
Section 1.1.2
x (t) =
0.164
0.059
0.059
0.164
where V is the matrix of eigenvectors and U has the eigenvalues on the main
diagonal.
The eigensystem is:
x (t) +
x (t0 ) =
1
0
1.085
0.031
u (t)
(15)
-0.2231
0
0
-0.1054
1 1
1
(16)
V , M=
M=
0.707
1 1
Eqn (16) illustrates that the basis vectors of the modal matrix can be
scaled by a parameter (actually each vector can be scaled independently).
By scaling M to 1.0, the some of the coefficients below get simpler.
Page 5
Page 6
Section 1.1.2
1 (t)
.. = M (t) = B u (t)
.
p
n (t)
so
(t) = M
B p u (t) =
0.527
0.558
u (t)
Section 1.1.2
For a step input, which gives constant i (t), the form for the solution is:
1 t
e 1
i (t) = i (0) et + i
(17)
(20)
which gives
1 0.223t
1
e
0.223
1 0.105t
0.527
1
e
0.105
(21)
0.5
0.5
(19)
Z t
e0.223 (t) u () d
Z t
e0.105 (t) u () d
1
1
1 (t) +
1
1
2 (t) (22)
Page 7
Page 8
Section 1.1.2
Section 1.1.3
rT1
..
(t) = M 1 x (t) =
.
rTn
x (t)
(24)
the jth row of M 1 gives the coupling of the physical states into the jth
mode. We can write that
1 (t) = rT1 x(t) = hr1, x(t)i
..
.
(25)
Eqn (11) works directly for complex pole pairs, but it may be more
convenient to organize each pair of complex poles into a 2nd order realvalued mode (see section 2).
nth order for an n n Jordan block.
When there is not a complete set of eigenvectors, the Jordan form is used,
and gives l coupled states for each chain of l eigenvectors (one regular
and l 1 generalized).
From
x (t) = M (t)
(26)
The response of a linear system can be thought of as a collection of firstand second-order mode responses with forcing functions.
Through the M matrix, the response of the physical states of the system
(voltages and velocities, say), generally involves a superposition of all of
the modes of the system.
Page 9
Page 10
Section 1.1.3
(27)
i = ri , B p
(28)
Consider 2 masses connected by a spring, this system will have two oscillatory
modes:
a lower frequency mode in which the masses swing in phase, and
a higher frequency mode in which the mass swing in opposite phase.
Z t
t0
e (t) i () d
Section 1.2.0
2
k
Since the modes are uncoupled, if a i is zero, the input u (t) is not
connected to that mode.
m1
m2
Opposite Phase
Page 11
= k 2
(29)
(30)
Page 12
Section 1.2.0
1 (t)
1.50 19.80 0.00 10.00
1 (t)
1.00
0.00
0.00
0.00
, Ap =
x (t) =
2 (t)
0.00 10.00 1.50 19.80
2 (t)
0.00
0.00
1.00
0.00
Section 1.2.0
0.5
Theta 1
(31)
0.5
0
10
5
6
t [seconds]
10
Theta 2
0.5
0.5
0
We can excite the modes individually. Setting up initial conditions that lie
in the column space formed by the basis vectors of the mode.
General initial conditions give motion that is a superposition of all modes.
1
0
10
5
6
t [seconds]
10
1
Theta 2 [degrees]
Theta 1 [degrees]
1
0.5
0
0
0.5
0.5
1
0
1
0
1
10
1
Theta 2 [degrees]
0.5
0.5
0
0.5
Notes:
1
0
5
6
t [seconds]
10
Figure 3: Two masses swinging out of phase (mode 1, mode 2 not excited).
Part 6: Response in Modal Coordinates
Page 13
Page 14
Section 1.2.0
(32)
Choosing the modal matrix M as a special transformation matrix, and
introducing (t), the state vector in modal coordinates,
x(t) = M (t)
Am = M 1 A p M
(33)
A p = M Am M 1
(34)
If the system has second order modes, Am will have 2x2 blocks, one
corresponding to each 2nd order mode.
Then:
(t) =
Or:
(t) = = Am (t) + Bm u (t)
y (t) = Cm (t) + D p u (t)
Where:
Am = M 1 A p M
Bm = M 1 B p
Cm = C p M
second order:
M 1 A p M x(t) + M 1 B p u(t)
(35)
(t) = M 1 x(t)
If the system has only first order modes, Am is diagonal (all blocks are
1x1).
first order:
Section 1.3.0
Weve seen that we can transform a state model to a new set of basis vectors
with a transformation matrix.
and
y(t) = a1e1t
Page 15
Page 16
Section 1.3.1
U =
1
...
n
..
.
..
.
Section 1.3.2
When we have real and distinct eigenvalues we will have a complete set of
independent eigenvectors, and
Given the system of section 1.1.2. Recall that the solution for x (t) is of the
form
1
1
1 (t) +
2 (t)
x (t) = M (t) = e1 1 (t) + e2 2 (t) =
1
1
Figure 6 is a plot of the phase portrait, showing the state trajectory from
initial condition
1
x (0) =
0
V = v1 vn
..
..
.
.
Then
M =V
and Am = M
Ap M
(36)
1
x2
e2
x2
0.5
x(t)
x1
0.5
e1
1
0.5
0.5
x1
1.5
Figure 6: Response of a system with two first-order modes. The x show the
state at 1.0 second intervals.
Part 6: Response in Modal Coordinates
Page 17
Page 18
Section 2.1.0
Am =
0.75 + j 5.41
0.00
0.00
0.00
0.00
0.75 j 5.41
0.00
0.00
0.00
0.00
0.75 + j 3.04
0.00
0.00
0.00
0.00
Section 2.1.0
0.75 j 3.04
(37)
(38)
with
When the poles are complex, Eqns (37), (38) are none-the-less valid. For
the example above,
1 (t) e1
2 (t) e2
e(0.75+ j5.41)t
e(0.75 j5.41)t
0.70 + j 0.00
+0.02 + j 0.13
+0.70 + j 0.00
0.02 j0.13
0.70 j 0.00
+0.02 j 0.13
+0.70 j 0.00
0.02 + j0.13
h
i
h
i
x (0) =
Page 19
and
t = 0.6
Page 20
Section 2.1.0
Section 2.1.0
-0.00 + 1.98i
Page 21
Page 22
Section 2.2.0
nd
Section 2.2.0
All the imaginary terms cancel (as they must !) and the result reduces to:
order mode
x(t) = 2 a er rr T b er ri T a ei ri T b ei rr T x (0)
Considering two terms from Eqn (37), a 2nd order mode makes a
contribution to x (t) according to:
...
e(+ j )t
e( j )t
..
.
(rr + jri )T
(rr jri )T
..
...
.
(39)
Define a + j b as
a + j b = e(+ j )t = et (cos( t) + j sin( t))
(40)
Or, equivalently,
a = et cos ( t) ,
x(0)
x(t) = [ er ei ]
b a
rTr
rTi
x(0)
(42)
b = et sin ( t)
(41)
exp(alpha*t) * cos(omega*t),
-0.6343
exp(alpha*t) * sin(omega*t),
-0.0654
Page 23
Page 24
Section 2.3.0
Section 2.3.0
M = ei ei
ei = er + j e j
with
(44)
The 2 2 element in N that selects the real and imaginary parts of ei is:
11 j
N2 =
2 1 j
with
Am = M 1 A p M
Bm = M 1 B p
Then
Am
(45)
...
|
(43)
j j
and
M = er e j
| |
Then
Am = N 1 M 1 A p M N = N 1 Am N
N2
...
N =
M 1 = N 1 M 1
N21 =
which gives
Choose N to be
M = MN
Page 25
1
= N Am N =
...
1
j j
...
...
i
i
...
1
2
...
(46)
1 j
...
1
Page 26
Section 2.4.0
...
=
2
...
(47)
(48)
1.00
1 j
N=
2
0
0
then
j 0 0
0 1 1
0 j j
real
The double pendulum has two second order modes. Using the example from
section 2.1, choose
0.03 1 0.08 1
M =
1.00 0
1
0
0.03 1 0.08 1
where
= + j
Section 2.4.0
...
+
j ( )
=
j ( ) +
0.75 5.41
5.41
1 1
1
Am = N M A p M N = N Am N =
0.75
0
0
0.75 3.04
3.04 0.75
0
0.70
0.00
0.68
Page 27
Page 28
Section 2.4.0
1
,
x (0) =
(0) = M p
Section 3.0.0
1.0
x (0) =
(49)
and the initial condition of Eqn (49) excites only the first (faster) mode.
(that is, u (t) = 0), a real i and ei define a 1-D A p -invariant subspace. That
is, if
x (t = 0) {x : x = ai ei }
then
x (t) {x : x = ai ei }
x (0) =
,
0
1
(0) = M p
x (0) =
1.0
If
(50)
x (0) {x : x = a1 er + a2 ei }
then
x (t) {x : x = a1 er + a2 ei } t > 0
and the initial condition of Eqn (50) excites only the second (slower) mode.
(51)
t > 0
Page 29
(53)
Page 30
Section 4.0.0
4 Conclusions
The response of linear dynamic systems can be decomposed into the
responses of individual modes.
The modes are decoupled: if the input or initial condition excites only
one mode, only that mode responds.
Modes are either
First order, or
Second order, or
Correspond to a Jordan block
The basis vectors of the modes (vectors ei in Eqn (3) et seq.) are the bases
of A p -invariant subspaces in state-space, defined by the modes.
The modal matrix M is used to transform between modal and physical
coordinates.
The forcing function, u (t), can also be decomposed into forcing functions
for each of the modes.
Page 31
Section 1.0.0
Contents
Linear time-invariant systems
1 Introduction to Stability Theory
Nonlinear systems
2.1
2.2
2.3
13
2.4
14
3 Limit Cycles
15
4 Lyapunov stability
17
4.1
20
4.2
Quadratic Forms . . . . . . . . . . . . . . . . . . . . . . . . . .
21
4.3
22
. . . . . . . . . . . . . . .
5 Summary
23
For nonlinear systems the picture is even more complex:
Local stability,
Properties for small inputs may not extend to large input
Stability may be input dependent
Stability may be initial-condition dependent
Page 1
Page 2
Section 1.0.0
Section 2.0.0
(1)
y (t) = g (x, u, t)
Uniform stability
we need a tool for looking at the behavior of the system.
Stability is not dependent on the time (for time-varying systems).
One general and powerful tool is the phase plane.
Asymptotic stability
Example, consider the undamped system :
d 2y
+ 2 y = 0
dt 2
Exponential stability
As t , the state draws ever closer to the equilibrium point at
least as fast as some exponential curve.
x (t) =
x (t) =
0 2
1
A time-plot shows:
1
0.8
0.6
State signals
0.4
0.2
0
0.2
0.4
0.6
0.8
1
0
10
15
20
25
time [sec]
Page 3
Page 4
Section 2.0.0
Section 2.0.0
To draw the phase portrait, take away time, and make the axes of the plot
the states (2-D plot for 2nd order system, 3-D plot for 3rd order system, etc.)
1.5
Velocity [m/s]
0.5
Velocity [m/s]
0.5
0.5
0.5
0.5
0
Position [m]
0.5
0.5
0
Position [m]
0.5
1.5
1
Undamped oscillator response
0.5
Velocity [m/s]
0.8
State signals
0.6
0.4
0.2
0.5
0
0.2
1
0.4
0.6
0
4
time [sec]
0.5
0
Position [m]
0.5
Page 5
Page 6
Section 2.0.0
Section 2.2.0
The concept of a trajectory through phase space extends naturally to higherorder systems.
We can plot the phase arrows along trajectories, or at any point, such as grid
points.
0.8
0.8
0.6
0.6
0.4
0.4
0.2
0.2
0
0.2
0.4
0.6
0.6
0.8
0.8
0.2
0.4
1
1
0.5
0
Position [m]
0.5
Velocity [m/s]
Velocity [m/s]
0.5
0
Position [m]
0.5
xe : A xe + B u = 0
Page 7
Page 8
Section 2.2.0
Section 2.2.0
3. Saddle point
2. Unstable node
4. Center
Page 9
Page 10
Section 2.2.0
Section 2.2.0
Figure 7: Saddle points, system has both stable and unstable modes.
Page 11
Page 12
Section 2.3.0
Section 2.4.0
(3)
f (x, u, t)
x + O x2
x
x=xe
(4)
0+J x
f1
x1
f2
x1
f1
x2
f2
x2
..
.
..
.
f1
xn
f2
xn
f (x, u, t)
J=
=
x
x=xe
.. fn
fn fn
. xn
x1 x2
x=xe
Near to xe , the first-order term will dominate and the stability properties
(stable vs. unstable vs. saddle point vs. center) is determined by the
f (x, u,t)
, which is sometimes called the Jacobian matrix.
eigenvalues of
x
Local stability is usually computable, because we can usually form the
Jacobian matrix, even for non-linear systems.
Figure 9: Multiple attractors and basins of attraction (Bay figure 7.2).
Part 7: Phase Portraits and Stability
Page 13
Local stability is a limited result. For example, even for a stable fixed point,
it may be difficult to determine the size of the basin of attraction.
Part 7: Phase Portraits and Stability
Page 14
Section 3.0.0
3 Limit Cycles
Section 3.0.0
Summary on Stability
The local stability of a (sufficiently smooth) nonlinear system can be
determined by examining the stability of the equilibrium points.
Nonlinear systems can have a new kind of behavior: a limit cycle.
Needed: a global stability result.
Page 15
Page 16
Section 4.0.0
4 Lyapunov stability
Section 4.0.0
k (y)
Lyapunov method:
b (y)
x=
x =
y
0
x1
x2
k (y) b (y)
E (x1 , x2 ) =
x22
+
2
k (x1 ) dx1
dE
dt
becomes:
dE
= x2 [k (x1 ) b (x2) + k (x1)]
dt
Part 7: Phase Portraits and Stability
Page 17
Page 18
Section 4.0.0
Section 4.1.0
x 6= 0
(5)
(6)
and show:
dE
dt
dV
< 0 , x 6= 0
(7)
dt
Which establishes the Bounded-input bounded-output (BIBO) stability:
t > t0
(8)
E>0
dE
dt
<0
Energy function
Clever choice
Observations:
For any initial condition giving energy E0 , the system never goes to a
state with E (x) > E0
When b > 0 energy steadily decays, and the system converges to
E = 0.
Typical choice:
V (x) = xT P x ,
(9)
Page 19
Page 20
Section 4.2.0
Section 4.3.0
Given
x (t) = A x (t)
Consider Vc = 12 CV 2
(11)
V (x) = xT P x
(12)
(10)
Where
P is a matrix
V (x) = x T P x + xT P x
It can be shown (see chapter) P may be restricted to symmetric matrices
without loss of generality
(What is the advantage of a symmetric matrix, in terms of the
eigensystem of P?)
= xT AT P x + xT P A x = xT Q x
Student
exercise
where
Q = AT P + P A
If P is positive-definite
(13)
(14)
For a stable linear system, Eqn (14) has a solution for every positive
definite P
Page 21
Page 22
Section 5.0.0
5 Summary
Weve seen that stability is more complex for nonlinear systems
Property of system, and also of initial conditions and inputs
(Think of the stability of a plane in flight).
A system at equilibrium and perturbed can:
Return to equilibrium
Diverge
Go to a different equilibrium point
Go into a limit cycle
The Lyapunov stabiltiy method gives one approach for non-linear systems.
Page 23
3.2
3.3
Contents
1 Introduction
1.1
Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2
2.2
10
2.3
Controllability example . . . . . . . . . . . . . . . . . . . . . . .
12
2.4
15
2.5
18
2.6
Observability example . . . . . . . . . . . . . . . . . . . . . . .
18
2.7
Popov-Belevitch-Hautus Tests . . . . . . . . . . . . . . . . . . .
19
2.7.1
19
2.7.2
20
2.2.2
2.8
. . . . .
3.2.1
34
37
3.3.1
38
39
39
21
26
31
2.1
2.2.1
30
Page 1
Page 2
Section 1.1.0
1 Introduction
Section 1.1.0
y(t)
s+3
u(t)
(s+3) (s+4)
u(t)
y(t)
s+3
(s+3) (s+4)
Either the signal of the mode does not appear in the output
(Unobservable, fig 1(B));
Or the input signal cant reach the mode (Uncontrollable, fig 1(C)).
1.1 Definitions
u(t)
s+3
y(t)
(s+3) (s+4)
Controllable System: The input signal reaches each of the modes, so that the
system can be driven from any state, x0 , to the origin by suitable choice of
input signal.
Page 3
Page 4
Section 1.2.0
Section 2.1.0
Challenge: if a pole and zero cancel, it means that feedback control can do
nothing about the mode:
x (k + 1) = A x (k) + B u (k)
(1)
(2)
Non-linearities, etc.
At time k = 1 :
x (2) = A x (1) + B u (1)
(3)
Page 5
Page 6
Section 2.1.0
At time k = 2 :
Section 2.1.0
and also
then
u
(l
1)
u (l 2)
h
i
..
u (1)
u (0)
u
(l
1)
u (l 2)
..
(7)
u=
.
u (1)
u (0)
(4)
Al x (0) = P u
(8)
From Eqn (8), it is clear that if Al x (0) lies in the column space of P , then
a solution u exists which is the control sequence to drives the initial state to
the origin. Thus:
If the rank of P = n , then a control sequence u is guaranteed to exist;
and the system is controllable.
(6)
Page 7
Page 8
Section 2.2.1
n1
+ + 1 + 0
p (A) = A + n1 A
n1
(9)
+ + 1 A + 0I
Z t
eA(t) B u () d
(13)
t0
(10)
Cayley-Hamilton Theorem:
A matrix satisfies its own characteristic equation
Z t1
t0
(A) = An + n1 An1 + + 1A + 0I
n
n1
= n1 A
1 A 0I
(11)
(14)
We dont need to solve for the 1 for the proof, only to know it
exists.
so
(12)
has rank n.
Section 2.2.2
Page 9
Term eA(t1 t0 ) has a polynomial expansion, so by the CayleyHamilton theorem, it can be expressed in terms of a low-order
polynomial:
eA(t1 t0 ) =
i () Ani
(15)
i=1
We dont need to solve for the i () for the proof, only to know
they exist.
Page 10
Section 2.2.2
1 =
=
Z t1
t0
Z t1
t0
"
i () A
ni
i=1
"
Ani B i ()
i=1
Z t1 h
n1
t0
= An1 B
t0
(16)
R
u () d
i
B 1 () u () + + A B n1 () u () + B n () u () d
Z t1
Section 2.3.0
1 () u () d + + A B
Define:
i ,
Z t1
t0
Z t1
t0
n1 () u () d + B
Z t1
t0
+
vs(t)
+
vx(t)
-
(17)
n1
.
..
(18)
2
1
1
RC
d vC (t)
C vC (t) RC
vs (t)
=
+
1
dt iL (t)
L1 0
iL (t)
L
h
i vC (t)
+ [1] vs (t)
vx (t) =
1 0
iL (t)
P = [B | A B] =
Page 11
(19)
From Eqn (14), i is a vector depending on x (t0); from Eqns (17) and (18), if
P is full rank, then there exists a control input u (t) , t [t0 , t1 ] to give some
i such that x (t1 ) = 0 . Thus, the system is guaranteed to be controllable.
Part 8: Controllability and Observability
n () u () dx
n1
h
i
=P
1 = B | A B | ... | Al2 B | Al1 B
+ vc(t)
i () u () d
iL(t)
1
RC
1
L
1
R22C2 + LC
1
R LC
(20)
Page 12
Section 2.3.0
Note: The controllability matrix doesnt have to be square, (well see this
example with an extra input below). A determinant calculation can only
be used when P is square.
|P | =
So rank (P ) < 2 if
1
RC
1
L
1
R22C2 + LC
= 1 1
R2 LC2 L2 C
1
R LC
R=
(23)
p
L/C then L = R2 C the denominator factors into:
s
Vx (s)
=
Vs (s) s2 + 2
iL(t)
+ vc(t) I (t)
b
+
vx(t)
-
(22)
1
s + RC
1
1 2
RC s + RC
+
vs(t)
L
C
Section 2.3.0
(21)
If R =
1
s s + RC
1
1
s + RC
s + RC
2
1
1
1
RC
vC (t)
vs (t)
d vC (t)
C
RC
C
(24)
=
1
dt iL (t)
L1 0
iL (t)
Ib (t)
0
L
h
i vC (t)
+ [1] vs (t)
vx (t) =
1 0
iL (t)
The controllability matrix is:
s
1
s + RC
The second mode is not gone from the system, it is just unreachable from
the input.
P = [B | A B] =
1
RC
1
L
1
C
0 |
1
R22C2 + LC
1
R LC
R2
1
LC
(25)
Notice that P changes shape. It still has n rows, but now has 2n columns.
A 2 4 matrix has to be quite special to have rank less than 2.
In the present case, P is rank 2 as long as the two rows are independent.
The zero in the (2, 2) element assures the rows will be independent.
Page 13
Page 14
Section 2.4.0
Section 2.4.0
At time k = 0 :
(27)
(26)
At time k = 1 :
(28)
At time k = 2 :
Duality: Duality situations are those where, with a systematic set of
changes or exchanges, one system turns out to have properties equivalent
to another. For example, circuit duality:
Inductors
Resistances
Conductances
(29)
and the new dual circuit will behave identically to the original.
In controls there are several dualities, an important one is the
Observability / Controllability duality. As we will see, with an
appropriate transpose and C substituted for B, the properties carry over.
Solution:
C
y (1) C A
2
y (2)
= CA
..
..
.
.
C Al1
y (l 1)
y (0)
x (0) +
Big Term
(based on u (k))
(30)
Page 15
Page 16
Section 2.4.0
Observability (continued)
y (0)
y (1)
y (2)
..
.
y (l 1)
Section 2.6.0
It doesnt matter what the big term is, as long as it is known. Write
Big Term
(based on u (k))
= Q x (0)
C
1
0
Q =
=
2
1
CA
RC C
(33)
CA
2
Q ,
CA
..
C Al1
(32)
From Eqn (31), it is clear that if x (0) lies in the row space of Q , then by
knowing the left hand side it is possible to determine x (0). It is guaranteed
that x (0) lies in the row space of Q if the rank of Q is n.
If the rank of Q = n , then x (0) can be determined from known samples
of the input and output; and the system is observable.
Page 17
Page 18
Section 2.7.2
Section 2.7.2
These tests for controllability and observability do not involve testing any
matrix for rank, but rather examine the left eigenvectors (eigenvectors) for
orthogonality with B (C) .
Left Eigenvectors: Left eigenvectors are row vectors which have the property
that
vA = v
(34)
For example,
so v =
1 1
1 1
3 1
= 3 1 1
0 2
(35)
Page 19
Page 20
Section 2.8.0
Recall that we can use the eigenvectors of A to transform the state variable
model onto a new basis (modal coordinates) in which the modes are
decoupled.
V = Evecs A ; T = V 1
b = T A T 1
A
Bb = T B
Section 2.8.0
Cb = C T 1
The eigenvectors of A are given as:
>> A = [-2/(R*C), (1/C)
-(1/L)
0]
>> B = [1/(R*C) ; (1/L)]
>> C = [ -1 0]; D = 1;
>> [V, U] = eig(A)
1
1
A=
1 0
0.5
B=
1.0
C=
D = [1]
1 0
Page 21
V =
0.3536 - 0.6124i
0.7071
0.3536 + 0.6124i
0.7071
Notice that the eigenvalues and eigenvectors are complex. This is fine. The
complex terms will come in complex-conjugate pairs, with the imaginary
components canceling in the output.
Page 22
Section 2.8.0
0 + 0.0000i
-0.5000 - 0.8660i
>> Bhat = T * B
Bhat = 0.7071 - 0.0000i
0.7071 + 0.0000i
>> Chat = C * inv(T)
Chat = -0.3536 + 0.6124i
Section 2.8.0
Following the steps in section 4.4 to construct the T matrix (called the modal
matrix M by Bay), the transformation is given by:
0.7071 - 0.4082i
0.7071 + 0.4082i
>> T = inv(VV)
T = 0.7071
-1.4142
0.7071
1.4142
-0.3536 - 0.6124i
When R = 1 [] .
The is more difficult because of the repeated eigenvalue (the repeated
pole at s = 1/ (RC)).
It is a coincidence that the pole-zero cancellation occurs at the same
value of R as the double pole, and that this A matrix has only 1
eigenvector.
>> Bhat = T * B
Bhat = 1.4142
0.0000
>> Chat = C * inv(T)
Chat = -0.7071
0.3536
Page 23
Page 24
Section 2.8.0
Section 3.0.0
With
b x (t) + Bu
b (t)
x (t) = A
Notice:
(36)
b
1. The repeated poles at 1 in A.
A typical remedy for uncontrollable or unobservable modes is to reengineer a system to change an actuator or sensor.
The double pendulum, seen in figures 4 and 5:
Has 4 energy storage elements (kinetic energy of each mass, potential
energy of each mass);
Is a 4th order system;
Has 2 oscillatory modes.
l1
M1
l2
M2
Page 25
Page 26
Section 3.0.0
Section 3.0.0
Ap = 0
-19.8000 0
10.0000
1.0000 0
0
0
0
10.0000 0
-19.8000
0
0
1.0000 0
5.4589i
5.4589i
3.1305i
3.1305i
%% Fast mode
%% Slow mode
>> Bp = [ l1/M1l2 0 0 0]
%% Input is force on M1
>> Cp = [ 0 0 0 1 ]
>> Dp = [ 0]
%% Output is 2
Page 27
Page 28
Section 3.0.0
This model gives the step response of figure 7, where both modes are
present.
Section 3.1.0
2(t)
(Sensor)
>>
%% Controllability matrix
>> Ccontrol = [Bp, Ap*Bp, Ap*Ap*Bp, Ap*Ap*Ap*Bp]
Ccontrol = 0.5000
0 9.9000 0
0
0.5000 0
-9.9000
0
0
5.0000 0
0
0
0
5.0000
u(t)
(Applied Force)
M1
M2
>> rank(Ccontrol)
ans = 4
0.05
0.04
Amplitude
0.03
0.02
0.01
0.01
0.02
50
100
150
200
250
Time (sec)
>> rank(Oobserve)
ans =
4
Page 29
Page 30
Section 3.2.0
u(t)
(Sensor)
k
M1
M2
C p1 =
The controllability matrix:
l1 1 + l2 2
2
0 l1 /2 0 l2 /2
P = B p A p B p A2p B p A3p B p ;
y(t)
or
Section 3.2.0
Now lets model a system with a position sensor placed in the middle of the
spring (rather than sensing position 2 ):
(Applied Force)
unchanged
(37)
Page 31
Page 32
Section 3.2.0
Section 3.2.1
Lets go back to the original system, and rather than applying a force to M1,
lets put in a linear motor that acts between M1 and M2
Original system:
%% Fast mode
Linear Motor
f(t) = ks va(t)
u(t)
%% Slow mode
2(t)
(Sensor)
u(t)
(Applied Force)
(Applied Force)
k
M1
%% No zeros
M2
Unchanged.
0
B p2 =
l2 /M2 l22
The new sensor position introduces zeros which collide with the fast mode
poles.
This system is controllable but unobservable.
l1 /M1 l12
Cp
Cp A p
Q =
C p A2p
C p A3p
unchanged (38)
Page 33
Page 34
Section 3.2.1
Section 3.2.1
Page 35
Page 36
Section 3.3.0
Section 3.3.1
The order of the system is based on the number of storage elements (or 1st
order differential equations).
If a pole and zero cancel, it does not remove an energy storage element
from the system: the mode is still in there.
Space launch vehicles are one type of system where controllability and
observability problems arise:
Flexible structures
Restricted freedom to place sensors or actuators
The poles and zeros move around vigorously during launch, as the
aerodynamic condition changes and mass changes.
Open-loop unstable mode (without control, the rocket will fall over)
Lightly damped structural modes:
Page 37
Page 38
Section 4.1.0
Section 4.1.0
Controllability:
A system is controllable if there exists a u (t) to drive from an arbitrary
state x0 to the origin.
Reachability:
Can find u (t)to drive from an arbitrary state x0 to any second
arbitrary state x1 .
LTI systems: Controllability are reachability are equivalent for continuous
systems. For discrete systems, there are (defective) discrete
systems which are controllable in a trivial way, consider:
xk+1 =
This is partly why it takes a Ph.D. to design control for an air or space
craft.
0 0
0 0
xk +
0
0
uk
Page 39
Page 40
Section 4.1.0
References
[1] R.E. Kalman. On the general theory of control systems. In Proc. 1st Inter.
Congress on Automatic Control, pages 481493. Moscow: IFAC, 1960.
[2] R.E. Kalman, Y.C. Ho, and K.S. Narendra. Controllability of Linear
Dynamical Systems, Vol 1. New York: John Wiley and Sons, 1962.
Part 8: Controllability and Observability
Page 41