Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Augmentation, Costates, and the Hamiltonian Formulation

A general optimal control problem contains a performance index, differential equations, endpoint constraints, and possibly path constraints. The objective cannot be minimized independently of these constraints because an unconstrained minimizer of the performance index may violate the dynamics or fail to satisfy the boundary conditions.

The central idea developed in this section is augmentation. Each constraint is appended to the performance index using an associated Lagrange multiplier. The resulting augmented functional contains the original constraints explicitly, allowing the entire problem to be treated using the calculus of variations.

This construction introduces two important multiplier variables:

The Hamiltonian

H(x,u,λ,t)=L(x,u,t)+λf(x,u,t)H(\boldsymbol{x},\boldsymbol{u},\boldsymbol{\lambda},t) = L(\boldsymbol{x},\boldsymbol{u},t) + \boldsymbol{\lambda}^{\top}\boldsymbol{f}(\boldsymbol{x},\boldsymbol{u},t)

then emerges naturally as a compact representation of the running cost and dynamic constraint.

General Optimal Control Problem

Consider the Bolza-form problem

minu(),t0,tfJ,\min_{\boldsymbol{u}(\cdot),\,t_0,\,t_f} J,

where

J=Φ(x(t0),t0,x(tf),tf)+t0tfL(x(t),u(t),t)dt.\begin{aligned} J &= \Phi \bigl( \boldsymbol{x}(t_0), t_0, \boldsymbol{x}(t_f), t_f \bigr) \nonumber\\ &\quad + \int_{t_0}^{t_f} L \bigl( \boldsymbol{x}(t), \boldsymbol{u}(t), t \bigr)\,\mathrm{d} t. \end{aligned}

The dynamics are

x˙(t)=f(x(t),u(t),t).\dot{\boldsymbol{x}}(t) = \boldsymbol{f} \bigl( \boldsymbol{x}(t), \boldsymbol{u}(t), t \bigr).

The endpoint constraints are

ϕ(x(t0),t0,x(tf),tf)=0.\boldsymbol{\phi} \bigl( \boldsymbol{x}(t_0), t_0, \boldsymbol{x}(t_f), t_f \bigr) = \boldsymbol{0}.

Optional path constraints may also be present:

c(x(t),u(t),t)0.\boldsymbol{c} \bigl( \boldsymbol{x}(t), \boldsymbol{u}(t), t \bigr) \le \boldsymbol{0}.

For the derivation in this section, path constraints are omitted to avoid introducing complementary-slackness conditions and additional multipliers.

Why the Dynamics Are Constraints

A differential equation is a constraint because it restricts the state derivative at every instant.

Equation (4) can be written as

f(x,u,t)x˙=0.\boldsymbol{f}(\boldsymbol{x},\boldsymbol{u},t) - \dot{\boldsymbol{x}} = \boldsymbol{0}.

This form makes the constraint character explicit. For every time tt along an admissible trajectory,

x˙(t)\dot{\boldsymbol{x}}(t)

cannot be chosen arbitrarily. It must equal the right-hand side of the system dynamics.

Augmentation with Lagrange Multipliers

For each equality constraint, introduce a Lagrange multiplier.

The dynamic constraint receives a time-varying multiplier

λ(t)Rn.\boldsymbol{\lambda}(t)\in\mathbb{R}^n.

The endpoint constraint receives a static multiplier

νRp.\boldsymbol{\nu}\in\mathbb{R}^p.

The augmented functional is defined by

Ja=Φ(x(t0),t0,x(tf),tf)νϕ(x(t0),t0,x(tf),tf)+t0tf[L(x,u,t)+λ(f(x,u,t)x˙)]dt.\begin{aligned} J_a &= \Phi \bigl( \boldsymbol{x}(t_0), t_0, \boldsymbol{x}(t_f), t_f \bigr) - \boldsymbol{\nu}^{\top} \boldsymbol{\phi} \bigl( \boldsymbol{x}(t_0), t_0, \boldsymbol{x}(t_f), t_f \bigr) \nonumber\\ &\quad + \int_{t_0}^{t_f} \left[ L(\boldsymbol{x},\boldsymbol{u},t) + \boldsymbol{\lambda}^{\top} \left( \boldsymbol{f}(\boldsymbol{x},\boldsymbol{u},t) - \dot{\boldsymbol{x}} \right) \right]\,\mathrm{d} t. \end{aligned}

On every feasible process,

fx˙=0,\boldsymbol{f}-\dot{\boldsymbol{x}}=\boldsymbol{0},

and

ϕ=0.\boldsymbol{\phi}=\boldsymbol{0}.

Therefore,

Ja=JJ_a=J

for every feasible solution. In particular,

Ja=J.J_a^*=J^*.

Why Augmentation Does Not Change the Optimal Cost

The purpose of augmentation is not to modify the physical problem. It is to construct an unconstrained variational representation of the constrained problem.

At a feasible solution,

νϕ=0,λ(fx˙)=0.\begin{aligned} \boldsymbol{\nu}^{\top}\boldsymbol{\phi}&=0,\\ \boldsymbol{\lambda}^{\top} \left( \boldsymbol{f}-\dot{\boldsymbol{x}} \right)&=0. \end{aligned}

Hence, all augmented terms vanish on the feasible trajectory. The multipliers enlarge the set of unknowns, but they do not alter the original objective value at feasibility.

The Costate and Endpoint Multiplier

The costate is time dependent because the dynamic constraint must hold separately at every time. Each instant has its own local multiplier associated with dynamic feasibility.

Unlike λ(t)\boldsymbol{\lambda}(t), the multiplier ν\boldsymbol{\nu} is static because the endpoint constraint is imposed only at the boundary.

Dimensional Bookkeeping

Let

x(t)Rn,u(t)Rm,f(x,u,t)Rn,ϕRp.\begin{aligned} \boldsymbol{x}(t)&\in\mathbb{R}^n,\\ \boldsymbol{u}(t)&\in\mathbb{R}^m,\\ \boldsymbol{f}(\boldsymbol{x},\boldsymbol{u},t)&\in\mathbb{R}^n,\\ \boldsymbol{\phi}&\in\mathbb{R}^p. \end{aligned}

Since

λ(fx˙)\boldsymbol{\lambda}^{\top} \left( \boldsymbol{f}-\dot{\boldsymbol{x}} \right)

must be scalar,

λ(t)Rn.\boldsymbol{\lambda}(t)\in\mathbb{R}^n.

Similarly, because

νϕ\boldsymbol{\nu}^{\top}\boldsymbol{\phi}

must be scalar,

νRp.\boldsymbol{\nu}\in\mathbb{R}^p.

The endpoint mapping has the form

ϕ:Rn×R×Rn×RRp.\boldsymbol{\phi}: \mathbb{R}^n\times\mathbb{R}\times\mathbb{R}^n\times\mathbb{R} \rightarrow \mathbb{R}^p.

Functional Versus Function

The quantity JaJ_a is a functional, not an ordinary function.

It depends on the entire functions

x(),u(),λ(),\boldsymbol{x}(\cdot), \qquad \boldsymbol{u}(\cdot), \qquad \boldsymbol{\lambda}(\cdot),

and returns a scalar.

This distinction determines the correct stationarity operation:

δJa=0.\delta J_a=0.

One does not take an ordinary derivative of JaJ_a with respect to a scalar variable unless a specific scalar parameter is being isolated.

Extremum Versus Extremal

An extremum is a point that minimizes or maximizes an ordinary function.

An extremal is a function or trajectory satisfying first-order variational stationarity conditions.

Thus, the augmented optimal control derivation seeks an extremal process:

(x(),u(),λ()).\left( \boldsymbol{x}^*(\cdot), \boldsymbol{u}^*(\cdot), \boldsymbol{\lambda}^*(\cdot) \right).

The first-order conditions identify stationary candidates but do not by themselves establish whether the candidate is a minimum or maximum.

Definition of the Hamiltonian

Define the Hamiltonian

H(x,u,λ,t)=L(x,u,t)+λf(x,u,t).\boxed{ H(\boldsymbol{x},\boldsymbol{u},\boldsymbol{\lambda},t) = L(\boldsymbol{x},\boldsymbol{u},t) + \boldsymbol{\lambda}^{\top} \boldsymbol{f}(\boldsymbol{x},\boldsymbol{u},t) }.

Then the augmented functional becomes

Ja=Φνϕ+t0tf[Hλx˙]dt.\begin{aligned} J_a &= \Phi - \boldsymbol{\nu}^{\top}\boldsymbol{\phi} \nonumber\\ &\quad + \int_{t_0}^{t_f} \left[ H - \boldsymbol{\lambda}^{\top}\dot{\boldsymbol{x}} \right]\,\mathrm{d} t. \end{aligned}

This is only a change of notation. No new assumption has been introduced.

Quantities That May Vary Independently

Before taking the first variation, identify all independently variable quantities.

For the unrestricted endpoint problem, these are

x(),u(),λ(),ν,t0,tf,x(t0),x(tf).\boldsymbol{x}(\cdot), \quad \boldsymbol{u}(\cdot), \quad \boldsymbol{\lambda}(\cdot), \quad \boldsymbol{\nu}, \quad t_0, \quad t_f, \quad \boldsymbol{x}(t_0), \quad \boldsymbol{x}(t_f).

More precisely, the endpoint values and endpoint times are linked by the endpoint variation identities

δx0=δx(t0)+x˙(t0)δt0,\begin{aligned} \delta\boldsymbol{x}_0 &= \delta\boldsymbol{x}(t_0) + \dot{\boldsymbol{x}}(t_0)\delta t_0, \end{aligned}
δxf=δx(tf)+x˙(tf)δtf.\begin{aligned} \delta\boldsymbol{x}_f &= \delta\boldsymbol{x}(t_f) + \dot{\boldsymbol{x}}(t_f)\delta t_f. \end{aligned}

Thus, the derivation must carefully distinguish:

Variation of the Endpoint Part

Define the endpoint part of the augmented functional as

Ψ=Φνϕ.\Psi = \Phi - \boldsymbol{\nu}^{\top}\boldsymbol{\phi}.

Then

δΨ=δΦδ(νϕ).\delta\Psi = \delta\Phi - \delta \left( \boldsymbol{\nu}^{\top}\boldsymbol{\phi} \right).

We derive these two pieces separately.

Variation of the Mayer Cost

The Mayer cost is

Φ=Φ(x(t0),t0,x(tf),tf).\Phi = \Phi \bigl( \boldsymbol{x}(t_0), t_0, \boldsymbol{x}(t_f), t_f \bigr).

Its first variation is

δΦ=Φx(t0)δx(t0)+Φt0δt0+Φx(tf)δx(tf)+Φtfδtf.\begin{aligned} \delta\Phi &= \frac{\partial\Phi} {\partial\boldsymbol{x}(t_0)} \delta\boldsymbol{x}(t_0) + \frac{\partial\Phi}{\partial t_0} \delta t_0 \nonumber\\ &\quad + \frac{\partial\Phi} {\partial\boldsymbol{x}(t_f)} \delta\boldsymbol{x}(t_f) + \frac{\partial\Phi}{\partial t_f} \delta t_f. \end{aligned}

Under the row-gradient convention,

Φx(t0)R1×n,\frac{\partial\Phi}{\partial\boldsymbol{x}(t_0)} \in\mathbb{R}^{1\times n},

while

δx(t0)Rn×1,\delta\boldsymbol{x}(t_0)\in\mathbb{R}^{n\times1},

so their product is scalar.

Variation of the Endpoint Constraint Term

Using the product rule,

δ(νϕ)=δνϕ+νδϕ.\delta \left( \boldsymbol{\nu}^{\top}\boldsymbol{\phi} \right) = \delta\boldsymbol{\nu}^{\top}\boldsymbol{\phi} + \boldsymbol{\nu}^{\top}\delta\boldsymbol{\phi}.

The first variation of ϕ\boldsymbol{\phi} is

δϕ=ϕx(t0)δx(t0)+ϕt0δt0+ϕx(tf)δx(tf)+ϕtfδtf.\begin{aligned} \delta\boldsymbol{\phi} &= \frac{\partial\boldsymbol{\phi}} {\partial\boldsymbol{x}(t_0)} \delta\boldsymbol{x}(t_0) + \frac{\partial\boldsymbol{\phi}}{\partial t_0} \delta t_0 \nonumber\\ &\quad + \frac{\partial\boldsymbol{\phi}} {\partial\boldsymbol{x}(t_f)} \delta\boldsymbol{x}(t_f) + \frac{\partial\boldsymbol{\phi}}{\partial t_f} \delta t_f. \end{aligned}

The Jacobian dimensions are

ϕx(t0)Rp×n,ϕx(tf)Rp×n.\begin{aligned} \frac{\partial\boldsymbol{\phi}} {\partial\boldsymbol{x}(t_0)} &\in\mathbb{R}^{p\times n},\\ \frac{\partial\boldsymbol{\phi}} {\partial\boldsymbol{x}(t_f)} &\in\mathbb{R}^{p\times n}. \end{aligned}

Therefore,

νϕx(t0)δx(t0)\boldsymbol{\nu}^{\top} \frac{\partial\boldsymbol{\phi}} {\partial\boldsymbol{x}(t_0)} \delta\boldsymbol{x}(t_0)

has dimensions

(1×p)(p×n)(n×1),(1\times p)(p\times n)(n\times1),

and is scalar.

Combined Variation of the Endpoint Terms

Substituting (34), (37), and (38) into (32) gives

δΨ=[Φx(t0)νϕx(t0)]δx(t0)+[Φt0νϕt0]δt0+[Φx(tf)νϕx(tf)]δx(tf)+[Φtfνϕtf]δtfδνϕ.\begin{aligned} \delta\Psi &= \left[ \frac{\partial\Phi} {\partial\boldsymbol{x}(t_0)} - \boldsymbol{\nu}^{\top} \frac{\partial\boldsymbol{\phi}} {\partial\boldsymbol{x}(t_0)} \right] \delta\boldsymbol{x}(t_0) \nonumber\\ &\quad + \left[ \frac{\partial\Phi}{\partial t_0} - \boldsymbol{\nu}^{\top} \frac{\partial\boldsymbol{\phi}}{\partial t_0} \right] \delta t_0 \nonumber\\ &\quad + \left[ \frac{\partial\Phi} {\partial\boldsymbol{x}(t_f)} - \boldsymbol{\nu}^{\top} \frac{\partial\boldsymbol{\phi}} {\partial\boldsymbol{x}(t_f)} \right] \delta\boldsymbol{x}(t_f) \nonumber\\ &\quad + \left[ \frac{\partial\Phi}{\partial t_f} - \boldsymbol{\nu}^{\top} \frac{\partial\boldsymbol{\phi}}{\partial t_f} \right] \delta t_f \nonumber\\ &\quad - \delta\boldsymbol{\nu}^{\top}\boldsymbol{\phi}. \end{aligned}

This completes the variation of all terms outside the integral.

Why Endpoint Times Have Two Effects

The endpoint time t0t_0 appears:

  1. directly as an argument of Φ\Phi and ϕ\boldsymbol{\phi};

  2. indirectly through the evaluated state x(t0)\boldsymbol{x}(t_0).

Therefore, perturbing t0t_0 can change an endpoint quantity through both channels.

The endpoint relation

δx0=δx(t0)+x˙(t0)δt0\delta\boldsymbol{x}_0 = \delta\boldsymbol{x}(t_0) + \dot{\boldsymbol{x}}(t_0)\delta t_0

is the mechanism that combines these effects later in the derivation.

The same reasoning applies at tft_f.

Perturbation-Parameter Interpretation

A useful way to understand variations is to introduce a scalar perturbation parameter ϵ\epsilon.

For example,

t0(ϵ)=t0+ϵηt0.t_0(\epsilon) = t_0+\epsilon\eta_{t_0}.

Then

δt0=dt0(ϵ)dϵϵ=0=ηt0.\delta t_0 = \left. \frac{\,\mathrm{d} t_0(\epsilon)} {\,\mathrm{d}\epsilon} \right|_{\epsilon=0} = \eta_{t_0}.

Similarly,

xϵ(t)=x(t)+ϵηx(t),\boldsymbol{x}_{\epsilon}(t) = \boldsymbol{x}(t) + \epsilon\boldsymbol{\eta}_x(t),

so

δx(t)=ηx(t).\delta\boldsymbol{x}(t) = \boldsymbol{\eta}_x(t).

This construction clarifies that every independently variable quantity must receive its own admissible perturbation.

What Remains for the Full Derivation

The complete first variation of JaJ_a also requires the variation of

t0tf[Hλx˙]dt.\int_{t_0}^{t_f} \left[ H - \boldsymbol{\lambda}^{\top}\dot{\boldsymbol{x}} \right]\,\mathrm{d} t.

That derivation must account for:

Once the complete first variation is separated into independent variations, the coefficients yield:

Chapter Summary

The main results are:

  1. The state equation is an equality constraint imposed at every time:

f(x,u,t)x˙=0.\boldsymbol{f}(\boldsymbol{x},\boldsymbol{u},t) - \dot{\boldsymbol{x}} = \boldsymbol{0}.
  1. The constrained optimal control problem can be converted into an augmented variational problem using Lagrange multipliers.

  2. The costate λ(t)\boldsymbol{\lambda}(t) is the multiplier associated with the dynamics.

  3. The static vector ν\boldsymbol{\nu} is the multiplier associated with endpoint constraints.

  4. The augmented functional is

Ja=Φνϕ+t0tf[L+λ(fx˙)]dt.\begin{aligned} J_a &= \Phi-\boldsymbol{\nu}^{\top}\boldsymbol{\phi} + \int_{t_0}^{t_f} \left[ L+ \boldsymbol{\lambda}^{\top} (\boldsymbol{f}-\dot{\boldsymbol{x}}) \right]\,\mathrm{d} t. \end{aligned}
  1. On feasible processes,

Ja=J.J_a=J.
  1. The Hamiltonian is

H=L+λf.H=L+\boldsymbol{\lambda}^{\top}\boldsymbol{f}.
  1. The augmented functional becomes

Ja=Φνϕ+t0tf[Hλx˙]dt.J_a = \Phi-\boldsymbol{\nu}^{\top}\boldsymbol{\phi} + \int_{t_0}^{t_f} \left[ H-\boldsymbol{\lambda}^{\top}\dot{\boldsymbol{x}} \right]\,\mathrm{d} t.
  1. The correct stationarity operation is

δJa=0.\delta J_a=0.
  1. The endpoint variation must include the variations of endpoint states, endpoint times, and the endpoint multiplier.

  2. The complete variation of the endpoint terms is given by (42).

Connection. After defining the augmented functional and its multipliers, we can begin the central derivation by varying its endpoint contribution.