Exercise MPC1
Exercise MPC1
Given a system
1 a 0
x(k + 1) = x(k) + u(k)
0 1 2
y(k) = 1 0 x(k)
1
with x(k) = and
1
(
1 for j = 20
u(k + j|k) =
0 elsewhere
Solution:
1 a
A=
0 1
1 pa
Ap =
0 1
Use the formula
for p(k + j) = y(k + 25):
= 1 + 25a + 8a
= 1 + 33a
XN
T T
J(u, k) = x̂o (k+j|k)Qx̂o (k+j|k) + u (k+j −1|k)Ru(k+j −1|k)
j=1
T
+ ŷ (k+j|k)S ŷ(k+j|k) (1)
1. Describe the problem of finding the control-law that minimizes performance index (1)
subject to (2) as a standard predictive control problem, and give the corresponding
system matrices and the selection matrices Γ(j).
Solution:
Define the performance signal
S 1/2 y(k + 1)
z(k) = Q1/2 x (k + 1)
o
R 1/2 , u(k)
1 0 0
Γ(j) = 0 1 0
0 0 1
NX−1
J(v, k) = ẑ T (k + j)Γ(j)ẑ(k + j) =
j=0
XN
= ŷ T (k+j|k)S ŷ(k+j|k) + x̂T
o (k+j|k)Qx̂o (k+j|k)
j=1
+uT (k+j −1|k)Ru(k+j −1|k)
for
S 1/2 Co Ao S 1/2 Co Ko
C2 = Q1/2 Ao D21 = Q1/2 Ko
0 0
S 1/2 Co Lo S 1/2 Co Bo
D22 = Q1/2 Lo
D23 = Q 1/2 B
o
0 R 1/2
x(k) = xo (k), e(k) = eo (k), w(k) = do (k), v(k) = u(k)
Finally by choosing
A = Ao , B1 = Ko , B2 = Lo , B3 = Bo
Define
v(k|k)
v(k + 1|k)
ṽ(k) = ..
.
v(k + N − 1|k)
with v(k) = u(k) we obtain the constraint:
u(k + Nc ) = u(k + Nc − 1)
u(k + Nc + 1) = u(k + Nc )
..
.
u(k + N − 1) = u(k + N − 2)
0 ··· 0 1 −1 0 ... 0
0 0 0 1 −1 0
= .. .. .. .. ṽ(k)
. 0 . . .
..
0 . 0 0 0 ··· 1 −1
| {z }
D̃33
3 1
where A = −2, B3 = 1, C2 = and D23 = . Note that there is no noise
0 1
(so e = 0) and there is no external input (w = 0). A performance index is defined as
NX−1
T
min J(ṽ, k) = min ẑ (k + j|k)ẑ(k + j|k) (3)
ṽ(k) ṽ(k) j=0
Solution:
1 3
Compute Ev = 1, Γ̄ = 1, D̃23 = D23 = , C̃2 = C2 = ,
1 0
1 0
and Γ̄ = . The optimal control law is given by
0 1
v(k) = −F x(k)
T −1 T
= −Ev (D̃23 Γ̄D̃23 ) D̃23 Γ̄C̃2 x(k)
1 −1 3
= 1( 1 1 · I ) 1 1 I = −1.5 · x(k)
1 0
system
at time k with state x(k), external signal w̃(k) and ZMWN signal e(k).
1. Define
J ∗ (k) = min J(k)
ṽ
Describe how the optimized performance index J ∗ (k) of the SPCP changes when
• the prediction horizon is increased (decreased),
• the minimum cost horizon is increased (decreased), (but Nm < N )
• the control horizon is increased (decreased), (but Nc < N ),
• an inequality constraint is introduced (removed).
• J1 is the performance index for the SPCP with infinite prediction horizon (N = ∞),
minimum cost horizon Nm = 4 and control horizon Nc = 20 subject to inequality
constraints ψ(k) ≤ Ψ(k).
• J2 is the performance index for the SPCP with prediction horizon N = 50,
minimum cost horizon Nm = 1 and control horizon Nc = 20.
Solution:
1. Define
J ∗ (k) = min J(k)
ṽ
• Increasing (Decreasing) the prediction horizon means that more (less)
terms are taken into account, so performance index J(k) will increase
(decrease).
• Increasing (Decreasing) the minimum cost horizon means that less
(more) terms are taken into account, so performance index J(k) will
decrease (increase).
• Increasing (Decreasing) the control horizon means that we obtain more
(less) degrees of freedom for the optimization, so performance index
J(k) will decrease (increase).
• Introducing (removing) an inequality constraint means that we obtain
less (more) degrees of freedom for the optimization, so performance
PI N Nm Nc ψ
J1∗ ∞ 4 20 Yes
J2∗ 50 1 20 No
J3∗ ∞ 4 ∞ No
J4∗ ∞ 1 20 Yes
J5∗ ∞ 1 ∞ No
J6∗ 50 1 20 Yes
We find the following inequalities
NX−1
T
min J(ṽ, k) = min ẑ (k + j|k)ẑ(k + j|k) . (4)
ṽ(k) ṽ(k) j=0
Solution:
T =D
1. For N = 1 we obtain: Ev = 1, Γ̄ = 1, D̃23 23 = 1
and C̃2 = C2 = 3. The optimal control law is given by
D21 1
D̃21 = C2 B1 = 6
C2 AB1 −12
D23 0 0
D̃23 = C2 B3 D23 0
C2 AB3 C2 B3 D23
1 0 0
= 3 1 0
−6 3 1
T −1 T
F = Ev (D̃23 Γ̄D̃23 ) D̃23 Γ̄C̃2
T −1
1 0 0 1 0 0
= 1 0 0 3 1 0 3 1 0
−6 3 1 −6 3 1
T
1 0 0 3
× 3 1 0 −6
−6 3 1 12
=3
A − B3 F = −2 − 1 · 3 = −5
−1 C = −2 − 2 · 1 · (−1)0
A − B1 D11 1
0 1 0
ṽ = D̃33 ṽ = 0
0 0 1
and so
0
C̃3 = D̃31 =
0
0 0 1
r r⊥
D̃33 = 1 0 , D̃33 = 0
0 1 0
r = I and D̃ D̃ r⊥ = 0.)
(check that D̃33 D̃33 33 33
r⊥ )T D̃ T Γ̄D̃ D̃ r⊥ −1 (D̃ r⊥ )T D̃ T Γ̄
Ξ= (D̃33 23 23 33 33 23
−1
1 3 −6 1 0 0 1
= 1 0 0 0 1 3 3 1 0 0
0 0 1 −6 3 1 0
1 3 −6
× 1 0 0 0 1 3
0 0 1
= (46)−1
1 3 −6
F = −Ev D̃33 r⊥ ΞD̃ D̃ r C̃ − D̃ r⊥ ΞC̃ − D̃ r C̃
23 33 3 33 2 33 3
r⊥ ΞC̃
= Ev D̃33 2
1 3
=− 1 0 0 0 1/46 3/46 −6/46 −6
0 12
= −85/46
= −1.8478
A − B3 F = −2 − 1 · (−1.8478) = −0.1522
The system is stable.
✷
y(k) − 0.6 y(k − 1) + 0.05 y(k − 2) = 3u(k) − 1.1 u(k − 1) + e(k) − 0.5 e(k − 1)
Solution:
The transfer function is given by
3 z 2 − 1.1z
G(z) =
(z − 0.6z + 0.05)
Step response:
−1 z
s(k) = Z (G(z) )
z−1
3z 3 − 1.1z 2
= Z −1 (
z 3 − 1.6z 2 + 0.65z − 0.05
38 −1 z 1 z 2 −1 z
= Z ( ) − Z −1 ( )− Z ( )
9 z−1 2 z−1 90 z−1
We find ts = 2. This means that the initial setting for the prediction horizon
is: 3 ≤ N ≤ 4. There is no delay or inverse response, so with d = 0 we find
Nm = d + 1 = 1. Finally the IIO system will be a third-order system, so
Nc = 3.
✷