Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#3358 closed defect (fixed)

Strange discrete behavior in algorithms

Reported by: Lennart Ochel Owned by: Lennart Ochel
Priority: high Milestone: 1.9.4
Component: Backend Version: trunk
Keywords: Cc:

Description (last modified by Lennart Ochel)

The following two models produces different simulation results:

model foo3
  Real x(fixed=true, start=0.0);
  Boolean b1, b2;
algorithm
  b1 := time > 0.5;
  b2 := time > 0.5;
  when b1 then
    x := pre(x) + 1;
  elsewhen b2 then
    x := pre(x) + 0.1;
  end when;
end foo3;
model foo3b
  Real x(fixed=true, start=0.0);
  Boolean b1, b2;
algorithm
  b2 := time > 0.5;
  b1 := time > 0.5;
  when b1 then
    x := pre(x) + 1;
  elsewhen b2 then
    x := pre(x) + 0.1;
  end when;
end foo3b;

The only difference is that the first two statements of the algorithm sections are swapped.

Change History (6)

comment:1 by Lennart Ochel, 9 years ago

Description: modified (diff)

comment:2 by Lennart Ochel, 9 years ago

Owner: changed from somebody to Lennart Ochel
Status: newaccepted

comment:3 by Lennart Ochel, 9 years ago

Fixed in 4d21eda/OMCompiler.

comment:4 by Lennart Ochel, 9 years ago

Resolution: fixed
Status: acceptedclosed

comment:5 by Dietmar Winkler, 9 years ago

Milestone: Futurepre1.9.4

It doesn't make sense to keep closed ticket in the "Future" milestone that were simply forgotten to assign to the correct milestone in the past.

comment:6 by Martin Sjölund, 7 years ago

Milestone: pre1.9.41.9.4

Removing the pre1.9.4 milestone in favor of 1.9.4.

Note: See TracTickets for help on using tickets.