Create Presentation
Download Presentation

Download Presentation

Lecture #3 What can go wrong? Trajectories of hybrid systems

Download Presentation
## Lecture #3 What can go wrong? Trajectories of hybrid systems

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -

**Hybrid Control and Switched Systems**Lecture #3What can go wrong?Trajectories of hybrid systems João P. Hespanha University of Californiaat Santa Barbara**Summary**• Trajectories of hybrid systems: • Solution to a hybrid system • Execution of a hybrid system • Degeneracies • Finite escape time • Chattering • Zeno trajectories • Non-continuous dependency on initial conditions**Hybrid Automaton (deterministic)**Q ´ set of discrete states Rn´ continuous state-space f : Q£Rn!Rn´ vector field : Q£Rn!Q´ discrete transition r : Q£Rn!Rn´ reset map j(q1,x–) = q2 ? xr(q1,x–) mode q1 mode q3 mode q2 xr(q1,x–) j(q1,x–) = q3 ?**Hybrid Automaton**Q ´ set of discrete states Rn´ continuous state-space f : Q£Rn!Rn´ vector field F : Q£Rn!Q£Rn´ discrete transition (& reset map) F1(q1,x–) = q2 ? x F2(q1,x–) mode q1 mode q3 mode q2 x F2(q1,x–) F1(q1,x–) = q3 ? Compact representation of a hybrid automaton**Solution to a hybrid automaton**mode q1 mode q2 F1(q1,x–) = q2 ? x F2(q1,x–) Definition: A solution to the hybrid automaton is a pair of right-continuous signals x : [0,1) !Rnq : [0,1) !Qsuch that 1. x is piecewise differentiable & q is piecewise constant 2. on any interval (t1,t2) on which q is constant and x continuous 3. continuous evolution discrete transitions**Example #4: Inverted pendulum swing-up**q Hybrid controller: 1st pump/remove energy into/from the system by applying maximum force, until E ¼ 0 2nd wait until pendulum is close to the upright position 3th next to upright position use feedback linearization controller u2 [-1,1] E2 [–e,e] ? remove energy E < –e ? stabilize wait E>e? pump energy |w| + |q| ·d ? E2 [–e,e] ?**Example #4: Inverted pendulum swing-up**stabilize wait pump energy E¸ – e ? |w| + |q| ·d ? Q = { pump, wait, stab } R2 = continuous state-space**Example #4: Inverted pendulum swing-up**stabilize wait pump energy E¸ – e ? |w| + |q| ·d ? Q = { pump, wait, stab } R2 = continuous state-space |w| + |q| d – e t q = wait q = stab E q = pump What if we already have |w| + |q| ·d when E reaches – e?**Example #4: Inverted pendulum swing-up**stabilize wait pump energy E¸ – e ? |w| + |q| ·d ? Q = { pump, wait, stab } R2 = continuous state-space |w| + |q| t* d – e t q = stab In general, we may need more than one value for the state at each instant of time q = wait E q( t* ) = ? q = pump**Hybrid signals**Definition: A hybrid time trajectory is a (finite or infinite) sequence of closed intervals t = { [ti,t'i] : ti·t'i, t'i = ti+1 , i =1,2, … } (if t is finite the last interval may by open on the right) T´ set of hybrid time trajectories Definition: For a given t = { [ti,t'i] : ti·t'i, ti+1 = t'i, i =1,2, … } 2 T a hybrid signal defined on t with values on X is a sequence of functions x = {xi : [ti,t'i]!X i =1,2, … } x : t!X´ hybrid signal defined on t with values on X E.g., t { [0,1], [1,1], [1,1], [1,+1) }, x { t/2 , 1/4 , 3/4, 1/t } 3/4 1/t t/2 1/4 t A hybrid signal can take multiple values for the same time-instant [1,1] [0,1] [1,1] [1,+1)**Execution of a hybrid automaton**mode q1 mode q2 F1(q1,x–) = q2 ? x F2(q1,x–) Definition: An execution of the hybrid automaton is a pair of hybrid signals x : t!Rnq : t!Q t = { [ti,t'i] : i =1,2, … } 2 Tsuch that 1. on any [ti,t'i] 2t, qi is constant and 2. continuous evolution discrete transitions**Example #4: Inverted pendulum swing-up**stabilize wait pump energy E¸ – e ? |w| + |q| ·d ? Q = { pump, wait, stab } R2 = continuous state-space |w| + |q| t { [0,t*], [t*, t*], [t*,+1) } q { pump , wait , stab } x { … , … , … } t* d – e t q = stab q = wait E • There are other concepts of solution that also avoid this problem [Teel 2005] • Could one “fix” this hybrid system to still work with the usual notion of solution? q = pump**What can go wrong?**• Problems in the continuous evolution: • existence • uniqueness • finite escape • Problems in the hybrid execution: • Chattering • Zeno • Non-continuous dependency on initial conditions**Existence**f(x) discontinuous x There is no solution to this differential equation that starts with x(0) = 0 Why? one any interval [0,e) x cannot: remain zero, become positive, or become negative. (x = 0 would make some sense) Theorem [Existence of solution] If f : Rn!Rn is continuous, then 8x0 2 Rn there exists at least one solution with x(0) = x0, defined on some interval [0,e)**Uniqueness**f(x) 1 derivative at 0 There are multiple solutions that start at x(0) = 0, e.g., x x t t Definitions: A function f : Rn!Rn is Lipschitz continuous if in any bounded subset of S of Rn there exists a constant c such that (f is differentiable almost everywhere and the derivative is bounded on any bounded set) Theorem [Uniqueness of solution] If f : Rn!Rn is Lipschitz continuous, then 8x0 2 Rn there a single solution with x(0) = x0, defined on some interval [0,e)**Finite escape time**x unbounded derivative t Any solution that does not start at x(0) = 0 is of the form T-1 T finite escape ´ solution x tends to 1 in finite time Definitions: A function f : Rn!Rn is globally Lipschitz continuous if there exists a constant c such that f grows no faster than linearly Theorem [Uniqueness of solution] If f : Rn!Rn is globally Lipschitz continuous, then 8x0 2 Rn there a single solution with x(0) = x0, defined on [0,1)**Degenerate executions due to problems in the continuous**evolution t = { [0,1] , [1,2] } q = {q1(t) = 1 , q2(t) = 2 } x = {x1(t) = t , x2(t) = 2 – t } x¸ 1 ? q = 2 q = 1 x1(t) x x2(t) 1 t 2 t = { [0,1] , [1,2) } q = {q1(t) = 1 , q2(t) = 2 } x = {x1(t) = t , x2(t) = 1/(2 – t) } x¸ 1 ? q = 2 q = 1 x1(t) x x2(t) 1 t 2**Chattering**q = 2 q = 1 There is no solution past x = 0 x(t) t 1 x¸ 0 ? but there is an execution x < 0 ? t = { [0,1] , [1], [1], [1], … } q = {q1(t) = 2 , q2(t) = 1, q1(t) = 2, …} x = {x1(t) = 1 – t , x2(t) = 0, x2(t) = 0, …} q2k+1 (t)k¸ 1 q1 (t) q2k(t)k¸ 1 x1 (t) Chattering execution ´t is infinite but after some time, all intervals are singletons xk(t)k¸ 2 t 1**Example #3: Semi-automatic transmission**g = 1 g = 2 g = 3 g = 4 v(t) 2 { up, down, keep } ´ drivers input (discrete) v = up or w¸w2 ? v = up or w¸w3 ? v = up or w¸w4 ? v = down or w·1 ? v = down or w·2 ? v = down or w·3 ? w2 g = 1 w3 1 g = 2 w4 2 g = 3 g = 4 3 If the driver sets v(t) = up8t¸t* and w(t*)·1 one gets chattering. For ever?**Example #1: Bouncing ball (Zeno execution)**Free fall ´ g g Collision ´ y y c2 [0,1) ´ energy absorbed at impact x1 = 0 & x2 <0 ? t x2 – c x2 –**Zeno solution**x1 = 0 & x2 <0 ? t1 t2 t3 t x2 – c x2 –**Zeno execution**x1 = 0 & x2 <0 ? t1 t2 t3 t x2 – c x2 – Zeno execution ´t is infinite but the execution does not extend to t = +1 Zeno time´ t1 sups2t s**Example #9: Water tank system (regularization)**inflow ´l goal ´ prevent both tanks from becoming emptying x2 · h2 ? q = 2 q = 1 x1 h2 h1 x2 outflow ´m1 outflow ´m2 x1 · h1 ? x2 x1 h1 = h2 q = 1 q = 2 q = 1**Temporal regularizationExample #9: Water tank system**inflow ´l x2 · h2 ? q = 2 x1 h2 h1 x2 x1 · h1 ? outflow ´m1 outflow ´m2 x2 · h2, t > e ? t 0 q = 2 q = 1 only jump after a minimum time has elapsed t 0 x1 · h1, t > e ?**Spatial regularizationExample #9: Water tank system**inflow ´l x2 · h2 ? q = 2 x1 h2 h1 x2 x1 · h1 ? outflow ´m1 outflow ´m2 x2 · h2, |x1–x3|+|x2–x4|> e ? x3x1, x4x2 only jump after a minimum change in the continuous state has occurred q = 2 q = 1 x3x1, x4x2 x1 · h1, |x1–x3|+|x2–x4|> e ?**Continuity with respect to initial conditions**Theorem [Uniqueness & continuity of solution] If f : Rn!Rn is Lipschitz continuous, then 8x0 2 Rn there a single solution with x(0) = x0, defined on some interval [0,e) Moreover, given any T < 1, and two solutions x1, x2 that exist on [0,T]: 8e > 0 9d > 0 : ||x1(0) – x2(0)|| ·d) ||x1(t) – x2(t)|| ·e8t2 [0,T] value of the solution on the interval [0,T] is continuous with respect to the initial conditions**Discontinuity with respect to initial conditions**x1 ¸ 0 & x2 > 0 ? x1 ¸ 0 & x2 · 0 ? mode q1 mode q2 mode q3 1 x2 x2 e x1 e – 1 x1 no matter how close to zero x2(0) = e > 0 is, x2(2) = e – 1 if x2(0) = 0 then x2(2) = 1 problem arises from discontinuity of the transition function**Next class…**• Numerical simulation of hybrid automata • simulations of ODEs • zero-crossing detection • Simulators • Simulink • Stateflow • SHIFT • Modelica • Follow-up homework • Find conditions for the existence of solution to a hybrid system