23  Transformations of Optimal Control Problems

Author
Affiliation

Enrico Bertolazzi

University of Trento, Department of Industrial Engineering

23.1 Reference Problem and Sign Convention

Consider the Bolza problem

\begin{aligned} \operatorname*{minimize}_{\bm{x},\bm{u},\bm{p}}\quad &J=\Phi\big(\bm{x}(a),\bm{x}(b),\bm{p}\big) +\int_a^b L(\bm{x},\bm{u},\bm{p},t)\,\mathrm dt,\\ \text{subject to}\quad &\bm{x}'=\bm{f}(\bm{x},\bm{u},\bm{p},t),\\ &\bm{b}\big(\bm{x}(a),\bm{x}(b),\bm{p}\big)=\bm{0},\\ &\bm{u}(t)\in\mathcal U. \end{aligned}

Here \bm{x}(t)\in\mathbb R^n, \bm{u}(t)\in\mathbb R^m, and \bm{p}\in\mathbb R^r denotes a vector of constant optimization parameters when present.

Throughout these notes we use the normal minimization convention

H(\bm{x},\bm{\lambda},\bm{u},\bm{p},t) =L(\bm{x},\bm{u},\bm{p},t) +\bm{\lambda}^{\mathsf T}\bm{f}(\bm{x},\bm{u},\bm{p},t),

and the endpoint Lagrangian

B(\bm{x}_a,\bm{x}_b,\bm{p},\bm{\omega}) =\Phi(\bm{x}_a,\bm{x}_b,\bm{p}) +\bm{\omega}^{\mathsf T}\bm{b}(\bm{x}_a,\bm{x}_b,\bm{p}).

The augmented functional contains

\int_a^b\left(H-\bm{\lambda}^{\mathsf T}\bm{x}'\right)\,\mathrm dt.

Therefore the endpoint transversality conditions are

B_{\bm{x}_a}+\bm{\lambda}(a)=\bm{0}, \qquad B_{\bm{x}_b}-\bm{\lambda}(b)=\bm{0}.

Important

These signs depend on the Hamiltonian and augmented-functional convention. Mixing the convention H=L+\bm{\lambda}^{\mathsf T}\bm{f} with endpoint signs derived from H=L-\bm{\lambda}^{\mathsf T}\bm{f} gives an incorrect BVP.

For a constrained control, Pontryagin’s condition is

\bm{u}^\star(t)\in \operatorname*{arg\,min}_{\bm{v}\in\mathcal U} H\big(\bm{x}^\star(t),\bm{\lambda}(t),\bm{v},\bm{p},t\big).

Only when \bm{u}^\star is interior to \mathcal U and H is differentiable in \bm{u} may this be reduced to H_{\bm{u}}=\bm{0}.

23.2 Lagrange to Mayer Transformation

Consider a pure Lagrange objective

J=\int_a^b L(\bm{x},\bm{u},t)\,\mathrm dt.

Introduce a scalar auxiliary state z:

z'=L(\bm{x},\bm{u},t), \qquad z(a)=0.

Then

z(b)=\int_a^bL(\bm{x},\bm{u},t)\,\mathrm dt,

so the equivalent Mayer problem is

\begin{aligned} \operatorname*{minimize}\quad &z(b),\\ \text{subject to}\quad &\bm{x}'=\bm{f}(\bm{x},\bm{u},t),\\ &z'=L(\bm{x},\bm{u},t),\\ &\bm{b}\big(\bm{x}(a),\bm{x}(b)\big)=\bm{0},\\ &z(a)=0,\\ &\bm{u}(t)\in\mathcal U. \end{aligned}

With the augmented state

\bm{w}=(\bm{x}^{\mathsf T},z)^{\mathsf T},

this can be written as a standard Mayer OCP.

Note

For a Bolza objective, the same construction gives the Mayer cost \Phi(\bm{x}(a),\bm{x}(b))+z(b).

23.3 Mayer to Lagrange Transformation

Consider

J=\Phi\big(\bm{x}(a),\bm{x}(b)\big).

A general Mayer term depends on both endpoints. Consequently, it cannot in general be represented by a running cost depending only on the instantaneous variables (\bm{x}(t),\bm{u}(t),t) unless the initial endpoint is fixed or is carried along as an additional constant state.

General construction

Introduce

\bm{p}'=\bm{0}, \qquad \bm{p}(a)=\bm{x}(a).

Thus \bm{p}(t)\equiv\bm{x}(a). Define

\widetilde L(\bm{p},\bm{x},\bm{u},t) = \nabla_{\bm{x}}\Phi(\bm{p},\bm{x})^{\mathsf T} \bm{f}(\bm{x},\bm{u},t) + \frac{\Phi(\bm{p},\bm{p})}{b-a}.

Since \bm{p}'=\bm{0},

\frac{\mathrm d}{\mathrm dt}\Phi(\bm{p},\bm{x}(t)) = \nabla_{\bm{x}}\Phi(\bm{p},\bm{x})^{\mathsf T}\bm{x}'.

Hence

\begin{aligned} \int_a^b\widetilde L\,\mathrm dt &=\Phi\big(\bm{p},\bm{x}(b)\big) -\Phi\big(\bm{p},\bm{x}(a)\big) +\Phi(\bm{p},\bm{p})\\ &=\Phi\big(\bm{x}(a),\bm{x}(b)\big). \end{aligned}

Therefore an equivalent pure Lagrange formulation is

\begin{aligned} \operatorname*{minimize}\quad &\int_a^b\widetilde L(\bm{p},\bm{x},\bm{u},t)\,\mathrm dt,\\ \text{subject to}\quad &\bm{x}'=\bm{f}(\bm{x},\bm{u},t),\\ &\bm{p}'=\bm{0},\\ &\bm{p}(a)-\bm{x}(a)=\bm{0},\\ &\bm{b}\big(\bm{x}(a),\bm{x}(b)\big)=\bm{0}. \end{aligned}

If \bm{x}(a) is fixed, the state \bm{p} is unnecessary because its value is already known.

23.4 Constant Parameters as States

Suppose the OCP contains an unknown constant vector \bm{p}\in\mathbb R^r. It can be represented as a constant state:

\bm{p}'(t)=\bm{0}.

The transformed dynamics are

\begin{aligned} \bm{x}'&=\bm{f}(\bm{x},\bm{u},\bm{p},t),\\ \bm{p}'&=\bm{0}. \end{aligned}

If \bm{p} is an optimization variable, its endpoint value must not be fixed. Equivalently, one may keep \bm{p} as a finite-dimensional parameter. The two formulations lead to the parameter stationarity condition

B_{\bm{p}} +\int_a^b H_{\bm{p}}\,\mathrm dt =\bm{0}.

Warning

A prescribed physical parameter is not an optimization variable. Converting a known constant into a state is usually unnecessary and introduces redundant variables.

23.5 Integral Constraints

Consider the isoperimetric constraint

\bm{\Psi}\big(\bm{x}(a),\bm{x}(b),\bm{p}\big) +\int_a^b\bm{g}(\bm{x},\bm{u},\bm{p},t)\,\mathrm dt =\bm{0}.

Introduce \bm{z} by

\bm{z}'=\bm{g}(\bm{x},\bm{u},\bm{p},t), \qquad \bm{z}(a)=\bm{0}.

Then

\bm{z}(b)=\int_a^b\bm{g}(\bm{x},\bm{u},\bm{p},t)\,\mathrm dt,

and the integral constraint becomes

\bm{z}(b) +\bm{\Psi}\big(\bm{x}(a),\bm{x}(b),\bm{p}\big) =\bm{0}.

Thus the equivalent augmented OCP contains

\begin{aligned} \bm{x}'&=\bm{f}(\bm{x},\bm{u},\bm{p},t),\\ \bm{z}'&=\bm{g}(\bm{x},\bm{u},\bm{p},t),\\ \bm{z}(a)&=\bm{0},\\ \bm{z}(b)+\bm{\Psi}(\bm{x}(a),\bm{x}(b),\bm{p})&=\bm{0}. \end{aligned}

For the special condition

\int_a^b\bm{g}(\bm{x},\bm{u},t)\,\mathrm dt=\bm{c},

use \bm{z}(a)=\bm{0} and \bm{z}(b)=\bm{c}.

Important

Introducing only the differential equation \bm{z}'=\bm{g} does not enforce the integral constraint. The corresponding terminal condition on \bm{z}(b) is essential.

23.6 Fixed-Interval Time Transformation

A general interval t\in[a,b] can be mapped to s\in[0,1] by

t=a+(b-a)s.

Then

\frac{\mathrm d\bm{x}}{\mathrm ds} =(b-a)\bm{f}\big(\bm{x},\bm{u},a+(b-a)s\big),

and

\int_a^bL(\bm{x},\bm{u},t)\,\mathrm dt = \int_0^1(b-a)L\big(\bm{x},\bm{u},a+(b-a)s\big)\,\mathrm ds.

This simple scaling is useful for numerical solvers that assume a normalized independent-variable interval.

23.7 Free Terminal Time

Consider

\begin{aligned} \operatorname*{minimize}_{T,\bm{x},\bm{u}}\quad &\Phi\big(\bm{x}(0),\bm{x}(T),T\big) +\int_0^T L(\bm{x},\bm{u},t)\,\mathrm dt,\\ \text{subject to}\quad &\bm{x}'=\bm{f}(\bm{x},\bm{u},t),\\ &\bm{b}\big(\bm{x}(0),\bm{x}(T),T\big)=\bm{0},\\ &\bm{u}(t)\in\mathcal U, \qquad T>0. \end{aligned}

Time normalization

Set

t=sT, \qquad s\in[0,1],

and define

\widetilde{\bm{x}}(s)=\bm{x}(sT), \qquad \widetilde{\bm{u}}(s)=\bm{u}(sT).

Then

\widetilde{\bm{x}}' =T\bm{f}\big(\widetilde{\bm{x}},\widetilde{\bm{u}},sT\big)

and

\int_0^T L(\bm{x},\bm{u},t)\,\mathrm dt = \int_0^1 T L\big(\widetilde{\bm{x}},\widetilde{\bm{u}},sT\big)\,\mathrm ds.

The normalized problem is therefore

\begin{aligned} \operatorname*{minimize}\quad &\Phi\big(\widetilde{\bm{x}}(0),\widetilde{\bm{x}}(1),T\big) +\int_0^1T L\big(\widetilde{\bm{x}},\widetilde{\bm{u}},sT\big)\,\mathrm ds,\\ \text{subject to}\quad &\widetilde{\bm{x}}' =T\bm{f}\big(\widetilde{\bm{x}},\widetilde{\bm{u}},sT\big),\\ &\bm{b}\big(\widetilde{\bm{x}}(0),\widetilde{\bm{x}}(1),T\big)=\bm{0},\\ &\widetilde{\bm{u}}(s)\in\mathcal U, \qquad T>0. \end{aligned}

The scalar T can either remain an optimization parameter or be represented by a constant state T'=0.

Free-time transversality

Let

B(\bm{x}_0,\bm{x}_T,T,\bm{\omega}) = \Phi(\bm{x}_0,\bm{x}_T,T) +\bm{\omega}^{\mathsf T}\bm{b}(\bm{x}_0,\bm{x}_T,T).

A free terminal time produces the additional condition

H\big(\bm{x}(T),\bm{\lambda}(T),\bm{u}(T),T\big) +B_T=0.

If the problem is autonomous and B has no explicit dependence on T, then

H(T)=0.

In the normalized formulation, the same information appears as stationarity with respect to the parameter T.

23.8 Free Initial and Final Times

If both endpoints in time are unknown, use

t=t_0+(t_f-t_0)s, \qquad s\in[0,1].

Then

\widetilde{\bm{x}}' =(t_f-t_0)\bm{f} \big(\widetilde{\bm{x}},\widetilde{\bm{u}},t_0+(t_f-t_0)s\big).

Both t_0 and t_f become optimization parameters and each has its own stationarity/transversality equation. This case should not be collapsed into a single free-duration parameter when the dynamics or endpoint data depend explicitly on absolute time.

23.9 Path and Mixed Constraints

A path constraint has the form

\bm{c}(\bm{x}(t),\bm{u}(t),t)\le\bm{0}.

Unlike an integral constraint, it cannot generally be replaced by a finite number of endpoint conditions. It requires pointwise multipliers and complementarity conditions. For a mixed state-control constraint, one works formally with

H_a =H+\bm{\nu}^{\mathsf T}\bm{c},

with

\bm{\nu}(t)\ge\bm{0}, \qquad \bm{c}(\bm{x},\bm{u},t)\le\bm{0}, \qquad \nu_i c_i=0.

Pure state constraints are more delicate because the associated multipliers may be measures and costates may have jump conditions at entry or exit points. They should be treated separately from ordinary control bounds.

23.10 Equivalence and Numerical Conditioning

The transformations in this chapter preserve the mathematical problem when all auxiliary dynamics and endpoint conditions are included. They do not necessarily preserve numerical conditioning. In particular:

  • converting every integral to an auxiliary state increases BVP dimension;
  • introducing constant parameters as states adds zero dynamics and may worsen conditioning;
  • time normalization introduces products with the unknown duration T;
  • Mayer and Lagrange formulations can produce different sparsity patterns after discretization.

For analysis, choose the formulation that makes the necessary conditions transparent. For computation, choose the formulation that gives the best-scaled and sparsest nonlinear system.