3. The
Closed-‐Loop
Energy Price Water Demand
Potable Water
NetworkModel Predictive
Controller
(running on GPUs+CPUs)
Online Measurements
Flow
Pressure
Quality
Precipitation
Price of
water
EFFINET
|
MARCH
18-‐21,
2013
4. Today’s
PresentaFon
Outline of the presentation:
o Summary of WP2 requirements
o Formulation of the MPC problem
o Solution approaches
² Hierarchical MPC
² Model Reduction
² Newton methods
² Dual Projection Algorithms
² Decomposition methods
o Implementation
o Open Problems and Directions
EFFINET
|
MARCH
18-‐21,
2013
5. WP2
Requirements
Requirements of WP2:
Involved Partners: IMTL, IRI, AASI, SGAB, WBL
• Construct models for MPC based on mass-balance
equations accompanied by constraints,
• Define risk-sensitive cost functions to be optimised,
• Devise stochastic models for the water demand,
• Develop stochastic models for the energy prices in
the day-ahead market.
Implementation:
• Prototype application in MATLAB/Simulink,
• Control-Oriented models available in MATLAB.
EFFINET
|
MARCH
18-‐21,
2013
6. Mass balance equations:
⇢A
dh
dt
= Fi Fo(h)
Fo(h) =
h
R
Simple linear correlation:
Bernoulli and Haagen-Poisseuille:
Fo(h) =
p
hInflux
Level
Fo(h) ' (h h0) + O((h h0)2
)
* Modelling error
Control-‐Oriented
Modelling
EFFINET
|
MARCH
18-‐21,
2013
7. Control-‐Oriented
Modelling
The mass-balance equations of the water
network yield an LTI dynamical model in
the following form:
xk+1 = Axk + Buk + Dwk
yk = Cxk
wk|k = wk
wk+j|k = ˆwk+j|k + ek+j|k
ek+j|k ⇠ D
Disturbance Model (Stochastic):
Note: The uncertainty is considered to
be bounded and possibly discrete.
The demand requirements can be cast
either as (hard) equality constraints:
Muk + Nwk = 0
Or can be introduced in the cost function
(soft constraints). The state and input
variables are bounded in convex sets:
xk 2 X, 8k 2 N
uk 2 U, 8k 2 N
Alternatively, we may impose
bounds on the probability of
cosntraints’ violation, e.g.,
Prob(xk /2 X) ↵x, 8k 2 N
Prob(uk /2 U) ↵u, 8k 2 N
EFFINET
|
MARCH
18-‐21,
2013
8. Control-‐Oriented
Modelling
The mass-balance equations of the water
network yield an LTI dynamical model with
parametric uncertainty:
xk+1 =Axk + Buk + Dwk
yk = Cxk
Parametric Uncertainty arises
from modelling errors:
(A, B) ⇠ D supp(D)where is compact, or
(A, B) 2 co { i}i2N[1,K]
EFFINET
|
MARCH
18-‐21,
2013
Note: We can treat the quantisation of input as uncertainty:
xk+1 = Axk + Bq(uk) q(uk) = uk + kwith
9. Risk-‐SensiFve
Cost
FuncFons
Goal: Introduce Cost Functions so as to:
o Minimise the total energy consuption
o Minimise variations of the control signal
(A motor consumes 6~8 times its
nominal operating currect on startup)
o Optimise the performance of the water
network
o Penalise violation of (soft) constraints.
`e
(xk, pk) , kpkukk1
` ( uk) , u0
kS uk
Energy cost:
Startup/(Shutdown) cost:
Performance index:
VN (xk, wk, pk, xsp
k , ⇡k) = Vf (xk, wk, pk, xsp
k )+
X
k2N[0,N 1]
`e
(xk, pk) + ` ( uk) + `x
(xk, xsp
k )
MPC Optimisation problem:
* We may also use a
quadratic form
`(xk, xsp
k ) , ⇠0
kQ⇠k
⇠k , xk xsp
k
Reference
signal
Terminal
Cost
EFFINET
|
MARCH
18-‐21,
2013
10. FormulaFon
of
the
MPC
Problem
Our MPC problem amounts to solving the
following optimisation problem:
⇡ = {uk}k2N[0,N 1]
Subj. to:
x0 = x
w0 = w
p0 = p
V ?
N (x, w, p, xsp
) = min
⇡2RmN
EV (x, w, p, xsp
, ⇡)
And the initial
conditions:
xk 2 X, 8k 2 N[1,N 1]
uk 2 U, 8k 2 N[0,N 1]
xk+1 = Axk + Buk + Dwk, 8k 2 N[0,N 1]
wk+1 ⇠ ⌦(wk, uk), 8k 2 N[1,N 1]
pk+1 ⇠ ⇥(pk), 8k 2 N[1,N 1]
xN 2 Xf
* There exist various other ways
in which the problem can be
formulated
These probability distributions
may well be dicrete.
EFFINET
|
MARCH
18-‐21,
2013
11. The
MPC
OpFmisaFon
Problem
Remarks:
i. Proper conditions on the terminal cost and the terminal
set should be imposed for the mean-square stability of
the closed loop,
ii. Recursive feasibility should be enforced and
iii. Constraints that involve probabilities may be imposed.
iv. Discrete distributions call for scenario reduction
methods.
Take away:
i. Large-scale optimisation problem!
ii. We need distributed computational methods to solve it
efficiently.
k k + NE
k k + NE
D. Bernardini and A. Bempoad, “Scenario-based Model Predictive Control of Stochastic Constrained Linear Systems,” proc.
Joint 48th IEEE Conf. Decision & Control, 28th Chinese Control Conf., Shangai, China, 2013, pp. 6333-8.
EFFINET
|
MARCH
18-‐21,
2013
12. Hierarchical
MPC
Remarks:
• Upper & Lower Layers run at
different sampling rates
• The LCL steers the plant’s state
towards the prescribed set-point
• The UCL sets the references and
takes care about the satisfaction
of constraints.
EFFINET
|
MARCH
18-‐21,
2013
13. Reduced-‐Order
MPC
Large-Scale Systems
xk+1 = A11xk + A12wk + B1uk,
wk+1 = A21xk + A22wk + B2uk
Dominant Dynamics
Neglected Dynamics
Constraints:
xk 2 X, 8k 2 N,
uk 2 U, 8k 2 N.
Nominal system: zk+1 = A11zk + B1vk
where uk = vk + K · (xk zk)
| {z }
ek
And we know that: w0 2 W
P. Sopasakis, D. Bernardini, A. Bemporad, “Constrained Model Predictive Control Based on Reduced-Order Models,” in proc.
51st CDC conf., 2013, submitted.
Assumption 1. A22 is Hurwicz
and there is an ε such that:
kA22k "
Notice that wk 2 Wk , where:
Wk = Ak
22W
k 1X
j=0
Aj
22(A21X B2U),
and notice that: Wk ✓ ˆW, 8k 2 N
where:
ˆW=W (I A22) 1
(A21X B2U)
(ellipsoid)
EFFINET
|
MARCH
18-‐21,
2013
14. Reduced-‐Order
MPC
Idea: Exploit online information to
estimate the whereabouts of the
neglected variables. Define:
Hk|k , A12Wk|k
Resides in a low-
dimensional space…
Result: If andHk|k ! H?
S?
, (I AK) 1
H?
then the set is exponen-
tially stable for the system:
S?
⇥ {0}
zk+1 = A11zk + B1vk
xk+1 = A11xk + B1uk + A12wk
EFFINET
|
MARCH
18-‐21,
2013
15. Reduced-‐Order
MPC
0 10 20
−1
−0.8
−0.6
−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
k
u
0 10 20
−10
−8
−6
−4
−2
0
2
4
6
8
10
k
x
0 10 20
−4
−3
−2
−1
0
1
2
3
k
w
0 10 20
−1
−0.8
−0.6
−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
k
u
0 10 20
−10
−8
−6
−4
−2
0
2
4
6
8
10
k
x
0 10 20
−4
−3
−2
−1
0
1
2
3
k
w
Full Order Model/Full state
feedback.
Solution time: 14.3 ± 1.8(95%)s
Reduced-Order MPC. Only the
dominant variables are measured
Solution time: 8.4 ± 2.6(95%)ms
“Speedup” 1700 (!)
EFFINET
|
MARCH
18-‐21,
2013
16. Newton-‐Based
MPC
P. Patrinos, P. Sopasakis, H. Sarimveis, “A global piecewise smooth Newton method for fast large-scale model predictive
control,” Automatica 47 (2011), pp. 2016-2022.
Primal Space:
• Constraints are complicated
• Smooth optimisation
Dual Space:
• Constraints are simple and manageable, thus
• Most algorithms are based on the dual problem which is
• unconstrained and involves a PW-smooth function,
• The Hessian is positive semi-definite.
Interior-PointActive Set
Large number of
cheap computations
Few expensive
iterations
Newton-Based
min
⇢
1
2
u0
Mu + c0
u | bmin Gu bmax
mid(l, u; y) = max{min{y, u}, l}
⌧,mid(y) , ⌧Gu mid(⌧bmin, ⌧bmax; ⌧Gu + y) = 0
* No duality gap…
• Global Q-Quadratic convergence
• Excellent scale-up
• Exact Line Search
EFFINET
|
MARCH
18-‐21,
2013
17. Newton-‐Based
MPC
Algorithm:
1. Let
2. If stop
3. Pick a
4. Solve the system
5. Update
y0
2 Rm
k ⌧,mid(yk
)k ✏
Hk
2 @ ⌧,mid(yk
)
Hk
rk
= ⌧,mid(yk
)
yk+1
= yk
+ rk
, k k + 1
Notes:
i. The Hessian is positive semi-definite
ii. Regularised Cholesky Factorisation
iii. Cholesky Updates at every iteration
EFFINET
|
MARCH
18-‐21,
2013
18. Newton-‐Based
MPC
Characteristics:
i. Outperforms all existing fast MPC
approaches (especially for high horizons)
ii. Scales-up well with the dimensions of the
problem
iii. In practise converges after just a few
iterations
iv. No easy way to calculate error bounds for
large problems.
EFFINET
|
MARCH
18-‐21,
2013
19. Accelerated
Dual-‐Gradient
ProjecFon
P(x) : V ?
(x) = min
z2Z(x)
{V (z) | g(z) 0}
An MPC problem can be written as (primal form):
where
Z(x) =
⇢
z 2 Rn x0 = x, 8k 2 N[0,N 1] :
xk+1 = Axk + Buk + f
The dual problem is:
D(x) : ?
(x) = max
y 0
(x, y), where (x, y) = min
z2Z(x)
L(z, y)
and L(z, y) = V (z) + y0
g(z)
P. Patrinos and A. Bemporad, “An Accelerated Dual-Gradient Projection Algorithm for Embedded Linear Model Predictive
Control,” 2013, Submitted for publication.
Equality Constraints
Danskin’s Theorem: r (y) = g(zy
), zy
, argminz2Z L(z, y)
The Dual QP has much
simpler constraint set
(orthant)!
EFFINET
|
MARCH
18-‐21,
2013
20. Accelerated
Dual-‐Gradient
ProjecFon
P. Patrinos and A. Bemporad, “An Accelerated Dual-Gradient Projection Algorithm for Embedded Linear Model Predictive
Control,” 2013, Submitted for publication.
Primal suboptimality & Dual Infeasibility:
V (z) V ?
"V
[g(z)]+ 1
"g
Let Ψ be LΨ-smooth. The following
algorithm converges to an
suboptimal solution:
("V , "g)
Idea: Apply a standard fast
gradient projection algorithm to
solve the dual problem.
Strong
Duality
Solution of the primal problem!
Additionally
Primal convergence, infeasibili-
ty, suboptimality, propagation
of error.
Only simple
algebraic operations!
EFFINET
|
MARCH
18-‐21,
2013
21. Accelerated
Dual-‐Gradient
ProjecFon
P. Patrinos and A. Bemporad, “An Accelerated Dual-Gradient Projection Algorithm for Embedded Linear Model Predictive
Control,” 2013, Submitted for publication.
Primal suboptimality & Dual Infeasibility of a
solution:
V (z) V ?
"V
[g(z)]+ 1
"g
Let Ψ be LΨ-smooth. The following
algorithm converges to an
suboptimal solution:
("V , "g)
Dual Infeasibility Bound:
Let ¯z(⌫) , # 1
⌫
⌫X
i=0
✓ 1
i z(i)
Then:
* Averaged Sequence
⇥
g(¯z(⌫))
⇤
+ 1
8L
(⌫ + 2)2
ky0 y?
k
EFFINET
|
MARCH
18-‐21,
2013
22. Accelerated
Dual-‐Gradient
ProjecFon
P. Patrinos and A. Bemporad, “An Accelerated Dual-Gradient Projection Algorithm for Embedded Linear Model Predictive
Control,” 2013, Submitted for publication.
Primal Suboptimality Bound:
Let ¯z(⌫) , # 1
⌫
⌫X
i=0
✓ 1
i z(i)
Then the following bound holds:
* Averaged Sequence
8L
(⌫ + 2)2
ky(0) y?
k · ky?
k V (¯z(⌫)) V ?
2L
(⌫ + 2)2
(ky(0)k2
+ ky?
k2
)
Hence: We can compute complexity certificates = number of iterations/
operations needed to reach an - neighbourhood of the solution.("V , "g)
EFFINET
|
MARCH
18-‐21,
2013
23. Accelerated
Dual-‐Gradient
ProjecFon
Characteristics:
i. GPAD does not propagate round-off
errors (works even on an Arduino Uno,
8bit PLC)
ii. It is very fast – it requires few cheap
iterations
iii. Converges quadratically (with respect to
the primal problem)
iv. Complexity Certification (Necessary for
embedded applications),
v. Primal suboptimality bounds are known.
Directions:
i. A C/MATLAB toolbox is under preparation.
ii. On-chip implementation of the algorithm
and demo applications.
EFFINET
|
MARCH
18-‐21,
2013
24. DecomposiFon
Methods
Decomposition:
Large-scale optimisation problems
need to be decomposed so as to be
solved in a distributed fashion.
Examples:
• Direct Methods
• Cutting Plane
• Regularised (Smoothened)
Cutting Plane methods
• Nested Decomposition
• Dual Methods
• Augmented Lagrangian
Decomposition
• Splitting methods
• Stochastic Methods
Andrzej Ruszuński, “Decomposition methods in stochastic programming,” Mathematical Programming, 79 (1997), pp. 333-353.
Research
Direc:on:
Fast
MPC
methods
coupled
with
decomposiFon
methods…
EFFINET
|
MARCH
18-‐21,
2013
25. ImplementaFon
GPU programming because:
• A CPU core can execute 4 to 8 32-
bit instructions per clock (IPC32)
• A GPU can execute >3200 IPC32.
• GPUs are good at doing the same
thing, but they’re not good at
switching from one job to the other.
1100
paint-‐guns
A Success Story:
EFFINET
|
MARCH
18-‐21,
2013
26. The
End!
Thank you for your attention.
EFFINET
|
MARCH
18-‐21,
2013