Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2363 closed defect (fixed)

smooth operator is removed for order 0

Reported by: Willi Braun Owned by: Per Östlund
Priority: high Milestone: 1.9.0
Component: Frontend Version: trunk
Keywords: Cc: Niklas Worschech

Description

The smooth operator is removed in the frontend, if the order is 0.
It should decide in the backend if such expressions should generate
zero-crossing or not.

For example

loadString("
model A
  Real u = sin(time);
  output Real y;
equation
  y = smooth(0, if u > 0.7 then 0.7 else if u < 0.2 then 0.2 else u);
end A;
");
getErrorString();
instantiateModel(A);

results in

true
""
"class A
  Real u = sin(time);
  output Real y;
equation
  y = if u > 0.7 then 0.7 else if u < 0.2 then 0.2 else u;
end A;
"

Change History (3)

comment:1 by Per Östlund, 11 years ago

Owner: changed from somebody to Per Östlund
Status: newassigned

comment:2 by Adrian Pop, 11 years ago

Resolution: fixed
Status: assignedclosed

Fixed in r17388.
Note that Modelica.Electrical.Analog.Examples.SimpleTriacCircuit give small differences compared with Dymola (i used the OpenModelica result file for now).
Willi, please investigate this.

comment:3 by Willi Braun, 11 years ago

Adrian, I think that's okay, the model has now fewer events and so resolution of evaluation is a bit different, but the basic trajectories are equal. May be we need an engineer, who can decide such things.

Note: See TracTickets for help on using tickets.