Hybrid Conrol and Swiched Sysems Lecure #3 Wha can go wrong? Trajecories of hybrid sysems João P. Hespanha Universiy of California a Sana Barbara Summary 1. Trajecories of hybrid sysems: Soluion o a hybrid sysem Execuion of a hybrid sysem 2. Degeneracies Finie escape ime Chaering Zeno rajecories Non-coninuous dependency on iniial condiions 1
Hybrid Auomaon (deerminisic) Q se of discree saes R n coninuous sae-space f : Q R n R n vecor field ϕ : Q R n Q discree ransiion ρ : Q R n R n rese map x ú ρ(q 1,x ) mode q 2 ϕ(q 1,x ) = q 2? mode q 1 mode q 3 ϕ(q 1,x ) = q 3? x ú ρ(q 1,x ) Q R n f : Q R n R n Φ : Q R n Q R n Hybrid Auomaon se of discree saes coninuous sae-space vecor field discree ransiion (& rese map) x ú Φ 2 (q 1,x ) mode q 2 Φ 1 (q 1,x ) = q 2? mode q 1 mode q 3 Φ 1 (q 1,x ) = q 3? x ú Φ 2 (q 1,x ) Compac represenaion of a hybrid auomaon 2
Soluion o a hybrid auomaon x ú Φ 2 (q 1,x ) Φ 1 (q 1,x ) = q 2? mode q 2 mode q 1 Definiion: A soluion o he hybrid auomaon is a pair of righ-coninuous signals x : [0, ) R n q : [0, ) Q such ha 1. x is piecewise differeniable & q is piecewise consan 2. on any inerval ( 1, 2 ) on which q is consan and x coninuous coninuous evoluion 3. discree ransiions Example #4: Invered pendulum swing-up u [-1,1] θ Hybrid conroller: 1 s pump/remove energy ino/from he sysem by applying maximum force, unil E 0 2 nd wai unil pendulum is close o he uprigh posiion 3 h nex o uprigh posiion use feedback linearizaion conroller remove energy E [ ε,ε]? E < ε? wai sabilize E>ε? pump energy E [ ε,ε]? ω + θ δ? 3
Example #4: Invered pendulum swing-up pump energy wai sabilize Ε ε? ω + θ δ? Q = { pump, wai, sab } R 2 = coninuous sae-space (pump,x) q = pump,e < ² (wai,x) q = pump,e ² Φ(q,x)= (wai,x) q =wai, ω + θ > δ (sab,x) q =wai, ω + θ δ (sab,x) q =sab Example #4: Invered pendulum swing-up pump energy wai sabilize Ε ε? ω + θ δ? Q = { pump, wai, sab } R 2 = coninuous sae-space δ ω + θ ε E q = wai q = sab q = pump Wha if we already have ω + θ δ when E reaches ε? 4
Example #4: Invered pendulum swing-up pump energy wai sabilize Q = { pump, wai, sab } δ ε ω + θ E q = pump * Ε ε? q = wai ω + θ δ? R 2 = coninuous sae-space (pump,x) q =pump,e < ² (wai,x) q =pump,e ² Φ(q, x) = (wai,x) q =wai, ω + θ > ² (sab,x) q =wai, ω + θ ² (sab,x) q =sab q = sab q( * ) =? In general, we may need more han one value for he sae a each insan of ime Hybrid signals Definiion: A hybrid ime rajecory is a (finie or infinie) sequence of closed inervals τ = { [τ i,τ' i ] : τ i τ' i, τ' i = τ i+1, i =1,2, } (if τ is finie he las inerval may by open on he righ) T se of hybrid ime rajecories Definiion: For a given τ = { [τ i,τ' i ] : τ i τ' i, τ i+1 = τ' i, i =1,2, } T a hybrid signal defined on τ wih values on X is a sequence of funcions x = {x i : [τ i,τ' i ] X i =1,2, } x : τ X hybrid signal defined on τ wih values on X E.g., τ ú { [0,1], [1,1], [1,1], [1,+ ) }, x ú { /2, 1/4, 3/4, 1/ } /2 3/4 1/4 1/ [0,1] [1,1] [1,1] [1,+ ) A hybrid signal can ake muliple values for he same ime-insan 5
Execuion of a hybrid auomaon x ú Φ 2 (q 1,x ) Φ 1 (q 1,x ) = q 2? mode q 2 mode q 1 Definiion: An execuion of he hybrid auomaon is a pair of hybrid signals x : τ R n q : τ Q τ = { [τ i,τ' i ] : i =1,2, } T such ha 1. on any [τ i,τ' i ] τ, q i is consan and coninuous evoluion 2. discree ransiions Example #4: Invered pendulum swing-up pump energy wai sabilize Ε ε? ω + θ δ? Q = { pump, wai, sab } R 2 = coninuous sae-space δ ε ω + θ * q = sab τ ú { [0, * ], [ *, * ], [ *,+ ) } q ú { pump, wai, sab } x ú {,, } E q = pump q = wai 1. There are oher conceps of soluion ha also avoid his problem [Teel 2005] 2. Could one fix his hybrid sysem o sill work wih he usual noion of soluion? 6
Wha can go wrong? 1. Problems in he coninuous evoluion : exisence uniqueness finie escape 2. Problems in he hybrid execuion: Chaering Zeno 3. Non-coninuous dependency on iniial condiions Exisence f(x) disconinuous x There is no soluion o his differenial equaion ha sars wih x(0) = 0 Why? one any inerval [0,ε) x canno: remain zero, become posiive, or become negaive. (x = 0 would make some sense) Theorem [Exisence of soluion] If f : R n R n is coninuous, hen x 0 R n here exiss a leas one soluion wih x(0) = x 0, defined on some inerval [0,ε) 7
Uniqueness f(x) derivaive a 0 There are muliple soluions ha sar a x(0) = 0, e.g., x x Definiions: A funcion f : R n R n is Lipschiz coninuous if in any bounded subse of S of R n here exiss a consan c such ha (f is differeniable almos everywhere and he derivaive is bounded on any bounded se) Theorem [Uniqueness of soluion] If f : R n R n is Lipschiz coninuous, hen x 0 R n here a single soluion wih x(0) = x 0, defined on some inerval [0,ε) Finie escape ime x Any soluion ha does no sar a x(0) = 0 is of he form unbounded derivaive T -1 T finie escape soluion x ends o in finie ime Definiions: A funcion f : R n R n is globally Lipschiz coninuous if here exiss a consan c such ha f grows no faser han linearly Theorem [Uniqueness of soluion] If f : R n R n is globally Lipschiz coninuous, hen x 0 R n here a single soluion wih x(0) = x 0, defined on [0, ) 8
Degenerae execuions due o problems in he coninuous evoluion x 1? q = 1 q = 2 τ = { [0,1], [1,2] } q = {q 1 () = 1, q 2 () = 2 } x = {x 1 () =, () = 2 } x x 1 () () 1 2 τ = { [0,1], [1,2) } q = {q 1 () = 1, q 2 () = 2 } x = {x 1 () =, () = 1/(2 ) } x 1? q = 1 q = 2 x x 1 () () 1 2 Chaering There is no soluion pas x = 0 x () 1 q = 1 x 0? q = 2 bu here is an execuion x < 0? q 1 () q 2k+1 () k 1 τ = { [0,1], [1], [1], [1], } q = {q 1 () = 2, q 2 () = 1, q 1 () = 2, } x = {x 1 () = 1, () = 0, () = 0, } x 1 () q 2k () k 1 x k () k 2 1 Chaering execuion τ is infinie bu afer some ime, all inervals are singleons 9
Example #3: Semi-auomaic ransmission v() { up, down, keep } drivers inpu (discree) v = up or ω ω 2? v = up or ω ω 3? v = up or ω ω 4? g = 1 g = 2 g = 3 g = 4 v = down or ω ϖ 1? v = down or ω ϖ 2? v = down or ω ϖ 3? ω 2 g = 1 ϖ 1 g = 2 ω 3 ϖ 2 g = 3 ϖ 3 g = 4 ω 4 If he driver ses v() = up * and ω( ) ϖ 1 one ges chaering. For ever? Example #1: Bouncing ball (Zeno execuion) y g Free fall Collision c [0,1) energy absorbed a impac x 1 = 0 & <0? ú c 10
Zeno soluion x 1 = 0 & <0? 1 2 3 ú c Zeno soluion x 1 = 0 & = 0? x 1 = 0 & <0? 1 2 3 ú c 11
Zeno execuion x 1 = 0 & <0? 1 2 3 ú c Zeno execuion τ is infinie bu he execuion does no exend o = + Zeno ime τ ú sup s τ s Example #9: Waer ank sysem (regularizaion) inflow λ goal preven boh anks from becoming empying h 2? q = 1 q = 2 x 1 h 1 h 2 ouflow μ 1 ouflow μ 2 x 1 h 1? x 1 h 1 = h 2 q = 1 q = 2 q = 1 12
inflow λ Temporal regularizaion Example #9: Waer ank sysem h 2? q = 2 x 1 h 1 h 2 x 1 h 1? ouflow μ 1 ouflow μ 2 only jump afer a minimum ime has elapsed h 2, τ > ε? q = 1 τ ú 0 q = 2 τ ú 0 x 1 h 1, τ > ε? inflow λ Spaial regularizaion Example #9: Waer ank sysem h 2? q = 2 x 1 ouflow μ 1 h 1 h 2 ouflow μ 2 only jump afer a minimum change in he coninuous sae has occurred h 2, x 1 x 3 + x 4 > ε? q = 1 x 1 h 1? x 3 ú x 1, x 4 ú q = 2 x 3 ú x 1, x 4 ú x 1 h 1, x 1 x 3 + x 4 > ε? 13
Coninuiy wih respec o iniial condiions Theorem [Uniqueness & coninuiy of soluion] If f : R n R n is Lipschiz coninuous, hen x 0 R n here a single soluion wih x(0) = x 0, defined on some inerval [0,ε) Moreover, given any T <, and wo soluions x 1, ha exis on [0,T]: ε > 0 δ > 0 : x 1 (0) (0) δ x 1 () () ε [0,T] value of he soluion on he inerval [0,T] is coninuous wih respec o he iniial condiions Disconinuiy wih respec o iniial condiions x 1 0 & > 0? mode q 1 ú 1 mode q 2 disconinuiy of he rese map x 1 0 & 0? ú 2 2 ε 1 x 1 1 1 no maer how close o zero (0) = ε > 0 is, (1) = 1 x 1 if (0) = 0 hen (1) = 2 14
Disconinuiy wih respec o iniial condiions x 1 0 & > 0? mode q 1 x 1 0 & 0? ẋ 1 =1 ẋ 2 =0 mode q 2 mode q 3 ẋ 1 =0 ẋ 1 =1 ẋ 2 = 1 ẋ 2 =1 ε 1 x 1 ε 1 x 1 no maer how close o zero (0) = ε > 0 is, (2) = ε 1 if (0) = 0 hen (2) = 1 problem arises from disconinuiy of he ransiion funcion Nex class 1. Numerical simulaion of hybrid auomaa simulaions of ODEs zero-crossing deecion 2. Simulaors Simulink Saeflow SHIFT Modelica Follow-up homework Find condiions for he exisence of soluion o a hybrid sysem 15