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;