Geometric Optimal Control and Applications to Aerospace

This survey article deals with applications of optimal control to aerospace problems with a focus on modern geometric optimal control tools and numerical continuation techniques. Geometric optimal control is a theory combining optimal control with various concepts of differential geometry. The ultimate objective is to derive optimal synthesis results for general classes of control systems. Continuation or homotopy methods consist in solving a series of parameterized problems, starting from a simple one to end up by continuous deformation with the initial problem. They help overcoming the difficult initialization issues of the shooting method. The combination of geometric control and homotopy methods improves the traditional techniques of optimal control theory. A nonacademic example of optimal attitude-trajectory control of (classical and airborne) launch vehicles, treated in details, illustrates how geometric optimal control can be used to analyze finely the structure of the extremals. This theoretical analysis helps building an efficient numerical solution procedure combining shooting methods and numerical continuation. Chattering is also analyzed and it is shown how to deal with this issue in practice.


Introduction
This article makes a survey of the main issues in optimal control theory, with a specific focus on numerical solution methods and applications to aerospace problems. The purpose is to show how to address optimal control problems using modern techniques of geometric optimal control and how to build solution algorithms based on continuation techniques. The geometric optimal control (stated in the early 1980s and having widely demonstrated its advantages over the classical theory of the 1960s) and the continuation techniques (which are not new, but have been somewhat neglected until recently in optimal control) are powerful approaches for aerospace applications.
As motivation, an overview of optimal control problems raised by aerospace missions is first presented. These problems are classified in three categories depending on the departure and the arrival point. The interested reader will thus have a general view on how space transportation missions translate into optimal control problems.
A detailed example is then presented to illustrate the application of geometric optimal control techniques and numerical continuation methods on a practical problem. This example deals with a minimum time maneuver of a coupled attitude-trajectory dynamic system. Due to the system high nonlinearity and the existence of a chattering phenomenon (see Sections 3.4 and 6 for details), the standard techniques of optimal control do not provide adequate solutions to this problem. Through this example, we will show step by step how to build efficient numerical procedures with the help of theoretical results obtained by applying geometric optimal control techniques.
Before this example, we will recall briefly the main techniques of optimal control theory, including the Pontryagin Maximum Principle, the first-order and higher order optimality conditions, the associated numerical methods, and the numerical continuation principles. Most mathematical notions presented here are known by many readers, and can be skipped at the first reading.
In Section 2, several optimal control problems stemming from various aerospace missions are systematically introduced. In Section 3, we provide a brief survey of geometric optimal control, including the use of Lie and Poisson brackets with first and higher order optimality conditions. In Section 4, we recall classical numerical methods for optimal control problems, namely indirect and direct methods. In Section 5, we recall the concept of continuation methods, which help overcoming the initialization issue for indirect methods. In Section 6, we detail a full nonacademic example in aerospace, in order to illustrate how to solve optimal control problems with the help of geometric optimal control theory and the continuation methods. Finally in Section 7, we shortly give other applications of geometric optimal control and of continuation for space trajectory optimization problems.

Applications to Aerospace Problems
Transport in space gives rise to a large range of problems that can be addressed by optimal control and mathematical programming techniques. Three kinds of problems can be distinguished depending on the departure and the arrival point: ascent from the Earth ground to an orbit, reentry from an orbit to the Earth ground (or to another body of the solar system), transfer from an orbit to another one. A space mission is generally composed of successive ascent, transfer and reentry phases, whose features are presented in the following paragraphs.
Ascent missions necessitate huge propellant masses to reach the orbital velocity and deliver large payloads such as telecommunications satellites. Due to the large lift-off mass, only chemical rocket engines are able to deliver the required thrust level. Consumption minimization is the main concern for these missions whose time of flight is generally about half an hour. Heavy launchers lift off vertically from a fixed ground launch pad, whereas airborne launchers are released horizontally by an airplane, benefiting thus from a higher initial altitude and an initial subsonic velocity.
The first part of the trajectory occurs in the Earth atmosphere at increasing speed. The large aerodynamics loads met during the atmospheric flight require flying at near zero angle of attack, so that the atmospheric leg is completely driven by the initial conditions. Due to the large masses of propellants carried on board, the whole flight must be track by ground radar stations and stringent safety constraints must be applied regarding the area flown over. Once in vacuum the vehicle attitude is no longer constrained and the thrust direction can be freely chosen. When the orbital velocity is reached the thrust level can be reduced and coast arcs may help sparing propellant to reach the targeted orbit. Figure 1 gives an overview of the constraints applied to an ascent trajectory. Reentry missions aim at retrieving either experiment results or space crews. The trajectory is split into a coast arc targeting accurate conditions at the atmospheric entry interface and a gliding atmospheric leg of about half an hour until the landing. The most stringent constraint comes from the convection flux that grows quickly when entering the dense atmosphere layers at hypersonic speeds. A near-horizontal flight is mandatory to achieve a progressive braking at limited thermal flux and load factor levels. The aerodynamic forces are controlled through the vehicle attitude. The angle of attack modulates the force magnitude and the loads applied to the vehicle. The bank angle orientates the lift left or right to follow an adequate descent rate and achieve the required downrange and cross-range until the targeted landing site. The landing may occur vertically in the sea or on the ground, or horizontally on a runway. Depending on the landing options the final braking is achieved by thrusting engines or by parachutes. If necessary the touchdown may also be damped by airbags or legs, for example for delivering scientific payloads on the Mars surface. The reentry is always the final part of a space mission. The example of the Space Shuttle servicing the International Space Station is pictured on Figure 2. Orbital missions deal with orbit changes around the Earth and also with interplanetary travels. A major difference with ascent and reentry trajectories is the much larger duration, which ranges from days to months or even years to reach the farthest planets of the solar system. The motion is essentially due to the gravity field of the nearest body and possibly of a second one. The vehicle operational life is limited by its onboard propellant so that all propelled maneuvers must be achieved as economically as possible. Depending on the engine thrust level the maneuvers are modeled either as impulsive velocity changes (impulsive modelling) or as short duration boosts (high thrust modelling) or as long duration boosts (low thrust modelling). Low thrust engines are particularly attractive due to their high specific impulse, but they require a high electrical power that cannot be delivered by onboard batteries. The energy is provided by large solar panels and the engine must be cut-off when the vehicle enters the Earth shadow. Low thrust orbit raising of telecommunication satellites toward the geostationary orbit at 36000 km lead thus to quite complex optimal control problems as pictured on Figure 3. Other orbital transfer problems are the removal of space debris or the rendezvous for orbit servicing. Interplanetary missions raise other difficulties due to the gravity of several attracting bodies. For missions towards the Lagrange points (see Figure 4) the detailed analysis of manifolds in the three body problem can provide very inexpensive transfer solutions. The above non exhaustive list gives a preview of various space transportation problems. In all cases the mission analysis comprises a simulation task and an optimization task (see Figure 5). Various formulations and methods are possible regarding these two tasks. Selecting an adequate approach is essential in order to build a satisfying numerical solution process. The simulation task consists in integrating the dynamics differential equations derived from mechanics laws. The vehicle is generally modeled as a solid body. The motion combines the translation of the center of gravity defining the trajectory and the body rotation around its center of gravity defining the attitude. The main forces and torques originate from the gravity field (always present), from the propulsion system (when switched on) and possibly from the aerodynamics shape when the vehicle evolves in an atmosphere. In many cases a gravity model including the first zonal term due to the Earth flattening is sufficiently accurate at the mission analysis stage. The aerodynamics is generally modeled by the drag and lift components tabulated versus the Mach number and the angle of attack. The atmosphere parameters (density, pressure, temperature) can be represented by an exponential model or tabulated with respect to the altitude. A higher accuracy may be required on some specific occasions, for example to forecast the possible fall-out of dangerous space debris, to assess correctly low thrust orbital transfers or complex interplanetary space missions. In such cases the dynamical model must be enhanced to account for effects of smaller magnitudes. These enhancements include higher order terms of the gravitational field, accurate atmosphere models depending on the season and the geographic position, extended aerodynamic databases, third body attraction, etc, and also other effects such as the solar wind pressure or the magnetic induced forces.
Complex dynamical models yield more representative results at the expense of larger computation times. In view of trajectory optimization purposes the simulation models have to make compromises between accuracy and speed. A usual simplification consists in assuming that the translation and the rotation motions are independent. With this assumption the trajectory problem (also called the guidance problem) and the attitude problem (also called the control problem) can be addressed separately. This uncoupling of the guidance and the control problem is valid either when the torque commands have a negligible effect on the CoG motion or when the control time scale is much shorter than the guidance time scale. Most space vehicles fall into one of these two categories. The main exceptions are atmospheric maneuvering vehicles such as cruise or anti-ballistic missiles and airborne launchers (see Figure 6). Such vehicles have to perform large reorientation maneuvers requiring significant durations. These maneuvers have a sensible influence of the CoG motion and they must be accounted for a realistic trajectory optimization.
Another way to speed up the simulation consists in splitting the trajectory into successive sequences using different dynamical models and propagation methods. Ascent or reentry trajectories are thus split into propelled, coast and gliding legs, while interplanetary missions are modeled by patched conics. Each leg is computed with its specific coordinate system and numerical integrator. Usual state vector choices are Cartesian coordinates for ascent trajectories, orbital parameters for orbital transfers, spherical coordinate for reentry trajectories. The reference frame is usually Galilean for most applications excepted for the reentry assessment. In this case an Earth rotating frame is more suited to formulate the landing constraints. The propagation of the dynamics equations may be achieved either by semi-analytical or numerical integrators. Semi-analytical integrators require significant mathematical efforts prior to the implementation and they are specialized to a given modelling. For example averaging techniques are particularly useful for long time-scale problems, such as low thrust transfers or space debris evolution, in order to provide high speed simulations with good differentiability features. On the other hand numerical integrators can be applied very directly to any dynamical problem. An adequate compromise has then to be found between the time-step as large as possible and the error tolerance depending on the desired accuracy.
The dynamics models consider first nominal features of the vehicle and of its environment in order to build a reference mission profile. Since the real flight conditions are never perfectly known, the analysis must also be extended with model uncertainties, first to assess sufficient margins when designing a future vehicle, then to ensure the required success probability and the flight safety when preparing an operational flight. The desired robustness may be obtained by additional propellant reserves for a launcher, or by reachable landing areas for a reentry glider (see Figure 7). The optimization task consists in finding the vehicle commands and optionally some design parameters in order to fulfill the mission constraints at the best cost. In most cases, the optimization deals only with the path followed by one vehicle. In more complicated cases, the optimization must account for moving targets or other vehicles that may be jettisoned parts of the main vehicle. Examples or such missions are debris removal, orbital rendezvous, interplanetary travel or reusable launchers with recovery of the stages after their separation.
A typical reusable launcher mission is pictured on Figure 8. The goal is to reach the targeted orbit with the upper stage carrying the payload, while the lower and the upper stage must be recovered safely for the next launches. This problem necessitates a multi-branch modelling and a coordinated optimization method.
For preliminary design studies, the vehicle configuration is not defined. The optimization has to deal simultaneously with the vehicle design and the trajectory control. Depending on the problem formulation the optimization variables may thus be functions, reals or integers.
In almost all cases an optimal control problem must be solved to find the vehicle command law along the trajectory. The command aims at changing the magnitude and the direction of the forces applied, namely the thrust and the aerodynamic force. The attitude time scale is often much shorter than the trajectory time scale so that the attitude control can be considered as nearly perfect, i.e., instantaneous or with a short response time. The rotation dynamics is thus not simulated and the command is directly the vehicle attitude. If the rotation and the translation motions are coupled, the 6 degrees of freedom must be simulated. The command are then the nozzle or the flap deflections depending on the vehicle control devices. The choice of the attitude angles depends on the mission dynamics. For a propelled launcher, the motion is controlled by the thrust force which is nearly aligned with the roll axis. This axis is orientated by inertial pitch and yaw angles. For a gliding reentry vehicle, the motion is controlled by the drag and lift forces. The angle of attack modulates the force magnitude while the bank angle only acts on the lift direction. For orbital maneuvering vehicles, the dynamics is generally formulated using the orbital parameters evolution, e.g., by Gauss equations, so that attitude angles in the local orbital frame are best suited.
If the trajectory comprises multiple branches or successive flight sequences with dynamics changes and interior point constraints, discontinuities may occur in the optimal command law. This occurs typically at stage separations and engine ignitions or shutdowns. The commutation dates between the flight sequences themselves may be part of the optimized variables, as well as other finite dimension parameters, leading to a hybrid optimal control problem. A further complexity occurs with path constraints relating either to the vehicle design (e.g., dynamic pressure or thermal flux levels), or to the operations (e.g., tracking, safety, lightening). These constraints may be active along some parts of the trajectory, and the junction between constrained and unconstrained arcs may raise theoretical and numerical issues.
The numerical procedures for optimal control problems are usually classified between direct and indirect methods. Direct methods discretize the optimal control problem in order to rewrite it as a nonlinear large scale optimization problem. The process is straightforward and it can be applied in a systematic manner to any optimal control problem. New variables or constraints may be added easily. But achieving an accurate solution requires a careful discretization and the convergence may be difficult due to the large number of variables. On the other hand indirect methods are based on the Pontryagin Maximum Principle which gives a set of necessary conditions for a local minimum. The problem is reduced to a nonlinear system that is generally solved by a shooting method using a Newton-like algorithm. The convergence is fast and accurate, but the method requires both an adequate starting point and a high integration accuracy. The sensitivity to the initial guess can be lowered by multiple shooting which breaks the trajectory into several legs linked by interface constraints, at the expense of a larger nonlinear system. The indirect method requires also prior theoretical work for problems with singular solutions or with state constraints. Handling these constraints by penalty method can avoid numerical issues, but yields less optimal solutions.
In some cases the mission analysis may address discrete variables. Examples of such problems are the removal of space debris by a cleaner vehicle or interplanetary travels with multiple fly-bys. For a debris cleaning mission (see Figure 9) the successive targets are moving independently of the vehicle, and the propellant required to go from one target to another depends on the rendezvous dates. The optimization aims at selecting the targets and the visiting order in order to minimize the required propellant. The path between two given targets is obtained by solving a time-dependent optimal control problem. The overall problem is thus a combinatorial variant of the well-known Traveling Salesman Problem, with successive embedded optimal control problems. For an interplanetary mission successive fly-bys around planets are necessary to increase progressively the velocity in the solar system and reach far destinations. Additional propelled maneuvers are necessary either at the fly-by or in the deep space in order to achieve the desired path. An impulsive velocity modelling is considered for these maneuvers in a first stage. If a low thrust engine is used, the maneuver assessment must be refined by solving an embedded optimal control problem. The optimization problem mixes discrete variables (selected planets, number of revolutions between two successive fly-bys, number of propelled maneuvers) and continuous variables (fly-bys dates, maneuver dates, magnitudes and orientations).
In preliminary design studies, the optimization problem addresses simultaneously the vehicle configuration and its command along the trajectory. The goal is usually to find the minimal gross weight vehicle able to achieve the specified mission. The configuration parameters are either continuous or discrete variables. For a propelled vehicle the main design parameters are the number of stages, the number of engines, the thrust level, the propellant type and the propellant masses. For a reentry vehicle the design is driven by the aerodynamic shape, the surface and by the auxiliary braking sub-systems if any. The gross mass minimization is essential for the feasibility of interplanetary missions. An example is given by a Mars lander composed of a heat shield, one or several parachutes, braking engines, airbags and legs. The sub-system designs drive the acceptable load levels and thus the state constraints applied to the entry trajectory. The successive sequence of the descent trajectory are depicted on Figure 10. Large uncertainties have also to be accounted regarding the Mars environment in order to define a robust vehicle configuration. Figure 10: Entry, descent and landing system design Multidisciplinary optimization deals with such problems involving both the vehicle design and the mission scenario. The overall problem is too complex to be address directly, and a specific optimization procedure must be devised for each new case. A bi-level approach consists in separating the design and the trajectory optimization. The design problem is generally non differentiable or may present many local minima. It can be addressed in some cases by mixed optimization methods like branch and bound, or more generally by meta-heuristics like simulated annealing, genetic algorithms, particle swarm, etc. None is intrinsically better than another and a specific analysis is needed to formulate the optimization problem in a way suited to the selected method. These algorithms are based partly on a random exploration of the variable space. In order to be successful the exploration strategy has to be customized to the problem specificities. Thousands or millions of trials may be necessary to yield a candidate configuration, based on very simplified performance assessment (e.g., analytical solutions, impulsive velocities, response surface models etc.). The trajectory problem is then solved for this candidate solution in order to assess the real performance, and if necessary iterate on the configuration optimization with a corrected the performance model. Meta-heuristics may also be combined with multi-objective optimization approaches since several criteria have to be balanced at the design stage of a new space vehicle. The goal is to build a family of launchers using a common architecture of propelled stages with variants depending the targeted orbit and payload. By this way the development and manufacturing costs are minimized while the launcher configuration and the launch cost can be customized for each flight.

Geometric Optimal Control
Geometric optimal control (see, e.g., [1,75,84]) combines classical optimal control and geometric methods in system theory, with the goal of achieving optimal synthesis results. More precisely, by combining the knowledge inferred from the Pontryagin Maximum Principle (PMP) with geometric considerations, such as the use of Lie brackets and Lie algebras, of differential geometry on manifolds, and of symplectic geometry and Hamiltonian systems, the aim is to describe in a precise way the structure of optimal trajectories. We refer the reader to [84,72] for a list of references on geometric tools used in geometric optimal control. The foundations of geometric control can be dated back to the Chow's theorem and to [24,25], where Brunovsky found that it was possible to derive regular synthesis results by using geometric considerations for a large class of control systems. Apart from the main goal of achieving a complete optimal synthesis, geometric control aims also at deriving higher-order optimality conditions in order to better characterize the set of candidate optimal trajectories.
In this section, we formulate the optimal control problem on differentiable manifolds and recall some tools and results from geometric optimal control. More precisely, the Lie derivative is used to define the order of the state constraints, the Lie and Poisson brackets are used to analyze the singular extremals and to derive higher order optimality conditions, and the optimality conditions (order one, two and higher) are used to analyze the chattering extremals (see Section 3.4 for the chattering phenomenon). These results will be applied in Section 6 on a coupled attitude and trajectory optimization problem.

Optimal Control Problem
Let M be a smooth manifold of dimension n, let N be a smooth manifold of dimension m, let M 0 and M 1 be two subsets of M , and let U be a subset of N . We consider the general nonlinear optimal control problem (P 0 ), of minimizing the cost functional over all possible trajectories solutions of the control systeṁ and satisfying the terminal conditions where For each x(0) ∈ M 0 and u ∈ U, we can integrate the system (1) from t = 0 to t = t f , and assess the cost C(t f , u) corresponding to x(t) = x(t; x 0 , u(t)) and u(t) for t = [0, t f ]. Solving the problem (P 0 ) consists in finding a pair (x(t), u(t)) = (x(t; x 0 , u(t)), u(t)) minimizing the cost. For convenience, we define the end-point mapping to describe the final point of the trajectory solution of the control system (1). Definition 1. The end-point mapping E : M × R × U of the system is defined by where t → x(x 0 , t, u) is the trajectory solution of the control system (1) associated to u such that Assuming moreover that U is endowed with the standard L ∞ topology, then the end-point mapping is C 1 on U, and in terms of the end-point mapping, the optimal control problem under consideration can be written as the infinite-dimensional minimization problem This formulation of the problem will be used when we introduce the Lagrange multipliers rule in Section 3.3.1 in a simpler case when M 0 = {x 0 } and M 1 = {x 1 } and U = R m .
If the optimal control problem has a solution, we say that the corresponding control and trajectory are minimizing or optimal. We refer to [31,83] for existence results in optimal control. Next, we introduce briefly the concept of Lie derivative, and of Lie and Poisson brackets (used in Section 3.3.3 for higher order optimality conditions). These concepts will be applied in Section 6 to analyze the pull-up maneuver problem.

Lie Derivative, Lie Bracket, and Poisson Bracket
Let Ω be an open and connected subset in M , and denote the space of all infinitely continuously differentiable functions on Ω by C ∞ (Ω). Let X ∈ C ∞ (Ω) be a vector field. X can be seen as defining a first-order differential operator from the space C ∞ (Ω) into C ∞ (Ω) by taking at every point q ∈ Ω the directional derivative of a function ϕ ∈ C ∞ (Ω) in the direction of the vector field X(q), i.e., X : C ∞ (Ω) → C ∞ (Ω), ϕ → Xϕ, defined by (X.ϕ)(q) = ∇ϕ(q) · X(q).
We call (X.ϕ)(q) the Lie derivative of the function ϕ along the vector field X, and generally one denote the operator by L X , i.e., L X (ϕ)(q) = (X.ϕ)(q).
In general, the order of the state constraints in optimal control problems is defined through Lie derivatives as we will show on the example in Section 6.1.5.
Definition 2. The Lie bracket of two vector fields X and Y defined on a domain Ω is the operator defined by the commutator The Lie bracket actually defines a first-order differential operator. For any function ϕ we have where ∇(∇ϕ)(X, Y ) denotes the action of the Hessian matrix of the function ϕ on the vector fields X and Y , and DX and DY denote the matrices of the partial derivatives of the vector fields X and Y . Therefore, if X : Ω → M, z → X(z), and Y : Ω → M, z → Y (z), are coordinates for these vector fields, then Lemma 1. Let X, Y , and Z be three C ∞ vector fields defined on Ω, and let α, β be smooth functions on Ω. The Lie bracket has the following properties: • [·, ·] is a bilinear operator; These properties show that the vector fields (as differential operators) form a Lie algebra. A Lie algebra over R is a real vector space G together with a bilinear operator [·, ·] : Going back to the problem (P 0 ), we assume that f (x, u) = f 0 (x) + uf 1 (x), f 0 (x, u) = 1, and g(t, x) = 0, and we define a C 1 function by where p is the adoint vector and Z is a vector field. The function h is the Hamiltonian lift of the vector field Z. Accordingly, and with a slight abuse of notation, we denote by h(t) = h(x(t), p(t)) the value at time t of h along a given extremal. The derivative of this function iṡ Let us recall also the concept of the Poisson bracket. The Poisson bracket is related to the Hamiltonians. In the canonical coordinates z = (x, p), given two C 1 functions α 1 (x, p) and α 2 (x, p), the Poisson bracket takes the form According to (3), taking where h 0 (t) = p(t), f 0 (x(t)) and h 1 (t) = p(t), f 1 (x(t)) . For convenience, we adopt the usual notations and We will see in Section 3.3 (and also in Section 6) that the Lie brackets and the Poisson brackets are very useful for deriving higher order optimality conditions in simpler form and for calculating the singular controls.

Optimality Conditions
This section gives an overview of necessary optimality conditions.
For the first-order optimality conditions, we recall the Lagrange multipliers method for the optimal control problem without control constraints. Such constraints can be accounted in the Lagrangian with additional Lagrange multipliers [23]. This method leads to weaker results than the Pontryagin Maximum Principle which considers needle-like variations accounting directly for the control constraints.
In some cases, the first-order conditions do not provide adequate information of the optimal control, and the higher order optimality conditions are needed. Therefore we recall the second and higher order necessary optimality conditions that must be met by any trajectory associated to an optimal control u. These conditions are especially useful to analyze the singular solutions because the first-order optimality conditions do not provide any information in such cases.

First-Order Optimality Conditions
Lagrange multipliers rule. We consider the simplified problem (P 0 ) with M = R n , M 0 = {x 0 }, M 1 = {x 1 }, and U = R m . According to the well known Lagrange multipliers rule (and assuming the C 1 regularity of the problem), if x ∈ M is optimal then there exists a nontrivial couple where dE(·) and dC(·) denote the Fréchet derivative of E(·) and C(·), respectively. Defining the Lagrangian by this first-order necessary condition can be written in the form If we define as usual the intrinsic second-order derivative Q t f of the Lagrangian as the Hessian ∂u , a second-order necessary condition for optimality is the nonpositivity of Q t f (with ψ 0 0), and a second-order sufficient condition for local optimality is the negative definiteness of Q t f .
These results are weaker to those obtained with the PMP. The Lagrange multiplier (ψ, ψ 0 ) is in fact related to the adjoint vector introduced in the PMP. More precisely, the Lagrange multiplier is unique up to a multiplicative scalar if and only if the trajectory x(·) admits a unique extremal lift up to a multiplicative scalar, and the adjoint vector (p(·), p 0 ) can be constructed such that (ψ, ψ 0 ) = (p(t f ), p 0 ) up to some multiplicative scalar. This relation can be observed from the proof of the PMP. The Lagrange multiplier ψ 0 = p 0 is associated with the instantaneous cost. The case with p 0 null is said abnormal, which means that there are no neighboring trajectories having the same terminal point (see, e.g., [2,84]).
Pontryagin Maximum Principle. The Pontryagin Maximum Principle (PMP, see [68]) for the problem (P 0 ) with control constraints and without state constraints is recalled in the following statement.
If moreover, the final time t f is not fixed, then If M 0 and M 1 (or just one of them) are submanifolds of M locally around x(0) ∈ M 0 and x(t f ) ∈ M 1 , then the adjoint vector satisfies the transversality conditions at both endpoints (or just one of them) where T x M 0 (resp., T x M 1 ) denote the tangent space to M 0 (resp., M 1 ) at the point x.
The quadruple (x(·), p(·), p 0 , u(·)) is called the extremal lift of x(·). An extremal is said to be normal (resp., abnormal ) if p 0 < 0 (resp., p 0 = 0). According to the convention chosen in the PMP, we consider p 0 0. If we adopt the opposite convention p 0 0, then we have to replace the maximization condition (7) with a minimization condition. When there are no control constraints, abnormal extremals project exactly onto singular trajectories.
The proof of the PMP is based on needle-like variations and uses a conic implicit function theorem (see, e.g., [1,50,77]). Since these needle-like variants are of order one, the optimality conditions given by the PMP are necessary conditions of the first-order. For singular controls, higher order control variations are needed to obtain optimality conditions. A singular control is defined precisely as follows.
The trajectory x(·) associated with a singular control u is called singular trajectory.
In practice the condition ∂ 2 H ∂u 2 (x(·), p(·), p 0 , u(·)) = 0 (the Hessian of the Hamiltonian is degenerate) is used to characterize singular controls. An extremal (x(·), p(·), p 0 , u(·)) is said totally singular if this condition is satisfied. The is especially the case when the control is affine (see Section 3.3.3).
The PMP claims that if a trajectory is optimal, then it should be found among projections of extremals joining the initial set to the final target. Nevertheless the projection of a given extremal is not necessarily optimal. This motivates the next section on second-order optimality conditions.

Second-Order Optimal Conditions
The literature on first and/or second-order sufficient conditions with continuous control is rich (see, e.g., [40,63,59,60,93]), which is less the case for discontinuous controls (see, e.g., [66]). We recall hereafter the Legendre type conditions with Poisson brackets to show that geometric optimal control allows a simple expression of the second-order necessary and sufficient conditions (see Theorem 2).
The C 0 local optimality and L ∞ local optimality are respectively called strong local optimality and weak local optimality 2 . The Legendre condition is a necessary optimality condition, whereas the strong Legendre condition is a sufficient optimality condition. We say that we are in the regular case whenever the strong Legendre condition holds along the extremal. Under the strong Legendre condition, a standard implicit function argument allows expressing, at least locally, the control u as a function of x and p.
In the totally singular case, the strong Legendre condition is not satisfied and we have the following generalized condition [1,49].

Theorem 2. (Goh and Generalized Legendre condition)
• If a trajectory x(·), associated to a piecewise smooth control u, and having a totally singular extremal lift (x(·), p(·), p 0 , u(·)), is optimal on [0, t f ] in L ∞ topology, then the Goh condition holds along the extremal, that is where {·, ·} denotes the Poisson bracket on T * M . Moreover, the generalized Legendre condition holds along every extremal lift (x(·), p(·), p 0 , u(·)) of x(·), that is 2 If the final time t f is fixed, thenx(·) is said to be locally optimal in L ∞ topology (resp. in C 0 topology), if it is optimal in a neighborhood of u in L ∞ topology (resp. in a neighborhood ofx(·) C 0 topology).
If the final time t f is not fixed, then a trajectoryx(·) is said to be locally optimal in L ∞ topology if, for every Moreover, a trajectoryx(·) is said to be locally optimal in C 0 topology if, for every neighborhood W ofx(·) in M , for every real number η so that |η| , for every trajectory x(·), associated to a control v ∈ V on [0, t f + η], contained in W , and satisfying • If the Goh condition holds along the extremal lift (x(·), p(·), p 0 , u(·)), if the strong Legendre condition holds along the extremal (x(·), p(·), p 0 , u(·)), that is, there exists 0 > 0 such that and if moreover the mapping ∂f ∂u (x 0 , u(0)) : R m → T x0 M is one-to-one, then there exists 1 > 0 such that x(·) is locally optimal in L ∞ topology on [0, 1 ].
As we have seen, the Legendre (or generalized Legendre) condition is a necessary condition, while the strong (or strong generalized Legendre) condition is a sufficient condition. However, these sufficient conditions are not easy to verify in practice. This leads to the next section where we explain how to use the so-called conjugate point along the extremal to determine the time when the extremal is no longer optimal.
Conjugate points. We consider here the simplified problem Under the strict Legendre assumption assuming that the Hessian Definition 4. The first conjugate time is defined by the infimum of times t > 0 such that Q t has a nontrivial kernel. We denote the first conjugate time along x(·) by t c .
The extremals are locally optimal (in L ∞ topology) as long as we do not encounter any conjugate point. Define the exponential mapping where the solution of (5) starting from (x 0 , p 0 ) at t = 0 is denoted as (x(t, x 0 , p 0 ), p(t, x 0 , p 0 )). Then, we have the following result (see, e.g., [1,15] for the proof and more precise results): The time t c is a conjugate time along x(·) if and only if the mapping exp x0 (t c , ·) is not an immersion at p 0 , i.e., the differential of the mapping exp x0 (t c , ·) is not injective.
Essentially this result states that computing a first conjugate time t c reduces to finding the zero of some determinant along the extremal. In the smooth case (the control can be expressed as a smooth function of x and p), the survey article [15] provides also some algorithms to compute first conjugate times. In case of bang-bang control, a conjugate time theory has been developed (see [78] for a brief survey of the approaches), but the computation of conjugate times remains difficult in practice (see, e.g., [58]).
When the singular controls are of order one (see Definition 5), the second-order optimality condition is sufficient for the analysis. For higher order singular controls, higher order optimality conditions are needed which are recalled in the next section.

Order of Singular Controls and Higher Order Optimality Conditions
In this section we recall briefly the order of singular controls and the higher order optimality conditions. They will be used in Section 6.1 to analyze the example, which exhibits a singular control of order two. It is worth noting that when the singular control is of order 1 (also called minimal order in [16,33]), these higher order optimality conditions are not required.
To illustrate how to use these conditions, we consider the minimal time control problem on M (10) where f , g 1 and g 2 are smooth vector fields on M . We assume that M 1 is accessible from x 0 , and that there exists a constant B t f such that for every admissible control u, the corresponding trajectory Then, according to classical results (see, e.g., [31,83]), there exists at least one optimal solution (x(·), u(·)), defined on [0, t f ].
. According to the PMP (see Section 3.3.1), the Hamiltonian of the problem (10) is defined by , the maximization condition of the PMP yields We call Φ (as well as its components) the switching function. We say that an arc (restriction of an extremal to a subinterval I) is regular if Φ(t) = 0 along I. Otherwise, the arc is said to be singular.
Following [43], we give here below a precise definition of the order of a singular control. The use of Poisson (and Lie) brackets simplifies the formulation of the higher order optimality conditions. This is one of the reasons making geometric optimal control theory a valuable tool in practice.
The control u is said to be of intrinsic order q if the vector fields satisfy also The condition of a nonzero determinant guarantees that the optimal control can be computed from the 2q-th time derivative of the switching function. Note that this definition requires that the two components of the control have the same order.
We next recall the Goh and generalized Legendre-Clebsch conditions (see [49,54,56]). It is worth noting that in [56], the following higher-order necessary conditions hold even when the components of the control u have different orders.

Lemma 2. (higher-order necessary conditions)
We assume that a singular control u = (u 1 , u 2 ) defined on I is of order q, that u is optimal and not saturating, i.e., u < 1. Then the Goh must be satisfied along I. Moreover, the matrix having as (i, j)-th component is symmetric and negative definite along I (generalized Legendre-Clebsch Condition).
In practice, it happens that the singular controls are often of intrinsic order 2, and that We have thus the following higher-order necessary conditions, that will be used on the example in Section 6.1.

Corollary 1.
We assume that the optimal trajectory x(·) contains a singular arc, defined on the subinterval I of [0, t f ], associated with a non saturating control u = (u 1 , u 2 ) of intrinsic order 2.
If the vector fields satisfy [g 1 , and the generalized Legendre-Clebsch condition (in short, GLCC ) must be satisfied along I. Moreover, we say that the strengthened GLCC is satisfied if we have a strict inequality above, that is, In the next section, we recall the chattering phenomenon that may happen in the optimal control problem. This phenomenon is actually not rare as illustrated in [88] by many examples (in astronautics, robotics, economics, and etc.). These examples are mostly single input systems. The existence of chattering phenomenon for bi-input control affine systems is also proved in [91].

Chattering phenomenon
We call chattering phenomenon (or Fuller's phenomenon) the situation when the optimal control switches an infinite number of times over a compact time interval. It is well known that, if the optimal trajectory involves a singular arc of higher order, then no connection with a bang arc is possible and the bang arcs asymptotically joining the singular arc must chatter. On Figure 11(b), the control is singular over (t 1 , t 2 ), and the control x(t 1 ) x(t 2 ) Figure 11: An illustration of chattering phenomenon. Figure 11(a), the chattering trajectory "oscillates" around the singular part and finally "gets off" the singular trajectory with an infinite number of switchings. The chattering phenomenon is illustrated by the Fuller's problem (see [42,61]), which is the optimal control problem We define ξ = The optimal synthesis of the Fuller's problem yields the following feedback control (see [42,75,87]).
The control switches from u = 1 to u = −1 at points on Γ − and from u = −1 to u = 1 at points on Γ + . The corresponding trajectories crossing the switching curves Γ ± transversally are chattering arcs with an infinite number of switchings that accumulate with a geometric progression at the final time t f > 0.
The optimal synthesis for the Fuller's problem is drawn on Figure 12. The optimal control of −5 the Fuller's problem, denoted u * , contains a countable set of switchings of the form converges to t f < +∞. This means that the chattering arcs contain an infinite number of switchings within a finite time interval t f > 0.

Numerical Methods in Optimal Control
Numerical approaches in optimal control are usually distinguished between direct and indirect methods. Indirect methods consist in solving numerically the boundary value problem derived from the application of the PMP. Direct methods consist in discretizing the state and the control, and solving the resulting nonlinear optimization problem. The principles of both methods are recalled hereafter.

Indirect Methods
In indirect approaches, the Pontryagin Maximum Principle (first-order necessary condition for optimality) is applied to the optimal control problem in order to express the control as a function of the state and the adjoint. This reduces the problem to a nonlinear system of n equations with n unknowns generally solved by Newton-like methods. Indirect methods are also called shooting methods. The principle of the simple shooting method and of the multiple shooting method are recalled. The problem considered in this section is (P 0 ).
Simple shooting method. Using (6), the optimal control can be expressed as a function of the state and the adjoint variable (x(t), p(t)). Denoting z(t) = (x(t), p(t)), the extremal system (5) can be written under the formż(t) = F (z(t)). The initial and final conditions (2), the transversality conditions (8), and the transversality condition on the Hamiltonian (7) can be written under the form of R(z(0), z(t f ), t f ) = 0. We thus get a two boundary value probleṁ Let z(t, z 0 ) be the solution of the Cauchy probleṁ Then this two boundary value problem consists in finding a zero of the equation This problem can be solved by Newton-like methods or other iterative methods.
Multiple shooting method. The drawback of the single shooting method is the sensitivity of the Cauchy problem to the initial condition z 0 . The multiple shooting aims at a better numerical stability by dividing the interval [0, and considering as unknowns the values of z i = (x(t i ), p(t i )) at the beginning of each subinterval. The application of the PMP to the optimal control problem yields a multi-point boundary value problem, which consists in and the constraints are satisfied. The nodes of the multiple shooting method may involve the switching times (at which the switching function changes sign), and the junction times (entry, contact, or exit times) with boundary arcs. In this case an a priori knowledge of the solution structure is required. The multiple shooting method improves the numerical stability at the expense of a larger nonlinear system. An adequate node number must be chosen making a compromise between the system dimension and the convergence domain.

Direct Methods
Direct methods are so called because they address directly the optimal control problem without using the first-order necessary conditions yielded by the PMP. By discretizing both the state and the control, the problem reduces to a nonlinear optimization problem in finite dimension, also called NonLinear Programming problem (NLP). The discretization may be carried out in many ways, depending on the problem features. As an example we may consider a subdivision 0 = t 0 < t 1 < · < t N = t f of the interval [0, t f ]. We discretize the controls such that they are piecewise constant on this subdivision with values in U . Meanwhile the differential equations may be discretized by an explicit Euler method : by setting The cost may be discretized by a quadrature procedure. These discretizations reduces the optimal control problem P 0 to a nonlinear programming problem of the form From a more general point of view, a finite dimensional representation of the control and of the state has to be chosen such that the differential equation, the cost, and all constraints can be expressed in a discrete way.
Alternative variants of direct methods are the collocation methods, the spectral or pseudospectral methods, the probabilistic approaches, etc.
Another approach to optimal control problems that can be considered as a direct method, consists in solving the Hamilton-Jacobi equation satisfied (in the viscosity sense) by the value function which is of the form The value function is the optimal cost for the optimal control problem starting from a given point (x, t) (see [76] for some numerical methods).

Comparison Between Methods
The main advantages and disadvantages of the direct and indirect methods are summarized in Table 1 (see also, e.g., [83,84]).
Direct methods Indirect methods a priori knowledge of the solution structure not required required sensible to the initial condition not sensible very sensible handle the state constraints easy difficult convergence speed and accuracy relatively slow and inaccurate fast and accurate computational aspect memory demanding parallelizable In practice no approach is intrinsically better than the other. The numerical method should be chosen depending on the problem features and on the known properties of the solution structure. These properties are derived by a theoretical analysis using the geometric optimal control theory. When a high accuracy is desired, as is generally the case for aerospace problems, indirect methods should be considered although they require more theoretical insight and may raise numerical difficulties.
Whatever the method chosen, there are many ways to adapt it to a specific problem (see [84]). Even with direct methods, a major issue lies in the initialization procedure. In recent years, the numerical continuation has become a powerful tool to overcome this difficulty. The next section recalls some basic mathematical concepts of the continuation approaches, with a focus on the numerical implementations of these methods.

Existence Results and Discrete Continuation
The basic idea of continuation (also called homotopy) methods is to solve a difficult problem step by step starting from a simpler problem by parameter deformation. The theory and practice of the continuation methods are well-spread (see, e.g., [3,69,86]). Combined with the shooting problem derived from the PMP, a continuation method consists in deforming the problem into a simpler one (that can be easily solved) and then solving a series of shooting problems step by step to come back to the original problem.
One difficulty of homotopy methods lies in the choice of a sufficiently regular deformation that allows the convergence of the homotopy method. The starting problem should be easy to solve, and the path between this starting problem and the original problem should be easy to model. Another difficulty is to numerically follow the path between the starting problem and the original problem. This path is parametrized by a parameter denoted λ. When the homotopic parameter λ is a real number and when the path is linear 3 in λ, the homotopy method is rather called a continuation method.
The choice of the homotopic parameter may require considerable physical insight into the problem. This parameter may be defined either artificially according to some intuition, or naturally by choosing physical parameters of the system, or by a combination of both.
Suppose that we have to solve a system of N nonlinear equations in N dimensional variable Z where G 0 : R N → R N is a smooth map having known zero points. A zero path is a curve c(s) ∈ G −1 (0) where s represents the arc length. We would like to trace a zero path starting from a point Z 0 such that G(Z 0 , 0) = 0 and ending at a point Z f such that G(Z f , 1) = 0.
The first question to address is the existence of zero paths, since the feasibility of the continuation method lies on this assumption. The second question to address is how to numerically track such zero paths when they exist.
Existence of zero paths The local existence of the zero paths is answered by the implicit function theorem. Some regularity assumptions are needed, as in the following statement (which is the contents of [44, Theorem 2.1]).
is of maximum rank N ; • Given any Z ∈ {Z ∈ Ω | G(Z, 0) = 0} ∪ {Z ∈ Ω | G(Z, 1) = 0}, the Jacobian matrix This means that the zero path is diffeomorphic to a circle or the real line. The possible paths and impossible paths are shown in Figure 13 (borrowed from [44,46]). Consider the simplified optimal control problem P 0 with M = R n , M 0 = {x 0 }, M 1 = {x 1 } and U = R m . We assume that the real parameter λ ∈ [0, 1] is increasing monotonically from 0 to 1. Under these assumptions, we are to solve a family of optimal control problems parameterized by λ, i.e., min where E is the end-point mapping defined in Definition 1. We assume moreover that, along the continuation procedure: (1) there are no minimizing abnormal extremals; (2) there are no minimizing singular controls: by Definition 3, the control u is not singular means that the mapping dE x0,t f ,λ (u) is surjective; (3) there are no conjugate points (by Definition 4 the quadratic form Q t f is not degenerate). The absence of conjugate point can be numerically tested (see, e.g., [15]).
We will see that these assumptions are essential for the local feasibility of the continuation methods. According to the Lagrange multipliers rule, especially the first-order condition (4), if u λ is optimal, then there exists (ψ λ , ψ 0 λ ) ∈ R n ×R\ {(0, 0)} such that ψ λ dE x0,t f ,λ (u λ )+ψ 0 λ dC t f ,λ (u) = 0. Since we have assumed that there are no minimizing abnormal extremals in the problem and (ψ λ , ψ 0 λ ) is defined up to a multiplicative scalar, we can set ψ 0 λ = −1. Defining the Lagrangian by Let (uλ, ψλ,λ) be a zero of G and assume that G is of class C 1 . Then according to Theorem 3, we require the Jacobian of G with respect to (u, ψ) at the point (uλ, ψλ,λ) to be invertible. More precisely, the Jacobian of G is where Q t f ,λ is the Hessian We observe that the matrix (12) is invertible if and only if the linear mapping dE x0,t f ,λ (u) is surjective and the quadratic form Q t f ,λ is non-degenerate. These properties correspond to the absence of any minimizing singular control and conjugate points, which are the assumptions done for the local feasibility of the continuation procedure.
The implicit function argument above is done on the control. In practice the continuation procedure is rather done on the exponential mapping (see (13)) and it consists in tracking a path of initial adjoint vectors p 0,λ . Therefore we parameterize the exponential mapping by λ, and thus problem (11) is to solve exp x0,λ (t f , p 0,λ ) = x 1 .
On the one hand, according to the PMP, the optimal control u satisfies the extremal equations (6), and thus u λ = u λ (t, p 0,λ ) is a function of the initial adjoint p 0,λ . On the other hand, the Lagrange multipliers are related to the adjoint vector by p(t f ) = ψ, and thus ψ λ = ψ λ (p 0,λ ) is also a function of p 0,λ . Therefore, the shooting function defined by S(p 0 , λ) = G(u(p 0 ), ψ(p 0 ), λ) has an invertible Jacobian if the matrix (12) is invertible. We conclude then that the assumptions (1)-(3) mentioned above are sufficient to ensure the local feasibility. Despite of local feasibility, the zero path may not be globally defined for any λ ∈ [0, 1]. The path could cross some singularity or diverge to infinity before reaching λ = 1.
The first possibility can be eliminated by assuming (2) and (3) over all the domain Ω and for every λ ∈ [0, 1]. The second possibility is eliminated if the paths remain bounded or equivalently by the properness of the exponential mapping (i.e., the initial adjoint vectors p 0,λ that are computed along the continuation procedure remain bounded uniformly with respect to λ). According to [20,81], if the exponential mapping is not proper, then there exists an abnormal minimizer. By contraposition, if one assumes the absence of minimizing abnormal extremals, then the required boundedness follows.
For the simplified problem (11), where the controls are unconstrained and the singular trajectories are the projections of abnormal extremals, if there are no minimizing singular trajectory nor conjugate points over Ω, then the continuation procedure (13) is globally feasible on [0, 1].
In more general homotopy strategies, the homotopic parameter λ is not necessarily increasing monotonically from 0 to 1. There may be turning points (see, e.g., [86]) and it is preferable to parametrize the zero path by the arc length s. Let c(s) = (Z(s), λ(s)) be the zero path such that G(c(s)) = 0. Then, a turning point of order one is the point where λ (s) = 0, λ (s) = 0. In [27], the authors indicate that if λ = λ(s) is a turning point of order one, then the corresponding final time t f is a conjugate time, and the corresponding point E x0,t f ,λ (u(x 0 , p 0 , t f , λ)) is the corresponding conjugate point 4 . By assuming the absence of conjugate points over Ω for all λ ∈ [0, 1], the possibility of turning points is discarded.
Unfortunately, assuming the absence of singularities is in general too strong, and weaker assumptions do not allow concluding to the feasibility of the continuation method. In the literature, there are essentially two approaches to tackle this difficulty. The first one is of local type. One detects the singularities or bifurcations along the zero path (see, e.g., [3]). The second one is of global type, concerning the so-called globally convergent probability-one homotopy method. We refer the readers to [34,86] for more details concerning this method.
Numerical tracking the zero paths. There exists many numerical algorithms to track a zero path. Among these algorithms, the simplest one is the so called discrete continuation or embedding algorithm. The continuation parameter denoted λ, is discretized by 0 = λ 0 < λ 1 < · · · < λ n l = 1 and the sequence of problems G(Z, λ i ) = 0, i = 1, · · · , n l is solved to end up with a zero point of F (Z). If the increment λ = λ i+1 − λ i is small enough, then the solution Z i associated to λ i such that G(Z i , λ i ) = 0 is generally close to the solution of G(Z, λ i+1 ) = 0. The discrete continuation algorithm is detailed in Algorithm 1.
Result: The solution of the discrete continuation initialization Z = Z 0 , λ 0 = 0, λ ∈ ( λ min , λ max ); while λ 1 and λ min λ λ max do λ = min( λ, 1 − λ); λ = λ + λ; Find the solutionZ such that G(Z,λ) = 0; if successful then Z =Z; The discrete continuation is successful; else The discrete continuation has failed; end Algorithm 1: Discrete continuation algorithm In some cases the parameter λ may be ill suited to parameterize the zero path, and thus causes a slow progress or even a failure of the discrete continuation. Two enhancements (predictor-corrector methods and piecewise-Linear methods) have been proposed in the literature.

Predictor-Corrector (PC) Continuation
A natural parameter for the zero curve (Z, λ) is the arc-length denoted s.
The zero curve parameterized by the arc length s is denoted c(s) = (Z(s), λ(s)).
Differentiating G(Z(s), λ(s)) = 0 with respect to s, we obtain where is the Jacobian, and t(J G ) = dc(s) ds is the tangent vector of the zero path c(s).
If we know a point of this curve (Z(s i ),λ(s i )), and assuming that c(s) is not a critical point (i.e., t(J G ) is not null),we can predict a new zero point (Z(s i+1 ),λ(s i+1 )) by where h s is the step size on s. As shown in Figure 14, if the step size h s is sufficiently small, the prediction step yields a point (Z(s i+1 ),λ(s i+1 )) close to a point (Z(s i+1 ),λ(s i+1 )) on the curve, such that G(c(s i+1 )) = G(Z(s i+1 ),λ(s i+1 )) = 0. The correction step consists in coming back on the curve using a Newton-like method. The PC continuation is described by Algorithm 2. When the optimal control problem is regular (in the sense of the Legendre condition are defined) and the homotopic parameter is a scalar, one can use the so called differential continuation or differential pathfollowing. This method consists in integrating accurately t(J G ) satisfying (14) (see details in [26]). The correction step is replaced by the mere integration of an ordinary differential equation with the help of automatic differentiation (see, e.g., [5,28]).

Piecewise-Linear (PL) Continuation
The main advantage of the PL method is that it only needs the zero paths to be continuous (smoothness assumption of G is not necessary). For a detailed description of the PL methods, we refer the readers to [3,4,45].
Here we present the basic idea of the PL methods, which are also referred to as a simplicial methods. A PL continuation consists of following exactly a piecewise-linear curve c T (s) that approximates the zero path c(s) ∈ G −1 (0).

Result:
The solution of the PC continuation initialization Z = Z 0 , h s > 0, λ 0 = 0, λ ∈ ( λ min , λ max ); while λ 1 and λ min λ λ max do (Predictor) Predict a point (Z,λ) according to (15) The approximation curve c T (s) is a polygonal path relative to an underlying triangulation T of R N +1 , which is a subdivision of R N +1 into (N + 1)-simplices. 5 Then, for any map G : R N +1 → R N , the piecewise linear approximation G T to G relative to the triangulation T of R N +1 is the unique map defined by: (2) for any N + 1-simplex σ = [v 1 , v 2 , · · · , v N +2 ] ∈ T , the restriction G T | σ of G T to σ is an affine map.

Consequently a point
The set G −1 T (0) contains a polygonal path c T : R → R N +1 which approximates the path c. Tracking such a path is carried out via PL-steps similar to the steps used in linear programming methods such as the Simplex Method. Figure 15 portrays the basic idea of a PL method.
In aerospace applications, where the continuation procedure is in general differentiable, the PL methods are usually not as efficient as the PC methods or the differential continuation that we present in next sections. Nevertheless when singularities exist in the zero path, the PL method is probably the most efficient one.

Application to Attitude-Trajectory Optimal Control
In this section, the nonacademic attitude-trajectory optimal control problem for a launch vehicle (classical and airborne) is analyzed in detail. Through this example, we illustrate how to analyze the (singular and regular) extremals of the problem with Lie and Poisson brackets, and how to elaborate numerical continuation procedures adapted to the solution structure. Indeed the theoretical analysis reveals the existence of a chattering phenomenon. Being aware of this feature is essential to devise an efficient numerical solution method.

Geometric Analysis and Numerical Continuations for Optimal Attitude and Trajectory Control Problem (P S )
The problem is formulated in terms of dynamics, control, constraints and cost. The Pontryagin Maximum Principle and the geometric optimal control are then applied to analyze the extremals, revealing the existence of the chattering phenomenon.

Formulation of (P S ) and Difficulties
Minimum time attitude-trajectory control problem (P S ). In this section, we formulate an attitude-trajectory minimum time control problem, denoted by (P S ). The trajectory of a launch vehicle is controlled by the thrust which can only have limited deflection angles with the vehicle longitudinal axis. Controlling the thrust direction requires controlling the vehicle attitude. When the attitude dynamics is slow, or when the orientation maneuver is large, this induces a coupling between the attitude motion and the trajectory, as explained in Section 2.
When this coupling is not negligible the dynamics and the state must account simultaneously for the trajectory variables (considering the launch vehicle as a mass point) and the attitude variables (e.g., the Euler angles or the quaternion associated to the body frame).
The objective is then to determine the deflection angle law driving the vehicle from given initial conditions to the desired final attitude and velocity, taking into account the attitude-trajectory coupling.
The typical duration of such reorientation maneuvers is small compared to the overall launch trajectory. We assume therefore that the gravity acceleration is constant and we do not account for the position evolution. The aerodynamical forces (lift and drag) are supposed negligible in the first approach, and they will be introduced later in the system modelling. The dynamics equations in an inertial frame (O, x, y, z) arė v x = a sin θ cos ψ + g x , v y = −a sin ψ + g y , v z = a cos θ cos ψ + g z , θ = (ω x sin φ + ω y cos φ)/ cos ψ, where (v x , v y , v z ) represents the velocity, (g x , g y , g z ) represents the gravity acceleration, θ (pitch), ψ (yaw), φ (roll) are the Euler angles, a is the ratio of the thrust force to the mass, and b is the ratio of the thrust torque to the transverse inertia of the launcher (a and b are assumed constant). u = (u 1 , u 2 ) ∈ R 2 is the control input of the system satisfying |u| = u 2 1 + u 2 2 1. See more details of the model and the problem formulation in [90] or [92].
Defining the state vector as x = (v x , v y , v z , θ, ψ, φ, ω x , ω y ), we write the system (16) as the bi-input control-affine systemẋ where the controls u 1 and u 2 satisfy the constraint u 2 1 + u 2 2 1, and the vector fields f , g 1 and g 2 are defined by f = (a sin θ cos ψ + g x ) ∂ ∂v x + (−a sin ψ + g y ) ∂ ∂v y + (a cos θ cos ψ + g z ) ∂ ∂v z + (ω x sin φ + ω y cos φ)/ cos ψ ∂ ∂θ + (ω x cos φ − ω y sin φ) ∂ ∂ψ We define the target set (submanifold of R 8 ) The first two conditions in (19) define a final velocity direction parallel to the longitudinal axis of the launcher, or in other terms a zero angle of attack.
The problem (P S ) consists in steering the bi-input control-affine system (17) from x(0) = x 0 = (v x0 , v y0 , v z0 , θ 0 , ψ 0 , φ 0 , ω x0 , ω y0 ) ∈ R 8 to the final target M 1S in minimum time t f , with controls satisfying the constraint u 2 1 +u 2 2 1. The fixed initial condition is x(0) = x 0 and the final condition of problem P S is The initial and final conditions are also called terminal conditions.
Difficulties. The problem (P S ) is difficult to solve directly due to the coupling of the attitude and the trajectory. The system is of dimension 8 and its dynamics contains both slow (trajectory) and fast (attitude) components. This observation is be particularly important in order to design an appropriate solution method. The idea is to define a simplified starting problem and then to apply continuation techniques. However the essential difficulty of this problem is the chattering phenomenon making the control switch an infinite number of times over a compact time interval. Such a phenomenon typically occurs when trying to connect bang arcs with higher-order singular arcs (see, e.g., [42,61,88,89], or Section 3.4).
In a preliminary step, we limited ourselves to the planar problem, which is a single-input control affine system. This planar problem is close to real flight conditions of a launcher ascent phase. We have used the results of M.I. Zelikin and V.F. Borisov [88,89] to understand the chattering phenomenon and to prove the local optimality of the chattering extremals. We refer the readers to [91] for details.
In a second step using the Pontryagin Maximum Principle and the geometric optimal control theory (see [1,75,84]), we have established an existence result of the chattering phenomenon for a class of bi-input control affine systems and we have applied the result to the problem (P s ). More precisely, based on Goh and generalized Legendre-Clebsch conditions, we have proved that there exist optimal chattering arcs when connecting the regular arcs with a singular arc of order two.
The transversality condition where T x(t f ) M 1 is the tangent space to M 1 at the point x(t f ). The final time t f being free and the system being autonomous, we have also h 0 (x(t), p(t)) + Φ(t) We say that an arc (restriction of an extremal to a subinterval I) is regular if Φ(t) = 0 along I. Otherwise, the arc is said to be singular. An arc that is a concatenation of an infinite number of regular arcs is said to be chattering. The chattering arc is associated with a chattering control that switches an infinite number of times, over a compact time interval. A junction between a regular arc and a singular arc is said to be a singular junction.
We next compute the singular control, since it is important to understand and explain the occurrence of chattering. The usual method for to computing singular controls is to differentiate repeatedly the switching function until the control explicitly appears. Note that here we need to use the notion of Lie bracket and Poisson bracket (see Section 3.2).
Assuming that Φ(t) = 0 for every t ∈ I, i.e., h 1 (t) = h 2 (t) = 0, and differentiating with respect to t, we get, using the Poisson brackets, along I. If the singular arc is optimal and the associated singular control is not saturating, then the Goh condition (see [49], see also Theorem 2) {h 1 , h 2 } = p, [g 1 , g 2 ](x) = 0 must be satisfied along I. Therefore we get thatḣ along I.
Since the vector fields g 1 and g 2 commute, i.e., [g 1 , g 2 ] = 0, we get by differentiating again thaẗ Assuming that along I, we obtain that so that the control u = (u 1 , u 2 ) is said of order 1. u 1 and u 2 must moreover satisfy the constraint u 2 1 + u 2 This is a new constraint along the singular arc. The time derivative of this constraint is equal to zero and therefore does not induce any additional constraint. The higher-order necessary conditions for optimality (see Definition 5) state that an optimal singular control can only appear explicitly within an even derivative. Therefore we must have gives three additional constraints along the singular arc: By differentiating the first two constraints with respect to t, we get Assuming that h i , ad 3 h 0 .h i < 0 for i = 1, 2 (generalized Legendre-Clebsch condition, see Corollary 1) and since along I for problem (P S ), the singular control is The singular control u = (u 1 , u 2 ) is then said of intrinsic order two (see the precise definition in Definition 5).
Let us assume that (x(·), p(·), p 0 , u(·)) is a singular arc of (P S ) along the subinterval I, which is locally optimal in C 0 topology. Then we have u = (u 1 , u 2 ) = (0, 0) along I, and u is a singular control of intrinsic order two. Moreover, we can establish (see the proof in [90]) that this singular extremal must be normal, i.e., p 0 = 0, and according to Lemma 1, the Generalized Legendre-Clebsch Condition (GLCC) along I takes the form a + g x sin θ cos ψ − g y sin ψ + g z cos θ cos ψ 0, We define next the singular surface S, which is filled by singular extremals of (P S ), by S = (x, p) | ω x = ω y = 0, p θ = p ψ = p φ = p ωx = p ωy = 0, p vx = tan θp vz , p vz = −p 0 cos θ cos ψ a + g x sin θ cos ψ − g y sin ψ + g z cos θ cos ψ , p vy = − tan ψ/ cos θp vz . (23) We will see later that the solutions of the problem of order zero (defined in the following Section) lie on this singular surface S. Finally, the possibility of chattering in problem (P S ) is demonstrated in [90]. A chattering arc appears when trying to connect a regular arc with an optimal singular arc. More precisely, let u be an optimal control, solution of (P S ), and assume that u is singular on the sub-interval (t 1 , t 2 ) ⊂ [0, t f ] and is regular elsewhere. If t 1 > 0 (resp., if t 2 < t f ) then, for every ε > 0, the control u switches an infinite number of times over the time interval [t 1 −ε, t 1 ] (resp., on [t 2 , t 2 +ε]). The condition (22) was required in the proof.
The knowledge of chattering occurrence is essential for solving the problem (P S ) in practice. Chattering raises indeed numerical issues that may prevent any convergence, especially when using an indirect approach (shooting). The occurrence of the chattering phenomenon in (P S ) explains the failure of the indirect methods for certain terminal conditions (see also the recent paper [29]).

Indirect Method and Numerical Continuation Procedure for (P S )
The principle of the continuation procedure is to start from the known solution of a simpler problem (called hereafter the problem of order zero) in order to initialize an indirect method for the more complicated problem (P S ). This simple low-dimensional problem will then be embedded in higher dimension, and appropriate continuations will be applied to come back to the initial problem.
The problem of order zero defined below considers only the trajectory dynamics which is much slower than the attitude dynamics. Assuming an instantaneous attitude motion simplifies greatly the problem and provides an analytical solution. It is worth noting that the solution of the problem of order zero is contained in the singular surface S filled by the singular solutions for (P S ), defined by (23).
Auxiliary Problems. We define the problem of order zero, denoted by (P 0 ) as the "subproblem" of problem (P S ) reduced to the trajectory dynamics. The control for this problem is directly the vehicle attitude, and the attitude dynamics is not simulated.
Denoting the vehicle longitudinal axis as e and considering it as the control vector (instead of the attitude angles θ, ψ), we formulate the problem as follows: where w is a given vector that refers to the desired target velocity direction, and g is the gravitational acceleration vector. The solution of this problem is straightforward and gives : the optimal solution of (P 0 ) is given by with and We refer the readers to [90] for the detailed calculation. The Euler angles θ * ∈ (−π, π) and ψ * ∈ (−π/2, π/2) are retrieved from the components of the vector e * since e * = (sin θ * cos ψ * , − sin ψ * , cos θ * sin ψ * ) .
We can check that these optimal angles θ = θ * , ψ = ψ * and φ = φ * (whatever the value of φ * ) satisfy the equations (23), so that the solution of (P 0 ) is contained in the singular surface S. The optimal solution of (P 0 ) actually corresponds to a singular solution of (P S ) with the terminal conditions given by A natural continuation strategy consists in changing continuously these terminal conditions (24)- (26) to come back to the terminal conditions (20) of (P S ).
Unfortunately the chattering phenomenon may prevent the convergence of the shooting method. When the terminal conditions are in the neighborhood of the singular surface S, the optimal extremals are likely to contain a singular arc and thus chattering arcs causing the failure of the shooting method. In order to overcome the numerical issues we define a regularized problem with a modified cost functional.
The regularized problem (P R ) consists in minimizing the cost functional for the bi-input control-affine system (17), under the control constraints −1 u i 1, i = 1, 2, and with the terminal conditions (20). The constant K > 0 is arbitrary. We have replaced the constraint u 2 1 + u 2 2 1 (i.e., u takes its values in the unit Euclidean disk) with the constraint that u takes its values in the unit Euclidean square. Note that we use the Euclidean square (and not the disk) because we observed that our numerical simulations worked better in this case. This regularized optimal control problem with the cost (27) has continuous extremal controls and it is therefore well suited to a continuation procedure.
The Hamiltonian of problem (P R ) is and according to the PMP, the optimal controls are where the saturation operator sat is defined by An important advantage of considering problem (P R ) is that when we embed the solutions of (P 0 ) into the (P R ), they are not singular, whereas the solution of (P 0 ) is a singular trajectory of the full problem (P S ) and thus passing directly from (P 0 ) to (P S ) causes essential difficulties due to chattering. More precisely, an extremal of (P 0 ) can be embedded into (P R ), by setting where θ * and ψ * are given by solving problem P 0 , with the natural terminal conditions given by (24) and (25)- (26). This solution is not a singular extremal for (P R ). The extremal equations for (P R ), are the same than for (P S ), as well as the transversality conditions.
Numerical Continuation Procedure. The objective is to find the optimal solution of (P S ), starting from the explicit solution of P 0 . We proceed as follows: • First, we embed the solution of (P 0 ) into (P R ). For convenience, we still denote (P 0 ) the problem (P 0 ) formulated in higher dimension.
• Then, we pass from (P 0 ) to (P S ) by means of a numerical continuation procedure, involving three continuation parameters. The first two parameters λ 1 and λ 2 are used to pass continuously from the optimal solution of (P 0 ) to the optimal solution of the regularized problem (P R ) with prescribed terminal attitude conditions, for some fixed K > 0. The third parameter λ 3 is then used to pass to the optimal solution of (P S ) (see Figure 16). In a first step, we use the continuation parameter λ 1 to act on the initial conditions, according to where ω * x = ω * y = 0, φ * = 0, and θ * , ψ * are given by the explicit solution of the problem (P 0 ). Using the transversality condition (21) and the extremal equations, the shooting function S λ1 for the λ 1 -continuation is of dimension 8 and defined by where H K (t f ) with p 0 = −1 is calculated from (28) and u 1 and u 2 are given by (29). Recall that we have proved that a singular extremal of problem (P S ) must be normal, and since we are starting to solve the problem from a singular extremal, we can assume that p 0 = −1.
Note again that there is no concern using S λ1 as shooting function for (P R ). This would not be the case for (P S ) : if S λ1 = 0, then together with ω x (t f ) = 0 and ω y (t f ) = 0, the final point (x(t f ), p(t f )) of the extremal would lie on the singular surface S defined by (23) and this would cause the failure of the shooting method. On the opposite, for problem (P R ), even when x(t f ) ∈ S, the shooting problem is smooth and it can still be solved.
The solution of (P 0 ) is a solution of (P R ) for λ 1 = 0, corresponding to the terminal conditions (24)-(25) (the other states at t f being free). By continuation, we vary λ 1 from 0 to 1, yielding the solution of (P R ), for λ 1 = 1. The final state of the corresponding extremal gives some unconstrained Euler angles denoted by θ e = θ(t f ), ψ e = ψ(t f ), φ e = φ(t f ), ω xe = ω x (t f ) and ω ye = ω y (t f ).
In a second step, we use the continuation parameter λ 2 to act on the final conditions, in order to make them pass from the values θ e , ψ e , φ e , ω xe and ω ye , to the desired target values θ f , ψ f , φ f , ω xf and ω yf . The shooting function S λ2 for the λ 2 -continuation is still of dimension 8 and defined by Solving this problem by varying λ 2 from 0 to 1, we obtain the solution of (P R ), with the terminal condition (20).
Finally, in order to compute the solution of (P S ), we use the continuation parameter λ 3 to pass from (P R ) to (P S ). We introduce the parameter λ 3 into the cost functional (27) and the Hamiltonian H K as follows: H(t f , λ 3 ) = p, f + p, g 1 u 1 + p, g 2 u 2 + p 0 + p 0 K(u 2 1 + u 2 2 )(1 − λ 3 ). According to the PMP, the extremal controls of this problem are given by u i = sat(−1, u ie , 1), The shooting function S λ3 is defined similarly to S λ2 , replacing H K (t f ) with H K (t f , λ 3 ). The solution of (P S ) is then obtained by varying λ 3 continuously from 0 to 1.
This last continuation procedure fails in case of chattering, and thus it cannot be successful for any arbitrary terminal conditions. In particular, if chattering occurs then the λ 3 -continuation is expected to fail for some value λ 3 = λ *

Direct Method
In this section we envision a direct approach for solving (P S ), with a piecewise constant control over a given time discretization. The solutions obtained with such a method are sub-optimal, especially when the control is chattering (the number of switches being limited by the time step).
Since the initialization of a direct method may also raise some difficulties, we propose the following strategy. The idea is to start from the problem (P S ) with relaxed terminal requirements, in order to get a first solution, and then to reintroduce step by step the final conditions (20) of (P S ). We implement this direct approach with the software BOCOP and its batch optimization option (see [13]).
• Step 1: we solve (P S ) with the initial condition x(0) = x 0 and the final conditions These final conditions are those of the planar version of (P S ) (see [91] for details). This problem is easily solved by a direct method without any initialization care (a constant initial guess for the discretized variables suffices to ensure convergence).
• Then, in Steps 2, 3, 4 and 5, we add successively (and step by step) the final conditions and for each new step we use the solution of the previous one as an initial guess.
At the end of this process, we have obtained the solution of (P S ).

Comparison of the Indirect and Direct Approaches
So far, in order to compute numerically the solutions of (P S ), we have implemented two approaches. The indirect approach, combining shooting and numerical continuation, is time-efficient when the solution does not contain any singular arcs.
Depending on the terminal conditions, the optimal solution of (P S ) may involve a singular arc of order two, and the connection with regular arcs generates chattering. The occurrence of chattering causes the failure of the indirect approach. For such cases, we have proposed two alternatives. The first alternative is based on an indirect approach involving three continuations. The last continuation starting from a regularized problem with smooth controls aims at coming back to the original problem that may be chattering. When chattering appears the continuation fails, but the last successful step provides a valuable smooth solution meeting the terminal conditions.
The second alternative is based on a direct approach, and it yields as well a sub-optimal solution having a finite number of switches. The number of switches is limited by the discretization step. In any case, the direct strategy is much more time consuming than the indirect approach and the resulting control may exhibit many numerical oscillations as can be observed on Figure 17. This kind of solutions is practically undesirable.
Note that with both approaches, no a priori knowledge of the solution structure is required (in particular, the number of switches is unknown).
As a conclusion about this example (P S ), we can emphasize that the theoretical analysis has revealed the existence of singular solutions with possible chattering. This led us to introduce a regularized problem in order to overcome this essential difficulty. On the other hand a continuation procedure is devised considering the dynamics slow-fast rates. This procedure is initiated by the problem of order zero reduced to the trajectory dynamics.
In the next section, we extend this approach to a more complicated problem (optimal pull-up maneuvers of airborne launch vehicles), in order to further illustrate the potential of continuation methods in aerospace applications.

Extension to Optimal Pull-up Maneuver Problem (P A )
Since the first successful flight of Pegasus vehicle in April 1990, the airborne launch vehicles have always been a potentially interesting technique for small and medium-sized space transportation systems. The mobility and deployment of the airborne launch vehicles provide increased performance and reduced velocity requirements due to non-zero initial velocity and altitude. Airborne launch vehicles consist of a carrier aircraft and a rocket-powered launch vehicle. The launch vehicle is released almost horizontally from the carrier aircraft and its engine is ignited a few seconds later once the carrier aircraft has moved away. The flight begins with a pull-up maneuver [73,74] targeting the optimal flight path angle for the subsequent ascent at zero angle of attack. The kinematics conditions for the Pegasus vehicle are recalled here after [8,35,65,71]. The release takes place horizontally at an altitude of 12.65 km. The first stage is ignited at an altitude of 12.54 km and a velocity of 236.8 m/s (0.8 Mach). The pull-up maneuver targets a flight path angle of 13.8 • at the end of the first stage flight. The load factor is limited to 2.5 g and the dynamic pressure is limited to 47.6 kP a.
The pull-up maneuver consists in an attitude maneuver such that the flight path angle increases up to its targeted value, while satisfying the state constraints on the load factor and the dynamic pressure. In this section, we address the minimum time-energy pull-up maneuver problem for airborne launch vehicles with a focus on the numerical solution method.
The model of the control system is more complex than (16) due to the aerodynamics forces that depend on the flight conditions (atmospheric density depending on the altitude, vehicle angle of attack):ṙ where (r x , r y , r z ) is the position, m is the mass, (L x , L y , L z ) is the lift force, and (D x , D y , D z ) is the drag force.
Defining the state variable x = (r x , r y , r z , v x , v y , v z , θ, ψ, φ, ω x , ω y ), we write the system (30) as a bi-input control-affine systemẋ where the controls u 1 and u 2 satisfy the constraint u 2 1 + u 2 2 1, and the smooth vector fieldsf ,ĝ 1 andĝ 2 are defined bŷ + (−a sin ψ + g y + (D y + L y )/m) ∂ ∂v y + (a cos θ cos ψ + g z + (D z + L z )/m) ∂ ∂v z + (ω x sin φ + ω y cos φ)/ cos ψ ∂ ∂θ + (ω x cos φ − ω y sin φ) ∂ ∂ψ + tan ψ(ω x sin φ + ω y cos φ) ∂ ∂φ , The initial state is fixed x 0 = (r x0 , r y0 , r z0 , v x0 , v y0 , v z0 , θ 0 , ψ 0 , φ 0 , ω x0 , ω y0 ) ∈ R 11 , and the target set is defined by (submanifold of R 11 ) The optimal pull-up maneuver problem (P A ) consists in steering the bi-input control-affine system (31) from to a point belonging to the final target M 1 , i.e., while minimizing the cost functional with controls satisfying the constraint u 2 1 + u 2 2 1, and with the state satisfying constraints on the lateral load factor and the dynamic pressure due to aerodynamic forces where ρ is the air density, S is the reference surface of the launcher, C N is the lift coefficient approximated by C N = C N 0 + C N α α with given constants C N 0 and C N α . α is the angle of attack given by α = (v x sin θ cos ψ − v y sin ψ + v z cos θ cos φ)/v, and |v| is the module of the velocity |v| = v 2 x + v 2 y + v 2 z . Compared to (P S ), a significant additional difficulty comes from the state constraints.
Hard constraint formulation. Recall that a state constraint c(x) 0 is of order m ifĝ i .c = g if .c = · · · =ĝ if m−2 .c = 0 and g i f m .c = 0, i = 1, 2. Here we use the notation of Lie derivatives, see Section 3.2. A boundary arc is an arc (not reduced to a point) satisfying the system c(x(t)) = c (1) (x(t)) = · · · = c (m−1) (x(t)) = 0, and the control along the boundary arc is a feedback control obtained by solving After calculations, we find that the constraint on the load factorn is of order 2 and the constraint on the dynamic pressureq is of order 3.
According to the maximum principle with state constraints (see, e.g., [51]), there exists a nontrivial triple of Lagrange multipliers (p, p 0 , η), with p 0 0, p ∈ BV (0, t f ) 11 and η = (η 1 , where the Hamiltonian of the problem is and we have the maximization condition for almost every t. In addition, we have dη i 0 and t f 0 c i (x) dη i = 0 for i = 1, 2. Along a boundary arc, we must have h i = p,ĝ i (x) = 0, i = 1, 2. Assuming that only the first constraint (which is of order 2) is active along this boundary arc, and differentiating twice the switching functions h i , i = 1, 2, we have d 2 h i = p, ad 2f .ĝ i (x) dt 2 − dη 1 · (adf .ĝ i ).c 1 dt. Moreover, at an entry point occurring at t = τ , we have dh i (τ + ) = dh i (τ − ) − dη 1 · (adf .ĝ i ).c 1 = 0, which yields dη 1 . A similar result is obtained at an exit point.
The main drawback of this formulation is that the adjoint vector p is no longer absolutely continuous. A jump dη may occur at the entry or at the exit point of a boundary arc, which complexifies significantly the numerical solution.
An alternative approach to address the dynamic pressure state constraint, used in [36,39], is to design a feedback law that reduces the commanded throttle based on an error signal. According to [39], this approach works well when the trajectory does not violate too much the maximal dynamic pressure constraint, but it may cause instability if the constraint is violated significantly. In any case the derived solutions are suboptimal.
Another alternative is the penalty function method (also called soft constraint method ). The soft constraint consists in introducing a penalty function to discard solutions entering the constrained region [38,62,83]. For the problem (P A ), this soft constraint method is well suited in view of a continuation procedure starting from an unconstrained solution. This initial solution generally violates significantly the state constraint. The continuation procedure aims at reducing progressively the infeasibility.
Soft constraint formulation. The problem (P A ) is recast as an unconstrained optimal control problem by adding a penalty function to the cost functional defined by (34). The penalized cost is where the penalty function P (·) for the state constraints is defined by P (x) = (max(0,n −n max )) 2 + (max(0,q −q max )) 2 .
The constraint violation is managed by tuning the parameter K p . For convenience we still denote this unconstrained problem by (P A ) and we apply the PMP.
Application of the PMP. The Hamiltonian is now given by

The adjoint equation isṗ
where we have set p = (p rx , p ry , p rz , p vx , p vy , p vz , p θ , p ψ , p φ , p ωx , p ωy ). Let h = (h 1 , h 2 ) be the switching function and let h 1 (t) = p(t),ĝ 1 (x(t)) = bp ωy (t), The maximization condition of the PMP gives The transversality condition The final time t f being free and the system being autonomous, we have in addition that H(x(t), p(t), p 0 , u(t)) = 0, almost everywhere on [0, t f ]. As previously we can assume p 0 = −1.
The optimal control given by (36) is regular unless K = 0 and h(t) = 0, in which case it becomes singular. As before the term K t f 0 u(t) 2 dt in the cost functional (34) is used to avoid chattering [61,42,70,88,89], and the exact minimum time solution can be approached by decreasing step by step the value of K 0 until the shooting method possibly fails due to chattering.
Solution algorithm and comparison with (P S ) We aim at extending the continuation strategy developed for (P S ) in order to address (P A ). Comparing (P A ) with (P S ), we see that in (P A ): (c) the cost functional is penalized by the state constraints violation; Regarding the point (a), we need embedding the solution of (P 0 ) into a larger dimension problem with the adjoint variable of the position p r = (p rx , p ry , p rz ) being zero. More precisely, consider the following problem, denoted by (P H 0 ), in which the position and the velocity are considereḋ The solution of (P H 0 ) is retrieved from the solution of (P 0 ) completed by the new state components, and the optimal control is and We use this solution as the initialization of the continuation procedure for solving (P A ).
The point (b) can be addressed with a new continuation parameter λ 4 introducing simultaneously the variable gravity acceleration, the aerodynamic forces and the atmospheric density ρ (exponential model) as follows: where R E = 6378137 m is the radius of the Earth, h s = 7143 m, ρ 0 = 1.225 kg/m 3 , and g x , g y , g z are given by (g x , g y , g z ) = − g 0 (R E + r x (0)) 2 + r y (0) 2 + r z (0) 2 (R E + r x ) 2 + r 2 y + r 2 z (cos l 2 , sin l 1 sin l 2 , cos l 1 sin l 2 ) , with g 0 = g 2 x0 + g 2 y0 + g z0 , and tan l 1 = r y /r x , tan l 2 = r 2 y + r 2 z /(r x + R E ). The parameter λ 4 acts only on the dynamics. Applying the PMP, λ 4 appears explicitly in the adjoint equations, but not in the shooting function.
Finally, regarding the point (c), the penalty parameter K p in the cost functional (27) has to be large enough in order to produce a feasible solution. Unfortunately, too large values of K p may generate ill conditioning and raise numerical difficulties. In order to obtain an adequate value for K p , a simple strategy [41,79] consists in starting with a quite small value of K p = K p0 and solving a series of problems with increasing K p . The process is stopped as soon as c(x(t)) < c , for every t ∈ [0, t f ], for some given tolerance c > 0.
For convenience, we define the exo-atmospheric pull-up maneuver problem (P exo A ) as (P A ) without state constraints and without aerodynamic forces and the unconstrained pull-up maneuver problem (P unc A ) as (P A ) without state constraints. We proceed as follows: • First, we embed the solution of (P 0 ), into the larger dimension problem (P A ). This problem is denoted (P H 0 ).
• Then, we pass from (P H 0 ), to (P A ) by using a numerical continuation procedure, involving four continuation parameters: two parameters λ 1 and λ 2 introduce the terminal conditions (32)-(33) into (P exo A ); λ 4 introduces the variable gravity acceleration and the aerodynamic forces in (P unc A ); λ 5 introduces the soft constraints in (P A ).
The overall continuation procedure is depicted on Figure 18. The final step of the procedure is to increase λ 3 (or equivalently decrease K) in order to minimize the maneuver duration.
(P H 0 ) start More precisely, we have to solve the following problem with continuation parameters λ i , i = 1, 2, 4, 5, 3 subject to the dynamicṡ and with initial conditions and final conditions The attitude angles θ e , ψ e , φ e , ω xe , and ω ye are those obtained at the end of the first continuation on λ 1 . θ * , ψ * are the explicit solutions of (P H 0 ). These successive continuations are implemented using the PC continuation combined with the multiple shooting method. Some additional enhancements regarding the inertial frame choice and the Euler angle singularities help improving the overall robustness of the solution process.
Multiple shooting. The unknowns of this shooting problem are p(0) ∈ R 11 , t f ∈ R, and z i = (x i , p i ) ∈ R 22 , i = 1, · · · , N − 1, where z i are the node points of the multiple shooting method (see Section 4.1). We set Z = (p(0), t f , z i ), and let E = (θ, ψ, φ), ω = (ω x , ω y ), p r = (p rx , p ry , p rz ), p E = (p θ , p ψ , p φ ), and p ω = (p ωx , p ωy ). Then, the shooting function with the continuation parameter λ 1 is given by where the Hamiltonian is given by The shooting function with the continuation parameter λ 2 is , and the shooting functions G λ4 and G λ5 are identical to G λ2 .
PC continuation. The predictor-corrector continuation requires the calculation of the Jacobian matrix J G (see Section 5.2) which is computationally expenssive. In order to speed up the process, an approximation is used based on the assumption of no conjugate point. According to [27], the first turning point of λ(s) (where dλ ds (s) = 0 and d 2 λ ds 2 (s) = 0) corresponds to a conjugate point (the first point where extremals lose local optimality). If we assume the absence of the conjugate point, there is no turning point for λ(s), and λ increases monotonically along the zero path. Knowing three zeros (Z i−2 , λ i−2 ), (Z i−1 , λ i−1 ) and (Z i , λ i ), and let When the step length h s is small enough, this approximation yields a predicted point (15) very close to the true zero.
Change of Frame. Changing the inertial reference frame can improve the problem conditioning and enhance the numerical solution process. The new frame S R is defined from the initial frame S R by two successive rotations of angles (β 1 , β 2 ). The problem (P A ) becomes numerically easier to solve when the new reference frame S R is adapted to the terminal conditions. However we do not know a priori which reference frame is the best suited. We propose to choose a reference frame associated to (β 1 , β 2 ) such that ψ f = −ψ 0 and |ψ f | + |ψ 0 | being minimal (the subscribe here means the new variable in S R ). This choice centers the terminal values on the yaw angle on zero.
Thus we can hope that the solution remains far from the Euler angle singularities occurring when ψ → π/2 + kπ. This frame rotation defines a nonlinear state transformation, which acts as a preconditionner. We observe from numerical experiments that it actually enhances the robustness of the algorithm. The reader is referred to [91] for more details of the change of frame.
Algorithm We describe the whole numerical strategy of solving (P A ) in the following algorithm.

Numerical Results of Solving (P A )
The algorithm 3 is first applied to a pull-up maneuver of an airborne launch vehicle just after its release from the carrier. We present some statistical results showing robustness of our algorithm. A second example considers the three-dimensional reorientation maneuver of a launch vehicle upper stage after a stage separation.

Pull-Up Maneuvers of an airborne launch vehicle (AVL)
We consider a pull-up maneuver of an airborne launch vehicle close to the Pegasus configuration : a = 15.8, b = 0.2, S = 14 m 2 , C x0 = 0.06, C xα = 0, C z0 = 0, and C zα = 4.7. Letn max = 2.2g and q max = 47 kP a. The initial conditions (32) correspond to the engine ignition just after the release.
Such pull-up maneuvers are generally planar (ψ f = 0 • ). Here we set ψ f = 10 • in order to show that the algorithm can also deal efficiently with non-planar pull-up maneuvers.
The multiple shooting method is applied with three node points. The components of the state variable x and the control u are plotted on Figures 19 and 20, the components of the adjoint variable p are plotted on Figure 21, the time histories of the load factorn and of the dynamic pressureq are plotted on Figure 22. The position components are given in the geographic local frame with the vertical along the first axis (denoted x, not to be confused with the state vector). The control vector first component u 1 lies mainly in the trajectory plane and it acts mainly on the pitch angle.     We observe on Figure 22 a boundary arc on the load factor constraint near the maximal level n max = 2.2g. This corresponds on Figure 21 to the switching function h(t) = b(p ωy , −p ωx ) being close to zero. Comparing Figs. 20 and 21, we see that the control follows the form of the switching function. On the other hand, the state constraint of the dynamic pressure is never active.
We observe also on Figure 21 a steeper variation of p θ (t) at t = 5.86 s. The penalty function P (x) starts being positive at this date and adds terms in the adjoint differential equation. Running this example requires 24.6 s to compute the optimal solution, with CPU: Intel(R) Core(TM) i5-2500 CPU 3.30GHz; Memory: 3.8 Gio; Compiler: gcc version 4.8.4 (Ubuntu 14.04 LTS). The number of nodes for the multiple shooting has been set to 3 from experiments. Passing to four node increases the computing time to 31.2 s without obvious robustness benefit.
We next present some statistical results obtained with the same computer settings.
Statistical results. (P A ) is solved for various terminal conditions. The initial and final conditions are swept in the range given in Table 2. The last cell of the table indicates that the initial angle of attack is bounded to 10 degrees in order to exclude unrealistic cases. For each variable, we  The statistical results are reported in Table 3-5.   Tables 3-4 show the results with a multiple shooting using 2 nodes, with different values of the regularization parameter K. The algorithm appears fairly robust with respect to the terminal conditions. The choice of the regularization parameter K affects the resolution results: (i) the rate of success increases (resp. decreases) in the non-planar case (resp. planar case) when K increases from K = 800 to K = 1000; (ii) in term of the execution time, we see that in both cases, it is faster to get a result in planar case than in non-planar case, and most time is devoted to deal with the state constraints during the last continuation.
This suggests that for each specific problem (defined by the launcher configuration and the terminal conditions) a systematical experiment should be processed to find out the best K value.
For example, we have tested the planar cases with different values of K. The success rate and the execution time are plotted with respect to K in Figure 23. We see that the value of K should neither be too large nor too small. From Tables 3-5, we observe also that the λ 2 -continuation causes most failures in the non-planar case. The success rate could be possibly improved by adapting the K value. Table 3 and Table 5 compare the multiple and the single shooting method (N = 0). The multiple shooting method (N = 2) clearly improves the robustness of the algorithm, without significant increase of the execution time.  Figure 24 plots the success rate and the execution time depending of the number of nodes. The test case is the planar maneuver with the regularization parameter K set to 5.5 × 10 3 . The rate of success does not increase monotonically with respect to the number of node points, and the execution time does not change significantly for N less than 6. When N 6, the success rate decreases quickly and equals to zero when N = 7. When the number of unknowns for the shooting method becomes too large, the domain of convergence of a Newton-type method reduces which finally leads to lower rate of success.

Reorientation Maneuver of a launch vehicle
Along multi-burn ascent trajectories, the control (Euler angles) exhibit jumps at the stage separations (see for example [57, Figure 3]). In this case, a reorientation maneuver is necessary to follow the optimal thrust direction. For this reason, we apply the above algorithm as well to the maneuver problem of the upper stages of the launch vehicles.
Opposite to the airborne launch vehicle's pull-up maneuvers, these reorientation maneuvers are in general three-dimensional and of lower magnitude. They occur at high altitudes (typically higher than 50 km since a sufficiently low dynamic pressure is required to ensure the separation safety) and high velocity (since the first stage has already delivered a large velocity increment).
The maneuver occurs in vacuum so that no state constraints apply. Finding the minimum time maneuver corresponds to solving the problem (P S ).
In the example, we set the system parameters in (31) to a = 20, b = 0.2, which approximate an Ariane-like launcher. The initial conditions (32)  The multiple shooting method is applied with four node points. On Figures 25 and 26, we report the components of state and control variables. We observe that, when t ∈ [32, 145] s, the control is quasi null, and the attitude angles take the solution values of the zero order problem The maneuver duration t f is about 175 s due to the large direction change required on the velocity. During a real flight the velocity direction change is much smaller and the maneuver takes at most a few seconds. Our purpose when presenting this "unrealistic" case is rather to show that the proposed algorithm is robust in a large range of system configurations and terminal conditions.

Applications to Trajectory Optimization
The previous section was devoted to an ascent trajectory application. The example dealt with the pull-up maneuver of an airborne launch vehicle just after its release from the carrier. This section gives a brief overview of optimal geometric control and continuation techniques applied to other mission categories, namely orbital transfer and atmospheric reentry.

Orbital Transfer Problems
The orbital transfer problem consists in steering the engine from an initial orbit to a final one while minimizing either the duration or the consumption. This problem has been widely studied in the literature, and the solution algorithms involve direct methods as well as indirect methods. The reader is referred to [6] and [30] for a list of methods and references.
Our aim is here to recall how geometric optimal control theory and numerical continuation methods can help solving such problems. The dynamics is modelled by the controlled Kepler equationsr (t) = −r(t) µ r(t) 3 + T (t) m(t) , m(t) = −β T (t) , where r(·) is the position of the spacecraft, µ is the gravitational constant of the planet, T (·) T max is the bounded thrust, and m(·) is the mass with β a constant depending on the specific impulse of the engine. Controllability properties ensuring the feasibility of the problem have been studied in [15,19], based on the analysis of Lie algebra generated by the vector fields of the system. The minimum time low thrust transfer is addressed for example in [22]. It is observed that the domain of convergence of the Newton-type method in the shooting problem becomes smaller when the maximal thrust decreases. Therefore, a natural continuation process consists in starting with larger values of the maximal thrust and then decreasing step by step the maximal thrust. In [22], acceleration, and the dynamic pressure. We refer the readers to [21,82] for a formulation of this problem.
The control u acts on the lift force orientation, changing simultaneously the descent rate and the heading angle.
A practical guidance strategy consists in following the constraint boundaries, successively : thermal flux, normal acceleration, and dynamic pressure. This strategy does not care about the cost functional and it is therefore not optimal. Applying the Pontryagin Maximum Principle with state constraints is not promising due to a narrow domain of convergence of the shooting method. Finding a correct guess for the initial adjoint vector proves quite difficult. Therefore direct methods are generally preferred for this atmospheric reentry problem (see, e.g., [6,7,67]).
Here we recall two alternative approaches to address the problem by indirect methods.
The first approach is to analyze the control system using geometric control theory. For example, in [17,18,82], a careful analysis of the control system provides a precise description of the optimal trajectory. The resulting problem reduction makes it tractable by the shooting method. More precisely, the control system is rewritten as a single-input control-affine system in dimension three under some reasonable assumptions. Local optimal syntheses are derived from extending existing results in geometric optimal control theory. Based on perturbation arguments, this local nature of the optimal trajectory is then used to provide an approximation of the optimal trajectory for the full problem in dimension six, and finally simple approximation methods are developed to solve the problem.
A second approach is to use the continuation method. For example, in [53], the problem is solved by a shooting method, and a continuation is applied on the maximal value of the thermal flux. It is shown in [11,52] that under some appropriate assumptions, the change in the structure of the trajectory is regular, i.e., when a constraint becomes active along the continuation, only one boundary arc appears. Nevertheless it is possible that an infinite number of boundary arcs appear (see, e.g., [70]). This phenomenon is possible when the constraint is of order three at least. By using a properly modified continuation procedure, the reentry problem was solved in [53] and the results of [18] were retrieved.

Conclusion
The aim of this article was to show how to apply techniques of geometric optimal control and numerical continuation to aerospace problems. After an overview of space transportation missions, some classical techniques of optimal control have been recalled, including Pontryagin Maximum Principle, first and second-order optimality conditions, and conjugate time theory. Techniques of geometric optimal control have then been recalled, such as higher-order optimality conditions and singular controls.
A quite difficult problem has illustrated in detail how to design an efficient solution method with the help of geometric optimal control tools and continuation methods. Other applications in space trajectory optimization have also been recalled.
Though geometric optimal control and numerical continuation provide a nice way to design efficient approaches for many aerospace applications, the answer to "how to select a reasonably simple problem for the continuation procedure" for general optimal control problems remains open. A deep understanding of the system dynamics is necessary to devise a simple problem that is "physically" sufficiently close to the original problem, while being numerically suited to initiate a continuation procedure.
In practice, many problems remain difficult due to the complexity of real-life models. In general, a compromise should be found between the complexity of the model under consideration and the choice of an adapted numerical method. As illustrated by the example of airborne launch vehicles, many state and/or control constraints should also be considered in a real-life problem, and such constraints makes the problem much more difficult. For the airborne launch problem a penalization method combined with the previous geometric analysis proves satisfying. But this approach has to be customized to the specific problem under consideration. A challenging task is then to combine an adapted numerical approach with a thorough geometric analysis in order to get more information on the optimal synthesis. We refer the readers to [84] for a summary of open challenges in aerospace applications.