Nonlinear MPC Design
As in traditional linear MPC, nonlinear MPC calculates control actions at each control interval, using a combination of model-based prediction and constrained optimization. The key differences are:
The prediction model can be nonlinear and include time-varying parameters
The equality and inequality constraints can be nonlinear
The scalar cost function to be minimized can be a nonquadratic (linear or nonlinear) function of the decision variables.
By default, nonlinear MPC controllers solve a nonlinear programming problem using
the fmincon function, which requires Optimization Toolbox™ software. If you do not have Optimization Toolbox software you can specify your own custom nonlinear solver.
For more information, see Nonlinear MPC.
Functions
nlmpc | Nonlinear model predictive controller |
nlmpcMultistage | Multistage nonlinear model predictive controller (Since R2021a) |
validateFcns | Examine prediction model and custom functions of nlmpc or
nlmpcMultistage objects for potential problems |
generateJacobianFunction | Generate MATLAB Jacobian functions for multistage nonlinear MPC using automatic differentiation (Since R2023a) |
nlmpcmove | Compute optimal control action for nonlinear MPC controller |
nlmpcmoveopt | Option set for nlmpcmove function |
getSimulationData | Create data structure to simulate multistage MPC controller with
nlmpcmove (Since R2021a) |
convertToMPC | Convert nlmpc object into one or more mpc
objects |
createParameterBus | Create Simulink bus object and configure Bus Creator block for passing model parameters to Nonlinear MPC Controller block |
Blocks
| Nonlinear MPC Controller | Simulate nonlinear model predictive controllers |
| Multistage Nonlinear MPC Controller | Simulate multistage nonlinear model predictive controllers (Since R2021a) |
Topics
Nonlinear MPC Basics
- Nonlinear MPC
Nonlinear model predictive controllers control plants using nonlinear prediction models, cost functions, or constraints. - Specify Prediction Model for Nonlinear MPC
To define a prediction model for a nonlinear MPC controller, specify the state and output functions. - Specify Cost Function for Nonlinear MPC
Nonlinear MPC controllers support generic cost functions, such as a combination of linear or nonlinear functions of the system states, inputs, and outputs. - Specify Constraints for Nonlinear MPC
You can specify custom linear and nonlinear constraints for your nonlinear MPC controller in addition to standard linear MPC constraints. - Configure Optimization Solver for Nonlinear MPC
By default, nonlinear MPC controllers optimize their control move using thefminconfunction from the Optimization Toolbox. You can also specify your own custom nonlinear solver. - Trajectory Optimization and Control of Flying Robot Using Nonlinear MPC
You can use nonlinear MPC for both optimal trajectory planning and closed-loop control applications. - Landing a Vehicle Using Multistage Nonlinear MPC
Plan an optimal rocket lander trajectory and perform closed-loop control of landing process using multistage nonlinear MPC.
Feedback Control
- Nonlinear Model Predictive Control of Exothermic Chemical Reactor
Control a nonlinear plant as it transitions between operating points. - Swing-Up Control of Pendulum Using Nonlinear Model Predictive Control
Achieve swing-up and balancing control of an inverted pendulum on a cart using a nonlinear model predictive controller. - Nonlinear and Gain-Scheduled MPC Control of an Ethylene Oxidation Plant
You can generate one or more linear MPC controllers from a nonlinear MPC controller and use these controllers for gain-scheduled control applications. - Optimization and Control of Fed-Batch Reactor Using Nonlinear MPC
Simulate nonlinear MPC controller as adaptive and time-varying MPC controller, and compare performance.
Optimal Planning
- Optimizing Tuberculosis Treatment Using Nonlinear MPC with Custom Solver
You can use nonlinear MPC controllers for optimal planning applications that require a nonlinear model with nonlinear costs or constraints. - Generate Code to Plan and Execute Collision-Free Trajectories Using KINOVA Gen3 Manipulator
Use nonlinear MPC to plan and execute trajectories for a robot manipulator.
Economic MPC
- Economic MPC
Economic model predictive controllers optimize control actions to satisfy generic economic or performance cost functions. - Economic MPC Control of Ethylene Oxide Production
Maximize production of an ethylene oxide plant for profit using a nonlinear cost function and nonlinear constraints.
Use Neural and Grey-Box Prediction Models
- Control House Heating Using Nonlinear MPC with Neural State-Space Prediction Model
Design a Multistage MPC controller using a neural state space prediction model. - Swing-Up Control of Pendulum Using Multistage Nonlinear MPC with Nonlinear Grey-Box Model
Design a Multistage MPC controller using a nonlinear grey-box prediction model.
Passivity-Based MPC
- Control Robot Manipulator Using Passivity-Based Nonlinear MPC
Enforce stability of a robotic manipulator by implementing passivity-based constraints in a nonlinear MPC controller. - Control Quadruple-Tank Using Passivity-Based Nonlinear MPC
Control a system of four water tanks using passivity-based MPC.






