Inferensys

Glossary

Direct Multiple Shooting

Direct multiple shooting is a numerical method for solving Optimal Control Problems (OCPs) in Nonlinear MPC, which discretizes the time horizon into segments, solves initial value problems on each, and enforces continuity constraints to improve numerical stability.
Developer demonstrating multi-agent tool use, agent tool selection interface on laptop, casual tech demo moment.
NUMERICAL OPTIMIZATION METHOD

What is Direct Multiple Shooting?

Direct multiple shooting is a prominent numerical method for solving Optimal Control Problems (OCPs), particularly within Nonlinear Model Predictive Control (NMPC). It transforms the infinite-dimensional OCP into a structured, finite-dimensional Nonlinear Programming (NLP) problem by discretizing the time horizon.

Direct multiple shooting is a discretization strategy for solving Optimal Control Problems (OCPs) by dividing the prediction horizon into multiple shorter time segments. On each segment, an initial value problem (IVP) is solved independently from a parameterized initial state, and continuity constraints are enforced to link the segments together, ensuring a physically consistent trajectory. This segmentation enhances numerical stability and robustness compared to single-shooting methods, especially for unstable systems or long horizons.

The method explicitly handles path constraints and complex system dynamics by converting the continuous-time OCP into a large but sparse Nonlinear Programming (NLP) problem. This structured NLP is then solved efficiently using specialized Sequential Quadratic Programming (SQP) solvers that exploit the block-diagonal sparsity pattern. Direct multiple shooting is a cornerstone of high-performance Nonlinear MPC (NMPC) implementations, enabling real-time control of robotic, aerospace, and chemical processes.

NUMERICAL METHOD

Key Features of Direct Multiple Shooting

Direct multiple shooting is a high-performance numerical method for solving Optimal Control Problems (OCPs) in Nonlinear MPC. It transforms an infinite-dimensional OCP into a finite-dimensional Nonlinear Programming (NLP) problem by discretizing the time horizon and solving parallel initial value problems.

01

Time Horizon Discretization

The core of the method involves dividing the prediction horizon into N multiple shooting intervals. The continuous-time OCP is discretized at these shooting nodes, creating a structured, finite-dimensional optimization problem. This segmentation is the primary distinction from single shooting methods and is key to handling unstable dynamics and path constraints effectively.

02

Parallel Initial Value Problems

On each shooting interval, an initial value problem (IVP) is solved independently, integrating the system dynamics from an initial state guess at the node. This allows for:

  • Parallel computation of trajectories, significantly speeding up function evaluations.
  • Natural embedding of sophisticated, adaptive ODE/DAE solvers for accurate simulation.
  • Isolation of numerical instability; a problem on one interval does not corrupt the entire solution.
03

Continuity Constraints

To ensure the overall solution represents a physically continuous trajectory, continuity constraints are enforced at the boundaries between shooting intervals. These are equality constraints of the form: x_{i+1}(t_i) - x_{i+1}^0 = 0 where the simulated end state of interval i must match the initial state variable for interval i+1. The optimizer adjusts the initial state guesses at all nodes to satisfy these constraints, yielding a continuous, feasible solution.

04

Improved Numerical Stability

By breaking the long integration into shorter segments, direct multiple shooting dramatically reduces the sensitivity to initial guesses compared to single shooting. This decouples the simulation from the optimization, preventing the "tail-wagging-the-dog" problem where small changes at the start cause exponentially large deviations at the end. It is particularly robust for systems with unstable modes or long horizons.

05

Structure for Efficient NLP Solvers

The transcribed NLP problem has a characteristic block-banded sparsity structure in its constraint Jacobian and Lagrangian Hessian. This structure arises because variables and constraints from one shooting interval primarily couple only with neighboring intervals. High-performance NLP solvers (like IPOPT or SNOPT) and QP solvers within Sequential Quadratic Programming (SQP) exploit this sparsity using specialized linear algebra, enabling the solution of large-scale problems.

06

Natural Handling of Path Constraints

State and input constraints can be enforced directly at the discretization nodes (and optionally at intermediate points via collocation). This explicit, pointwise enforcement is more straightforward and often more accurate than in single shooting, where constraints must be enforced along an entire, highly sensitive integrated trajectory. It provides direct control over constraint satisfaction throughout the horizon.

NUMERICAL METHODS FOR OPTIMAL CONTROL

Direct Multiple Shooting vs. Direct Single Shooting

A comparison of two primary direct transcription methods for solving Optimal Control Problems (OCPs) in Nonlinear Model Predictive Control (NMPC).

Numerical FeatureDirect Single ShootingDirect Multiple Shooting

Core Discretization Approach

Only control inputs are discretized. The state trajectory is generated by a single forward integration of the full-horizon dynamics.

Both time horizon and states are discretized into segments (shooting intervals). An initial value problem is solved on each segment independently.

Decision Variables for NLP

Control inputs at discretization points only.

States at the beginning of each shooting interval AND control inputs over each interval.

Continuity Constraints

Implicitly satisfied by the single integration. No explicit constraints are needed.

Explicit equality constraints are added to the NLP to enforce continuity of the state trajectory across shooting intervals.

Numerical Stability

Low. Sensitive to unstable dynamics; small changes in early controls can cause large, unbounded deviations in later states (the "tail-wags-the-dog" problem).

High. Localizes the effect of unstable modes within shorter intervals, preventing error propagation across the entire horizon.

Initialization & Warm-Starting

Difficult. Requires a good initial guess for the full control sequence to produce a feasible state trajectory.

Easier. Can initialize with a physically meaningful (but possibly discontinuous) state guess. Permits efficient warm-starting from previous solution.

Problem Sparsity Structure

Dense. The Jacobian of the constraints is generally dense due to the full-horizon integration.

Highly Sparse & Block-Structured. The continuity constraints create a block-banded structure (almost diagonal) that specialized NLP solvers exploit for speed.

Computational Load per NLP Iteration

Lower per iteration, as fewer decision variables and no explicit continuity constraints are evaluated.

Higher per iteration due to more variables and constraints, but the sparsity enables faster overall convergence for complex problems.

Sensitivity to Poor Initial Guess

High. Can easily fail to converge or converge to poor local minima if the initial control sequence is far from optimal.

Moderate. The explicit state variables provide more "handles" for the optimizer, making it more robust to suboptimal initial guesses.

Primary Use Case

Simple, stable systems with short prediction horizons where a good initial guess is readily available.

Complex, unstable, or stiff systems (e.g., chemical reactors, aerospace), long horizons, and applications requiring robust real-time performance.

DIRECT MULTIPLE SHOOTING

Frequently Asked Questions

Direct multiple shooting is a foundational numerical method for solving Optimal Control Problems (OCPs) in robotics and process control. These FAQs address its core mechanics, advantages, and implementation details for engineers and researchers.

Direct multiple shooting is a numerical method for solving Optimal Control Problems (OCPs) by discretizing the prediction horizon into multiple segments, solving an initial value problem on each segment independently, and then enforcing continuity constraints between them through a large-scale Nonlinear Programming (NLP) problem.

The algorithm works in four key steps:

  1. Time Discretization: The prediction horizon ([t_0, t_f]) is divided into (N) shooting intervals ([t_i, t_{i+1}]).
  2. Parameterization: The control input is parameterized (e.g., piecewise constant) on each interval. The system's state at the beginning of each interval, (s_i), is introduced as an additional decision variable.
  3. Parallel Integration: On each interval (i), an initial value problem (IVP) is solved numerically, integrating the system dynamics from the initial value (s_i) using the parameterized control. This yields a simulated trajectory segment.
  4. Constraint Assembly & Optimization: A large-scale NLP is formed where the cost function is a sum over intervals, and continuity constraints (s_{i+1} = x(t_{i+1}; s_i, u_i)) are enforced to ensure the pieces of the trajectory connect smoothly. An NLP solver (like IPOPT or SNOPT) then solves for the optimal sequence of control parameters and shooting node states.
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.