You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported by ahaumer on 26 Jun 2013 13:48 UTC
It seems quite dangerous to define the quantities of sensor outputs, at least Dymola shows an ERROR with the enclosed example, although Voltage and PotentialDifference are the same (ElectricPotential).
On the other hand, is Dymola's check too strict?
package Test
model Test
extends Modelica.Electrical.Analog.Interfaces.TwoPin;
Modelica.Electrical.Analog.Sensors.VoltageSensor voltageSensor
annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
Bus bus annotation (Placement(transformation(extent={{-20,-120},{20,-80}})));
equation
connect(p, voltageSensor.p) annotation (Line(
points={{-100,0},{-10,0}},
color={0,0,255},
smooth=Smooth.None));
connect(voltageSensor.n, n) annotation (Line(
points={{10,0},{100,0}},
color={0,0,255},
smooth=Smooth.None));
connect(voltageSensor.v, bus.v) annotation (Line(
points={{0,-10},{0,-100}},
color={0,0,127},
smooth=Smooth.None), Text(
string="%second",
index=1,
extent={{6,3},{6,3}}));
end Test;
expandable connector Bus
extends Modelica.Icons.SignalBus;
Modelica.SIunits.Voltage v;
end Bus;
annotation (uses(Modelica(version="3.2.1")));
end Test;
Comment by otter on 27 Jun 2013 11:37 UTC
Fixed in f319d15:
According to the suggestion in the Unit chapter of the Modelica specification, quantities must be identical and units must be decomposable in the same base units in order that two variables can be connected together.
This is also carefully taken care off in Modelica.SIunits and the rest of MSL. For example Modelica.SIunits.Position/Length/Distance/Height/Distance etc. all have the same quantity: "Length".
The issue above just shows that there is a bug in MSL and Dymola detects it from your test model:
In Modelica.SIunits only the quantity "ElectricPotential" is defined. But at a few places in MSL, also the quantity "PotentialDifference" is used (as explicit quantity definition). This is wrong and I replaced these quantities by "ElectricPotential".
Reported by ahaumer on 26 Jun 2013 13:48 UTC
It seems quite dangerous to define the quantities of sensor outputs, at least Dymola shows an ERROR with the enclosed example, although Voltage and PotentialDifference are the same (ElectricPotential).
On the other hand, is Dymola's check too strict?
Migrated-From: https://trac.modelica.org/Modelica/ticket/1180
The text was updated successfully, but these errors were encountered: