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.

Natural Boundary Conditions and the Structure of Optimal Control Problems

The calculus of variations produces two distinct kinds of necessary conditions:

  1. differential equations governing the trajectory in the interior of the time interval;

  2. boundary or transversality conditions governing behavior at the endpoints.

The endpoint conditions depend directly on which endpoint quantities are fixed and which are free. A small change in the problem statement can therefore produce a significantly different boundary condition.

This section first revisits the free-final-time case through a worked example. It then derives the natural boundary condition for a free terminal state at fixed final time. The chapter also develops standard vector-derivative notation and introduces the principal ingredients of a general optimal control problem: dynamics, boundary conditions, static parameters, controls, and performance indices.

Review: Fixed Terminal State and Free Terminal Time

Consider

J[x,tf]=t0tfL(x,x˙,t)dt,J[x,t_f] = \int_{t_0}^{t_f} L(x,\dot{x},t)\,\mathrm{d} t,

with

x(t0)=x0,x(tf)=xf,\begin{aligned} x(t_0)&=x_0,\\ x(t_f)&=x_f, \end{aligned}

where t0t_0, x0x_0, and xfx_f are fixed, while tft_f is free.

The necessary conditions are

Lxddt(Lx˙)=0\frac{\partial L}{\partial x} - \frac{\,\mathrm{d}}{\,\mathrm{d} t} \left( \frac{\partial L}{\partial\dot{x}} \right) = 0

and

[Lx˙Lx˙]tf=0.\left[ L - \dot{x} \frac{\partial L}{\partial\dot{x}} \right]_{t_f} = 0.

The first equation governs the interior trajectory. The second supplies the missing boundary condition associated with the free final time.

Worked Example: A Free-Final-Time Variational Problem

Consider

J[x,tf]=1tf[2x(t)+12x˙2(t)]dt,J[x,t_f] = \int_1^{t_f} \left[ 2x(t) + \frac{1}{2}\dot{x}^2(t) \right]\,\mathrm{d} t,

subject to

x(1)=4,x(tf)=4,tf>1.x(1)=4, \qquad x(t_f)=4, \qquad t_f>1.

The integrand is

L(x,x˙,t)=2x+12x˙2.L(x,\dot{x},t) = 2x+\frac{1}{2}\dot{x}^2.

Euler–Lagrange equation

We have

Lx=2\frac{\partial L}{\partial x}=2

and

Lx˙=x˙.\frac{\partial L}{\partial\dot{x}} = \dot{x}.

Thus,

ddt(Lx˙)=x¨.\frac{\,\mathrm{d}}{\,\mathrm{d} t} \left( \frac{\partial L}{\partial\dot{x}} \right) = \ddot{x}.

The Euler–Lagrange equation gives

2x¨=0,2-\ddot{x}=0,

or

x¨=2.\boxed{ \ddot{x}=2 }.

Integrating twice yields

x(t)=t2+c1t+c2.x(t) = t^2+c_1t+c_2.

Initial boundary condition

Using x(1)=4x(1)=4,

1+c1+c2=4,1+c_1+c_2=4,

so

c1+c2=3.c_1+c_2=3.

Free-final-time condition

The transversality condition is

[Lx˙Lx˙]tf=0.\left[ L - \dot{x} \frac{\partial L}{\partial\dot{x}} \right]_{t_f} = 0.

Since

Lx˙=x˙,\frac{\partial L}{\partial\dot{x}} = \dot{x},

we obtain

0=[2x+12x˙2x˙2]tf=[2x12x˙2]tf.\begin{aligned} 0 &= \left[ 2x+\frac{1}{2}\dot{x}^2-\dot{x}^2 \right]_{t_f} \nonumber\\ &= \left[ 2x-\frac{1}{2}\dot{x}^2 \right]_{t_f}. \end{aligned}

Using the terminal-state condition x(tf)=4x(t_f)=4,

812x˙2(tf)=0,8-\frac{1}{2}\dot{x}^2(t_f)=0,

which implies

x˙2(tf)=16.\dot{x}^2(t_f)=16.

Therefore,

x˙(tf)=±4.\dot{x}(t_f)=\pm4.

From (13),

x˙(t)=2t+c1.\dot{x}(t)=2t+c_1.

Combining this with

x(tf)=tf2+c1tf+c2=4x(t_f)=t_f^2+c_1t_f+c_2=4

and (15), the admissible solution satisfying tf>1t_f>1 is

tf=5\boxed{ t_f=5 }

with

c1=6,c2=9.c_1=-6, \qquad c_2=9.

Hence,

x(t)=t26t+9.\boxed{ x^*(t) = t^2-6t+9 }.

A direct check gives

x(1)=4,x(5)=4,x˙(5)=4.\begin{aligned} x^*(1)&=4,\\ x^*(5)&=4,\\ \dot{x}^*(5)&=4. \end{aligned}

Free Terminal State with Fixed Final Time

Now consider

J[x]=t0tfL(x,x˙,t)dt,J[x] = \int_{t_0}^{t_f} L(x,\dot{x},t)\,\mathrm{d} t,

subject to

x(t0)=x0,x(t_0)=x_0,

where t0t_0 and tft_f are fixed, but x(tf)x(t_f) is free.

The endpoint configuration is shown conceptually in Figure 1.

When t_f is fixed but x(t_f) is free, admissible trajectories may terminate at different state values along the vertical line t=t_f.

Figure 1:When tft_f is fixed but x(tf)x(t_f) is free, admissible trajectories may terminate at different state values along the vertical line t=tft=t_f.

Derivation of the Natural Boundary Condition

Because the endpoint times are fixed, variation of the functional gives

δJ=t0tfδLdt.\delta J = \int_{t_0}^{t_f} \delta L\,\mathrm{d} t.

To first order,

δL=Lxδx+Lx˙δx˙.\delta L = \frac{\partial L}{\partial x}\delta x + \frac{\partial L}{\partial\dot{x}} \delta\dot{x}.

Thus,

δJ=t0tf[Lxδx+Lx˙δx˙]dt.\delta J = \int_{t_0}^{t_f} \left[ \frac{\partial L}{\partial x}\delta x + \frac{\partial L}{\partial\dot{x}} \delta\dot{x} \right]\,\mathrm{d} t.

Using

δx˙=ddtδx\delta\dot{x} = \frac{\,\mathrm{d}}{\,\mathrm{d} t}\delta x

and integrating by parts,

δJ=Lx˙δxt0tf+t0tf[Lxddt(Lx˙)]δxdt.\begin{aligned} \delta J &= \left. \frac{\partial L}{\partial\dot{x}} \delta x \right|_{t_0}^{t_f} \nonumber\\ &\quad + \int_{t_0}^{t_f} \left[ \frac{\partial L}{\partial x} - \frac{\,\mathrm{d}}{\,\mathrm{d} t} \left( \frac{\partial L}{\partial\dot{x}} \right) \right] \delta x\,\mathrm{d} t. \end{aligned}

Since the initial state is fixed,

δx(t0)=0.\delta x(t_0)=0.

Since tft_f is fixed,

δtf=0.\delta t_f=0.

The endpoint identity

δxf=δx(tf)+x˙(tf)δtf\delta x_f = \delta x(t_f) + \dot{x}(t_f)\delta t_f

therefore reduces to

δxf=δx(tf).\delta x_f = \delta x(t_f).

Because the terminal state is free,

δx(tf)\delta x(t_f)

is arbitrary and generally nonzero.

Equation (34) becomes

δJ=Lx˙tfδx(tf)+t0tf[Lxddt(Lx˙)]δxdt.\begin{aligned} \delta J &= \left. \frac{\partial L}{\partial\dot{x}} \right|_{t_f} \delta x(t_f) \nonumber\\ &\quad + \int_{t_0}^{t_f} \left[ \frac{\partial L}{\partial x} - \frac{\,\mathrm{d}}{\,\mathrm{d} t} \left( \frac{\partial L}{\partial\dot{x}} \right) \right] \delta x\,\mathrm{d} t. \end{aligned}

Since the interior variation and terminal variation are independent, the necessary conditions are

Lxddt(Lx˙)=0\boxed{ \frac{\partial L}{\partial x} - \frac{\,\mathrm{d}}{\,\mathrm{d} t} \left( \frac{\partial L}{\partial\dot{x}} \right) = 0 }

and

Lx˙tf=0.\boxed{ \left. \frac{\partial L}{\partial\dot{x}} \right|_{t_f} = 0 }.

The second equation is called a natural boundary condition.

Boundary Conditions as Products

Boundary terms in variational derivations often appear in the form

AB=0.A\,B=0.

For scalar quantities, this implies

A=0,B=0,or both.A=0, \qquad B=0, \qquad \text{or both}.

However, one cannot arbitrarily choose which factor is zero. The problem statement determines whether an endpoint variation is zero.

For example,

Lx˙tfδx(tf)=0.\left. \frac{\partial L}{\partial\dot{x}} \right|_{t_f} \delta x(t_f) = 0.

Two cases are possible:

  1. If x(tf)x(t_f) is fixed, then

δx(tf)=0,\delta x(t_f)=0,

and no additional natural boundary condition arises.

  1. If x(tf)x(t_f) is free, then δx(tf)\delta x(t_f) is arbitrary, so

Lx˙tf=0.\left. \frac{\partial L}{\partial\dot{x}} \right|_{t_f} = 0.

For vector quantities, a zero inner product

ab=0\boldsymbol{a}^{\top}\boldsymbol{b}=0

does not generally imply that either vector is zero. It may instead indicate orthogonality. This distinction becomes important in vector transversality conditions.

Interior Conditions and Endpoint Conditions

The first variation naturally separates into:

The integral term yields the Euler–Lagrange differential equation, which governs the interior path. The boundary terms yield endpoint conditions, whose form depends on which endpoint quantities are free.

This separation is fundamental:

path condition+endpoint conditions.\text{path condition} \quad+\quad \text{endpoint conditions}.

A First-Principles Workflow

For each variational problem, the safest procedure is:

  1. identify the functional;

  2. identify all quantities that may vary;

  3. identify all quantities that are fixed;

  4. compute the first variation;

  5. account for moving integration limits if present;

  6. use integration by parts to eliminate δx˙\delta\dot{x};

  7. apply endpoint variation identities;

  8. rewrite the result in terms of independent variations;

  9. set the coefficients of independent variations to zero.

This approach is more reliable than applying formulas from a table because it reveals the origin of every boundary condition.

Vector Notation

Optimal control problems are usually vector-valued. Let

x=[x1x2xn]Rn.\boldsymbol{x} = \begin{bmatrix} x_1\\ x_2\\ \vdots\\ x_n \end{bmatrix} \in\mathbb{R}^n.

Its transpose is

x=[x1x2xn].\boldsymbol{x}^{\top} = \begin{bmatrix} x_1 & x_2 & \cdots & x_n \end{bmatrix}.

Throughout this section, vectors are taken to be column vectors unless otherwise stated.

Gradient of a Scalar Function

Let

f:RnR.f:\mathbb{R}^n\rightarrow\mathbb{R}.

Using the row-gradient convention,

f(x)=[fx1fx2fxn].\nabla f(\boldsymbol{x}) = \begin{bmatrix} \dfrac{\partial f}{\partial x_1} & \dfrac{\partial f}{\partial x_2} & \cdots & \dfrac{\partial f}{\partial x_n} \end{bmatrix}.

Some texts define the gradient as a column vector. Either convention is acceptable if used consistently. The present convention is convenient for writing first-order expansions as

f(x+Δx)=f(x)+f(x)Δx+O(Δx2).f(\boldsymbol{x}+\Delta\boldsymbol{x}) = f(\boldsymbol{x}) + \nabla f(\boldsymbol{x})\Delta\boldsymbol{x} + \mathcal{O}(\|\Delta\boldsymbol{x}\|^2).

The Hessian Matrix

The Hessian of a scalar function is the matrix of second derivatives:

2f(x)=[2fx122fx1xn2fxnx12fxn2].\nabla^2 f(\boldsymbol{x}) = \begin{bmatrix} \dfrac{\partial^2 f}{\partial x_1^2} & \cdots & \dfrac{\partial^2 f}{\partial x_1\partial x_n} \\ \vdots & \ddots & \vdots \\ \dfrac{\partial^2 f}{\partial x_n\partial x_1} & \cdots & \dfrac{\partial^2 f}{\partial x_n^2} \end{bmatrix}.

If ff is twice continuously differentiable, then

2fxixj=2fxjxi,\frac{\partial^2 f}{\partial x_i\partial x_j} = \frac{\partial^2 f}{\partial x_j\partial x_i},

and the Hessian is symmetric.

Jacobian of a Vector Function

Let

f:RnRm\boldsymbol{f}:\mathbb{R}^n\rightarrow\mathbb{R}^m

with

f(x)=[f1(x)f2(x)fm(x)].\boldsymbol{f}(\boldsymbol{x}) = \begin{bmatrix} f_1(\boldsymbol{x})\\ f_2(\boldsymbol{x})\\ \vdots\\ f_m(\boldsymbol{x}) \end{bmatrix}.

The Jacobian is

fx=[f1x1f1x2f1xnf2x1f2x2f2xnfmx1fmx2fmxn]Rm×n.\frac{\partial\boldsymbol{f}}{\partial\boldsymbol{x}} = \begin{bmatrix} \dfrac{\partial f_1}{\partial x_1} & \dfrac{\partial f_1}{\partial x_2} & \cdots & \dfrac{\partial f_1}{\partial x_n} \\ \dfrac{\partial f_2}{\partial x_1} & \dfrac{\partial f_2}{\partial x_2} & \cdots & \dfrac{\partial f_2}{\partial x_n} \\ \vdots & \vdots & \ddots & \vdots \\ \dfrac{\partial f_m}{\partial x_1} & \dfrac{\partial f_m}{\partial x_2} & \cdots & \dfrac{\partial f_m}{\partial x_n} \end{bmatrix} \in\mathbb{R}^{m\times n}.

The Jacobian maps a first-order state perturbation to a first-order function perturbation:

ΔffxΔx.\Delta\boldsymbol{f} \approx \frac{\partial\boldsymbol{f}}{\partial\boldsymbol{x}} \Delta\boldsymbol{x}.

General Dynamical System

A broad class of physical systems can be written as

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

where

The vector q\boldsymbol{q} may be optimized, but it is not a function of time.

Why first-order form is general

A second-order mechanical equation such as

mr¨=Fm\ddot{r}=F

can be converted to first-order form by defining

x1=r,x2=r˙.x_1=r, \qquad x_2=\dot{r}.

Then

x˙1=x2,x˙2=Fm.\begin{aligned} \dot{x}_1&=x_2,\\ \dot{x}_2&=\frac{F}{m}. \end{aligned}

Thus, higher-order systems can generally be rewritten as first-order state-space systems.

General Boundary Conditions

A general equality boundary constraint may be written as

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

This formulation includes simple fixed endpoint conditions as a special case. For example,

x(t0)=x0,x(tf)=xf\begin{aligned} \boldsymbol{x}(t_0)&=\boldsymbol{x}_0,\\ \boldsymbol{x}(t_f)&=\boldsymbol{x}_f \end{aligned}

can be written as

ϕ=[x(t0)x0x(tf)xf]=0.\boldsymbol{\phi} = \begin{bmatrix} \boldsymbol{x}(t_0)-\boldsymbol{x}_0\\ \boldsymbol{x}(t_f)-\boldsymbol{x}_f \end{bmatrix} = \boldsymbol{0}.

Point-to-Point and Locus-to-Locus Problems

A point-to-point problem prescribes exact endpoint states:

x(t0)=x0,x(tf)=xf.\boldsymbol{x}(t_0)=\boldsymbol{x}_0, \qquad \boldsymbol{x}(t_f)=\boldsymbol{x}_f.

A more general problem may require the initial and final states to lie on specified manifolds:

ψ0(x(t0))=0,ψf(x(tf))=0.\begin{aligned} \boldsymbol{\psi}_0\bigl(\boldsymbol{x}(t_0)\bigr)&=\boldsymbol{0},\\ \boldsymbol{\psi}_f\bigl(\boldsymbol{x}(t_f)\bigr)&=\boldsymbol{0}. \end{aligned}

For example, an orbital-transfer problem may require a spacecraft to begin somewhere on one orbit and end somewhere on another orbit without prescribing the exact position on either orbit.

A locus-to-locus transfer constrains endpoints to lie on sets rather than at prescribed points.

Figure 2:A locus-to-locus transfer constrains endpoints to lie on sets rather than at prescribed points.

This broader boundary formulation substantially enlarges the class of problems that can be modeled.

Why a Performance Index Is Required

The dynamics and boundary conditions may admit many feasible controls. Therefore, feasibility alone does not identify a unique preferred solution.

A performance index assigns a scalar measure to each admissible process:

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

The endpoint term Φ\Phi is often called the Mayer term. The integral term is called the Lagrange term. Their combination is commonly called the Bolza form.

Mayer, Lagrange, and Bolza Forms

Mayer form

A pure endpoint cost has the form

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

Lagrange form

A pure running cost has the form

J=t0tfL(x,u,t,q)dt.J = \int_{t_0}^{t_f} L(\boldsymbol{x},\boldsymbol{u},t,\boldsymbol{q})\,\mathrm{d} t.

Bolza form

The general combination is

J=Φ+t0tfLdt.J = \Phi + \int_{t_0}^{t_f}L\,\mathrm{d} t.

Fuel-Optimal Interpretation

Suppose spacecraft mass satisfies

m˙(t)=T(t)Ispg0,\dot{m}(t) = - \frac{T(t)}{I_{\mathrm{sp}}g_0},

where T(t)T(t) is thrust magnitude, IspI_{\mathrm{sp}} is specific impulse, and g0g_0 is standard gravity.

Integrating,

m(t)=m(t0)t0tT(τ)Ispg0dτ.m(t) = m(t_0) - \int_{t_0}^{t} \frac{T(\tau)} {I_{\mathrm{sp}}g_0} \,\mathrm{d}\tau.

Minimizing fuel consumption is equivalent to maximizing final mass:

maxm(tf).\max m(t_f).

This can be written as a minimization:

min[m(tf)].\min\left[-m(t_f)\right].

More generally,

maxFmin(F).\max F \quad\Longleftrightarrow\quad \min(-F).

The General Optimal Control Problem

A standard optimal control problem is:

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

with

J=Φ(x(t0),t0,x(tf),tf,q)+t0tfL(x(t),u(t),t,q)dt,J = \Phi \bigl( \boldsymbol{x}(t_0), t_0, \boldsymbol{x}(t_f), t_f, \boldsymbol{q} \bigr) + \int_{t_0}^{t_f} L \bigl( \boldsymbol{x}(t), \boldsymbol{u}(t), t, \boldsymbol{q} \bigr)\,\mathrm{d} t,

subject to

x˙=f(x,u,t,q),\dot{\boldsymbol{x}} = \boldsymbol{f}(\boldsymbol{x},\boldsymbol{u},t,\boldsymbol{q}),

and

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

Additional path constraints may also be imposed:

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

Why Arbitrary Control Search Is Inadequate

One might attempt to choose candidate controls, integrate the dynamics, evaluate the cost, and retain the best result. This approach is generally ineffective because:

  1. the control is an infinite-dimensional function;

  2. most arbitrary controls may violate boundary conditions;

  3. the number of admissible alternatives is uncountably infinite;

  4. random search provides no guarantee of stationarity or optimality.

A systematic variational framework is therefore needed. The next step is to convert the constrained optimal control problem into an augmented calculus-of-variations problem and derive its first-order necessary conditions.

Chapter Summary

The key results are:

  1. A free endpoint parameter produces an additional transversality or natural boundary condition.

  2. For fixed terminal state and free final time,

[Lx˙Lx˙]tf=0.\left[ L-\dot{x}L_{\dot{x}} \right]_{t_f} = 0.
  1. For fixed final time and free terminal state,

Lx˙(tf)=0.L_{\dot{x}}(t_f)=0.
  1. Boundary terms must be interpreted as products involving endpoint variations. One must determine from the problem statement which factor is constrained to vanish.

  2. The Euler–Lagrange equation governs the interior path, while natural and transversality conditions govern the endpoints.

  3. Gradients, Hessians, and Jacobians provide the derivative notation required for vector-valued optimal control problems.

  4. A general dynamical system can be written as

x˙=f(x,u,t,q).\dot{\boldsymbol{x}} = \boldsymbol{f}(\boldsymbol{x},\boldsymbol{u},t,\boldsymbol{q}).
  1. General boundary conditions are expressed as

ϕ(x(t0),t0,x(tf),tf,q)=0.\boldsymbol{\phi} \bigl( \boldsymbol{x}(t_0), t_0, \boldsymbol{x}(t_f), t_f, \boldsymbol{q} \bigr) = \boldsymbol{0}.
  1. The general Bolza performance index is

J=Φ+t0tfLdt.J = \Phi + \int_{t_0}^{t_f}L\,\mathrm{d} t.
  1. Dynamics and boundary conditions determine feasibility; the performance index determines preference among feasible processes.