Solutions for Exercises in Linear Systems Theory by Joao Hespanha
Solutions for Exercises in Linear Systems Theory by Joao Hespanha
x1
u ř ş
4
ř y
´1
x2
.co
ř ş
3
Linearization
Exercises
2.3 (Local linearization around equilibrium: saturated inverted pendulum). Consider the in-
verted pendulum in Figure 2.1 and assume the input and output to the system are the signals
u and y defined as
T “ satpuq, y “ θ,
where “sat” denotes the unit-slope saturation function that truncates u at `1 and ´1.
(a) Linearize this system around the equilibrium point for which θ “ 0.
(b) Linearize this system around the equilibrium point for which θ “ π (assume that the
pendulum is free to rotate all the way to this configuration without hitting the table).
(c) Linearize this system around the equilibrium point for which θ “ π4 .
Does such an equilibrium point always exist?
(d) Assume that b “ 1{2 and mg` “ 1{4. Compute the torque T ptq needed for the pendulum
to fall from θ p0q “ 0 with constant velocity θ9 ptq “ 1, @t ě 0. Linearize the system
around this trajectory. 2
2
João P. Hespanha
„ 1 „ 1
x θ
Solution to Exercise 2.3. Setting x – 1 “ 9 , the system dynamics are given by
x2 θ
„
x2
x9 “ f px, uq – g b 1
` sin x1 ´ m`2 x2 ` m`2 satpuq
y “ gpx, uq – x1 .
(a) The linearized dynamics around an arbitrary equilibrium point xeq , ueq are then given by
B f px, uq ˇˇ B f px, uq ˇˇ
δx “ ˇ x“xeq δ x ` ˇ xeq δ u
Bx u“ueq
Bu ux“ “ueq
„ „
0 1 0
“ g eq δ x ` 1 d satpu q δ u
eq
` cos x1 ´ m`b 2 m`2 du
Bgpx, uq ˇˇ Bgpx, uq ˇˇ
δy “ ˇ xeq δ x ` ˇ xeq δ u
Bx ux“ “ueq
Bu ux“ “ueq
“ ‰
“ 1 0 δ x,
eq
(c) For x1 “ θ “ π{4 to be an equilibrium point, we need
π
0 “ mg` sin ` satpueq q
4
to have a solution. This means that we must have
?
2
mg` P r´1, 1s.
2
eq q
Except for the extreme case of |ueq | “ 1, we will always have d satdu
pu
“ 1 and therefore
the linearization is given by
« ff „
9 0
?
1 0 “ ‰
δx “ g 2 b δx` 1 δu δy “ 1 0 δ x.
` 2 ´ m`2 m`2
3
Lecture 2
1 sint ” 1 3 ı
0 “ mg` sint ´ b ` T ptq ô T ptq “ b ´ mg` sint “ ´ P , , @t ě 0.
2 4 4 4
Attention! Note the The linearized dynamics around this trajectory are then given by
time-varying nature of
the linearized system.
„ „
0 1 0 “ ‰
δ9x “ g b δ x ` 1 δu δy “ 1 0 δ x.
` cost ´ m`2 m`2
2.4 (Local linearization around equilibrium: pendulum). The following equation models the
motion of a frictionless pendulum:
θ: ` k sin θ “ τ
where θ P R is the angle of the pendulum with the vertical, τ P R an applied torque, and k a
positive constant.
(a) Compute a state-space model for the system when u – τ is viewed as the input and y – θ
as the output. Write the model in the form
x9 “ f px, uq y “ gpx, uq
(b) Find the equilibrium points of this system corresponding to the constant input τptq “ 0,
t ě 0.
Hint: There are many.
(c) Compute the linearization of the system around the solution τptq “ θ ptq “ θ9 ptq “ 0,
t ě 0.
„
θ
Solution to Exercise 2.4. (a) Defining x – 9 we have
θ
where
ˆ„ ˙ „ ˆ„ ˙
x1 x2 x1
f ,u – , g , u – x1 .
x2 ´k sin x1 ` u x2
where m can be any integer in Z. Therefore the equilibrium points are pairs pxeq , ueq q of
the form
„
πm
xeq “ , mPZ ueq “ 0.
0
4
João P. Hespanha
(c)
∆x – x ´ x0 , ∆u – u ´ u0 , ∆y – y ´ y0 ,
where x0 ptq “ 0, u0 ptq “ 0, y0 ptq “ 0, t ě 0 is the solution around which we are doing
the linearization, we get
9 “ A∆x ` B∆u,
∆x ∆y “ C∆x
with
„ „
Bf 0 1 Bf 0 Bg “ ‰
A– px0 , u0 q “ , B– px0 , u0 q “ , C – px0 , u0 q “ 1 0 .
Bx ´k 0 Bu 1 Bx
2.5 (Local linearization around equilibrium: nonlinear input). Consider the nonlinear system
y: ` y9 ` y “ u2 ´ 1.
(a) Compute a state-space representation for the system with input u and output y. Write the
model in the form
x9 “ f px, uq y “ gpx, uq
for appropriate functions f and g.
(b) Linearize the system around the solution yptq “ 0, uptq “ 1, @t ě 0. 2
„ „
x1 y
Solution to Exercise 2.5. Defining x “ – , we can write
x2 y9
„ „
y9 y9
x9 “ “ “ f px, uq,
y: ´y9 ´ y ` u2 ´ 1
y “ gpx, uq
with
„
x2
f px, uq – , gpx, uq “ x1
´x1 ´ x2 ` u2 ´ 1
The linearized system around the equilibrium point x “ 0, u “ 1 is given by
δ9x “ A δ x ` b δ u
δy “ cδx`d δu
with
„ „
B f ˇˇ 0 1 B f ˇˇ 0
A“ “ , b“ “ ,
2
ˇ ˇ
Bx x“0,u“1 ´1 ´1 Bu x“0,u“1
Bg ˇˇ “ ‰ Bg ˇˇ “ ‰
c“ ˇ “ 1 0 , d“ ˇ “ 0 .
Bx x“0,u“1 Bu x“0,u“1
2.6 (Local linearization around equilibrium: one-link robot). Consider the one-link robot in
Figure 2.2, where θ denotes the angle of the link with the horizontal, τ the torque applied
at the base, px, yq the position of the tip, ` the length of the link, I its moment of inertia, m
the mass at the tip, g gravity’s acceleration, and b a friction coefficient. This system evolves
according to the following equation:
I θ: “ ´bθ9 ´ gm cos θ ` τ.
5
Lecture 2
m
y
θ
τ x
Figure 2.2. One-link robotic manipulator.
(a) Compute the state-space model for the system when u “ τ is regarded as the input and
the vertical position of the tip y is regarded as the output.
Please denote the state vector by z to avoid confusion with the horizontal position of the
tip x, and write the model in the form
z9 “ f pz, uq y “ gpz, uq
” ı
θ
Solution to Exercise 2.6. (a) Let us pick the state vector as z – θ9
. Then
„ „
θ9 θ9
z9 “ : “ “ f pz, uq,
θ ´ b θ9 ´ gm cos θ ` τ
I I I
where
„
z2
f pz, uq – u .
´ bI z2 ´ gm
I cos z1 ` I
Moreover,
with
gpz, uq – ` sin z1 .
” ı
π {2
(b) For z0 ptq “ 0
and u0 ptq “ 0, ě 0 we have
„
0
f pz0 , uq “ π “ 0 “ z90 , @t ě 0.
´ gm
I cos 2
6
João P. Hespanha
δ9z “ Aδ z ` Bδ u
δ y “ Cδ z ` Dδ u,
where
„ „ „
Bf 0 1 0 1 Bf 0
A– pz0 , u0 q “ gm b “ gm , B– pz0 , u0 q “ 1
Bz I sin π
2 ´ I I ´ bI Bz I
Bg “ ‰ “ ‰ Bg
C – pz0 , u0 q “ ` cos π2 0 “ 0 0 , D – pz0 , u0 q “ 0.
Bz Bz
The fact that C and D are both zero means that around this configuration the torque
has little affect on the output (i.e., the y position). In fact, it only affects y through
second order effects that were neglected by the linearization. This indicates that it will
be difficult to control y around this configuration.
2.7 (Local linearization around trajectory: unicycle). A single-wheel cart (unicycle) moving
on the plane with linear velocity v and angular velocity ω can be modeled by the nonlinear
system
where ppx , py q denote the Cartesian coordinates of the wheel and θ its orientation. Regard
“ ‰1
this as a system with input u – v ω P R2 .
(b) Compute a local linearization for this system around the equilibrium point xeq “ 0, ueq “
0.
(c) Show that ωptq “ vptq “ 1, px ptq “ sint, py ptq “ 1 ´ cost, θ ptq “ t, @t ě 0 is a solution
to the system.
(d) Show that a local linearization of the system around this trajectory results in an LTI Attention! Writing
system. 2 the system (2.1) in the
carefully chosen
coordinates x1 , x2 , x3
is crucial to getting an
Solution to Exercise 2.7. (a) LTI linearization. If
» fi one tried to linearize
v ` ωx2 this system in the
x9 “ – ´ωx1 fl original coordinates
ω px , py , θ , one would
get an LTV system.
(b)
» fi » fi
0 0 0 1 0 „
1 0 0
δ9x “ –0 0 0fl δ x ` –0 0fl δ u, δy “ δ x.
0 1 0
0 0 0 0 1
7
Lecture 2
Therefore
» fi » fi
0 v ` ωx2
x9 “ –0fl “ – ´ωx1 fl .
1 ω
(d)
» fi » fi
0 1 0 1 ´1 „
1 0 0
δ9x “ –´1 0 0fl δ x ` –0 0 fl δ u, δy “ δ x.
0 1 0
0 0 0 0 1
2.8 (Feedback linearization controller). Consider the inverted pendulum in Figure 2.1.
(a) Assume that you can directly control the system in torque (i.e., that the control input is
u “ T ).
Design a feedback linearization controller to drive the pendulum to the upright position.
Use the following values for the parameters: ` “ 1 m, m “ 1 kg, b “ 0.1 N m´1 s´1 , and
g “ 9.8 m s´2 . Verify the performance of your system in the presence of measurement
noise using Simulink.
(b) Assume now that the pendulum is mounted on a cart and that you can control the cart’s
jerk, which is the derivative of its acceleration a. In this case,
T “ ´m ` a cos θ , a9 “ u.
where the constants KD and KP should be chosen so as to achieve good performance for
the following closed-loop system:
θ: “ ´KD θ9 ´ KP θ .
g bθ9 1
θ: “ sin θ ´ 2 ´ a cos θ
` m` `
a9 “ u.
8
João P. Hespanha
Defining
θ: “ z
gθ9 cos θ bz a θ9 sin θ cos θ
z9 “ ´ 2` ´ u
` m` ` `
A feedback linearization control can then be given by
θ: “ z
z9 “ v.