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.

Direct and Multiple Shooting

Direct shooting

Parameterize control as u(t;q)\mathbf{u}(t;\mathbf{q}). The optimizer selects q\mathbf{q} and design variables; a forward integrator simulates the dynamics and returns objective and constraint values.

An optimizer proposing control parameters, a forward simulator generating trajectories, and results returning to the optimizer.

Direct shooting embeds a full forward simulation in every optimization evaluation.

Advantages include simple simulator integration, automatically integrated states, relatively few NLP variables, and reuse of mature ODE/DAE solvers.

Its main weakness is long-range sensitivity. If

S(t)=x(t)q,\mathbf{S}(t)=\frac{\partial\mathbf{x}(t)}{\partial\mathbf{q}},

then

S˙=fxS+fuuq,S(t0)=0.\dot{\mathbf{S}}=\mathbf{f}_x\mathbf{S}+\mathbf{f}_u\frac{\partial\mathbf{u}}{\partial\mathbf{q}}, \qquad\mathbf{S}(t_0)=\mathbf{0}.

For unstable or long-horizon systems, sensitivities may grow or decay severely, making terminal and path constraints difficult. Shooting is most suitable for stable systems, short horizons, low-dimensional controls, and moderate terminal requirements.

Multiple shooting

Multiple shooting splits the horizon into segments with independent initial-state decisions Xk\mathbf{X}_k.

Several short simulated trajectory segments joined by continuity constraints at their boundaries.

Short local simulations limit sensitivity propagation.

Let Φk(Xk,qk,xp,xc)\boldsymbol{\Phi}_k(\mathbf{X}_k,\mathbf{q}_k,\mathbf{x}_p,\mathbf{x}_c) be the simulated endpoint of segment kk. Continuity requires

rk=Xk+1Φk(Xk,qk,xp,xc)=0.\mathbf{r}_k=\mathbf{X}_{k+1}-\boldsymbol{\Phi}_k(\mathbf{X}_k,\mathbf{q}_k,\mathbf{x}_p,\mathbf{x}_c)=\mathbf{0}.

Multiple shooting handles unstable dynamics and tight terminal constraints better, permits internal state guesses, and produces sparse continuity Jacobians. It adds state variables, constraints, and several local simulations. It lies between single shooting and direct transcription: integration remains inside each segment, while algebraic continuity reconnects the horizon.

Activity 7.1: Multiple Shooting versus Direct Collocation for an Unstable System

Activity 7.2: Hypersensitive Optimal-Control Problem