can I use Model Predictive Controller in Simulink and coding in script at the same time? using MATLAB

2 views (last 30 days)
Hello,
so i have a question, I have Model Predictive Controller in Simulink and also i have to add some new constraints and cost function that are not added by the MPC, so i have to write them in script;
my question is: can i use the simulink and coding for model predictive controller at the same time, or should I just use coding?;
i remember last year someone form matlab answered and said that they are working to make the MPC working in parallel by simulink and script.
thanks in advance

Answers (1)

Satwik
Satwik on 28 Mar 2024
Hello,
To my knowledge, defining custom constraints and cost functions is only possible in Nonlinear MPC (NLMPC) and not in Linear MPC. So, if you are using a NLMPC to serve the purpose of your project, you can go ahead and add custom constraints and cost functions using the steps provided in the following documentation:
Additionally, I recommend you have a look at this MATLAB Central discussion:
It could help you formulate a possible workaround on using custom constraints even in Linear MPC.This discussion also provides some insights into the merits and demerits of NLMPC versus Linear MPC.
Hope this helps!

Categories

Find more on Model Predictive Control Toolbox in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!