Professional Documents
Culture Documents
Homework 5: Answer
Homework 5: Answer
1. Find the control input u(t) sequence that minimizes the cost functional:
J = −y(tf )
for an initial condition y(0) = 2 and final time tf = 5. Give both the control, the state
response and co-state.
Answer:
First, we identify the elements of the problem:
h(y(tf ), tf ) = −y(tf )
g(y(t), u(t), t) = 0
a(y(t), u(t), t) = y(t)u(t) − y(t) − u2 (t)
Substituting:
Hu = 0 → P (t)[y(t) − 2u(t)] = 0
1
y(t) − 2u(t) = 0 → u∗ (t) = y(t)
2
Replacing u∗ (t) in ẏ(t):
2
1 1
ẏ(t) = y(t) y(t) − y(t) − y(t)
2 2
1 1
ẏ(t) = y 2 (t) − y(t) − y 2 (t)
2 4
1 2
ẏ(t) = y (t) − y(t)
4
Replacing u∗ (t) in Ṗ (t):
1
Ṗ = −P (t)[u(t) − 1] → Ṗ = −P (t)[ y(t) − 1]
2
1 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
Then:
4
y(t) =
1 + et
Replacing y(t) in u∗ (t):
2
u∗ (t) =
1 + et
Now the co-state:
2
Ṗ (t) = −P (t) −1
1 + et
Z P Z t
dP (t) 2
= 1− dt
P0 P (t) 0 1 + et
t
ln(P (t)) − ln(P (0)) = [t − 2(− ln(1 + et ) + t)]0
P (t) t
ln = [2 ln(1 + et ) − t]0
P (0)
P (t)
ln = [2 ln(1 + et ) − 2 ln(2) − t]
P (0)
2
1 + et
P (t)
ln = [ln − t]
P (0) 2
2
1 + et
P (t)
= e−t
P (0) 2
2
1 + et
P (t) = P (0) e−t
2
2 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
2
1 + etf
−y(tf ) − P (0) e−tf = 0
2
4
tf
etf
P (0) = − 1 + e
2
1 + etf
2
etf
P (0) = −16
(1 + etf )3
We know that tf = 5:
e5
P (0) = −16
(1 + e5 )3
P (0) = −0.0007119
where w(t) ∼ N (0, 4) and v(t) ∼ N (0, 0.5) are Gaussian, white noises and tf = 15.
(a) Numerically integrate the Riccati equations for LQR and the LQE to find the
time-varying regulator and estimator gains.
(b) The full stochastic linear optimal output feedback problem involves using u(t) =
−K x̂(t). For this control policy, the compensator is of the form:
3 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
(d) Find the steady-state mean-squared values of the regulator and estimator. (x1 (t),
x2 (t), x̂1 (t) and x̂2 (t))
Answer a):
First we are going to identify the elements of the problem:
0 1 0 0 1 0
A= Bu = Bw = Cy = 0 1 Cz =
1 0 1 1 0 1
3 0
Rvv = 0.5 Rww = 4 Ruu = 1 Rxx =
0 3
The solution to solve the regulator and estimator gains is an LQG controller. So its equations
are as follows:
Regulator:
−1 T
−Ṗ (t) = AT P (t) + P (t)A + Rxx − P (t)Bu Ruu Bu P (t)
−1 T
K(t) = Ruu Bu P (t)
Estimator:
−1
Q̇(t) = AQ(t) + Q(t)AT + Bw Rww BwT − Q(t)CyT Rvv Cy Q(t)
−1
L(t) = Q(t)CyT Rvv
Using simulink we find the values of K and L as shown in the following figures.
4 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
Answer b):
For closed-loop system:
ẋc = Ac xc + Bc y
u = −Cc xc
With:
Ac = A − Bu K(t) − L(t)Cy
Bc = L(t)
Cc = K(t)
In the same way we have the original system:
ẋ = Ax + Bu u + Bw w
y = Cy x + v
Relating both systems:
ẋ = Ax − Bu Cc xc + Bw w
ẋc = Ac xc + Bc Cy x + Bc v
We can accommodate the system as follows:
ẋ A −Bu Cc x Bw 0 w
= +
ẋc Bc Cy Ac xc 0 Bc v
x
y = Cy 0 +v
xc
5 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
Answer c):
To test this section we need to find the steady state values of Pss and Qss . We know that
these values can be calculated in the following way:
−1 T
AT Pss + Pss A + CzT Rzz Cz − Pss Bu Ruu Bu Pss = 0
−1
AQss + Qss AT + Bw Rww BwT − Qss CyT Rvv Cy Qss = 0
With:
−1 T −1
Kss = Ruu Bu Pss Lss = Qss CyT Rvv
Using MATLAB to find the Pss and Qss matrices, with the conditions that P and Q are
positive defined, the following values were found:
√
6 3 3 √1
Pss = Qss =
3 3 1 3
With this we determine that the gains values found with Simulink and steady state values are
6 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
7 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
In steady-state:
We have investigated various types of observer -based controllers that can be written
as:
Where, r(t) is the residual signal [r(t) = y(t) − Cy z(t)] and the state vectors x and z
have the same size. Assume that we have selected H and G so that the closed-loop
system is stable. We can modify the original compensator in (3) and (4) to obtain a
very general form the compensator:
so that the residual is filtered by another set of stable dynamics and then added to
the control signal. The dimension (k) of w is arbitrary, but the eigenvalues of F are
assumed to have negative real parts.
(a) Show that a ”separation” type principle still holds for the closed loop eigenvalues.
(b) Show that under the assumptions given, this new compensator still leads to a
stable closed loop system.
Answer a):
We can write the closed-loop equations as follows:
ẋ = Ax − Bu Gz + Bu P w
ż = (A − Bu G − HCy ) + Bu P w + Hy
ẇ = F w + QCy x − QCy z
8 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
In state-space:
ẋ A −Bu G Bu P x
ż = HCy A − Bu G − HCy Bu P z
ẇ QCy −QCy F w
So, the principle of separation applies with closed-loop system. We know that the eigenvalues
of each matrix separately, are part of ACL matrix, so:
F = λ1 , λ2 A − Bu G = λ3 , λ4 A − Cy H = λ5 , λ6
F ≡F A − Bu G ≡ A − Bu G A − Cy H ≡ A − Cy H
So:
λ 0 λ 0 λ5 0
F = 1 A − Bu G = 3 A − Cy H =
0 λ2 0 λ4 0 λ6
Finally:
F 0 0
ACL = 0 A − Bu G 0
0 0 A − Cy H
This shows that the eigenvalues of the ACL matrix depend on the eigenvalues of the original
system matrix.
Answer b):
The problem gave us the data that the H and G gains made the closed-loop system stable.
With this, the condition for the ACL array to be stable is that the eigenvalues of the F array
must have a negative real part.
9 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
4. For the following system, design a H∞ controller that minimizes the cost function:
WS S
Wu Gc S
∞
Where:
s/M + ωB
Ws (s) =
s + ωB A
with M = 2, ωB = 5, and A = 0.01. As discussed in class, the weight Wu should be
adjusted so that we meet the sensitivity specification.
You should then design a H2 optimal (LQG) controller that yields a similar settling
time of the step response and directly compare the graphs listed below for the H2 , and
H∞ controllers.
One way to do this for a SISO system is set Bu = Bw , Cz = Cy , choose Rww = 0.1 and
Rzz = 1. Then set Ruu = Rvv = ρ and use ρ << 1 as the basic design parameter. You
can then iterate on the choice of Rww and Rzz as needed.
Use this procedure to design a controller (follow the code given in the notes) for the
following system (ω1 = 1, ω2 = 5, ω3 = 10).
1
G1 (s) =
(−s/ω1 + 1)(s/ω2 + 1)(s/ω3 + 1)
Sensitivity and inverse of Ws weight to show that you meet the specification.
The Nyquist/Nichols plot to show that you have the correct number of encir-
clements.
A bode graph that contains Gi (s), Gc (s) and L = Gi Gc (s). Clearly label each
curve and identify the gain/phase cross-over points.
The root locus obtained by freezing the controller dynamics and then using a
controller αGc (s), where α ∈ {0, 2} (assuming that normally α = 1) to investigate
the robustness of your design to gain errors.
The step response of the closed-loop system.
The reason for drawing these plots is to develop some insights into what a typically
H∞ controller ”looks like”. So, use your results to comment on how the H∞ controller
modifies the plant dynamics to achieve the desired performance.
Answer:
First, we identify the information:
M =2 ωB = 5 A = 0.01
ω1 = 1 ω2 = 5 ω3 = 10
10 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
So:
s/2 + 5
Ws (s) =
s + 0.05
1
G1 (s) =
(−s + 1)(s/5 + 1)(s/10 + 1)
γmin < 1
We start with Wu = 1, but γmin > 1 then we decrease the value Wu , until we reach Wu =
1 × 10−9 . With this:
γmin = 0.5012
So the sensitivity and the inverse of Ws shows that:
11 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
12 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
The system G(s) is unstable, but enclose onet time the critical point. This means that the
system G(s) is stable with control law Gc (s).
Now using Bode Diagram:
GMG(s) = 0.0697
P MG(s) = −90
With this the system with control, makes the system stable and robust
Now checking the root locus of controller dynamics.
13 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
14 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
15 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
Use the book Non-linear Dynamical Systems and Control. A Lyapounove Based-Approach.
Wassim M. Haddad and Vijay Sekhar Chellaboina, Princeton University Press, 2008.
Simulate the following problem and present the graphics of x1 (t), x2 (t), x3 (t) and the control
effort. Discuss and compare the meaningful inverse control versus the optimal inverse control.
5. In this problem, we demonstrate the extra flexibility provided by inverse optimal con-
trollers with performance criteria involving cross-weighting terms over inverse optimal
controllers with meaningful cost functionals.
Specifically, we consider the controlled Lorentz dynamical system. Our objective is to
design and compare inverse optimal and meaningful inverse optimal controllers that
stabilize the origin of the Lorentz equations:
ẋ1 (t) = −σx1 (t) + σx2 (t) x1 (0) = x10 t≥0 (1)
ẋ2 (t) = rx1 (t) − x2 (t) − x1 (t)x3 (t) + u(t) x2 (0) = x20 (2)
ẋ3 (t) = x1 (t)x2 (t) − bx3 (t) x3 (0) = x30 (3)
In particular, we compare the guaranteed gain and sector margins to input saturation-
type nonlinearities and the transient performance in terms of maximum overshoot of
both designs.
Recall that the control law:
p1
φ(x) = −( σ + r)x1 (4)
p2
stabilizes the nonlinear system (1) − (3) while minimizing the performance functional:
Z ∞
J(x0 , u(·)) = [L1 (x(t)) + L2 (x(t))u(t) + uT R2 (x(t))u(t)]dt (5)
0
with:
" 2 #
p1
L1 (x) = 2σp1 + R2 σ+r x21 − 2(p1 σ + p2 r)x1 x2 + 2p2 x22 + 2p2 bx23 (6)
p2
R2
L2 (x) = (2p1 σ + 2p2 r)x1 − 2p2 x2 (7)
p2
Thus:
(1 − θ2 )[x̂T Qx̂ + 2p2 bx23 ] − x̂T yy T x̂ ≥ 0 (8)
Where:
T
x̂ ≡ x1 x2 (9)
2
p1
2σp1 + R2 σ+r −(p1 σ + p2 r)
Q ≡ R2 p2 (10)
−(p1 σ + p2 r) 2p2
and
T
p1
y ≡ R2 σ+r −p2 (11)
p2
16 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
Answer:
Since 2p2 bx23 is non-negative for all θ ∈ (0, 1) it follows that equation (8) is equivalent to:
(1 − θ2 )Q ≥ yy T
Which implies that, if Q is invertible, equation (8.119) is satisfied for all θ ∈ (0, 1) such that:
1 − θ2 ≥ y T Q−1 y
Hence, the maximum possible θ such that equation (8.119) holds is given by:
p
θ = 1 − y T Q−1 y (12)
Now, it follows from Theorem 8.6 that for all p1 , p2 , R2 > 0, such that det Q 6= 0, with φ(x)
given above the non-linear system (1) − (3) has disk margins of:
1 1
,
1+θ 1−θ
Where θ is given by equation (12). Furthermore, for p1 , p2 and R2 > 0 these disk margins
are the maximum possible disk margins that are guaranteed by Theorem 8.6.
Next, we vary p1 , p2 and R2 such that θ given by equation (12) is maximized. It can be shown
that the maximum is achieved at:
p1 r p2
= and =0
p2 σ R2
So that:
1
θmax = √
r+1
Next, using the control Lyapunov function:
Where:
17 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
σ = 10 r = 15 b = 8/3
Design parameters:
p1 = 1.5 p2 = 1
φ(x) = −2rx1
16x3 2
α(x) = −30x1 2 + 60x1 x2 − 2x2 2 −
3
β(x) = 2x2
c0 = 1
So:
( √
90 x1 x2 + (45 x1 2 −90 x1 x2 +3 x2 2 +8 x3 2 )2 +36 x2 4 −45 x1 2 +3 x2 2 −8 x3 2
φ(x) = − 3 x2
2x2 6= 0
0 2x2 = 0
18 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
First, we note that the downside disk and sector margins of the IOC are 0.8 while the
MIOC guarantees the standard 0.5 downside sector margin with no disk margin guarantees.
Hence, both controllers have guaranteed robustness sector margins to actuator saturation non-
linearities with, as expected, the MIOC having a slightly larger guarantee.
However, as shown in Figures (14), (15) and (16), the IOC with a cross-weighting term in
the performance functional has better transient performance in terms of peak overshoot over
the MIOC.
19 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
20 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
Where: T
x = x1 x2 x3
Construct a globally stabilizing controller for (1) − (3).
21 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
Answer:
We know that:
x2 x3 (I2 − I3 ) b1
I1 I1
x3 x1 (I3 − I1 ) b2
f = G=
I2
I2
x1 x2 (I1 − I2 ) b2
I3 I3
1
V (x) = (I1 x21 + I2 x22 + I3 x23 ) L2 (x) = 0
2
We have a system given by:
V (0) = 0 (8)
L2 (0) = 0 (9)
V (x) > 0 (10)
V (x) → ∞ as ||x|| → ∞ (11)
(b1 x1 + b2 x2 + b2 x3 )2
− <0
2 R2
For condition (12) to be met, only R2 needs to be positive. Then the zero solution x(t) ≡ 0
of the closed-loop system:
22 vmchan@gdl.cinvestav.mx
Victor M. Chan Ortiz Optimal Control
CINVESTAV - GDL Homework 5 April 26, 2020
Finally:
23 vmchan@gdl.cinvestav.mx