3âData generation
In this section, we shall describe the creation of a database containing optimal values of (OCPi,xi,xi+1 for various pairs :
Two methods are presented to achieve this goal. They are compared in terms of prior information, computation cost, and data distribution.
3.1âMethod 1
The first method consists in computing the value function on a given grid by solving optimal control problems thanks to the simple shooting method. This is the intuitive approach compared to the second method presented in the next section. Let be a discretization of admissible initial and final states. For all , we solve the optimal control problem (OCPi,xi,xi+1 by an indirect simple shooting method and store the corresponding optimal value in . The main complexity comes from the fact we have to solve equations, which essentially amounts to invert the exponential map given in (2.6). Algorithm 2.1 provides an overview of these steps.

Algorithm 2.1 Method 1.
Prior information
First of all, the set needs to be created as follows: the initial state is first discretized, then for each of these values the set of associated reachable final states has to be determined and discretized. This ensures that the space of initial and final state is fully explored and that all pairs are admissible, which prevents the Newton solver to fail. The determination of the reachable final states is a difficulty in this method. See the remark on page 25 for details about how we compute this set of reachable states in our application.
Computation cost
For each iteration of the Newton solver used to find a zero of the shooting function, at least one integration of the Hamiltonian vector field is required.
Data distribution
By construction, the distribution of the pairs is fully controlled inside the admissibility set. For example, a uniform distribution may be chosen for an easy interpolation.
3.2âMethod 2
The second method, described in Algorithm 2.2, is based on a discretization of the initial state and costate space. For all , the exponential map is computed, and Hypothesis 2.1 ensures that . Compared to Method 1, here we only perform a direct computation of the exponential map instead of inverting it.

Algorithm 2.2 Method 2.
Prior information
Since there are no admissibility constraints on , the set can be the Cartesian product between the discretization of initial state and costate. Nevertheless, the range of the costate discretization must be well chosen in order to ensure a full exploration of the reachable states while limiting the number of useless calls of the exponential map.
Computation cost
In contrast to Method 1, no (Newton) solver is involved here. Hence, only one evaluation of is needed to compute a point of .
Data distribution
In this method, the distribution of the reached final states is no more controlled. The main consequence is the risk of empty zones. Fortunately, we shall see in Section 4 that, in our application, a sufficient density in the set ensures a satisfactory distribution of reached states .