Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and...

32
Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA [email protected] VERIMAG

Transcript of Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and...

Page 1: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Zonotopes Techniques forReachability Analysis

Antoine Girard

Workshop “Topics in Computation and Control”March 27th 2006, Santa Barbara, CA, USA

[email protected]

VERIMAG

Page 2: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

• Computation of the states that are reachable by a system S:- from a set of initial states I- subject to a set of admissible inputs (disturbances)

• Can be thought as exhaustive simulation of a system

Reachability Analysis

S

Qx(t)Ix(0)Uu(t)

I

Reach(I)

Page 3: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Algorithmic Verification

• Algorithmic proof of the safety of a system:

No trajectory of the system can reacha set of unsafe states.

• Can be solved by computing:- the exact reachable set (LHA, some linear systems) - an over-approximation of the reachable set

Unsafe

I

Reach(I)

Page 4: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Outline

1. Reachability computations for continuous systems.

- Flow pipe approximation

- Computations for linear systems

2. Scalable computations using zonotopes.

3. Extensions to nonlinear/hybrid systems.

Page 5: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Continuous Dynamics

• Nondeterministic continuous system S is represented by a flow Φ :

Φ(X,t) denotes the set of states reachable from X at time t.

• Note that we must have the semi-group property

Φ(X,t+t’) = Φ(Φ(X,t),t’)

• Example:

• The reachable set of S on a time interval [t,t’] is formally defined by the flow pipe :

Xet)Φ(X,Axx At

t't,st't, s)Φ(I,(I)Reach

Page 6: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Flow Pipe Computation

• Choose a time step r (arbitrarily small ) and remark that

• Algorithm for reachability computation :

end

P;R:R

r);Φ(P,:P

1-N to 0 from k for

P;:R (I);Reach:P r0,

Nr.t with ,kr),Φ(Reach(I)Reach1Nk

0kr0,t0,

I

P:=Reach[0,r](I);

P:=Φ(P,r);

P:=Φ(P,r);

P:=Φ(P,r);

Page 7: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Implementation

• Choice of representation for the set P (P C):

C can be the set of polytopes, ellipsoids, level sets…

• Let us assume that the initial set I C, then define two functions

• Implement the previous algorithm with the functions :

- Over-approximation of the reachable set Reach[0,r](I)

- Under some assumptions, we can prove convergence as r 0.

(P)Φr)Φ(P, S,PS;S:Φ

(P)R(P)Reach S,PS;S:R

rr

rr0,r

Page 8: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Computations for Linear Systems

• Linear systems of the form:

where U is assumed to be bounded convex set of the class C.

• Then, the flow of the system is

which can be over-approximated by

where β(εr) is a ball of radius εr = O(r2).

Uu(t) Bu(t),Ax(t)(t)x

r

0

s)A(rrA Uu(s) s, and Xx Bu(s)dsexe r)Φ(X,

)β(ε Uu and Xx Budsexe r)Φ(X, r

r

0

s)A(rrA

Page 9: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Computations for Linear Systems

• If the class of sets C is closed under:- Linear transformations- Minkowski sum

• Then, the approximate flow can be chosen as

• Something similar can be done for

• Convergence as r 0.

• Example of such a class: polytopes ( d/dt, Checkmate )

)β(ε Uu Budse V

where VXe(X)Φ

r

r

0

s)A(rr

rrA

r

(X)Rr

)β(δ(X))ΦHull(X, Convex(X)R rrr

Page 10: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Outline

1. Reachability computations for continuous systems.

- Flow pipe approximation

- Computations for linear systems

2. Scalable computations using zonotopes.

3. Extensions to nonlinear/hybrid systems.

Page 11: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Polytopes and Large Scale Systems

• Minkowski sum of N polytopes with at most K vertices in Rd :

computational complexity in O(Nd-1 K2d-1 )

• Reachability computations of a d-dimensional system involve the Minkowski sum of N polytopes in Rd.

• (Expected) complexity of the reachability algorithm :

exponential in the dimension of the system

• Polytope based reachability computations are limited to :- relatively small systems (d 10)- relatively small time horizon N.

Page 12: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Reachability of Large Scale Systems

• Large scale systems (dimension 100) arise in : - Biology,- Circuits,- Networked systems…

• Idea for reachability of large scale systems :

use alternative classes of sets of bounded complexity

• Ellipsoids, Oriented hyperrectangles…

Page 13: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Reachability using Hyperrectangles

• Oriented hyperrectangles: polytopes of bounded complexity ( d2 )

• But not closed under:- Linear transformations- Minkowski sum

• ORH based reachability computations:

• Additional inaccuracies which propagates ( wrapping effect )

• No more convergence as r 0.

P PerA

rrA VPe

(P)Φr

Page 14: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

SummaryPolytope based reachability computations:

1. Accurate approximation of the reachable set(closed linear transformations and Minkowski sum)

2. Intractable for large scale systems(exponential complexity in dimension)

Oriented Hyperrectangles based reachability computations:

1. Can be used for large scale systems(polynomial complexity in dimension)

2. Inaccurate approximation of the reachable set (wrapping effect)

The missing link: Zonotopes

Page 15: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

What is a Zonotope?

• Zonotope: Minkowski sum of a finite number of segments.

• c is the center of the zonotope, {g1,…,gp } are the generators. The ratio p/n is the order of the zonotope.

.1x1 ,gxcx ,RxZpi

1iiii

n

Two dimensional zonotope with 3 generators

Page 16: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Some Properties of Zonotopes

• A generic d-dimensional zonotope of order p has

• The set of zonotopes is closed under linear transformation

• The set of zonotopes is closed under the Minkowski sum

• Suitable for accurate and efficient reachability computations.

).Lg,,Lg(Lc,LZ ),g,,g(c,Z p1p1

).h,,h,g,,g,c(cZZ

),h,,h,(cZ ),g,,g,(cZ

q1p12121

q122p111

vertices. d/(2p) than more 1d-

Page 17: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Reachability using Zonotopes

• Implementation of the reachability algorithm consists of:- Matrix products- List concatenations

• Computational complexity of the zonotope based algorithm is:

O(d3N2) compared to more than O(Nd-1) for polytopes.

• Polynomial complexity in the dimension

• Convergence of the approximation as r 0.

• Suitable for large scale systems (in practice up to dimension 100)

Page 18: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Two Dimensional Example

Reachable set on the interval [0,2].

Page 19: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Five Dimensional Example

Projections of the reachable set on the interval [0,1].

Page 20: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Reachability using Zonotopes

• Complexity O(d3N2) can be annoying for large time horizons N.

• Solution to this problem:- use a new implementation scheme of the recurrence

relation

- complexity becomes O(d3N)

• Subject of Colas Le Guernic’s talk on Wednesday afternoon.

rkrA

1k VPeP

Page 21: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Outline

1. Reachability computations for continuous systems.

- Flow pipe approximation

- Computations for linear systems

2. Scalable computations using zonotopes.

3. Extensions to nonlinear/hybrid systems.

Page 22: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Hybrid Systems

We consider the class of hybrid systems that consists of:

1. A finite set Q of modes.2. In each mode q, the continuous dynamics is given by a

linear system:

3. Switching conditions (Guards) are given by linear inequalities:

Mxhm Sx(t)q'q q'q,q'q,q'q,q'q,

qqq Uu(t) u(t),Bx(t)A(t)x

Page 23: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Reachability of Hybrid Systems

Following the classical scheme for reachability of hybrid systems:

• In each mode, the reachability analysis of the continuous dynamics is handled by our algorithm.

• Processing of discrete transitions requires:1. Detection of the intersection of a zonotope with a guard.2. Computation of this intersection

- The intersection of zonotope with a band is not a zonotope.

- Over-approximation algorithms.

Page 24: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Event Detection

• Detection of the intersection of a zonotope with a guard.

xh q'q,

q'q,q'q, Mxh

.1x1 ,gxcx ,RxZpi

1iiii

n

pi

1iiq'q,q'q, gh ch

pi

1iiq'q,q'q, gh ch

q'q,q'q, mxh

q'q,q'q,

pi

1iiq'q,q'q,

pi

1iiq'q,q'q, Mm gh ch gh ch onIntersecti ,,

Page 25: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Computing the Intersection

• Over-approximation by projection and bloating:

• The over-approximation I is - a zonotope:- included in the guard

q'q,q'q, Mxh q'q,q'q, mxh

v

v.βα,ZPI v

Page 26: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Computing the Intersection

• You can project in an other direction:

• Find the direction which results in the best over-approximation.

q'q,q'q, Mxh q'q,q'q, mxh

v

Page 27: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Direction of Projection

• Computation of the best direction is feasible but difficult

• Heuristics:- direction as weighted sum of generators (C. Le

Guernic):

- use the dynamics of the system:

.gg

hgv

pi

1ii

i

q'q,i

.UBcAcv

Page 28: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Direction of Projection

• Dynamic heuristic:

• A large part of the over-approximation at step k is actually reachable at steps k+1, k+2…

q'q,q'q, Mxh q'q,q'q, mxh

UBcAc

Page 29: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Example

Two tank system:

2x

1x

4: on/on

2: on/off

1: off/off

3: off/on

x1 = -1

x1 = -1

x1 = 1

x2 = 0

x2 = 0

x2 = 1

x2 = 1

Want to check robustness of periodic behavior.

Page 30: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Example

Reachable set of the two tank system for µ = 0.01 and µ = 0.1

Hybrid reachability needs to be tested for large scale examples.

Page 31: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Reachability of Nonlinear Systems

Two approaches for reachability analysis of nonlinear systems:

• Hybridization approach [Asarin, Dang, Girard]:

- state space is partitioned- in each region, linear conservative approximation of

the nonlinear vector field- accurate approximation

• Trajectory piecewise linearization [Han, Krogh]: - at each time step, vector field linearized around the

center of the zonotope- efficient computations

Page 32: Zonotopes Techniques for Reachability Analysis Antoine Girard Workshop “Topics in Computation and Control” March 27 th 2006, Santa Barbara, CA, USA Antoine.Girard@imag.fr.

Conclusions

• Class of zonotopes for reachability computations:

- nice balance between efficiency and accuracy- was proved efficient for high-dimensional linear

systems- ongoing research on nonlinear/hybrid dynamics

• Future work:

- software development- reachability framework based on support functions,

unifying zonotopes and ellipsoids approaches

• Thank you to Colas Le Guernic and Oded Maler