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

32 次查看(过去 30 天)
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

回答(1 个)

Mingkai Wang
Mingkai Wang 2019-11-4
编辑:Mingkai Wang 2019-11-4
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

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by