In order to illustrate some numerical methods implemented in the HJB Solver some elementary control problems are given below. For each example a Graphical User’s Interface is proposed. It allows to define the parameters of the model, the numerical method chosen to solve it. For time optimal control problems it is possible to compute the optimal trajectories for different initial conditions.
The graphical interfaces are developed with MATLAB (2015) and require a MATLAB licence to run.
We consider the navigation problem for a ground vehicle that has the objective to reach a target before some given time T . The state of the system is characterized by the state vector (x,y,θ) where (x,y) are the 2D-coordinates of the center of mass of the vehicle in a given reference frame, and θ is the angle between the velocity vector and the x-axis (the direction of the vehicle) The state space is therefore
The motion of the vehicle obeys the following dynamics:
![]()
| (26) |
where u, the modulus of the velocity, is assumed constant, and w, the control input, is the angular speed and satisfies ω ∈ [ωmin,ωmax] with adjustable parameters ωmin,ωmax. It is possible to fix the time horizon, T , the vehicle’s velocity u, the position and the shape of the target set (disc or rectangle). On can also choose up to 4 obstacles that the vehicle has to avoid during its trajectory to reach the target. These obstacles are considered as state constraints on the variables (x,y).
![]() (a)
Example
of
reachable
set |
![]() (b)
Some
optimal
trajectories |
The first step of the simulation computes and plots the reachable set corresponding to the fixed parameters, as in Figure 1-(a). After the computation of the reachable set it is possible to reconstruct optimal minimum time trajectories by choosing different initial conditions (see Figure 1-(b)).
A demonstrative GUI is available for different OS.
Linux: DubinsCar.zip
Mac OS X: DubinsCar.zip
Windows : DubinsCar.zip
In this example, we consider a ship moving with contant relative velocity in a river of a given width. We assume also that the current’s velocity is known, and the state of the system is the position (x,y) of the ship. The motion is given by a nonlinear system in ℝ2 controlled by the steering direction θ ∈ [0, 2π]. The evolution of the swimmer is governed by the control system
![]()
| (27) |
The ship aims to join an island (disc of radius R, where the parameter R can be chosen by the user).
Figure 2 shows the interface for this model. It is possible to fix the time horizon, T , the ship’s velocity, u, and the position of the target set (disc). The user can also choose up to 2 obstacles in the environnement. In this example, the first step of the simulation computes and plots the backward reachable set within time T , as on the figure 3 (left). After the computation of the reachable set it is possible to reconstruct optimal minimum time trajectories by choosing different initial conditions (see Figure 3 (right)).
A demo is available corresponding to different OS.
Linux: Zermelo.zip
Mac OS X: Zermelo.zip
Windows : Zermelo.zip
This interface allows to compare four numerical methods for solving a linear HJ-equation (Advection-rotation example):
with the Hamiltonian defined by:
and f : ℝ2 →ℝ2 is a rotational dynamics:
In this example, different numerical methods can be compared:
finite difference scheme, with Lax-Freidrich approximation of the Hamiltonian
finite difference scheme, with ENO2 approximation of the Hamiltonian
Semi-lagrangian scheme with RK2 scheme for the integration of the characteristics
Semi-Lagrangian scheme with exact integration of the characteristics
Figure 4 shows the interface for this problem. It is possible to fix the time horizon, T , the radius of the target set (disc). During the simulation, some local error estimates (in L∞, L1, and L2) are printed on the Matlab workspace.
A demo is available corresponding to different OS.
Linux: AdvectionRotation.zip
Mac OS X: AdvectionRotation.zip
Windows : AdvectionRotation.zip