1
以下Modelica软件包 - 虽然既不特别有用也不感兴趣 - 不会产生任何警告。Modelica:混合连接器和直接输入
package P
connector C
Real c;
end C;
model A
input C x;
output Real y;
equation
y = x.c;
end A;
model B
input C inp;
output C out;
A a;
equation
a.x = inp;
out.c = a.y;
end B;
end P;
然而,当A
不使用连接器,如以下的情况下,还有一个警告:以下输入缺少的结合方程:a.x
。显然,对于a.x
有一个约束方程。为什么会有这样的警告?
package P
connector C
Real c;
end C;
model A
input Real x;
output Real y;
equation
y = x;
end A;
model B
input C inp;
output C out;
A a;
equation
a.x = inp.c;
out.c = a.y;
end B;
end P;