谁能解释一下为什么在WindowsV1.9.1 beta2中编译和模拟的下列openmodelica模型中的初始条件得到了适当的处理,但是如果第5行被注释并且6未注释的(x,y)被初始化为(0.5,0)?谢谢。
class Pendulum "Planar Pendulum"
constant Real PI = 3.141592653589793;
parameter Real m = 1,g = 9.81,L = 0.5;
Real F "Force of the Rod";
output Real x(start=L*sin(PI/4)) ,y(start=-0.35355);
//output Real x(start = L * sin(PI / 4)), y(start=-L*sin(PI/4));
output Real vx,vy;
equation
m * der(vx) = -x / L * F;
m * der(vy) = (-y / L * F) - m * g;
der(x) = vx;
der(y) = vy;
x ^ 2 + y ^ 2 = L ^ 2;
end Pendulum;发布于 2014-05-21 17:32:15
简短的答案是,初始值仅被视为提示,您必须添加fixed=true属性来强制它们,如下所示:
output Real x(start=L*cos(PI/4),fixed=true);如果初始化变量是受约束的,则不应在所有初始化变量上使用fixed属性,而应在“正确”子集上使用,在本例中仅在一个子集上使用。
长长的答案可以在here找到
https://stackoverflow.com/questions/23762340
复制相似问题