Creating a PAHS

In order for the toolbox to synthesis controllers for a PAHS it needs to be defined.

The PAHS specification contains a set of polytopes for each mode and a description of the transitions between the modes.

Several examples are included in the demo subdirectory as demopahs*.m and a an example is shown below.

Example pahs creation

%It is assumed that s1 through s3 are fully specified polytopes
%including dynamics and input sets, while s4 to s6 are polytopes with
%no input set defined

%e is defined as an empty set for convinience
e={};

%Create mode 1

%First polytope
mode1.loc{1}.s=s1;

%Specify which polytopes it borders. The bordering polytopes are
listed in facet order and if a facet borders unpartitioned space an
empty set is inserted.
mode1.loc{1}.bord={2,e,3,e};

%Ditto for polytope 2 and 3
mode1.loc{2}.s=s2;
mode1.loc{2}.bord={e,e,1,e};

mode1.loc{3}.s=s3;
mode1.loc{3}.bord={1,e,e,e};

%Add an uncontrollable transition to mode 2
mode1.trans{1}.dest=2;
mode1.trans{1}.ctrb=false;

%Create mode 2, input2 is the common input polytope for polytopes 4 to 6

%Set common input polytope
mode2.input=input2;

%The same could be done for if all polytopes in a mode has the same dynamics
%mode2.dynamics=dyn2;

mode2.loc{1}.s=s4;
mode2.loc{1}.bord={e,2,3};

mode2.loc{2}.s=s5;
mode2.loc{2}.bord={1,e,e,3};

mode2.loc{3}.s=s6;
mode2.loc{3}.bord={1,e,e,2};

%no transitions from mode 2
mode2.trans={};

%Create the pahs
pahs.mode{1}=mode1;
pahs.mode{2}=mode2;

%Does the modes have the same partition, in this case no
pahs.samepart=false;