operspec error: the simulation inputs must be specified as a vector of doubles

33 views (last 30 days)
Hello,
I am currently trying to build a MPC simulink model following https://www.mathworks.com/help/mpc/ug/adaptive-mpc-control-of-nonlinear-chemical-reactor-using-successive-linearization.html, which relies on the "operspec" function.
I have encountered an error which says that " the simulation inputs must be specified as a vector of doubles" (See attached screen shots)
However, I have ensured that all the input to "operspec" are doubles. (see attached)
Does anyone know how I can resolve this problem?
The full model can be found on Github: https://github.com/christeefy/ECOstudioMPC, the offending file is AdaptiveInitBuilding.m
Thanks and god bless

Answers (1)

Mingkai Wang
Mingkai Wang on 4 Nov 2019
Edited: Mingkai Wang on 4 Nov 2019
Hi Bolin,
Sorry the previous explanation is not the reason. I found a "divided-by-zero" bug in my model, which hurts the calculation. The structure variable in the lookup table always gets a warning - It's actually innocent in terms of the calculation. Good luck!
Best
-------------------------------------------------------------------------------------------------------------------------------
I had the same problem. I finally got my model running by removing the structure variable in the model's lookup table block. I think this kind of variables cause trouble when calculating the derivatives during the trim or operation-point-finding. Maybe this could help.
Best

Categories

Find more on Modeling 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!