Interface of XOptima

Different Initial/Final Conditions

Historically and in literature, optimal control problems were not always of the proposed form, the classic problems that arise from calculus of variations, e.g. the brachistochrone, do not have fixed time extremals, but are instead minimum time problems, that is, the final time \(T\) is to be minimized. Similarly there are problems with free initial point, or with infinite time horizon. In this section it is shown how to deal with such problems, and how any OCP can be restated as an autonomous fixed time problem. The independent variable \(\zeta\) (in this case the time) will no longer have physical meaning, and it is pointed out that it is better to define the independent variable in a conveniently scaled way. For example, in pinsn, the OCPs are scaled and parametrized with independent variable \(\zeta\in[0,1]\). It is convenient to rewrite the general Optimal Control Problem in a more compact form to keep the notation light as possible:

(1)\[\begin{split}\begin{array}{rcl} J(\mathbf{u}) &=& M(\zeta_0,\mathbf{x}(\zeta_0),T,\mathbf{x}(T)) +\int_{\zeta_0}^T \mathcal{H} -\mathbf{\lambda}\cdot \mathbf{x}' \mathrm{d}\,\zeta\qquad \mathrm{s.t.}\\[1em] \mathbf{x}'(\zeta) & = & \mathbf{f}(\zeta,\mathbf{x},\mathbf{u})\\[1em] \mathbf{0} & = & \mathbf{b}(\zeta_0,\mathbf{x}(\zeta_0),T,\mathbf{x}(T)). \end{array}\end{split}\]

Free Initial Point

The case of free initial conditions does not appear very often in non academic examples. In this situation consider the two equations with respect to the variations of the initial point which are given by the Pontryagin first order necessary conditions of (1).

\[\begin{split}\begin{array}{rcl} \mathbf{\lambda}(\zeta_0) &=& - \dfrac{\partial M}{\partial \mathbf{x}(\zeta_0)}^T -\dfrac{\partial \mathbf{b}}{\partial \mathbf{x}(\zeta_0)}^T\mathbf{\nu} \\[1em] \mathcal{H}(\zeta_0) &=& \dfrac{\partial M}{\partial \zeta_0} + \mathbf{\nu}^T\dfrac{\partial\mathbf{b}}{\partial \zeta_0}. \end{array}\end{split}\]

Free Final Point

The case of free final point occurs often in practical problems, consider then the variations for \(\delta T\) and \(\delta \mathbf{x}_T\) from (1).

\[\begin{split}\begin{array}{rcl} \mathbf{\lambda}(T) &=& \dfrac{\partial M}{\partial \mathbf{x}(T)}^T+ \dfrac{\partial \mathbf{b}}{\partial \mathbf{x}(T)}^T\mathbf{\nu} \\ \mathcal{H}(T) &=& - \dfrac{\partial M}{\partial T} - \mathbf{\nu}^T\dfrac{\partial \mathbf{b}}{\partial T} \end{array}\end{split}\]

This way to proceed requires the derivation of new second order conditions to ensure the presence of a minimum, therefore it is convenient to reparametrize the problem to fixed time.

Infinite Horizon

This situation can be intended as an optimal control problem with fixed final time, and instead of writing \(\mathbf{x}(\infty)\) consider the limit \(\lim_{T\to\infty}\mathbf{x}(T)\). In general there should be enough conditions on the Lagrange term inside the integral, on the control and on the trajectory, in order to ensure the existence of the improper integral

\[\int_{\zeta_0}^\infty L(\zeta,\mathbf{x},\mathbf{u})\mathrm{d}\,\zeta.\]

The criticity is usually overcome by multiplying the integrand by the factor \(\mathrm{e}^{-\alpha \zeta}\) for \(\alpha>0\).

Autonomous Problems

When the functions and the functionals involved in the optimal control problem do not depend explicitly on the independent variable, or more correctly, when the independent variable does not occur explicitly in the problem, the OCP has the name of autonomous problem.

An important property of the Hamiltonian in this case is that is constant along an optimal trajectory. This follows from the first equation of (1) and from the related considerations. Moreover, if the final point is free, then the Hamiltonian is equal to zero. Most of the literature considers only autonomous problems, this is because every non autonomous problem can be transformed in an autonomous by a change of variable. This can be done easily by enlarging the original problem by setting the independent variable, e.g. \(s\), equal to a new state equation. This gives \(\mathbf{x}_{n+1}(\zeta)=\zeta\), and the new differential equation contains \(\mathbf{x}_{n+1}'=1\) with initial value \(\mathbf{x}_{n+1}(\zeta_0)=\zeta_0\).

Minimum Time

The problems in which the target to be minimized is the final time, are called time optimal problems. The functional to be minimized reduces (if \(t_0=0\)) to

\[\min T = \min \int_{0}^T 1 \mathrm{d}\,\zeta.\]

It it therefore transformed in a problem with free endpoint. Another way to treat this kind of problems is to reformulate them as a fixed time problem adding one more state variable, namely the final time \(T\). To do that change the independent variable \(\zeta\) with a new monotone variable, which is called sometimes dimensionless time or pseudotime, by posing \(\xi=\zeta/T\), in this way the differential becomes \(T(\xi) \mathrm{d}\xi=\mathrm{d}\,\zeta\) and an eventual differential equation \(x'(\zeta)=f(x,u,\zeta)\) is rewritten as \(x'(\xi)=T(\xi)f(x,u,\xi)\). The differential equation associated to the new state \(T(\xi)\) is clearly \(T'(\xi)=0\), because the final time is constant.

Integral Constraints

One historically important constraint in the calculus of variations is the integral constraint. It arises in the isoperimetric problems. There can be two kinds of integral constraints, expressed as an equality or as an inequality. In the first case there is to handle an expression like

\[\int_{\zeta_0}^T w(\zeta,x(\zeta),u(\zeta)) \mathrm{d}\,\zeta = W_e,\]

where the function \(w\) (can be a vector) is continuous with its first derivative with respect to \(x\) and \(s\), while \(W_e\) is a given constant (or a constant vector). It is possible to include this constraint as a standard ODE of a state extended problem by posing

(2)\[\begin{split}\begin{array}{rcl} z'(\zeta) & = & w(\zeta,x(\zeta),u(\zeta))\\ z(\zeta_0) & = & 0, \end{array}\end{split}\]

then add the final condition \(z(T)=W_e\). This can be done as shown in the previous section.

To deal with an integral inequality, of kind

\[\int_{\zeta_0}^T w(\zeta,x(\zeta),u(\zeta)) \mathrm{d}\,\zeta \leq W_d,\]

where \(W_d\) is a known constant, the first step is to convert it to an equality and apply the previous procedure as in equation eqref{XO:constraint:integral}; the second step is to add the final condition \(z(T)\leq W_d\). The inequality for the initial/final states can be treated as an inequality in a static NLP problem: written in canonical form as \(\leq\), it is multiplied by a multiplier that should be a posteriori non negative. From a computational point of view it is useful to introduce an ulterior differential state \(k\) and set the following conditions. Replace the inequality \(z_T \leq W_d\) with the equality \(z_T-k=0\) and add the condition \(k'(\zeta)=0\) with constraint \(k(\zeta)\leq W_d\). In this way the variable is forced to be constant and less than \(W_d\).