Lecture2 LectureNotes
Lecture2 LectureNotes
STATE-SPACE REPRESENTATIONS
In the above system, the state vector is the vector of dimension 2 defined by
x (t)
x(t) := 1 (1.16)
x2 (t)
So that the state space is R2 . Let us now draw a simple 2-dimensional graphical
representation of the evolution of this state at time t = 0, 1, 2, 3. For initial
conditions set as above (ie x(0) = [1, 0]T ), this evolution can be seen in figure
1.18a:
13
1.4. STATE-SPACE REPRESENTATIONS
F (t + 2) = F (t + 1) + F (t) (1.17)
The order of this system is 2, so we need 2 initial conditions which are set to
F (1) = 1, F (0) = 0.
The first observation one can make is that since system (1.17) is of order 2, then
it is not a state-space representation.
Let us now consider the variable F (t). Could this be a valid state vector? If that
were the case, then this would mean that knowning F (0) would be sufficient to
obtain F for any future t, which is not the case since we also need F (1)! Hence
dynamic variable F (t) is not a state vector.
x 2 Rn , A 2 Rn⇥n , u 2 Rm , B 2 Rn⇥m
14
1.4. STATE-SPACE REPRESENTATIONS
15
1.4. STATE-SPACE REPRESENTATIONS
f : Rn ! Rn (1.29)
so that f : R3 ! R3 :
2 3 2 3
px1 (t) + px2 (t) f1 (x1 (t), x2 (t), x3 (t))
f (x(t)) = 4 x1 (t)x3 (t) x2 (t)5 = 4f2 (x1 (t), x2 (t), x3 (t))5 (1.32)
x1 (t)x2 (t) x3 (t) f3 (x1 (t), x2 (t), x3 (t))
When inputs are included into the representation, the vector field f also
depends on u(t) and we have
16
1.5. BRIDGES
and similarly for discrete-time systems (ie we have x(t + 1) = f (x(t), u(t))).
Similarly to the linear case, an output equation, also nonlinear, can be added:
1.5 Bridges
Mathematical bridges or transformations between systems that are described
mathematically can be very useful, not only for finding interesting theoretical
results, but also for more practical-related matters.
The first one which we will see below concerns the actual implmentation of our
continuous-time systems on digital computers, ie how to discretize a system by
a simple program written in C, Python or pure Matlab (ie no Simulink).
x(t + 1) x(t)
= f (x(t), u(t)) (1.36)
Ts
where we recall that, in the above, time variable t is now discrete. The con-
stant Ts is the period at which the signal is discretized or sampled. Finally,
isolating the terms in (t + 1), we have the following discrete-time state-space
representation
17
1.5. BRIDGES
y (n) (t) + an 1y
(n 1)
(t) + ... + a1 ẏ(t) + a0 y(t) = bu(t) (1.41)
18
1.5. BRIDGES
As for the output equation, note that the definition of the state (1.42) also
implies that
y(t) = x1 (t) (1.48)
which simply translates in having the matrix C written as
⇥ ⇤
C = 1 0 ... 0 (1.49)
structure shown in (1.47), in particular for matrix A, with a diagonal of ones and all the ai
coefficients on the last line of the matrix, is often referred to as Controllability Canonical
Form.
19
1.5. BRIDGES
and
d k 1
ẋ2 (t) = x2 (t) x1 (t) + u(t) , (1.54)
m m m
so that we have the state-space representation
" # " #
ẋ1 (t) 0 1 x (t) 0
1
= k d + 1 u(t) (1.55)
ẋ2 (t) x2 (t)
m m m
⇥ ⇤ x1 (t)
y= 1 0 (1.56)
x2 (t)
20
1.5. BRIDGES
21
1.5. BRIDGES
with
ym (t) = x1 (t) and ẏm (t) = ẋ1 (t) = x2 (t). (1.71)
Then, let the actual output of system (1.67) be defined by
ÿ = b0 ( a1 ÿm (t) a0 ẏm (t) + u̇(t)) + b1 ( a1 ÿm (t) a0 ẏm (t) + u̇(t))
= a1 (b0 ẏm (t) + b1 ÿm (t)) a0 (b0 ym (t) + b1 ẏm (t)) + b0 u(t) + b1 u̇(t)
= a1 ẏ(t) a0 y(t) + b0 u(t) + b1 u̇(t)
Discrete-time systems
The reasoning is almost the same for discrete-time systems. Indeed, in this case,
consider instead the di↵erence equation of order n
22
1.5. BRIDGES
so that we have
2 3
0 1 0 0 ... 0 2 3
6 7 0
6 0 0 1 0 ... 0 7 607
6 0 0 0 1 ... 0 7 6 7
6 7 6.7
x(t + 1) = 6 .. .. .. .. .. .. 7 x(t) + 6 .. 7 u(t) (1.77)
6 . . . . . . 7 6 7
6 7 405
4 0 0 0 0 ... 1 5
b
a0 a1 a2 a3 ... an 1
y(1) = 1, y(0) = 0
which gives
x1 (t + 1) 0 1
x(t + 1) = = x(t) (1.81)
x2 (t + 1) 1 1
⇥ ⇤ x1 (t) y(0) 0
y(t) = 1 0 , x(0) = = (1.82)
x2 (t) y(1) 1
23
1.5. BRIDGES
Nonlinear Systems
Generally, not all nonlinear ODEs can be converted to state-space representa-
tions, and this is a topic of current research.
For example, the nonlinear system
¨ = g 1
✓(t) sin ✓(t) + u(t), y(t) = ✓(t) (1.85)
l ml2
and defining the state vector as
x1 (t) ✓(t)
x(t) = := ˙ (1.86)
x2 (t) ✓(t)
24
1.5. BRIDGES
Equilibrium Points
In order to make the notion of “point of interest” a bit more precise, we will
use the concept of equilibrium point. Let us start by giving a definition of an
equilibrium point in the state-space context.
From the above definition, note, importantly, that while it is possible that
the origin of the state-space is an equilibrium, it does not have to be so (see
for example the illustration in figure 1.19 below). Second, and as we will see on
an example, the definition implies that there can be several points, not just one.
0 = f (x⇤ ) (1.89)
25
1.5. BRIDGES
A first simple way to find the equilibrium points of this system is through using
a simple physical reasoning. The system is in equilibrium means that it does not
move anymore :-). Hence we have that the second component of x⇤ , ie angular
velocity x⇤2 is zero. This corresponds to 2 equilibrium positions (modulo 2⇡),
pendulum up and pendulum down. Thus we can easily conjecture 2 equilibrium
points: ⇤ ⇤
⇤ x1 0 ⇤ x1 ⇡
x = ⇤ = and x = ⇤ = (1.91)
x2 0 x2 0
Let us now confirm that mathematically. Indeed, having equation (1.89) means
that we need to solve " #
x⇤2 0
g = (1.92)
sin x⇤1 0
l
which indeed leads exactly to the 2 equilibrium points obtained in (1.91).
At this point, it is worth mentioning that the dynamic behavior around (but
not on) each equilibrium point can be very di↵erent whether the pendulum is up
or down. This is indeed the case and we will discuss that when we look at stabil-
ity considerations. For now, let us continue our discussion on equilibrium points.
x⇤ = f (x⇤ ) (1.93)
The systems we have considered now did not have any input signal... Let us
first see what happens when a torque input is added to our pendulum example.
26
1.5. BRIDGES
of (1.95) means that we have x⇤2 = 0, rewriting the second line of this expression
gives
g 1 ⇤
0= sin x⇤1 + u (1.96)
l ml2
where we see that we can choose any value of x⇤1 as long as we find the corre-
sponding u⇤ !
For example, assume that we would like to maintain the pendulum on position
x⇤1 = ⇡/4. Then we have the associated control input
⇡
u⇤ = mgl sin (1.97)
4
Finally, for system (1.94), we have the set of equilibrium points given by
⇤
x
x⇤ = 1 (1.98)
0
Hence, for systems with a control input, the set of equilibrium points have
to be considered in conjunction with their associated control input vector u⇤ ,
ie in continuous-time and for systems of the form ẋ = f (x, u), we need to find
the solutions x⇤ , u⇤ of the algebraic equation
0 = f (x⇤ , u⇤ ) , (1.100)
while for a discrete-time system with input vector x(t + 1) = f (x(t), u(t)), we
need to solve
x⇤ = f (x⇤ , u⇤ ) . (1.101)
In the simpler case where the considered state-space representation is linear, ie
as exemplified by the continuous-time case ẋ = Ax + Bu, we simply have the
linear algebraic equation
0 = Ax⇤ + Bu⇤ . (1.102)
Let us use our now infamous Mass-Spring-Damper example to illustrate this
last point.
27
1.5. BRIDGES
28
1.5. BRIDGES
d ⇤ @f
(x + x(t)) ⇡ f (x⇤ ) + (x) . x(t) (1.111)
dt @x x=x⇤
d ⇤
Then, since x⇤ is an equilibrium point, we have dt x = 0 and f (x⇤ ) = 0, which
finally gives us the dynamics
d @f
( x(t)) = (x) x(t) (1.112)
dt @x x=x⇤
29
1.5. BRIDGES
The previous reasoning can easily be extended to systems with inputs rep-
resented by
ẋ(t) = f (x(t), u(t)) (1.121)
In this case, we want to obtain a linear approximation of the system around x⇤
and its associated input u⇤ . Hence we write
d ⇤
(x + x(t)) = f (x⇤ + x(t), u⇤ + u(t)) (1.122)
dt
so that the first-order approximation of f (x, u) is now
where u(t) := u(t) u⇤ . From there, and similarly to what we have done for
systems without inputs, we end up with the following linear approximation
" # " #
d @f @f
x(t) = (x, u) x(t) + (x, u) u(t) (1.124)
dt @x x=x⇤ ,u=u⇤ @u x=x⇤ ,u=u⇤
ẋ = A x + B u (1.125)
with
" # " #
@f @f
A= (x, u) and B= (x, u) (1.126)
@x x=x⇤ ,u=u⇤ @u x=x⇤ ,u=u⇤
30
1.5. BRIDGES
31