Professional Documents
Culture Documents
Kupamekapakuhh PDF
Kupamekapakuhh PDF
Hybrid Systems.
Hybrid Systems
Francesco Borrelli
events mode
switches
δ ε
111111111111
000000000000
000000000000
111111111111
000000000000
111111111111
00
11 00
11
000000000000
111111111111
00
11 00
11
00
11
00
11 00 11
11 00
00
11 00
11
00
11 00
11
00
11 00
11 00
11
00
11
00
11 00
11 00
11 00
11
00 ∆x
11
00
11 11 00
11
00 11
00 00
11
00
11 00
11
11 00
11
00 11 00
11
00
11
00
11
00
11 00
11 00
00
11 00
11
x1 00
11 00 11
11 00 00
11
00
11 00
11
11 00
11
00 11 00
11
00
11
00
11
00
11 00
11 00
00
11 00
11
00
11 00 11
11 00 00
11
x2 00
11
00
11 00
11
00
11
000000000000
111111111111
000000000000
111111111111
000000000000
111111111111
rℓ iℓ S=0
vℓ i0
S=1 rc
vs ic r0 v0
vc
MODE 1 (S = 1 ) MODE 2 (S = 0 )
Ṫ = f (T, x, u)
u = ON
u T ≥ Thigh
Ṫ = f (T , x, ON) Ṫ = f (T , x, OFF)
T ≤ Tlow
with: x ∈ Rn , u ∈ Rm .
Remark: physical constraints on x(t) and u(t) are defined by polyhedra Xi .
Examples:
linearization of a non-linear system at different operating point ⇒ useful
as an approximation tool
Definition
Let P be a PWA system and let X = ∪si=1 Xi ⊆ Rn+m be the polyhedral
partition associated with it. System P is called well-posed if for all pairs
(x(t), u(t)) ∈ X there exists only one index i(t) satisfying the membership
condition.
1
2 x(t) if x(t) ≤ 0
x(t + 1) =
0 if x(t) > 0
can be approximated by
1
2 x(t) if x(t) ≤ 0
x(t + 1) =
0 if x(t) ≥ ǫ
where ǫ > 0 is an arbitrarily small number, for instance the machine precision.
Remark
In the previous example, the PWA system has only continuous states and
inputs.
We will formulate PWA systems including binary state and inputs by treating
0-1 binary variables as
δn = f (δ1 , δ2 , . . . , δn−1 ).
F (δ1 , . . . , δn )
Nj , Pj ⊆ {1, . . . , n}, ∀j = 1, . . . , m.
1 1
by associating xℓ = 0 with xℓ ≤ 2 and xℓ = 1 with xℓ ≥ 2 + ǫ for any
0 < ǫ ≤ 21 .
Francesco Borrelli (UC Berkeley) Hybrid Systems April 25, 2011 14 / 59
Example
Consider the spring-mass system
x1 x1
(a) Low b (u2 = 1) (b) High b (u2 = 0)
35
30
25
k(x1 )20
15
10
-5
-10
-10 -8 -6 -4 -2 0 2 4 6 8 10
x1
Francesco Borrelli (UC Berkeley) Hybrid Systems April 25, 2011 15 / 59
Example
for x1 (t) ∈ [−5, 1] ∪ [1 + ǫ, 5], x2 (t) ∈ [−5, 5], u(t) ∈ [−10, 10], and for any
arbitrary small ǫ > 0.
A logic state x2 ∈ [0, 1] stores the information whether the state of system has
ever gone below a certain lower bound xlb or not:
_
x2 (t + 1) = x2 (t) [x1 (t) ≤ xlb ],
for u(t) ∈ R, x1 (t) ∈ (−∞, xlb ] ∪ [xlb + ǫ, +∞), x2 ∈ {0, 1}, and for any ǫ > 0.
...
SYS 1
SYS s
uc (k)
SWITCHED AFFINE
xb (k) SYSTEM (SAS)
MODE SELECTOR
ub (k) (MS)
δe (k)
Interconnection between:
switched affine system (SAS) ⇒ continuous dynamics
finite state machine (FSM) ⇒ discrete events
Interconnection based on:
Event Generator (EG)
◮ logic signals from the constraints on continuous states and time
◮ triggers mode switching of the FSM
Mode Selector (MS) ⇒ selection of an affine subsystem
xc ∈ Xc ⊆ Rnc , uc ∈ Uc ⊆ Rmc
i(t) ⇒ dynamic mode of SAS
i(t), j ∈ I = {1, 2, . . . , s}
The mode i(t) of the SAS is generated by a Mode Selector function that
depends on
1 the FSM state
2 Discrete events generated by the continuous variables of the SAS
3 Exogenous discrete inputs
4 Time events
Generates a binary vector δe (t) ∈ {0, 1}ne of event conditions according to the
satisfaction of a linear (or affine) condition.
Red
∼ δ3 δ1 ∧ ∼ uℓ2
δ1 ∧ uℓ2
δ2
Green Blue
δ3 ∧ uℓ1
∼ uℓ1 ∧ δ3 ∼ δ2
δe (k) uc (k)
...
SYS 1
SYS s
uc (k)
SWITCHED AFFINE
xb (k) SYSTEM (SAS)
MODE SELECTOR
ub (k) (MS)
δe (k)
PWA:
mode enumeration explodes
DHA:
good framework for the description of a hybrid systems
not convenient for the MPC formulation
Final result: a compact model with linear equalities and inequalities involving
real and binary variables
Aim
Given a Boolean formula F (p1 , p2 , . . . , pn ) define a polyhedral set P such that
a set of binary values {δ1 , δ2 , . . . , δn } satisfies the Boolean formula F in P . I.e.,
1 remove implication:
δ1 δ2 δ3
0 0 1
0 1 1
δ3
1 0 0
1 1 1
0
0
1
δ2
δ1 0 1
δ2 − δ3 ≤ 0
0 0 1 1
δ3 ≤ 1
hull 0 , 1 , 0 , 1 =
δ 1 − δ 2 + δ3 ≤ 1
1 1 0 1
−δ − δ3 ≤April−1
Francesco Borrelli (UC Berkeley) Hybrid Systems
1 25, 2011 33 / 59
Linear Inequality As Logic Condition
Event Generator
Defined by function fEG : Xc × Uc × N0 → D:
X = {x | aT x − b ∈ [m, M ]}
where x ∈ X , with
sup aTi x − bi ≤ Mi ,
x∈X
inf aTi x − bi ≥ mi .
x∈X
−mδt ≤ xt − m
−(M + ǫ)δt ≤ −xt − ǫ,
4 constraints on z:
zt ≤ M δt
zt ≥ mδt
zt ≤ xt − m(1 − δt )
zt ≥ xt − M (1 − δt )
xt+1 = Axt + B1 ut + B2 δt + B3 zt
yt = Cxt + D1 ut + D2 δt + D3 zt
E2 δt + E3 zt ≤ E4 xt + E1 ut + E5
where x ∈ Rnc × {0, 1}nb , u ∈ Rmc × {0, 1}mb y ∈ Rpc × {0, 1}pb , δ ∈ {0, 1}rb
and z ∈ Rrc .
T
Well-Posedness: for a given xTt uTt
Complete Well-Posedness:
T
well-posedness + uniquely determined δt and zt ∀ xTt uTt
xt+1 = Axt + B1 ut + B2 wt ,
yt = Cxt + D1 ut + D2 wt ,
vt = E1 xt + E2 ut + E3 wt + g4
0 ≤ vt ⊥ wt ≥ 0
xt+1 = Mx (xt , ut , dt ),
yt = My (xt , ut , dt ),
Mc (xt , ut , dt ) ≤ c
ELC
MMPS MLD LC
DHA PWA
HYSDEL
based on DHA
enables description of discrete-time hybrid systems in a compact way:
◮ automata and propositional logic
◮ continuous dynamics
◮ A/D and D/A conversion
◮ definition of constraints
automatically generates MLD models for MATLAB
freely available from:
http://control.ee.ethz.ch/~hybrid/hysdel/
Case 2. The MILP solution is bounded, i.e., J ∗ > −∞ and the optimizer
is unique. Z ∗ is a singleton.
Case 3. The MILP solution is bounded and there are infinitely many
optima corresponding to the same integer value.
Case 4. The MILP solution is bounded and there are finitely many
optima corresponding to different integer values.
Brute force approach to the solution: enumerating all the 2sb integer
values of the variable zb and solve the corresponding QPs. By comparing
the 2sb optimal costs one can derive the optimizer and the optimal cost of
the MIQP.
Case 3. The MIQP solution is bounded and there are infinitely many
optima corresponding to the same integer value. subset of Rs
and an integer number zb∗ . This cannot happen if H ≻ 0.
Case 4. The MIQP solution is bounded and there are finitely many
optima corresponding to different integer values.
N
X −1
J ∗ (xt|t ) = min ℓN (xt+N |t ) + ℓ(xt+k|t , ut+k|t , δt+k|t , zt+k|t ),
U
k=0
xt+k+1|t = Axt+k|t + B1 ut+k|t + B2 δt+k|t + B3 zt+k|t
s.t. E2 δt+k|t + E3 zt+k|t ≤ E4 xt+k|t + E1 ut+k|t + E5
xt+N |t ∈ Xf
where x ∈ Rnc × {0, 1}nb , u ∈ Rmc × {0, 1}mb , y ∈ Rpc × {0, 1}pb , δ ∈ {0, 1}rb
and z ∈ Rrc and T
U = uTt|t uTt+1|t . . . uTt+N −1|t
ℓN (x) = kP xk2
ℓ(x, u, δ, z) = kQx xk2 + kQu uk2 + kQδ δk2 + kQz zk2
s. t. Gξ ≤ W + Sxt|t
Theorem
The solution to the CFTOC problem based on MLD model and with the cost
based on quadratic norm is time-varying PWA feedback law of the form:
Rt
where Rit i=1 are regions partitioning the set of feasible states Xt∗ and the
closure R̄ik of the sets Rik has the following form:
k = 0, . . . , N − 1.
SsN
The set X0 = i=1 Di in general is not convex.
The sets Di can, in general, overlap. I.e., some initial state is feasible
for more switching sequences.
ℓN (x) = kP xk1,∞
ℓ(x, u, δ, z) = kQx xk1,∞ + kQu uk1,∞ + kQδ δk1,∞ + kQz zk1,∞
Introduce decision variables to model ∞-norm:
−1n εxt+k|t ≤ ±Qx xt+k|t
−1m εut+k|t ≤ ±Qu ut+k|t
−1rb εδt+k|t ≤ ±Qδ δt+k|t
−1rc εzt+k|t ≤ ±Qz zt+k|t
−1n εxt+N |t ≤ ±P xt+N |t ,
where k = 0, . . . , N − 1, n = nc + nb , m = mc + mb .
Introduce the optimization vector:
h
ξ = U T , εxt|t , . . . , εxt+N |t , εut|t , . . . , εut+N −1|t ,
iT
εδt|t , . . . , εδt+N −1|t , εzt|t , . . . , εzt+N −1|t
s. t. Gξ ≤ W + Sxt|t
Theorem
The solution to the CFTOC problem based on MLD model and with the cost
based on norms {1, ∞} is time-varying PPWA feedback law of the form:
Rt
where Rit i=1 are polyhedral regions partitioning the set of feasible states Xt∗ .
the complexity strongly depends on the problem structure and the initial
setup
in general:
Mixed-Integer programming is HARD
N = 12, PN = Qx = I, Qu = 1, ∞ − norm
Controller partition with 252 regions
Value of the control action U over 252 regions
1 10
4
1
2
u∗ (x)
0.5
x2
0
0
−2
−0.5 −4
10
−1 5 −6
10 0
5 −8
0 −5
−5 x1
−10 −10 −10
−10 −8 −6 −4 −2 0 2 4 6 8 10
Francesco Borrelli (UC x 2
Berkeley) Hybrid Systems x April 25, 2011 59 / 59