リレーを構築しようとしていますが、意味をなさないエラーが常に発生します。
エラーは、地面オブジェクトが見つからないか、コンポーネントが接続されていないことを示し
ていますが、見つからないものは見つかりません。
リレーをさまざまな方法で構築しようとしましたが、常に同じエラーが発生します...
リレーをテストするための私のクラス:
model test
Relay relay annotation (Placement(transformation(extent={{-20,4},{0,24}})));
ConstantVoltage constantVoltage annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=-90,
origin={-74,10})));
ConstantVoltage constantVoltage1 annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=-90,
origin={52,12})));
Modelica.Electrical.Analog.Basic.Ground ground
annotation (Placement(transformation(extent={{-42,-30},{-22,-10}})));
equation
connect(relay.n1, constantVoltage.n) annotation (Line(
points={{-20,9},{-46,9},{-46,0},{-74,0}},
color={0,0,255},
smooth=Smooth.None));
connect(constantVoltage.p, relay.p1) annotation (Line(
points={{-74,20},{-48,20},{-48,19},{-20,19}},
color={0,0,255},
smooth=Smooth.None));
connect(relay.n1, ground.p) annotation (Line(
points={{-20,9},{-26,9},{-26,-10},{-32,-10}},
color={0,0,255},
smooth=Smooth.None));
connect(relay.p2, constantVoltage1.p) annotation (Line(
points={{0,19},{26,19},{26,22},{52,22}},
color={0,0,255},
smooth=Smooth.None));
connect(constantVoltage1.n, relay.n2) annotation (Line(
points={{52,2},{26,2},{26,9},{0,9}},
color={0,0,255},
smooth=Smooth.None));
connect(ground.p, relay.n2) annotation (Line(
points={{-32,-10},{-16,-10},{-16,9},{0,9}},
color={0,0,255},
smooth=Smooth.None));
annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,
-100},{100,100}}), graphics));
end test;
リレー クラス: 非常に単純です。v1 を見るだけです。電圧が正の場合、リレーは電流を通す必要があります。
model Relay
extends Modelica.Electrical.Analog.Interfaces.TwoPort;
Boolean off;
equation
off = v1 < 0;
v2 = if off then 0 else v2;
i2 = if off then 0 else i2;
annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,
-100},{100,100}}), graphics));
end Relay;
エラーログ:
Check of MTS.test:
The model has the same number of unknowns and equations: 27
The problem is structurally singular.
It has 27 scalar unknowns and 27 scalar equations.
The Real part has 26 unknowns and 26 equations.
The Integer part has 0 unknowns and 0 equations.
The Boolean part has 1 unknowns and 1 equations.
The String part has 0 unknowns and 0 equations.
Attempting to further localize singularity.
Singularity of MTS.test is at the top level.
The model MTS.test is structurally singular.
The problem is structurally singular for the element type Real.
The number of scalar Real unknown elements are 26.
The number of scalar Real equation elements are 26.
The model includes the following hints:
An electrical current cannot be uniquely calculated.
The reason could be that
- a ground object is missing (Modelica.Electrical.Analog.Basic.Ground)
to define the zero potential of the electrical circuit, or
- a connector of an electrical component is not connected.
The problem has no elements of type Integer.
The problem is structurally regular for the element type Boolean.
The number of scalar Boolean elements are 1.
The problem has no elements of type String.
ERROR: 2 errors were found
WARNING: 2 warnings were issued