This directory contains code to recreate some of the figures from 

  Ian M. Mitchell, Mo Chen & Meeko Oishi, "Ensuring Safety of
  Nonlinear Sampled Data Systems through Reachability," in Proceedings
  of IFAC Conference on Analysis and Design of Hybrid Systems, 2012.

and the extended version published as UBC Computer Science Technical
Report TR-2012-02 (denoted TR below).

It requires the Toolbox of Level Set Methods, which can be downloaded from

  http://www.cs.ubc.ca/~mitchell/ToolboxLS/

It will require a relatively recent version of Matlab as written (it
was tested in R2010b / version 7.11), although if it doesn't work with
slightly older versions (eg: version 7.x for x < 11), it might work if
the "~" in parameter lists is replaced with dummy variables.

After ToolboxLS is installed, you must modify addPathToKernel.m in
this directory so that it points to the Kernel/ subdirectory of your
ToolboxLS installation.  If you are getting an error about "missing
functions" when you try to run something in this directory, then you
haven't correctly modified addPathToKernel.

The tasks of the functions in this directory are:

* addPathToKernel: Modifies the Matlab path so that the other
  functions can access ToolboxLS.  Make sure that you modify this
  function to point to the Kernel/ subdirectory of your ToolboxLS
  installation.

* compareDblInt2: Generates sample trajectories using the sampled data
  control scheme.  Uses varyingDoubleIntegratorControl to determine
  this scheme.  Default settings will generate figure 4 from the
  paper, figure 7 from the TR; however, the trajectories' initial
  conditions are randomzied, so the plot will not be identical.
  Choosing the other input parameter setting will generate figure 8
  from the TR.  This code was mostly written by Mo.

* conservativeReachTubeVisualize: A script to generate figure 2 in TR,
  which is part of the proof of proposition 1.  Runs
  conservativeReachTube to compute the reach set component of this
  figure.

* conservativeReachTube: Function that computes the sampled data reach
  set for the example from the proof of proposition 1.

* downsampleGrid: Helper function for varyingDoubleIntegratorControl
  (it will be included in the next version of ToolboxLS).

* varyingDoubleIntegratorContinuous: Function to compute the reach set
  for the varying double integrator in continuous time (figure 6 top
  in TR).

* varyingDoubleIntegratorSampled: Function to compute the reach set
  for the varying double integrator in sampled time.  The default
  settings generate the case for delta = 0.3, N = 50 (figure 3 in the
  ADHS paper, figure 5 in TR).  By choosing different values of delta
  and N (input argument "max_steps") this same code can also generate
  figure 6 middle and bottom in TR.

* varyingDoubleIntegratorControl: Function to extract the control
  policy from the data provided by varyingDoubleIntegratorSampled.

Questions and bug reports (and any examples of the use of this
technique on other problems) can be send to mitchell@cs.ubc.ca

Ian M. Mitchell 
August 2012 (yeah, I was a little late getting this posted)
