Current version of the modelica translator can only handle array of components with fixed size

走远了吗. 提交于 2020-01-11 11:52:08

问题


I created an part with the AC library, and when I was trying to simulate the model, there is an error says "Current version of the modelica translator can only handle array of components with fixed size".

Not sure what is the meaning of it, and is there anyone has the same issue like this one?

Thank you

enter image description here


回答1:


Consider the following simple model:

model M
  parameter Integer n(start=3, fixed=false);
initial algorithm
  n := n;
end M;

It has a parameter n which can be changed before simulation starts. And array dimensions need to be parameter expressions. So you would think that the following model would be legal:

model M2
  Real arr[n] = fill(1, n);
  parameter Integer n(start=3, fixed=false);
initial algorithm
  n := n;
end M2;

But it isn't since Modelica tools will expand the number of equations and variables to get a fixed number. (According to the language specification, n is a structural parameter; it is not well defined what restrictions these have - most Modelica tools seem to require them to behave like constants which means only fixed=true parameters with a binding equation that depends only on other structural parameters or constants).



来源:https://stackoverflow.com/questions/35907544/current-version-of-the-modelica-translator-can-only-handle-array-of-components-w

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!