Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#4737 closed defect (invalid)

Badly displayed transformer model

Reported by: ceraolo Owned by: adeas31
Priority: high Milestone: 1.13.0
Component: OMEdit Version:
Keywords: Cc:

Description

The MSL model Electrical.Analog.Basic.Transformer is badly displayed by OMEdit: the connectors are placed far from the related wires.

I did not check the code to verify whether this is an OM or MSL issue.
However since the transformer model has been in the MSL for years, I suspect that this is a OM issue.

Note that Dymola shows the transformer correctly.

Tested with OM v1.13.0-dev-380-g8b177b9 (WIN-64-bit)

Attachments (2)

transf.svg (25.6 KB) - added by ceraolo 6 years ago.
transf.2.svg (25.6 KB) - added by ceraolo 6 years ago.

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by ceraolo

Changed 6 years ago by ceraolo

comment:1 Changed 6 years ago by adeas31

  • Resolution set to invalid
  • Status changed from new to closed

OpenModelica's TwoPort model,

partial model TwoPort
  "Component with two electrical ports, including current"
  SI.Voltage v1 "Voltage drop over port 1";
  SI.Voltage v2 "Voltage drop over port 2";
  SI.Current i1 "Current flowing from pos. to neg. pin of port 1";
  SI.Current i2 "Current flowing from pos. to neg. pin of port 2";
  PositivePin p1
    "Positive pin of port 1 (potential p1.v > n1.v for positive voltage drop v1)" annotation (Placement(
        transformation(extent={{-110,90},{-90,110}}), iconTransformation(extent={{-110,90},{-90,110}})));
  NegativePin n1 "Negative pin of port 1" annotation (Placement(
        transformation(extent={{-90,-110},{-110,-90}}), iconTransformation(extent={{-90,-110},{-110,-90}})));
  PositivePin p2
    "Positive pin of port 2 (potential p2.v > n2.v for positive voltage drop v2)" annotation (Placement(
        transformation(extent={{110,90},{90,110}}), iconTransformation(extent={{110,90},{90,110}})));
  NegativePin n2 "Negative pin of port 2" annotation (Placement(
        transformation(extent={{90,-110},{110,-90}}), iconTransformation(extent={{90,-110},{110,-90}})));
equation
  v1 = p1.v - n1.v;
  v2 = p2.v - n2.v;
  0 = p1.i + n1.i;
  0 = p2.i + n2.i;
  i1 = p1.i;
  i2 = p2.i;
  annotation (
    Diagram(coordinateSystem(
        preserveAspectRatio=true,
        extent={{-100,-100},{100,100}}), graphics={
        Polygon(
          points={{-120,53},{-110,50},{-120,47},{-120,53}},
          lineColor={160,160,164},
          fillColor={160,160,164},
          fillPattern=FillPattern.Solid),
        Line(points={{-136,50},{-111,50}}, color={160,160,164}),
        Polygon(
          points={{127,-47},{137,-50},{127,-53},{127,-47}},
          lineColor={160,160,164},
          fillColor={160,160,164},
          fillPattern=FillPattern.Solid),
        Line(points={{111,-50},{136,-50}}, color={160,160,164}),
        Text(
          extent={{112,-44},{128,-29}},
          lineColor={160,160,164},
          textString="i2"),
        Text(
          extent={{118,52},{135,67}},
          lineColor={0,0,0},
          textString="i2"),
        Polygon(
          points={{120,53},{110,50},{120,47},{120,53}},
          lineColor={0,0,0},
          fillPattern=FillPattern.HorizontalCylinder,
          fillColor={160,160,164}),
        Line(points={{111,50},{136,50}}),
        Line(points={{-136,-49},{-111,-49}}, color={160,160,164}),
        Polygon(
          points={{-126,-46},{-136,-49},{-126,-52},{-126,-46}},
          lineColor={160,160,164},
          fillColor={160,160,164},
          fillPattern=FillPattern.Solid),
        Text(
          extent={{-127,-46},{-110,-31}},
          lineColor={160,160,164},
          textString="i1"),
        Text(
          extent={{-136,53},{-119,68}},
          lineColor={160,160,164},
          textString="i1")}),
    Documentation(revisions="<html>
<ul>
<li><i> 1998   </i>
     by Christoph Clauss<br> initially implemented<br>
     </li>
</ul>
</html>", info="<html>
<p>TwoPort is a partial model that consists of two ports. Like OnePort each port has two pins. It is assumed that the current flowing into the positive  pin   is identical to the current flowing out of pin n. This currents of each port are  provided explicitly as currents i1 and i2, the voltages respectively as v1 and v2.</p>
</html>"));
end TwoPort;

Dymola's TwoPort model,

partial model TwoPort
  "Component with two electrical ports, including current"
  SI.Voltage v1 "Voltage drop over the left port";
  SI.Voltage v2 "Voltage drop over the right port";
  SI.Current i1 "Current flowing from pos. to neg. pin of the left port";
  SI.Current i2 "Current flowing from pos. to neg. pin of the right port";
  PositivePin p1
    "Positive pin of the left port (potential p1.v > n1.v for positive voltage drop v1)" annotation (Placement(
        transformation(extent={{-110,40},{-90,60}})));
  NegativePin n1 "Negative pin of the left port" annotation (Placement(
        transformation(extent={{-90,-60},{-110,-40}})));
  PositivePin p2
    "Positive pin of the right port (potential p2.v > n2.v for positive voltage drop v2)" annotation (Placement(
        transformation(extent={{110,40},{90,60}})));
  NegativePin n2 "Negative pin of the right port" annotation (Placement(
        transformation(extent={{90,-60},{110,-40}})));
equation 
  v1 = p1.v - n1.v;
  v2 = p2.v - n2.v;
  0 = p1.i + n1.i;
  0 = p2.i + n2.i;
  i1 = p1.i;
  i2 = p2.i;
  annotation (
    Diagram(coordinateSystem(
        preserveAspectRatio=true,
        extent={{-100,-100},{100,100}}), graphics={
        Polygon(
          points={{-120,53},{-110,50},{-120,47},{-120,53}},
          lineColor={160,160,164},
          fillColor={160,160,164},
          fillPattern=FillPattern.Solid),
        Line(points={{-136,50},{-111,50}}, color={160,160,164}),
        Polygon(
          points={{127,-47},{137,-50},{127,-53},{127,-47}},
          lineColor={160,160,164},
          fillColor={160,160,164},
          fillPattern=FillPattern.Solid),
        Line(points={{111,-50},{136,-50}}, color={160,160,164}),
        Text(
          extent={{112,-44},{128,-29}},
          lineColor={160,160,164},
          textString="i2"),
        Text(
          extent={{118,52},{135,67}},
          lineColor={0,0,0},
          textString="i2"),
        Polygon(
          points={{120,53},{110,50},{120,47},{120,53}},
          lineColor={0,0,0},
          fillPattern=FillPattern.HorizontalCylinder,
          fillColor={160,160,164}),
        Line(points={{111,50},{136,50}}),
        Line(points={{-136,-49},{-111,-49}}, color={160,160,164}),
        Polygon(
          points={{-126,-46},{-136,-49},{-126,-52},{-126,-46}},
          lineColor={160,160,164},
          fillColor={160,160,164},
          fillPattern=FillPattern.Solid),
        Text(
          extent={{-127,-46},{-110,-31}},
          lineColor={160,160,164},
          textString="i1"),
        Text(
          extent={{-136,53},{-119,68}},
          lineColor={160,160,164},
          textString="i1")}),
    Documentation(revisions="<html>
<ul>
<li><i> 1998   </i>
       by Christoph Clauss<br> initially implemented<br>
       </li>
</ul>
</html>",
        info="<html>
<p>TwoPort is a partial model that consists of two ports. Like OnePort each port has two pins. It is assumed that the current flowing into the positive  pin   is identical to the current flowing out of pin n. This currents of each port are  provided explicitly as currents i1 and i2, the voltages respectively as v1 and v2.</p>
</html>"));
end TwoPort;

OpenModelica is using the latest MSL and seems like Dymola is using a bit older.

See the difference between the annotations of PositivePin and NegativePin. It is MSL issue so you need to open a ticket on Modelica trac or github.

comment:2 Changed 6 years ago by ceraolo

I just opened ticket #2456 on github.

comment:3 Changed 6 years ago by ceraolo

Ehm...
Indeed the issue has been solved in a perfect way in Modelica trunk.
I've already closed ticket #2456 on github.

Note: See TracTickets for help on using tickets.