The PAHS Control Toolbox is a Matlab toolbox designed to aid in the design of controllers for piece-wise affine hybrid systems. The main purpose is to synthesise controllers for systems with uncontrollable external inputs, e.g. fault tolerant controllers, by computing discrete game abstractions of hybrid systems.

The toolbox implements the ideas presented in [Grunnet08a-ND], which is based on the [Habets06a] regarding control to facet of PAHSs.

The main capabilities are centered around checking which facets of a polytope an affine system can be prevented from leaving through, blocking, to which degree the system can be forced out a given facet, controllability, and by building on this basic capability compute discrete abstractions which describe the system dynamics as a discrete game.

This is the basis for creating discrete game abstractions of PAHS, which tools such as UppAal can synthesise solutions for. The PAHS Control Toolbox is capable converting the discrete game abstraction and Reach/Avoid/Stay requirements to UppAal syntax and if feasible find a winning strategy for the game. The winning strategy is then refined to piecewise affine control laws on the PAHS and a simulator based on the trap_101 ODE solver is included.

In summary: Given a piecewise-affine hybrid system with external events and a reach/avoid/stay specification the toolbox can automatically find a control strategy.


The PAHS toolbox V1.1 supports the following features

  • Determine control to facet properties of affine systems on polytopes

    • Autodetection of simplices for faster computations

  • Computing discrete equivalents of affine systems on polytopes

    • Visualising discrete equivalents (2D only)

  • Computing discrete game abstractions of PAHS

    • Support for Matlab parallel computing (linear speedup)

  • Converting Init, Goal and Avoid sets to specifications on a discrete abstraction

  • Finding winning strategies for discrete abstractions using UppAal

  • Refining strategies to affine control laws on the polytopes

    • User defineable optimisation functions

    • Montecarlo simulation of controlled affine systems on polytopes

    • Plotting Montecarlo simulations (2D only)

  • Simulating controlled PAHS

    • Plotting PAHS and simulations (2D only)


There are a number of restrictions on the PAHS

  • All resets are identity

  • No guards on external events

Known bugs and regressions

This is a list of known bugs that should be corrected in future releases

  • Controller generation does not support controllable external events

  • New method for plotting monte carlo simulations and discrete equivalents does not work for 3D

Planned features

The following features are planned for future realeases (if any)

  • Support for affine reset maps on external events

  • Support guards on external events (unions of polytopes)

  • Support for a Runge-Kutta based solver in the simulator

  • Parallelisation of refinement function

  • Helper functions for creating PAHS

  • Yalmip support (initial tests shows its slower for small problems)

  • Montecarlo simulation of controlled PAHS


The PAHS toolbox as licensed under the GPL V3.

The toolbox includes sligthtly modified versions of files from the RANDOM_DATA library authored by John Burkhardt and licensed under the LGPL. These can be found in the burkhardt subdirectory.