Error loading the initial state for the Multiple MPC contoller block

10 views (last 30 days)
Hi everyone,
After designing two linear MPCs for different operating points of a simulink model, I am attempting to combine them using the 'multiple MPC controller' block. However, the following message appears upon compiling:
Error loading the initial state for model 'BasicModel'. Unable to find a matching block state corresponding to element 3 of signals structure array
Component: Simulink | Category: Block error
To check the initial states work, I replaced the 'multiple MPC controller' with single MPC version and the model ran without error. It means the error comes entirely from having the multiple MPC block. I am not sure how to debug with this error message. Does anyone have experience on the multiple MPC block that knows how to solve this problem?
At the moment I put empty vectors in the 'initial controller states' as Mathworks website states that it means initializing with the nominal settings of the MPCs, which worked fine for the single MPC case. Is that possibly the source of this problem?
Many thanks, Michael

Answers (1)

usermatlabsimulink
usermatlabsimulink on 23 Dec 2014
Edited: usermatlabsimulink on 23 Dec 2014
Hello Michael, I had a similar problem but with the single MPC block. I had to create in command line an object for the controller (MPCobj), an another object (xmpc) using the function mpcstate. In initial state field in the simulink block, I call the state and the controller.
if true
% code
xp = [0, 0, 0, 0, 0, 0]; %vector with mi initial state
xd = [0 0 0 0];
xn = [];
u = ue; %vector with my previous move of the controller before starting
xmpc = mpcstate(MPCobj,xp,xd,xn,u);
end
Maybe the reference manual can help you:
http://www.mathworks.com/matlabcentral/answers/www.mathworks.es/help/pdf_doc/mpc/mpc_ref.pdf
Cheers

Community Treasure Hunt

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

Start Hunting!