Main Content


Simulate controllers against linear or nonlinear plants in MATLAB® and Simulink®

The toolbox provides tools for simulating your controller from the command line and in Simulink. If you are designing a controller using the MPC Designer app, you can simulate control scenarios during the design process and generate a Simulink model from your design.


mpcmoveCompute optimal control action and update controller states
mpcmoveoptOption set for mpcmove function
mpcstateMPC controller state
simSimulate an MPC controller in closed loop with a linear plant
mpcsimoptMPC simulation options
plotPlot responses generated by MPC simulations


MPC ControllerSimulate model predictive controller


MPC DesignerDesign and simulate model predictive controllers


Simulation Basics

Simulating MPC Controller with Plant Model Mismatch

Simulate an MPC controller when there is a mismatch between the controller prediction model and the actual plant dynamics.

Test MPC Controller Robustness using MPC Designer

You can test the robustness of your model predictive controller by simulating it with MPC Designer.

Generate Simulink Model from MPC Designer

You can automatically generate a Simulink model that uses the current model predictive controller to control its internal plant model.

Test an Existing MPC Controller with Simulink

Test an existing MPC controller within a Simulink model.

Signal Previewing

If your application allows you to anticipate trends in such signals, an MPC controller with signal previewing can improve reference tracking, measured disturbance rejection, or both.

Simulate Linear MPC Controller with Nonlinear Plant using Successive Linearizations

Simulate a model predictive controller with a nonlinear plant at the command line. At each control interval, relinearize the nonlinear plant and define a new controller based on the updated plant model.

Run-Time Features

Update Constraints at Run Time

You can update the constraints of your MPC controller at each control interval.

Tune Weights at Run Time

You can adjust the cost function penalty weights for your MPC controller while the controller operates.

Adjust Horizons at Run Time

You can adjust the prediction and control horizons for your MPC controller while the controller operates.

Switch Controller Online and Offline with Bumpless Transfer

Reduce large actuator movements when changing controller operating modes.

Switching Controllers Based on Optimal Costs

You can switch between multiple MPC controllers based on their optimal objective function cost values.

Monitoring Optimization Status to Detect Controller Failures

You can detect controller failures in real time by using the optimization status controller output.

QP Solver

Simulate MPC Controller with a Custom QP Solver

Simulate the closed-loop response of a model predictive controller with a custom quadratic programming solver.

Use Suboptimal Solution in Fast MPC Applications

You can guarantee the worst-case execution time for your MPC controller by applying a suboptimal solution after the number of optimization iterations exceeds a specified maximum value.

Case Studies

Design and Cosimulate Control of High-Fidelity Distillation Tower with Aspen Plus Dynamics

Design a model predictive controller in MATLAB and use cosimulation validate whether the controller is robust enough to control a nonlinear plant.

Related Information