Main Content


Specify custom disturbance models, custom state estimator, terminal weights, and custom constraints

Once you have created a model predictive controller for your plant, you can tune the system closed-loop response using the MPC Designer app or at the command line.


expand all

getGet property values from MPC object
getnameRetrieve I/O signal names from MPC plant model
setSet or modify MPC object properties
setnameSet I/O signal names in MPC plant model
getconstraintObtain mixed input/output constraints from model predictive controller
setconstraintSet mixed input/output constraints for model predictive controller
setterminalTerminal weights and constraints
getEstimatorObtain Kalman gains and model for estimator design
setEstimatorModify a model predictive controller’s state estimator
getindistRetrieve unmeasured input disturbance model
getoutdistRetrieve unmeasured output disturbance model
setindistModify unmeasured input disturbance model
setoutdistModify unmeasured output disturbance model
mpcActiveSetSolverSolve quadratic programming problem using active-set algorithm
mpcActiveSetOptionsCreate default option set for mpcActiveSetSolver
mpcInteriorPointSolverSolve a quadratic programming problem using an interior-point algorithm
mpcInteriorPointOptionsCreate default option set for mpcInteriorPointSolver
setCustomSolverConfigures an MPC object to use the QP solver from Optimization Toolbox as a custom solver


MPC DesignerDesign and simulate model predictive controllers


Weights and Constraints

Setting Targets for Manipulated Variables

If your plant has more manipulated variables than outputs, you can hold the excess manipulated variables at target values for economical or operational reasons.

Setting Time-Varying Weights and Constraints with MPC Designer

When designing an MPC controller, you can specify tuning weights and constraints that vary over the prediction horizon.

Constraints on Linear Combinations of Inputs and Outputs

You can design and simulate a model predictive controller with mixed input/output constraints.

Terminal Weights and Constraints

To achieve infinite horizon control, you can use terminal weights at the final prediction horizon step. To ensure stability for constrained systems, you may have to also define terminal constraints at the end of the prediction horizon.

Disturbance Models and State Estimation

Adjust Disturbance and Noise Models

MPC controllers model unknown events using input and output disturbance models, and measurement noise models.

Custom State Estimation

You can override the default MPC controller state estimation method by changing the default Kalman gains or by supplying your own controller state estimates.

Implement Custom State Estimator Equivalent to Built-In Kalman Filter

Design a state estimator equivalent to the linear Kalman filter of an MPC controller.

Optimization Settings

Manipulated Variable Blocking

You can improve the robustness of your controller and smooth manipulated variable adjustments by dividing the prediction horizon into a series of blocking intervals.

Specifying Alternative Cost Function with Off-Diagonal Weight Matrices

You can specify an alternative cost function for your model predictive controller to minimize during optimization.