Inferensys

Glossary

Prediction Horizon and Control Horizon

In Model Predictive Control (MPC), the prediction horizon is the future time window for system behavior prediction, while the control horizon is the (often shorter) window for optimizing control inputs.
ML engineer managing model versions on laptop, version history visible, technical Git-like workflow.
MODEL PREDICTIVE CONTROL (MPC)

What is Prediction Horizon and Control Horizon?

In Model Predictive Control (MPC), the prediction horizon and control horizon are the two fundamental time windows that define the scope of the controller's forward-looking optimization.

The prediction horizon (Np) is the future time window over which the MPC's internal dynamic model forecasts the system's states and outputs. The control horizon (Nc), often shorter, is the window over which future control moves (inputs) are optimized as decision variables; beyond this horizon, inputs are typically held constant at their last computed value. These horizons define the size and computational complexity of the Optimal Control Problem (OCP) solved at each time step.

A longer prediction horizon generally improves stability and performance by considering more distant future consequences, but increases computational cost. A shorter control horizon reduces the number of optimization variables, simplifying the problem, but can limit performance. The receding horizon principle means only the first control input from the optimized sequence is applied before both horizons shift forward in time, and the optimization repeats with new feedback.

MODEL PREDICTIVE CONTROL

Core Concepts of MPC Horizons

The prediction and control horizons are the fundamental time windows that define the scope of optimization in Model Predictive Control (MPC), balancing performance, computational load, and stability.

01

Prediction Horizon (Np)

The prediction horizon is the future time window over which the MPC controller predicts the system's behavior using its internal dynamic model. It defines how far into the future the controller 'looks ahead' to anticipate the consequences of its actions.

  • Purpose: Enables proactive, anticipatory control by accounting for future reference trajectories, disturbances, and constraints.
  • Trade-off: A longer horizon generally improves stability and performance but increases computational complexity. A horizon that is too short can lead to myopic, unstable control.
  • Typical Values: Ranges from tens of time steps for fast mechanical systems (e.g., drone attitude control) to hundreds for slow chemical processes.
02

Control Horizon (Nc)

The control horizon is the (typically shorter) time window over which the MPC optimizer computes a sequence of optimal control moves. Beyond this horizon, control inputs are usually assumed constant or zero.

  • Purpose: Reduces the dimensionality of the optimization problem. The optimizer solves for Nc control moves instead of Np, drastically cutting computation.
  • Effect: After the control horizon, the system evolves in open-loop based on the last computed input. This is a key simplification.
  • Rule of Thumb: Nc is often chosen as 10-20% of Np, or long enough to capture the system's dominant dynamics.
03

The Receding Horizon Principle

This is the core MPC execution loop. At each sampling instant:

  1. Measure/estimate the current system state.
  2. Solve an Optimal Control Problem (OCP) over the prediction horizon, optimizing control inputs over the control horizon.
  3. Apply only the first control input from the optimized sequence to the actual system.
  4. Shift the horizons forward by one time step and repeat with new measurements.

This feedback mechanism provides robustness to model inaccuracies and disturbances.

04

Tuning the Horizon Lengths

Selecting Np and Nc is a critical design choice:

  • Prediction Horizon (Np): Must be long enough to capture the settling time of the system. A good starting point is Np * Ts (sample time) ≈ 5-10 times the open-loop settling time.
  • Control Horizon (Nc): Must be long enough to give the optimizer sufficient 'authority' to steer the predicted trajectory. If Nc is too short, performance degrades.
  • Computational Cost: The online optimization problem size scales with Nc. For Nonlinear MPC (NMPC), even a small increase in Nc can make real-time execution infeasible.
05

Impact on Stability & Performance

Horizon lengths directly affect closed-loop guarantees:

  • Stability: For Linear MPC, a sufficiently long prediction horizon with a terminal cost (often from LQR) and/or a terminal constraint can guarantee nominal stability.
  • Performance: A longer Np allows better tracking of future reference changes and rejection of slow disturbances. A well-chosen Nc ensures the optimizer can achieve this performance.
  • Constraint Handling: The prediction horizon Np must be long enough to 'see' future constraint violations (e.g., an approaching obstacle or tank limit) to avoid them proactively.
06

Example: Autonomous Vehicle Path Tracking

Consider an MPC controller for lane-keeping:

  • Sample Time (Ts): 0.1 seconds.
  • Prediction Horizon (Np): 30 steps → Looks ahead 3 seconds. This is enough to see the road curvature.
  • Control Horizon (Nc): 10 steps → Optimizes steering angle for the next 1 second, then assumes it holds steady.
  • Process: Every 0.1s, the MPC solves for the best steering over the next 1s to stay centered over the next 3s, applies the first command, and repeats. This balances smooth control with computational limits.
MPC DESIGN PARAMETERS

Prediction Horizon vs. Control Horizon

A comparison of the two primary time-horizon parameters that define the scope of prediction and optimization in a Model Predictive Control (MPC) formulation.

Feature / RolePrediction Horizon (Np)Control Horizon (Nc)

Primary Definition

The future time window over which the system's dynamic behavior is simulated and predicted using the internal model.

The (often shorter) future time window over which control moves (Δu) are actively optimized as decision variables.

Typical Notation

Np or N

Nc or M

Temporal Relationship

Defines the total length of the look-ahead prediction, e.g., Np = 20 time steps.

A subset of the prediction horizon, where Nc ≤ Np. Control moves are typically held constant for the remainder (Np - Nc).

Impact on Optimization Problem Size

Determines the number of predicted state/output variables in the cost function and constraints. Larger Np increases problem size.

Determines the number of optimized control input variables. Larger Nc increases degrees of freedom and computational cost.

Primary Design Trade-off

Longer horizon improves stability and accounts for distant constraints but increases computational burden and prediction error accumulation.

Longer horizon provides more aggressive, optimal control but drastically increases computational complexity. Shorter horizon simplifies the problem but may reduce performance.

Effect on Closed-Loop Performance

Governs long-term behavior, stability guarantees, and ability to anticipate slow dynamics or distant obstacles.

Governs short-term aggressiveness and responsiveness of the controller. Directly shapes the initial control action.

Common Tuning Strategy

Set long enough to capture the dominant system dynamics and relevant future constraints. Often a multiple of the system's settling time.

Set based on the expected time to reach a steady-state control input or to balance performance vs. real-time solve time. Often Nc << Np.

Connection to Stability

Critical for stability proofs. Often paired with a terminal cost or terminal constraint applied at the end of the prediction horizon.

Less directly tied to stability proofs. The control horizon primarily affects the feasible region of the optimization problem.

MPC PARAMETER TUNING

How to Tune Horizon Lengths

The prediction and control horizons are critical, tunable parameters that directly determine the performance, stability, and computational burden of a Model Predictive Controller.

Tuning the prediction horizon involves balancing foresight against uncertainty. A longer horizon improves stability and anticipates distant events but increases computational cost and amplifies model error. A horizon too short causes myopic, unstable control. For stable systems, a rule of thumb is to set it to capture the dominant settling time of the open-loop response. For tracking, it must be long enough to 'see' future reference changes.

The control horizon is typically shorter to reduce decision variables. After this horizon, inputs are often held constant. A shorter control horizon increases robustness but reduces degrees of freedom, potentially degrading performance. A longer control horizon improves optimality at the cost of computation. It is common to set the control horizon to 10-20% of the prediction horizon, then adjust based on actuator bandwidth and the need for aggressive maneuvering versus smooth, conservative action.

PREDICTION AND CONTROL HORIZONS

Frequently Asked Questions

In Model Predictive Control (MPC), the prediction horizon and control horizon are fundamental design parameters that determine the controller's look-ahead capability and optimization flexibility. These settings directly impact stability, performance, and computational load.

The prediction horizon (N_p) is the finite future time window, measured in discrete time steps, over which the MPC controller uses its internal dynamic model to forecast the system's future states and outputs. It defines how far ahead the controller "looks" to anticipate the consequences of its control actions. A longer prediction horizon allows the controller to better account for future disturbances and setpoint changes, improving performance but increasing computational cost. The choice of N_p is critical; it must be long enough to capture the dominant dynamics of the system (e.g., the settling time) to ensure stability and good performance.

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.