Cost-function in MPC toolbox

Hello everyone,
I want to use the MPC toolbox in MATLAB 2021b and design my controller and then convert it into Simulink to test my model. Finally, I want to implement my MPC in a Real-time simulator that is compatible with MATLAB 2014b.
Firstly, I am so thankful if you let me know if the MPC codes generated by MATLAB 2021b are compatible with MATLAB 2014b or not. If not I have to write my own MPC code in MATLAB 2014b.
Then, I want to work with the MPC toolbox in MATLAB 2021b, but there is no room for entering the cost function. I import a simple system and defined the weights and constraints. However, I didn't figure out how I can define my quadratic cost function.
Finally, I am thankful if you let me know how in the MPC toolbox I can define variable states matrixes (A, B, C). The equations of the system are linear. But, at each time interval, I should update the A, B, and C of the state-space matrix.
Best regards
Mohammad

Réponses (0)

Question posée :

le 10 Avr 2023

Community Treasure Hunt

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

Start Hunting!

Translated by