Skip to content

Repository files navigation

flowp

Afternoon project that approximates and plots flow pipes for linear hybrid automata. Very unoptimal in the sense that this is restricted to 2D space and doesn't use any optimized libraries for polytope representations.

Nice to play around and explore basic flowpipe construction.

Please have a look at this lecture to get an idea of what's going on.

Usage

flowp can be used like:

importnumpyasnpfromflowpimportapproxinitial_location= [np.array(v) forvin [[1, 1], [2, 1], [3, 2], [1, 2]]]
flow=np.array([[1, 4], [-1, 3]])
bloating= [np.array(v) forvin [[0, 1], [1, 0], [-1, 0], [0, -1]]]
polytopes=approx(initial_location, flow, bloating, plot=True) # Opens plot in standard browser.

The above code will produce the following plot:

Flowpipe plot

One can optionally pass the argument step_size, which changes the standard step size from 1 to any desired value.

Setup

If you have problems installing dependencies/setting this up to work, you can use poetry dependency management. Just run:

> poetry install
> cd src
> poetry run ipython

This will use the provided lock file to install all dependencies and then run a virtual env python environment, in which you can execute the above code.

Subsitute ipython by your prefered python environment or execute code using flowp or whatever.

About

Flowpipe approximation for general Linear Hybrid Automata

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages