Computing Reachable Sets via Toolbox of Level Set Methods Mo Chen [email protected] Slides adapted from Michael Vitus and Jerry Ding
Feb 24, 2016
Computing Reachable Sets via Toolbox of Level Set Methods
Slides adapted from Michael Vitus and Jerry Ding
Toolbox of Level Set Methods• Ian Mitchell
– Professor at the University of British Columbia• http://www.cs.ubc.ca/~mitchell/
• MatLab Toolbox – http://www.cs.ubc.ca/~mitchell/ToolboxLS/inde
x.html– Computes the backwards reachable set
starting from some final target set– Fixed spacing Cartesian grid– Up to 4 or 5 dimensions
Backwards Reachability
[Mitchell, 2005]
Problem Formulation
• Dynamics: – System input: – Disturbance:
• Target set: – Final conditions– Level set representation:
– Eg. 2D unit disk centered at the origin:
Backwards Reachable Set• Solution to a Hamilton-Jacobi PDE:
where:
– For theory, see lecture 8 notes
• Terminal value HJ PDE– Converted to an initial value PDE by multiplying the
Hamiltonian by
• Provide 3 items1. Final target set
2. Hamiltonian function (multiplied by -1)
3. An upper bound on the partials functions
Toolbox Formulation
Example: Double Integrator• Dynamics
• Target set– Outside of the box
• Coding:– Mostly setting up the environment in the toolbox
t = 0
-2 0 2-1
0
1t = 1
-2 0 2-1
0
1
t = 2
-2 0 2-1
0
1t = 3
-2 0 2-1
0
1
Example: Double Integrator• Start from Examples\Reachability\air3D.m
Example: Grid and Target Set• Set-up grid and target set
– g.bdry: @addGhostExtrapolate usually– g.bdry: @addGhostPeriodic for periodic
dimensions
Example: Double Integrator– Target set: define own function OR use pre-
existing functions such as shapeCylinder, shapeRectangleByCorners
– See Section 3.3 of toolbox manual
Hamiltonian and Partial Functions
• Hamiltonian:
Hamiltonian and Partial Function
• Partials:
Hamiltonian and Partial Function• Set-up Hamiltonian
– is written as deriv{i}– is written as grid.xs{i}
Example: Double Integrator• Set up partials function
Results
t = 0
-2 0 2-1
0
1t = 1
-2 0 2-1
0
1
t = 2
-2 0 2-1
0
1t = 3
-2 0 2-1
0
1
Additional Comments• Hamiltonian overestimated reachable set
underestimated• Partials function (Pages 50-51 of Toolbox manual)
– Underestimation numerical instability– Overestimation rounded corners or worst case
underestimation of reachable set• Computation
– The solver grids the state space– Tractable only up to 4-5 continuous states– Advanced: Can also define avoid sets
• Toolbox– Coding: ~90% is setting up the environment
Useful Dynamical Form for Partial Function
• Pages 50-51 of Toolbox manual• Nonlinear system, linear input
• Input constraints are hyperrectangles• Analytical optimal inputs:
• Partials upper bound:
Other Tools• Plotting utilities
– Kernel\Helper\Visualization– visualizeLevelSet.m– spinAnimation.m
• Initial condition helpers– Cylinders, hyperrectangles
• Advice– Start with a small example– Look over air3D.m along with Section 2.6.1 of
toolbox manual