Hyrid Control nd Switched Systems Lecture #2 How to descrie hyrid system? Forml models for hyrid system João P. Hespnh University of Cliforni t Snt Brr Summry. Forml models for hyrid systems: Finite utomt Differentil equtions Hyrid utomt Open hyrid utomton 2. Nondeterministic vs. stochstic systems Non-deterministic hyrid utomt Stochstic hyrid utomt
Exmple #5: Multiple-tnk system pump pump-on inflow λ constnt outflow μ y gol prevent the tnk from emptying or filling up δ dely etween commnd is sent to pump nd the time it is executed gurd condition pump off τ δ? wit to off y y min? τ ú 0 stte reset τ ú 0 wit to on τ δ? pump on y y mx? How to formlly descrie this hyrid system? utomt M Deterministic finite utomton Q ú {q, q 2,, q n } finite set of sttes Σ ú {,, c, } finite set of input symols (lphet) Φ : Q Σ Q trnsition function Exmple: q Q 2 2 locking stte s Σ / Φ(q,s) 2 Grph representtion: 2 one node per stte (except for locking stte ) one directed edge (rrow) from q to Φ(q, s) with lel s for ech pir (q, s) for which Φ(q, s) 2
2 Deterministic finite utomton Nottion: Given set A string finite sequence of symols empty string A * set of ll strings of symols in set A e.g., A = {, } s = A * s[] = (rd element) s = 8 (length of string) Definition: Given initil stte q Q set of finl sttes F Q M ccepts string s Σ * with length n ú s if there exists sequence of sttes q Q * with length q = n+ (execution) such tht. q[] = q (strts t initil stte) 2. q[i+] = Φ(q[i], s[i] ), i {,2,,n} (follows rrows with correct lel). q[n+] F (ends in set of finl sttes) Definition: lnguge ccepted y utomton M L(M) ú { set of ll strings ccepted y M } There is no concept of time the whole string is ccepted instntneously 2 Deterministic finite utomton Definition: Given initil stte q Q set of finl sttes F Q M ccepts string s Σ * with length n ú s if there exists sequence of sttes q Q * with length q = n+ (execution) such tht. q[] = q (strts t initil stte) 2. q[i+] = Φ(q[i], s[i] ), i {,2,,n} (follows rrows with correct lel). q[n+] = F (ends in set of finl sttes) Definition: lnguge ccepted y utomton M L(M) ú { set of ll strings ccepted y M } Exmple: q ú F ú {} L(M)= {,,,,,, } = ( ()* ()* )* Questions in forml lnguge theory: Is there finite utomton tht ccepts given lnguge? Do two given utomt ccept the sme lnguge? Wht is the smllest utomton tht ccepts given lnguge? etc.
ordinry differentil eqution with input Σ Differentil eqution R m stte spce input spce f : R m vector field Definition: Given n input signl u : [0, ) R m A signl x : [0, ) is solution to Σ (in the sense of Crtheodory) if. x is piecewise differentile 2. If x is solution then t ny time t for which the derivtive exists ordinry differentil eqution without input Σ Differentil eqution (no inputs) f : stte spce vector field Definition: A signl x : [0, ) is solution to Σ (in the sense of Crtheodory) if. x is piecewise differentile 2. If x is solution then t ny time t for which the derivtive exists 4
Hyrid Automton (Exmple #2: Thermostt) x men temperture x 7? room off mode on mode heter x 77? Q set of discrete sttes continuous stte-spce f : Q vector field ϕ : Q Q discrete trnsition Exmple: Q ú { off, on } n ú note closed inequlities ssocited with jump nd open inequlities with flow Hyrid Automton (Exmple #2: Thermostt) x men temperture x 7? room off mode on mode heter x 77? Q set of discrete sttes continuous stte-spce f : Q vector field ϕ : Q Q discrete trnsition ϕ (q,x) = q 2? mode q 2 mode q mode q ϕ (q,x) = q? resets? 5
Hyrid Automton Q set of discrete sttes continuous stte-spce f : Q vector field ϕ : Q Q discrete trnsition ρ : Q reset mp x ú ρ (q,x ) mode q 2 ϕ (q,x ) = q 2? mode q mode q ϕ( q,x ) = q? x ú ρ (q,x ) Q f : Q Φ : Q Q Hyrid Automton set of discrete sttes continuous stte-spce vector field discrete trnsition (& reset mp) x ú Φ 2 (q,x ) mode q 2 Φ (q,x ) = q 2? mode q mode q Φ (q,x ) = q? x ú Φ 2 (q,x ) Compct representtion of hyrid utomton 6
Exmple #5: Multiple-tnk system pump pump-on inflow λ constnt outflow μ y gol prevent the tnk from emptying or filling up δ dely etween commnd is sent to pump nd the time it is executed pump off τ δ? wit to off y y min? τ ú 0 τ ú 0 wit to on τ δ? pump on y y mx? Exmple #5: Multiple-tnk system τ δ? pump off wit to off y y min? τ ú 0 τ ú 0 wit to on τ δ? pump on y y mx? Q ú { off, won, on, woff } R 2 continuous stte-spce 7
Solution to hyrid utomton x ú Φ 2 (q,x ) Φ (q,x ) = q 2? mode q 2 mode q Definition: A solution to the hyrid utomton is pir of right-continuous signls x : [0, ) q : [0, ) Q such tht. x is piecewise differentile & q is piecewise constnt 2. on ny intervl (t,t 2 ) on which q is constnt nd x continuous continuous evolution. discrete trnsitions Hyrid Automton (Exmple #2: Thermostt) x men temperture x 7? room off mode on mode heter x 77? 77 7 x x = 77, q = on q = off no trnsition would occur if the jump rnch hd strict inequlity x > 77 q = on off off off on on on note closed inequlities ssocited with jumps nd open inequlities with flows 8
Exmple #7: Server system with congestion control incoming rte r q mx q Additive increse/multiplictive decrese congestion control (AIMD): while q < q mx increse r linerly when q reches q mx instntneously multiply r y γ (0,) queue dynmics q q mx? server B rte of service (ndwidth) congestion controller q(t) r ú γ r t incoming rte r Open Automton (Exmple #7: Server system with congestion control) queue dynmics q q mx? q mx congestion controller r ú γ r q server vrile r B rte of service (ndwidth) queue dynmics event q q mx congestion controller 9
q mx incoming rte r server B rte of service (ndwidth) Open Automton (Exmple #7: Server system with congestion control) q queue dynmics vrile r congestion controller q q mx? queue-full event queue-full queue-full? r ú γ r synchronized trnsitions (ll gurds must hold for trnsition to occur) events re nothing more thn symolic lels for trnsitions incoming rte r q mx server B rte of service (ndwidth) Open Automton (Exmple #7: Server system with congestion control) q queue dynmics vrile r congestion controller q q mx? queue-full event queue-full r > queue-full r ú γ r synchronized trnsitions (ll gurds must hold for trnsition to occur) events re nothing more thn symolic lels for trnsitions 0
Open Automton (Exmple #5: Multiple-tnk system) pump pump-on inflow λ constnt outflow μ y gol prevent the tnk from emptying or filling up δ dely etween commnd is sent to pump nd the time it is executed pump off τ δ? wit to off y y min? τ ú 0 τ ú 0 wit to on τ δ? pump on y y mx? Open Automton (Exmple #5: Multiple-tnk system) pump pump-on inflow λ constnt outflow μ y gol prevent the tnk from emptying or filling up δ dely etween commnd is sent to pump nd the time it is executed sk y y min? pump off event chnge idle chnge? sk? chnge y y mx? chnge? pump on event sk τ ú 0 dely τ δ? sk
utomt M Deterministic finite utomton Q ú {q, q 2,, q n } finite set of sttes Σ ú {,, c, } finite set of input symols (lphet) Φ : Q Σ Q trnsition function Exmple: q Q 2 2 locking stte s Σ / Φ(q,s) 2 Grph representtion: 2 one node per stte (except for locking stte ) one directed edge (rrow) from q to Φ(q, s) with lel s for ech pir (q, s) for which Φ(q, s) utomt M Nondeterministic finite utomton Q ú {q, q 2,, q n } finite set of sttes Σ ú {,, c, } finite set of input symols (lphet) Φ : Q Σ 2 Q trnsition set-vlued function Exmple: q Q 2 2 locking stte s Σ / Φ(q,s) {2} { } { } {,} {} { } { } Grph representtion: 2 Nottion: Given set A, 2 A power-set of A, i.e., the set of ll susets of A e.g., A = {,2} 2 A = {, {}, {2}, {,2} } When A hs n < elements then 2 A hs 2 n elements 2
2 Nondeterministic finite utomton Exmple: q ú F ú {} L(M)= {,,,,,, } = ( ()* ()* )* Definition: Given initil stte q Q set of finl sttes F Q M ccepts string s Σ * with length n ú s if there exists sequence of sttes q Q * with length q = n+ (execution) such tht. q[] = q (strts t initil stte) 2. q[i+] Φ(q[i], s[i] ), i {,2,,n} (follows rrows with correct lel). q[n+] F (ends in set of finl sttes) Definition: lnguge ccepted y utomton M L(M) ú { set of ll strings ccepted y M } Determiniztion From forml lnguge theory: For every nondeterministic finite utomton there is deterministic one tht ccepts the sme lnguge (ut generlly the deterministic one needs more sttes) nondeterministic utomton M 2 deterministic utomton N 2 or 2 or from only ccepts nd goes to 2 from 2 only ccepts nd cn go to either or from or only ccepts nd goes to 2 or resp. from (or 2) cn ccepts nd go to 2 from ( or) 2 cn ccept nd go to or Sme lnguge: L(M) = L(N) = ( ()* ()* )* M provides more compct representtion
η η 2 η η 4 Exmple #: Trnsmission throttle u [-,] position θ g {,2,,4} ger ω velocity η k efficiency of the k th ger ω velocity [Hedlund, Rntzer 999] Exmple #: Semi-utomtic trnsmission v(t) { up, down, keep } drivers input (discrete) v = up or ω ω 2? v = up or ω ω? v = up or ω ω 4? g = g = 2 g = g = 4 v = down or ω ϖ? v = down or ω ϖ 2? v = down or ω ϖ? ω 2 g = ω g = 2 ϖ g = ϖ 2 ω 4 g = 4 ϖ 4
Nondeterministic Hyrid Automton (Exmple #: Semi-utomtic trnsmission) Suppose we wnt to consider ll possile driver inputs: ω ϖ? ω ϖ 2? ω ϖ? g = g = 2 g = g = 4 ω ω ϖ ω ω ϖ 2 ω ω 4 2 ω ϖ invrince condition (must hold to remin in discrete stte) g = ω ω 2? ω ω? ω ω 4? ϖ ϖ 2 ω 2 ω g = 2 g = ϖ gurd condition (does not force jump, simply llows it) ω 4 g = 4 Nondeterministic Hyrid Automton Q set of discrete sttes continuous stte-spce f : Q vector field ϕ : Q 2 Q set-vlued discrete trnsition ρ : Q 2 Rn set-vlued reset mp Δ Q domin or invrint set x ρ(q,x ) mode q 2 (q 2,x) Δ q 2 ϕ(q,x )? mode q mode q (q,x) Δ (q,x) Δ q ϕ(q,x )? x ρ(q,x ) 5
Nondeterministic Hyrid Automton Q set of discrete sttes continuous stte-spce f : Q vector field Φ: Q 2 Q Rn set-vlued discrete trnsition (& reset & domin)? ú (q 2, x) Φ(q,x ) mode q 2 mode q mode q (q 2,x) Φ(q 2,x ) (q,x) Φ(q,x ) (q,x) Φ(q,x ) (q, x) Φ(q,x ) Compct representtion of nondeterministic hyrid utomton gurd condition (does not force jump, simply llows it) Nondeterministic Hyrid Automton (Exmple #: Semi-utomtic trnsmission) ω ϖ? g = g = 2 g = ϖ ω 2 g = 2 invrince condition (must hold to remin in discrete stte) ω ω 2 ϖ ω ω ω ω 2? Q ú {, 2 } R 2 continuous stte-spce 6
Solution to nondeterministic hyrid utomton (q 2, x) Φ(q,x ) mode q 2 mode q (q 2,x) Φ(q 2,x ) (q,x) Φ(q,x ) Definition: A solution to the hyrid utomton is pir of right-continuous signls x : [0, ) q : [0, ) Q such tht. x is piecewise differentile & q is piecewise constnt 2. on ny intervl (t,t 2 ) on which q is constnt nd x continuous continuous evolution. discrete trnsition & resets & domin Stochstic finite utomton: controlled Mrkov chin controlled Mrkov chin M 2 20% 80% Q ú {q, q 2,, q n } finite set of sttes Σ ú {,, c, } finite set of input symols Φ : Q Q Σ [0,] trnsition proility function Φ(q, q 2, s ) proility of trnsitioning to stte q 2, when in stte q nd symol s is selected By convention, typiclly edges drwn without proilities correspond to trnsitions tht occur with proility self-loops my e omitted 7
Stochstic finite utomton: controlled Mrkov chin 00% 00% 2 00% 20% 00% 80% By convention, typiclly edges drwn without proilities correspond to trnsitions tht occur with proility self loops my e omitted 00% Q ú {, 2, } Σ ú {, } Φ(q, q 2, s ) proility of trnsitioning to stte q 2, when in stte q nd symol s is selected Stochstic Hyrid Automton Q set of discrete sttes continuous stte-spce f : Q vector field ϕ : Q Q [0, ] discrete trnsition proility ρ : Q Q reset mp (deterministic) x ú ρ (q, q 2, x ) ϕ (q, q 2, x ) mode q 2 (Poisson-like model) mode q mode q ϕ (q, q, x ) x ú ρ (q, q, x ) 8
Stochstic Hyrid Automton Q set of discrete sttes continuous stte-spce f : Q vector field Φ : Q Q [0, ] discrete trnsition proility & reset ϕ (q, q 2, x, x) (Poisson-like model) mode q 2 mode q mode q ϕ (q, q, x, x) More s specil topic lter Next clss. Trjectories of hyrid systems: Solution to hyrid system Execution of hyrid system 2. Degenercies Finite escpe time Chttering Zeno trjectories Non-continuous dependency on initil conditions 9