Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quantities of sensor outputs #1180

Closed
modelica-trac-importer opened this issue Jan 14, 2017 · 4 comments
Closed

Quantities of sensor outputs #1180

modelica-trac-importer opened this issue Jan 14, 2017 · 4 comments
Assignees
Labels
bug Critical/severe issue P: highest Highest priority issue
Milestone

Comments

@modelica-trac-importer
Copy link

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;

Migrated-From: https://trac.modelica.org/Modelica/ticket/1180

@modelica-trac-importer modelica-trac-importer added this to the MSL3.2.1 milestone Jan 14, 2017
@modelica-trac-importer modelica-trac-importer added bug Critical/severe issue P: highest Highest priority issue labels Jan 14, 2017
@modelica-trac-importer
Copy link
Author

Comment by beutlich on 26 Jun 2013 13:54 UTC
This is a follow-up of #830, #872 and #876.

@modelica-trac-importer
Copy link
Author

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".

@modelica-trac-importer
Copy link
Author

Modified by otter on 27 Jun 2013 11:37 UTC

@modelica-trac-importer
Copy link
Author

Modified by dietmarw on 18 Jul 2013 11:28 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Critical/severe issue P: highest Highest priority issue
Projects
None yet
Development

No branches or pull requests

2 participants