﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3309	A case of Assert malfunctioning?	massimo ceraolo		"The small package below shows what I presume is an OM (r25870) issue regarding assert. 

Run “AssertGood”:  the sentence “*** AssertMessage ***” is correctly displayed.
Run “AssertWrong”:  the sentence “*** AssertMessage ***” is NOT displayed.




{{{
package TestAssert
  model AssertWrong

    TestLoad resistor annotation(Placement(visible = true, transformation(extent = {{-50, -10}, {-30, 10}}, rotation = 0)));
    Modelica.Electrical.Analog.Sources.TableCurrent tableCurrent(table = [0, 1; 10, 1; 10, 110; 200, 110; 200, 0]) annotation(Placement(visible = true, transformation(origin = {28, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 270)));
    Modelica.Electrical.Analog.Basic.Ground ground annotation(Placement(visible = true, transformation(extent = {{-10, -48}, {10, -28}}, rotation = 0)));
  equation 
    connect(resistor.n, ground.p) annotation(Line(points = {{-30, -6.1}, {-29.9, -6.1}, {-29.9, -28}, {0, -28}}, color = {0, 0, 255}));
    connect(tableCurrent.p, resistor.p) annotation(Line(points={{28,10},{28,10},
            {28,20},{-30,20},{-30,5.9},{-29.9,5.9}},                                                                            color = {0, 0, 255}));
    connect(tableCurrent.n, ground.p) annotation(Line(points = {{28, -10}, {28, -28}, {0, -28}}, color = {0, 0, 255}));
    annotation(experiment(StopTime = 500, NumberOfIntervals = 5000), Diagram(coordinateSystem(extent = {{-80, -60}, {80, 60}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})), Icon(coordinateSystem(extent = {{-80, -60}, {80, 60}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})));
  end AssertWrong;

  model AssertGood

    TestLoad resistor annotation(Placement(visible = true, transformation(extent = {{-50, -10}, {-30, 10}}, rotation = 0)));
    Modelica.Electrical.Analog.Basic.Ground ground annotation(Placement(visible = true, transformation(extent = {{-10, -48}, {10, -28}}, rotation = 0)));
    Modelica.Electrical.Analog.Sources.ConstantCurrent constCurrent(I = 120) annotation(Placement(visible = true, transformation(origin = {22, 0}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  equation 
    connect(constCurrent.n, ground.p) annotation(Line(points = {{22, -10}, {22, -28}, {0, -28}}, color = {0, 0, 255}));
    connect(constCurrent.p, resistor.p) annotation(Line(points={{22,10},{22,20},
            {-29.9,20},{-29.9,5.9}},                                                                        color = {0, 0, 255}));
    connect(resistor.n, ground.p) annotation(Line(points = {{-30, -6.1}, {-29.9, -6.1}, {-29.9, -28}, {0, -28}}, color = {0, 0, 255}));
    annotation(experiment(StopTime = 500, NumberOfIntervals = 5000), Diagram(coordinateSystem(extent = {{-80, -60}, {80, 60}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})), Icon(coordinateSystem(extent = {{-80, -60}, {80, 60}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})));
  end AssertGood;

  model TestLoad

    Modelica.Electrical.Analog.Basic.Resistor R0(final R = 1e-4) annotation(Placement(transformation(origin = {24, 60}, extent = {{-10, -10}, {10, 10}}, rotation = 180)));
    Modelica.Electrical.Analog.Interfaces.Pin p annotation(Placement(transformation(extent = {{90, 50}, {110, 70}}), iconTransformation(extent = {{91, 49}, {111, 69}})));
    Modelica.Electrical.Analog.Interfaces.NegativePin n annotation(Placement(transformation(extent = {{90, -70}, {110, -50}}), iconTransformation(extent = {{90, -71}, {110, -51}})));
    parameter Modelica.SIunits.Capacitance CBattery = 36000;
  equation 
    connect(R0.n, n) annotation(Line(points={{14,60},{6,60},{6,-58},{100,-58},{100,
            -60},{100,-60}},                                                                                     color = {0, 0, 255}));
    connect(R0.p, p) annotation(Line(points = {{34, 60}, {100, 60}, {100, 60}, {100, 60}}, color = {0, 0, 255}));
    assert(n.i < 100, ""*** AssertMessage ***\n"");
    annotation(Diagram(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}, initialScale = 0.1), graphics), Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2}), graphics={  Text(origin = {-12, 0}, lineColor = {0, 0, 255}, extent = {{-100, 150}, {100, 110}}, textString = ""%name""), Rectangle(origin = {-29, 0}, extent = {{-11, 30}, {9, -30}}), Line(origin = {31.7391, 42.8678}, points = {{-61.7391, -16.8678}, {62.2609, 17.1322}, {60.2609, 15.1322}}), Line(origin = {36, -44}, points = {{-64, 18}, {64, -18}})}));
  end TestLoad;
end TestAssert;

}}}
"	defect	closed	normal	1.9.3	Run-time	trunk	fixed		
