use a linear state space model in NLMPC
5 views (last 30 days)
Show older comments
I have an mpcobj MPC controller. Now I want to use NLMPC to optimize a custom cost function. How do I incorporate my linear state space model into NLMPC? Seems like there should be a companion to convertToMPC, i.e. convertToNLMPC.
0 Comments
Answers (1)
Emmanouil Tzorakoleftherakis
on 25 Sep 2023
Is there a reason you want to convert to nonlinear MPC? If you get a good solution with linear MPC, going to nonlinear will only make your problem larger and slower to solve.
Regardless, the following page provides information on how to create the prediction model for nonlinear MPC:
1 Comment
Lane Desborough
on 26 Sep 2023
I'm using a custom cost function, which hasn't been supported in linear mpc since R2018a :-(
Everything else about my plant / disturbances is linear.
I finally figured out how to implement a linear plant etc using nlmpc and you're right, it is much slower. I also re-installed R2018a and got it to run using the linear mpc with a custom cost function.
I'm basically controlling a Wiener system. Per the R2018a documentation, "A quadratic cost function is adequate for tracking specified output and manipulated variable references. However, some applications can require optimizing for different criteria, such as a combination of linear or nonlinear functions of the system states and inputs. Such applications include using fuel consumption maps in an engine control problem and supporting Wiener models where the output is a nonlinear function of the states. "
See Also
Categories
Find more on Model Predictive Control Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!