Computing Reachable Sets via Toolbox of Level Set Methods
description
Transcript of Computing Reachable Sets via Toolbox of Level Set Methods
![Page 1: Computing Reachable Sets via Toolbox of Level Set Methods](https://reader036.fdocuments.in/reader036/viewer/2022062316/568166e5550346895ddb2165/html5/thumbnails/1.jpg)
Computing Reachable Sets via Toolbox of Level Set Methods
Slides adapted from Michael Vitus and Jerry Ding
![Page 2: Computing Reachable Sets via Toolbox of Level Set Methods](https://reader036.fdocuments.in/reader036/viewer/2022062316/568166e5550346895ddb2165/html5/thumbnails/2.jpg)
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
![Page 3: Computing Reachable Sets via Toolbox of Level Set Methods](https://reader036.fdocuments.in/reader036/viewer/2022062316/568166e5550346895ddb2165/html5/thumbnails/3.jpg)
Backwards Reachability
[Mitchell, 2005]
![Page 4: Computing Reachable Sets via Toolbox of Level Set Methods](https://reader036.fdocuments.in/reader036/viewer/2022062316/568166e5550346895ddb2165/html5/thumbnails/4.jpg)
Problem Formulation
• Dynamics: – System input: – Disturbance:
• Target set: – Final conditions– Level set representation:
– Eg. 2D unit disk centered at the origin:
![Page 5: Computing Reachable Sets via Toolbox of Level Set Methods](https://reader036.fdocuments.in/reader036/viewer/2022062316/568166e5550346895ddb2165/html5/thumbnails/5.jpg)
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
![Page 6: Computing Reachable Sets via Toolbox of Level Set Methods](https://reader036.fdocuments.in/reader036/viewer/2022062316/568166e5550346895ddb2165/html5/thumbnails/6.jpg)
• Provide 3 items1. Final target set
2. Hamiltonian function (multiplied by -1)
3. An upper bound on the partials functions
Toolbox Formulation
![Page 7: Computing Reachable Sets via Toolbox of Level Set Methods](https://reader036.fdocuments.in/reader036/viewer/2022062316/568166e5550346895ddb2165/html5/thumbnails/7.jpg)
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
![Page 8: Computing Reachable Sets via Toolbox of Level Set Methods](https://reader036.fdocuments.in/reader036/viewer/2022062316/568166e5550346895ddb2165/html5/thumbnails/8.jpg)
Example: Double Integrator• Start from Examples\Reachability\air3D.m
![Page 9: Computing Reachable Sets via Toolbox of Level Set Methods](https://reader036.fdocuments.in/reader036/viewer/2022062316/568166e5550346895ddb2165/html5/thumbnails/9.jpg)
Example: Grid and Target Set• Set-up grid and target set
– g.bdry: @addGhostExtrapolate usually– g.bdry: @addGhostPeriodic for periodic
dimensions
![Page 10: Computing Reachable Sets via Toolbox of Level Set Methods](https://reader036.fdocuments.in/reader036/viewer/2022062316/568166e5550346895ddb2165/html5/thumbnails/10.jpg)
Example: Double Integrator– Target set: define own function OR use pre-
existing functions such as shapeCylinder, shapeRectangleByCorners
– See Section 3.3 of toolbox manual
![Page 11: Computing Reachable Sets via Toolbox of Level Set Methods](https://reader036.fdocuments.in/reader036/viewer/2022062316/568166e5550346895ddb2165/html5/thumbnails/11.jpg)
Hamiltonian and Partial Functions
• Hamiltonian:
![Page 12: Computing Reachable Sets via Toolbox of Level Set Methods](https://reader036.fdocuments.in/reader036/viewer/2022062316/568166e5550346895ddb2165/html5/thumbnails/12.jpg)
Hamiltonian and Partial Function
• Partials:
![Page 13: Computing Reachable Sets via Toolbox of Level Set Methods](https://reader036.fdocuments.in/reader036/viewer/2022062316/568166e5550346895ddb2165/html5/thumbnails/13.jpg)
Hamiltonian and Partial Function• Set-up Hamiltonian
– is written as deriv{i}– is written as grid.xs{i}
![Page 14: Computing Reachable Sets via Toolbox of Level Set Methods](https://reader036.fdocuments.in/reader036/viewer/2022062316/568166e5550346895ddb2165/html5/thumbnails/14.jpg)
Example: Double Integrator• Set up partials function
![Page 15: Computing Reachable Sets via Toolbox of Level Set Methods](https://reader036.fdocuments.in/reader036/viewer/2022062316/568166e5550346895ddb2165/html5/thumbnails/15.jpg)
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
![Page 16: Computing Reachable Sets via Toolbox of Level Set Methods](https://reader036.fdocuments.in/reader036/viewer/2022062316/568166e5550346895ddb2165/html5/thumbnails/16.jpg)
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
![Page 17: Computing Reachable Sets via Toolbox of Level Set Methods](https://reader036.fdocuments.in/reader036/viewer/2022062316/568166e5550346895ddb2165/html5/thumbnails/17.jpg)
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:
![Page 18: Computing Reachable Sets via Toolbox of Level Set Methods](https://reader036.fdocuments.in/reader036/viewer/2022062316/568166e5550346895ddb2165/html5/thumbnails/18.jpg)
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