You are on page 1of 37

SC42001/EE4C04

Exercise Session 2
Ton van den Boom (a.j.j.vandenboom@tudelft.nl)

Delft Center for Systems and Control, TU Delft

Exercise Session 2 – SC42001/EE4C04


1. Reachability and Observability
Show that the property of reachability and observability for a linear system
is preserved under similarity transformations.

Exercise Session 2 – SC42001/EE4C04 1


Consider a model

ẋ = Ax + Bu

where x ∈ Rn, u ∈ R. Introduce a similarity transformation z = T x, where


T is an invertible matrix. Let us compute the derivative

ż = T ẋ = T Ax + T Bu = T AT −1z + T Bu

Let us compute the reachability matrix for the new set of coordinates, to
leverage the rank condition:
 n−1

T B|T AT T B| · · · |T A
−1
T −1
TB =
 n−1

T B|AB| · · · |A B .

Exercise Session 2 – SC42001/EE4C04 2


Since T is full rank (being invertible) we have that
  n−1

rank T B|AB| · · · |A B =
 n−1

rank B|AB| · · · |A B .

which shows that the observability property is preserved under


transformation T . ✷

Exercise Session 2 – SC42001/EE4C04 3


2. Reachability
Consider the system
   
µ α 0 b1
ẋ = Ax + Bu =  0 λ 1  x +  b2  u
0 0 λ b3

1. Show that the system is unreachable for b3 = 0.

2. Let µ = λ 6= 0 and α = 1.
Show that the system is reachable for b1 = 0, b2 = 0, and b3 = 1.

3. Let µ 6= 0, λ = 0, and α = 0.
Find necessary conditions for reachability of the pair (A, B).

Exercise Session 2 – SC42001/EE4C04 4


solution

1. First compute:
 2

 b1 µb1 + αb2 µ b1 + α(µ + λ)b2 + αb3

B AB A2B =  b2 λb2 + b3 λ2b2 + 2λb3 
b3 λb3 λ2b3

If b3 6= 0 the last row of the reachability matrix is zero and so the


matrix is not full rank. Thus the system is not reachable.

Exercise Session 2 – SC42001/EE4C04 5


2. For the settings µ = λ, α = 1, b1 = 0, b2 = 0, and b3 = 1 we find:
 
  0 0 1
det( B AB A2B ) = det( 0 1 2λb3 ) = 1
1 λ λ2 b3

This means that the system is reachable.

Exercise Session 2 – SC42001/EE4C04 6


3.
 2

  b1 µb1 µ b1
det( B AB A2B ) = det( b2 b3 0 ) = µ2b1b23
b3 0 0

Necessary and sufficient conditions: µ 6= 0, b1 6= 0 and b3 6= 0.

Exercise Session 2 – SC42001/EE4C04 7


3. Eigenvalues, stability and reachability
Consider the following dynamical system:

ẏ1 = αy1 + y5
ẏ2 = αy2 + u
ẏ3 = αy3 + y4
ẏ4 = y1 + αy4
ẏ5 = y2 + αy5

1. Write the given system in state space form. (Hint: choose state x in a
smart way).

Exercise Session 2 – SC42001/EE4C04 8


2. Without using any calculators or computers, compute the eigenvalues of
the system matrix. For which vaules of α is this system asymptotically
stable?

3. Again, without using any calculators or computers, check if the system


is reachable.

4. Verify your results using MATLAB for α = −2.

Exercise Session 2 – SC42001/EE4C04 9


solution
Note: this is an important example where the dimension of the system is
large, yet all analysis is done using linear algebra properties.

1. First reorder the equations such that it becomes a triangular system:

ẏ3 = αy3 + y4
ẏ4 = y1 + αy4
ẏ1 = αy1 + y5
ẏ5 = y2 + αy5
ẏ2 = αy2 + u

Exercise Session 2 – SC42001/EE4C04 10


Consider the state vector
 T
x= y3 y4 y1 y5 y2 .

We obtain the following linear system in state space form:

   
α 1 0 0 0 0

 0 α 1 0 0 

 0 
 
ẋ = 
 0 0 α 1 0 x +  0 u
  
 0 0 0 α 1   0 
0 0 0 0 α 1
| {z } | {z }
A B

Exercise Session 2 – SC42001/EE4C04 11


2. Since the system matrix A is upper triangular, the eigenvalues are
simply the elements of the diagonal. We find the eigenvalue

λ = {α}

with multiplicity five.


The system is LTI if all eigenvalues α are in the LHP. Therefore the
system is stable if α < 0.

Exercise Session 2 – SC42001/EE4C04 12


3. To check for reachability one needs to check the rank of the matrix.

First compute
 2

α 2α 1 0 0

 0 α2 2α 1 0 

2
A =
 0 0 α2 2α 1 

 0 0 0 α2 2α 
0 0 0 0 α2

 3 2

α 3α 3α 1 0

 0 α3 3α2 3α 1 

3
A =
 0 0 α3 3α2 3α 

 0 0 0 α3 3α2 
0 0 0 0 α3

Exercise Session 2 – SC42001/EE4C04 13


 4 3 2

α 4α 6α 4α 1

 0 α4 4α3 6α2 4α  
4 4 3 2 
A =
 0 0 α 4α 6α 
 0 0 0 α4 4α3 
0 0 0 0 α4
leading to:
 2 3 4

B AB A B A B A B =
 
0 0 0 0 1
 0 0 0 1 4α 
 
2 
 0
= 0 1 3α 6α 
 0 1 2α 3α2 4α3 
1 α α2 α3 α4
Clearly this matrix is full rank for any α.
More easy is Hautus test for one eigenvalue: λ = α:

Exercise Session 2 – SC42001/EE4C04 14


 
rank (λI − A)B λ=α
 
λ−α −1 0 0 0 0
 0 λ−α −1 0 0 0 
 
 0
= rank  0 λ−α −1 0 0 

 0 0 0 λ−α −1 0 
0 0 0 0 λ−α 1 λ=α
 
0 −1 0 0 0 0
 0 0 −1 0 0 0 
 
= rank  0 0
 0 −1 0 0 
=5
 0 0 0 0 −1 0 
0 0 0 0 0 1

So the system is reachable.

Exercise Session 2 – SC42001/EE4C04 15


4. For α = −2 we find with MATLAB:
 2 3 4

B AB A B A B A B =
 
0 0 0 0 1

 0 0 0 1 −8 

=
 0 0 1 −6 24 

 0 1 −4 12 −32 
1 −2 4 −8 16

Exercise Session 2 – SC42001/EE4C04 16


4. Eigenvalue Assignment via Controllable Canonical
Form
Consider the following dynamical system:

d4 θ d3 θ d2 θ dθ
4
+ α 3 + β 2 + γ + θ = u,
dt dt dt dt

d3 θ d2 θ dθ
where u represents a control input. Assuming that , , and θ can
dt3 dt2 dt
all be measured, design a state feedback control scheme (use a single
input) which places the closed-loop eigenvalues at
s1 = −2, s2 = −3, s3 = −1 + i, s4 = −1 − i.

Exercise Session 2 – SC42001/EE4C04 17


solution
The point of this exercise is to realize the above dynamics in a controllable
canonical form, and show that this form leads to simple solution to the
eigenvalue assignment problem. ...
Define the model states as x1 = θ , x2 = θ̈, x3 = θ̇, x4 = θ.
Then, ẋ2 = x1, ẋ3 = x2, ẋ4 = x3, and

ẋ1 + αx1 + βx2 + γx3 + x4 = u.

The state space representation is:


      
ẋ1 −α −β −γ −1 x1 1
= 1 0 0 0 
 ẋ2    0 
  x2
 
+
  0  u.
 
 ẋ3   0 1 0 0   x3
ẋ4 0 0 1 0 x4 0

The above representation coincides with the controllability canonical form.

Exercise Session 2 – SC42001/EE4C04 18


We conclude that the model is indeed controllable.
Let us introduce a state feedback u = −Kx, where K = [k1 k2 k3 k4].
The closed-loop dynamics can be expressed as

ẋ = (A − BK)x,

which, due to the nice canonical form, induces the following characteristic
polynomial:

det(sI − (A − BK)) =
s4 + (k1 + α)s3 + (k2 + β)s2 + (k3 + γ)s + (k4 + 1).

Exercise Session 2 – SC42001/EE4C04 19


The eigenvalues required in the text make up the following characteristic
polynomial:

p(s) = (s + 2)(s + 3)(s + 1 + j)(s + 1 − j)


= s4 + 7s3 + 18s2 + 22s + 12
= s4 + p1 s3 + p2 s2 + p3 s + p4

We thus directly obtain

k1 = p1 − a1 = 7 − α
k2 = p2 − a2 = 18 − β
k3 = p3 − a3 = 22 − γ
k4 = p4 − a4 = 12 − 1 = 11 ✷

Exercise Session 2 – SC42001/EE4C04 20


5. Linearization and Reachability
The equations of motion of an actuated skate on ice with coordinates
(x, y, θ) are the following:

mẍ + mθ̇ ẏ = cos(θ)uv


mÿ − m arctan(θ)θ̇ẏ = sin(θ)uv
I θ̈ = uθ ,

where m is the mass and I is the rotational inertia.


1. Define the state and input
 T  T
z= ẋ ẏ θ̇ x y θ , u= uv uθ

input vector and write this system in state space form.

Exercise Session 2 – SC42001/EE4C04 21


2. Linearize the system around the state
 T  T
z =

v ∗
w ∗
φ ∗
0 0 0 , u= 0 0 .

3. Is this linearized system reachable?

Exercise Session 2 – SC42001/EE4C04 22


solution

1. The system can be rewritten in the form:


   
cos(θ) cos(z6)
 −θ̇ẏ + uv   −z2z3 + u1 
   m   m 
ẍ  sin(θ)   sin(z6) 
   
ÿ   arctan(θ)θ̇ẏ + uv   arctan(z6)z2z3 + u1 

   m   m 
 θ̈   uθ
 
u2

 =  
=

 ẋ   I

     I 
 ẏ  
 ẋ
 
  z1


   
θ̇    
| {z }  ẏ   x2 
ż    
θ̇ x3
| {z }
f (z,u)

Exercise Session 2 – SC42001/EE4C04 23


2. Now compute the matrices of partial derivatives:
 
∂f1 ∂f1
 ··· 
∂f  ∂ ẋ ∂θ 
 . .. 
A= = . =
∂z  
 ∂f6 ∂f6 
···
∂ ẋ ∂θ
 
sin(z6)
 0 −z3 −z2 0 0 − u1 
 m 
 z2z3 cos(z6) 
 0 arctan(z6)z3 arctan(z6)z2 0 0 + u1 
 z62 + 1 m 
= 

 0 0 0 0 0 0 


 1 0 0 0 0 0 

 0 1 0 0 0 0 
0 0 1 0 0 0 z = z∗
u = u∗
Exercise Session 2 – SC42001/EE4C04 24
 
0 −φ ∗
−w ∗
0 0 0

 0 0 0 0 0 w ∗ φ∗ 

 0 0 0 0 0 0 
= 

 1 0 0 0 0 0 

 0 1 0 0 0 0 
0 0 1 0 0 0

Exercise Session 2 – SC42001/EE4C04 25


 
cos(z6) 
1

 0  0 
   m   m
 sin(z6)   
∂f1 ∂f1    0 0 
   0   
∂f  ∂u1 ∂u2   m   
B= = .. ..  =  
1 

= 0 1 
∂u     0  

 ∂f6 ∂f6   I 
  I 

  0 0 
∂u1 ∂u2  0 0   
   0 0 
 0 0 
0 0 z = z∗ 0 0
u = u∗

Exercise Session 2 – SC42001/EE4C04 26


3.  2 5

Wr = B ABA B ... A B

m−1 0 0 −w ∗ /I 0 0 ...

 0 0 0 0 0 w∗φ∗/I ...
 0 I −1 0 0 0 0 ...
=

 0 0 m−1 0 0 −w∗/I ...
 0 0 0 0 0 0 ...
0 0 0 I −1 0 0 ...

... 0 −w φ /I
∗ ∗2
0 0 0 0
... 0 0 0 0 0 0 

... 0 0 0 0 0 0 

... 0 0 0 −w∗φ∗2/I 0 0 

... 0 −w∗/I 0 0 0 0 
... 0 0 0 0 0 0

The matrix Wr has rank 6, so the system is reachable.

Exercise Session 2 – SC42001/EE4C04 27


6. Observability and Observer Design
Consider a process in the state-space form with
   
−2 −2 −1
A= , B= ,
2 5 2
 
C = 4 7 , D = 0.

Address the following items:


1. Check whether the system is observable. Motivate your answer.

2. Compute the observer gain L such that the observer poles are s1 = −3
and s2 = −4.

3. Verify the above computations in MATLAB.

Exercise Session 2 – SC42001/EE4C04 28


solution
The observability matrix is
   
C 4 7
= .
CA 6 27

Since its determinant is different than zero, the matrix is full rank and thus
the system is observable.
The observer error dynamics depend on the following closed-loop matrix
   
−2 −2 l1  
A − LC = − 4 7
2 5 l2
 
−2 − 4l1 −2 − 7l1
= .
2 − 4l2 5 − 7l2

Exercise Session 2 – SC42001/EE4C04 29


The associated characteristic polynomial is:

det (sI − (A − LC)) = s2 + (4l1 + 7l2 − 3)s − 6 − 6l1 + 6l2.

Equating the above characteristic polynomial with


(s + 3)(s + 4) = s2 + 7s + 12 yields L = [−1 2]T .
Notice that the estimation error xe = x − x̂ depends on the dynamics
ẋe = (A − LC)xe. It is then desirable to synthesize error dynamics that
are stable (which happens in our case), and possibly faster than the
dynamics of the state x. This is obtained by placing the eigenvalues of the
above ODE “enough in the left of the negative quadrant.”
In the observer design problem, we have the freedom to achieve this, for
example by choosing to place the eigenvalues even in −48 and −60 (and
for which we obtain L = [−111 185]T ).
The observability canonical form can be computed in MATLAB with the
command obsr over an ss structure:

Exercise Session 2 – SC42001/EE4C04 30


X = ss(A,B,C,D);
Y = obsv(X);
The test

rank(Y)
yields 2 (full rank). The observer gain can be calculated by exploiting the
function acker and the dual problem, as:

l = acker(A’,C’,[-3 -4])
which outputs the result above.

Exercise Session 2 – SC42001/EE4C04 31


7. Controllable and observable canonical forms
Consider a process in state-space form with
   
1 0 1
A= , B= ,
1 −3 1
 
C = 0 1 , D = 0.

Address the following items:


1. Transform the given SISO model into reachable canonical form.

2. Transform the given SISO model into observable canonical form.


Compute the full transformed state-space model in both the cases along
with the respective transformation matrices.

Exercise Session 2 – SC42001/EE4C04 32


solution

1. The reachability matrix is

 
  1 1
Wr = B AB = .
1 −2

Since its determinant is different than zero, the matrix is full rank and
thus the system is reachable.

Let à and B̃ be defined as


   
−2 3 1
à = . , B̃ = .
1 0 0

Exercise Session 2 – SC42001/EE4C04 33


The reachability matrix is
 
  1 −2
W̃r = B̃ ÃB̃ = .
0 1

 
0 1
T = W̃r Wr−1 =
1/3 −1/3
 
C̃ = CT −1
= 1 0
And so the state space realization is now
   
−2 3 1
ż = z+ u
1 0 0
 
y= 1 0 z

Exercise Session 2 – SC42001/EE4C04 34


2. The observability matrix is
   
C 0 1
Wo = = .
CA 1 −3

Since its determinant is different than zero, the matrix is full rank and
thus the system is observable.
Let à and B̃ be defined as
 
−2 1  
à = . , C̃ = 1 0 .
3 0

The observability matrix is


   
C̃ 1 0
W̃o = = .
C̃ Ã −2 1

Exercise Session 2 – SC42001/EE4C04 35


 
0 1
T = W̃o−1Wo =
1 −1
 
1
B̃ = T B =
0
And so the state space realization is now
   
−2 1 1
ż = z+ u
3 0 0
 
y= 1 0 z

Exercise Session 2 – SC42001/EE4C04 36

You might also like