Cost function for MPC controller in Simulink

20 vues (au cours des 30 derniers jours)
Raj Kumar Muniyandi
Raj Kumar Muniyandi le 4 Avr 2019
Hey guys !
I am working on designing a mpc controller using the MPC controller simulink block !
But i don't know where to define the cost function for the optimizer ?
  3 commentaires
jana nassereddine
jana nassereddine le 28 Mar 2023
yes, please, same question
akram amri
akram amri le 10 Fév 2024
Déplacé(e) : Walter Roberson le 12 Fév 2024
Did you solve the problem? If so, can you please give me the code?

Connectez-vous pour commenter.

Réponses (2)

Jordan Olson
Jordan Olson le 12 Fév 2024
The cost function for the MPC is defined within the MPC object that's provided as a parameter of the Simulink block, not on the Simulink block itself.
For linear and adaptive MPC, a standard linear cost function is used. You tune the cost function by modifying various weights using any of the following methods:
  • Modify controller weights in MATLAB, as discussed here
  • Enable online tuning weights in the block parameters of the MPC Controller block
  • [Linear MPC only] Tune weights interactively using the MPC Designer app (this app is opened when clicking the "Design" button in the block parameters of the MPC Controller block)
For nonlinear and nonlinear multistage MPC, you can specify a custom cost function (defined as a MATLAB function). The process for defining a custom cost function for nonlinear MPC is defined here.

akram amri
akram amri le 12 Fév 2024
When I run MPC code to control an asynchronous machine, I get this type of error "global declaration not resolved to a data store memory block registered via the ports and data manager" What should I do?
  1 commentaire
Jordan Olson
Jordan Olson le 12 Fév 2024
This issue seems unrelated to the original MPC question. Please consult a different MATLAB Answers thread or contact Technical Support.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Model Predictive Control Toolbox dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by