Modeling and Analysis of Hybrid Systems 7. Linear hybrid automata II Prof. Dr. Erika Ábrahám Informatik 2 - LuFG Theory of Hybrid Systems RWTH Aachen University Szeged, Hungary, 27 September - 6 October 217 Ábrahám - Hybrid Systems 1 / 26
Contents 1 Reachability analysis algorithms and tools 2 Reachability analysis for linear hybrid automata I 3 Reachability analysis for linear hybrid automata II Ábrahám - Hybrid Systems 2 / 26
Contents 1 Reachability analysis algorithms and tools 2 Reachability analysis for linear hybrid automata I 3 Reachability analysis for linear hybrid automata II Ábrahám - Hybrid Systems 3 / 26
Some tools for hybrid automata reachability analysis Tool Ariadne C2D2 Cora dreach Flow HSolver HyCreate HyPro HyReach HySon isat-ode KeYmaera NLTOOLBOX SoapBox SpaceEx Characteristics non-linear ODEs; Taylor models, boxes; interval constraint propagation, deduction non-linear ODEs; guaranteed simulation non-linear ODEs; geometric representations; several algorithms, linear abstraction non-linear ODEs; logical representation; interval constraint propagation, δ-reachability, bounded model checking non-linear ODEs; Taylor models; owpipe construction non-linear ODEs; logical representation; interval constraint propagation non-linear ODEs; boxes; owpipe construction linear ODEs; several representations; owpipe construction linear ODEs; support functions; owpipe construction non-linear ODEs; guaranteed simulation non-linear ODEs; logical representation; interval constraint propagation, bounded model checking dierential dynamic logic; logical representation; theorem proving, computer algebra non-linear ODEs; Bernstein expansion, hybridisation linear ODEs; symbolic orthogonal projections; owpipe construction linear ODEs; geometric and symbolic representations; owpipe construction We will learn how owpipe-construction-based methods work. Flow and HyPro were/are developed in our group. Besides them, most closely related is the SpaceEx tool. Ábrahám - Hybrid Systems 4 / 26
Forward reachability computation Input: Set Init of initial states. Output: Set R of reachable states. Algorithm: R new := Init; R := ; while (R new ){ }; return R R := R R new ; R new := Reach(R new )\R; Ábrahám - Hybrid Systems 5 / 26
Most well-known state set representations Geometric objects: hyperrectangles [Moore et al., 29] oriented rectangular hulls [Stursberg et al., 23] convex polyhedra [Ziegler, 1995] [Chen at el, 211] orthogonal polyhedra [Bournez et al., 1999] template polyhedra [Sankaranarayanan et al., 28] ellipsoids [Kurzhanski et al., 2] zonotopes [Girard, 25]) Other symbolic representations: support functions [Le Guernic et al., 29] Taylor models [Berz and Makino, 1998, 29] [Chen et al., 212] Ábrahám - Hybrid Systems 6 / 26
Reminder: Polytopes Halfspace: set of points satisfying c T x z Polyhedron: an intersection of nitely many halfspaces Polytope: a bounded polyhedron representation union intersection Minkowski sum V-representation by vertices easy hard easy H-representation by facets hard easy hard Ábrahám - Hybrid Systems 7 / 26
Contents 1 Reachability analysis algorithms and tools 2 Reachability analysis for linear hybrid automata I 3 Reachability analysis for linear hybrid automata II Ábrahám - Hybrid Systems 8 / 26
Linear hybrid automata I Linear hybrid automata of type I (LHA I) are hybrid automata with the following restrictions: All derivatives are dened by intervals. All invariants and jump guards are dened by polytopes. All jump resets are dened by linear transformations of the form x := Ax + b. Hybrid automata of this type have linear behaviour, i.e., when time passes by in a location, the values of the variables evolve according to a linear function. (To be more precise, each reachable state can be reached by such a linear evolution.) Ábrahám - Hybrid Systems 9 / 26
Reminder: Minkowski sum x 2 3 2 1 P x 2 3 2 1 Q = x 2 3 2 1 P Q 1 2 3 x 1 1 2 3 x 1 1 2 3 x 1 P Q = {p + q p P and q Q} Ábrahám - Hybrid Systems 1 / 26
Linear hybrid automata I: Time evolution Ábrahám - Hybrid Systems 11 / 26
Linear hybrid automata I: Time evolution x 2 initial state set X x 1 Ábrahám - Hybrid Systems 11 / 26
Linear hybrid automata I: Time evolution x 2 initial state set X x 1 ẋ 2 derivatives Q ẋ 1 Ábrahám - Hybrid Systems 11 / 26
Linear hybrid automata I: Time evolution x 2 initial state set X x 1 ẋ 2 cone(q) derivatives Q ẋ 1 Ábrahám - Hybrid Systems 11 / 26
Linear hybrid automata I: Time evolution x 2 initial state set X x 1 ẋ 2 cone(q) derivatives Q ẋ 1 Ábrahám - Hybrid Systems 11 / 26
Linear hybrid automata I: Time evolution x 2 x 2 initial state set X x 1 x 1 ẋ 2 cone(q) derivatives Q ẋ 1 Ábrahám - Hybrid Systems 11 / 26
Linear hybrid automata I: Time evolution x 2 x 2 X cone(q) initial state set X x 1 x 1 ẋ 2 cone(q) derivatives Q ẋ 1 Ábrahám - Hybrid Systems 11 / 26
Linear hybrid automata I: Time evolution x 2 x 2 X cone(q) initial state set X x 1 x 1 ẋ 2 cone(q) derivatives Q ẋ 1 Ábrahám - Hybrid Systems 11 / 26
Linear hybrid automata I: Time evolution x 2 x 2 X cone(q) initial state set X x 1 x 1 ẋ 2 cone(q) derivatives Q ẋ 1 Ábrahám - Hybrid Systems 11 / 26
Linear hybrid automata I: Time evolution x 2 x 2 X cone(q) initial state set X x 1 x 1 ẋ 2 cone(q) derivatives Q ẋ 1 Ábrahám - Hybrid Systems 11 / 26
Linear hybrid automata I: Time evolution x 2 (X cone(q)) Inv(l) x 2 initial state set X x 1 x 1 ẋ 2 cone(q) derivatives Q ẋ 1 Ábrahám - Hybrid Systems 11 / 26
Linear hybrid automata I: Discrete steps (jumps) x 2 Example jump: ( l, 4 x 2 5, }{{} x 2 : [2, 4], }{{} l ) Edge G R [4,5] R R [2,4] P x 1 l Ábrahám - Hybrid Systems 12 / 26
Linear hybrid automata I: Discrete steps (jumps) x 2 5 4 Example jump: ( l, 4 x 2 5, }{{} x 2 : [2, 4], }{{} l ) Edge G R [4,5] R R [2,4] P x 1 l Ábrahám - Hybrid Systems 12 / 26
Linear hybrid automata I: Discrete steps (jumps) x 2 5 4 Example jump: ( l, 4 x 2 5, }{{} x 2 : [2, 4], }{{} l ) Edge G R [4,5] R R [2,4] x 2 P G P x 1 x 1 l l Ábrahám - Hybrid Systems 12 / 26
Linear hybrid automata I: Discrete steps (jumps) x 2 5 4 Example jump: ( l, 4 x 2 5, }{{} x 2 : [2, 4], }{{} l ) Edge G R [4,5] R R [2,4] x 2 (P G) x1 P x 1 x 1 l l Ábrahám - Hybrid Systems 12 / 26
Linear hybrid automata I: Discrete steps (jumps) x 2 5 4 Example jump: ( l, 4 x 2 5, }{{} x 2 : [2, 4], }{{} l ) Edge G R [4,5] R R [2,4] x 2 ((P G) x1 ) R P x 1 x 1 l l Ábrahám - Hybrid Systems 12 / 26
Linear hybrid automata I: Discrete steps (jumps) x 2 5 4 Example jump: ( l, 4 x 2 5, }{{} x 2 : [2, 4], }{{} l ) Edge G R [4,5] R R [2,4] x 2 4 (((P G) x1 ) R) R P 2 x 1 x 1 l l Ábrahám - Hybrid Systems 12 / 26
Linear hybrid automata I: Discrete steps (jumps) x 2 5 4 Example jump: ( l, 4 x 2 5, }{{} x 2 : [2, 4], }{{} l ) Edge G R [4,5] R R [2,4] x 2 4 (((P G) x1 ) R) R P 2 x 1 x 1 l l Ábrahám - Hybrid Systems 12 / 26
Linear hybrid automata I: Discrete steps (jumps) x 2 5 4 Example jump: ( l, 4 x 2 5, }{{} x 2 : [2, 4], }{{} l ) Edge G R [4,5] R R [2,4] x 2 4 (((P G) x1 ) R) R P 2 x 1 x 1 l l Additionally, we intersect the result with the target location's invariant. Computed via projection, Minkowski sum and intersection. Ábrahám - Hybrid Systems 12 / 26
Contents 1 Reachability analysis algorithms and tools 2 Reachability analysis for linear hybrid automata I 3 Reachability analysis for linear hybrid automata II Ábrahám - Hybrid Systems 13 / 26
Linear hybrid automata II Linear hybrid automata of type II (LHA II) are hybrid automata with the following restrictions: All derivatives are dened by linear ordinary dierential equations (ODEs) of the form ẋ = Ax + Bu, where x = (x 1,..., x n ) T are the (continuous) variables, A is a matrix of dimension n n, u = (u 1,..., u m ) T are disturbance/input/control variables with rectangular domain U, and B is a matrix of dimension n m. All invariants and jump guards are dened by polytopes. All jump resets are dened by linear transformations of the form x := Ax + b. When time passes by in a location, the values of the continuous variables evolve according to linear ODEs. N.B.: Now the values follow non-linear functions! Ábrahám - Hybrid Systems 14 / 26
Approximating a owpipe Consider a dynamical system with state equation ẋ = f(x(t)). Ábrahám - Hybrid Systems 15 / 26
Approximating a owpipe Consider a dynamical system with state equation ẋ = f(x(t)). We assume f to be Lipschitz continuous. Ábrahám - Hybrid Systems 15 / 26
Approximating a owpipe Consider a dynamical system with state equation ẋ = f(x(t)). We assume f to be Lipschitz continuous. Wikipedia: Intuitively, a Lipschitz continuous function is limited in how fast it can change: for every pair of points on the graph of this function, the absolute value of the slope of the line connecting them is no greater than a denite real number [... ].. Ábrahám - Hybrid Systems 15 / 26
Approximating a owpipe Consider a dynamical system with state equation ẋ = f(x(t)). We assume f to be Lipschitz continuous. Wikipedia: Intuitively, a Lipschitz continuous function is limited in how fast it can change: for every pair of points on the graph of this function, the absolute value of the slope of the line connecting them is no greater than a denite real number [... ].. Lipschitz continuity implies the existence and uniqueness of the solution to an initial value problem, i.e., for every initial state x there is a unique solution x(t, x ) to the state equation. Ábrahám - Hybrid Systems 15 / 26
Approximating a owpipe The set of reachable states at time t from a set of initial states X is dened as R t (X ) = {x t x X. x t = x(t, x )}. Ábrahám - Hybrid Systems 16 / 26
Approximating a owpipe The set of reachable states at time t from a set of initial states X is dened as R t (X ) = {x t x X. x t = x(t, x )}. The set of reachable states, the owpipe, from X in the time interval [, T ] is dened as R [,T ] (X ) = t [,T ] R t (X ). Ábrahám - Hybrid Systems 16 / 26
Approximating a owpipe The set of reachable states at time t from a set of initial states X is dened as R t (X ) = {x t x X. x t = x(t, x )}. The set of reachable states, the owpipe, from X in the time interval [, T ] is dened as R [,T ] (X ) = t [,T ] R t (X ). We describe a solution which approximates the owpipe by a sequence of convex polytopes. Ábrahám - Hybrid Systems 16 / 26
Problem statement for polyhedral approximation of owpipes Given a set X of initial states which is a polytope, and a nal time T, compute a polyhedral approximation ˆR [,T ] (X ) to the owpipe R [,T ] (X ) such that R [,T ] (X ) ˆR [,T ] (X ). Ábrahám - Hybrid Systems 17 / 26
Flowpipe segmentation Since a single convex polyhedron would strongly overapproximate the owpipe, we compute a sequence of convex polyhedra, each approximating a owpipe segment. Ábrahám - Hybrid Systems 18 / 26
Segmented owpipe approximation Let the time interval [, T ] be divided into < N N time segments [, t 1 ], [t 1, t 2 ],..., [t N 1, T ] with t i = i δ for δ = T N. Ábrahám - Hybrid Systems 19 / 26
Segmented owpipe approximation Let the time interval [, T ] be divided into < N N time segments [, t 1 ], [t 1, t 2 ],..., [t N 1, T ] with t i = i δ for δ = T N. We generate an approximation ˆR [t1,t 2 ](X ) for each owpipe segment: R [t1,t 2 ](X ) ˆR [t1,t 2 ](X ). Ábrahám - Hybrid Systems 19 / 26
Segmented owpipe approximation Let the time interval [, T ] be divided into < N N time segments [, t 1 ], [t 1, t 2 ],..., [t N 1, T ] with t i = i δ for δ = T N. We generate an approximation ˆR [t1,t 2 ](X ) for each owpipe segment: R [t1,t 2 ](X ) ˆR [t1,t 2 ](X ). The complete owpipe approximation is the union of the approximation of all N pipe segments: R [,T ] (X ) ˆR [,T ] (X ) = ˆR [tk 1,t k ](X ) k=1,...,n Ábrahám - Hybrid Systems 19 / 26
Approaches Next we discuss one possible approach for owpipe approximation, but there are dierent other techniques, too. Ábrahám - Hybrid Systems 2 / 26
Linear hybrid automata II: Time evolution Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Time evolution Assume ẋ = Ax + Bu Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Time evolution Assume ẋ = Ax + Bu R [,δ] R [δ,2δ] R [2δ,3δ] Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Time evolution Assume ẋ = Ax + Bu Compute polytopes Ω, Ω 1,... such that R [iδ,(i+1)δ] Ω i Ω R [,δ] R [δ,2δ] Ω 1 Ω 2 R [2δ,3δ] Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Time evolution Assume ẋ = Ax + Bu Compute polytopes Ω, Ω 1,... such that R [iδ,(i+1)δ] Ω i The rst owpipe segment: Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Time evolution Assume ẋ = Ax + Bu Compute polytopes Ω, Ω 1,... such that R [iδ,(i+1)δ] Ω i The rst owpipe segment: δ 2δ t X Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Time evolution Assume ẋ = Ax + Bu Compute polytopes Ω, Ω 1,... such that R [iδ,(i+1)δ] Ω i The rst owpipe segment: Reminder matrix exponential: e X = k= Xk k! e Aδ X δ 2δ t X Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Time evolution Assume ẋ = Ax + Bu Compute polytopes Ω, Ω 1,... such that R [iδ,(i+1)δ] Ω i The rst owpipe segment: Reminder matrix exponential: e X = k= Xk k! e Aδ X δ 2δ t X convex hull of X e Aδ X Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Time evolution Assume ẋ = Ax + Bu Compute polytopes Ω, Ω 1,... such that R [iδ,(i+1)δ] Ω i The rst owpipe segment: Reminder matrix exponential: e X = k= Xk k! e Aδ X δ 2δ t X bloating with B 1 to include non-linear behaviour Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Time evolution Assume ẋ = Ax + Bu Compute polytopes Ω, Ω 1,... such that R [iδ,(i+1)δ] Ω i The rst owpipe segment: Reminder matrix exponential: e X = k= Xk k! e Aδ X δ 2δ t X (e Aδ X ) B 1 Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Time evolution Assume ẋ = Ax + Bu Compute polytopes Ω, Ω 1,... such that R [iδ,(i+1)δ] Ω i The rst owpipe segment: Reminder matrix exponential: e X = k= Xk k! e Aδ X δ 2δ t X convex hull of X ((e Aδ X ) B 1 ) covers the behaviour R [,δ] under ẋ = Ax Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Time evolution Assume ẋ = Ax + Bu Compute polytopes Ω, Ω 1,... such that R [iδ,(i+1)δ] Ω i The rst owpipe segment: Reminder matrix exponential: e X = k= Xk k! e Aδ X δ 2δ t X disturbance! Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Time evolution Assume ẋ = Ax + Bu Compute polytopes Ω, Ω 1,... such that R [iδ,(i+1)δ] Ω i The rst owpipe segment: Reminder matrix exponential: e X = k= Xk k! e Aδ X δ 2δ t X bloating with B 2 Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Time evolution Assume ẋ = Ax + Bu Compute polytopes Ω, Ω 1,... such that R [iδ,(i+1)δ] Ω i The rst owpipe segment: Reminder matrix exponential: e X = k= Xk k! e Aδ X δ 2δ t X (e Aδ X ) B 1 B 2 Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Time evolution Assume ẋ = Ax + Bu Compute polytopes Ω, Ω 1,... such that R [iδ,(i+1)δ] Ω i The rst owpipe segment: Reminder matrix exponential: e X = k= Xk k! Ω e Aδ X δ 2δ t X Ω = conv(x ((e Aδ X ) B 1 B 2 )) covers the behaviour R [,δ] under ẋ = Ax + Bu Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Time evolution Assume ẋ = Ax + Bu Compute polytopes Ω, Ω 1,... such that R [iδ,(i+1)δ] Ω i The rst owpipe segment: Reminder matrix exponential: e X = k= Xk k! Ω δ 2δ t Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Time evolution Assume ẋ = Ax + Bu Compute polytopes Ω, Ω 1,... such that R [iδ,(i+1)δ] Ω i The rst owpipe segment: Reminder matrix exponential: e X = k= Xk k! The remaining ones: Ω δ 2δ t Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Time evolution Assume ẋ = Ax + Bu Compute polytopes Ω, Ω 1,... such that R [iδ,(i+1)δ] Ω i The rst owpipe segment: Reminder matrix exponential: e X = k= Xk k! The remaining ones: Ω δ 2δ t e Aδ Ω covers the behaviour R [δ,2δ] under ẋ = Ax Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Time evolution Assume ẋ = Ax + Bu Compute polytopes Ω, Ω 1,... such that R [iδ,(i+1)δ] Ω i The rst owpipe segment: Reminder matrix exponential: e X = k= Xk k! The remaining ones: Ω δ 2δ t e Aδ Ω disturbance! Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Time evolution Assume ẋ = Ax + Bu Compute polytopes Ω, Ω 1,... such that R [iδ,(i+1)δ] Ω i The rst owpipe segment: Reminder matrix exponential: e X = k= Xk k! The remaining ones: Ω δ 2δ t e Aδ Ω bloating with B 2 Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Time evolution Assume ẋ = Ax + Bu Compute polytopes Ω, Ω 1,... such that R [iδ,(i+1)δ] Ω i The rst owpipe segment: Reminder matrix exponential: e X = k= Xk k! The remaining ones: Ω δ 2δ t Ω 1 Ω 1 = (e Aδ Ω ) B 2 covers the behaviour R [δ,2δ] under ẋ = Ax + Bu Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Time evolution Assume ẋ = Ax + Bu Compute polytopes Ω, Ω 1,... such that R [iδ,(i+1)δ] Ω i The rst owpipe segment: Reminder matrix exponential: e X = k= Xk k! The remaining ones: Ω δ 2δ t Ω 1 Ω 1 = (e Aδ Ω ) B 2 covers the behaviour R [δ,2δ] under ẋ = Ax + Bu Ábrahám - Hybrid Systems 21 / 26
Linear hybrid automata II: Discrete steps (jumps) The same procedure as for LHA I, extended with possibilities for aggregation and/or clustering. Ω 3 Ω 2 Ω 1 Ω Ábrahám - Hybrid Systems 22 / 26
Linear hybrid automata II: Discrete steps (jumps) The same procedure as for LHA I, extended with possibilities for aggregation and/or clustering. Ω 3 Ω 2 Ω 1 Ω Ábrahám - Hybrid Systems 22 / 26
Linear hybrid automata II: Discrete steps (jumps) The same procedure as for LHA I, extended with possibilities for aggregation and/or clustering. Ω 3 Ω 2 Ω 1 Ω Ábrahám - Hybrid Systems 22 / 26
Linear hybrid automata II: Discrete steps (jumps) The same procedure as for LHA I, extended with possibilities for aggregation and/or clustering. Ω 3 Ω 1 Ω 2 Ábrahám - Hybrid Systems 22 / 26
Linear hybrid automata II: Discrete steps (jumps) The same procedure as for LHA I, extended with possibilities for aggregation and/or clustering. Ω 3 Π 3 Ω 1 Ω 2 Π 1 Π 2 Ábrahám - Hybrid Systems 22 / 26
Linear hybrid automata II: Discrete steps (jumps) The same procedure as for LHA I, extended with possibilities for aggregation and/or clustering. Optionally aggregation (convex hull V 1 ) (alternative: clustering) Ω 3 Π 3 Ω 1 Ω 2 Π 1 Π 2 Ábrahám - Hybrid Systems 22 / 26
Linear hybrid automata II: The global picture Ábrahám - Hybrid Systems 23 / 26
Linear hybrid automata II: The global picture Ábrahám - Hybrid Systems 23 / 26
Linear hybrid automata II: The global picture Ábrahám - Hybrid Systems 23 / 26
Linear hybrid automata II: The global picture Ábrahám - Hybrid Systems 23 / 26
Linear hybrid automata II: The global picture Ábrahám - Hybrid Systems 23 / 26
Linear hybrid automata II: The global picture Ábrahám - Hybrid Systems 23 / 26
Linear hybrid automata II: The global picture Ábrahám - Hybrid Systems 23 / 26
Example Van der Pol equation: ẋ 1 = x 2 ẋ 2 =.2(x 2 1 1)x 2 x 1. Intial set: X = {(x 1, x 2 ).8 x 1 1 x 2 = }. Time: T = 1. Segments: 2 Ábrahám - Hybrid Systems 24 / 26
Other geometries for approximation Van der Pol equation with a third variable being a clock. Approximation with convex polyhedra and with oriented rectangular hull: Ábrahám - Hybrid Systems 25 / 26
Partitioning the initial set Var der Pol system with initial set X = {(x 1, x 2 ) 5 x 1 45 x 2 = }. Ábrahám - Hybrid Systems 26 / 26