Time-Optimal Control

The most natural objective of all is speed: reach the target in the least possible time. That is a special case of the cost functional with no terminal cost and a running cost of 1, since

J = \int_0^T 1\,dt = T.

Minimising J minimises the final time T outright. The Hamiltonian H = 1 + \lambda^\top f is linear in the control whenever the dynamics is, so the maximum principle makes the time-optimal control bang-bang: slam the input to a limit, switch once, slam it the other way. (For this to be possible the target must be reachable at all.) We work the classic example in full.

Stopping the double integrator at the origin

Take the unit mass \ddot{x} = u, |u| \le 1, and ask for the minimum-time control that brings it to rest at the origin: position and velocity both zero. With state x (position) and v = \dot{x} (velocity),

\dot{x} = v, \qquad \dot{v} = u, \qquad u \in \{+1, -1\}.

Step 1 — eliminate time to get phase-plane arcs. Dividing the two equations removes t:

\frac{dx}{dv} = \frac{\dot{x}}{\dot{v}} = \frac{v}{u} \quad\Longrightarrow\quad x = \frac{v^2}{2u} + C.

For u = +1 the trajectories are the parabolas x = \tfrac12 v^2 + C; for u = -1 they are x = -\tfrac12 v^2 + C. Every optimal path is a piece of one of these two families.

Step 2 — find the arcs that land on the origin. Only two specific arcs reach (0,0) (set C = 0): the u = +1 arc with v \le 0, and the u = -1 arc with v \ge 0. Together they form the switching curve:

\gamma:\quad x = -\tfrac12\, v\,|v| \qquad \Big(\text{i.e. } x = \tfrac12 v^2 \text{ for } v \le 0,\ \ x = -\tfrac12 v^2 \text{ for } v \ge 0\Big).

Step 3 — the optimal strategy. From any starting state, apply full thrust to drive the state onto \gamma, then switch once and ride \gamma straight into the origin:

Because the switching function is linear in time, there is at most one switch — a single reversal of full thrust. The feedback law packs the whole solution into one sign:

u^\*(x, v) = -\operatorname{sign}\!\Big(x + \tfrac12\,v\,|v|\Big).

Trace the bang-bang trajectory

The phase plane below plots position x against velocity v. The dashed curve is the switching curve x = -\tfrac12 v|v| — its two parabolic arcs. Slide the starting position and velocity: the trajectory fires full thrust along a parabola until it strikes the switching curve, switches once, and then slides along the curve into the origin. That single corner is the moment u flips between +1 and -1.

This is not just a textbook toy. Any time you must bring something to rest in the least time with a bounded effort, the answer is bang-bang with a single switch. To stop a train as quickly as possible: full brake — but braking from full speed all the way overshoots the platform, so you brake hard, ease at the right instant, and crawl in. To parallel-park tightly: full lock one way, then full lock the other, switching at the geometric sweet spot. A spacecraft reorienting with reaction thrusters, a hard-drive head seeking a track, a crane damping its load — each solves a time-optimal problem whose optimal policy is exactly the two-arc, one-switch strategy on this switching curve.