Opened 9 years ago

Last modified 7 years ago

#3358 closed defect

Strange discrete behavior in algorithms — at Version 1

Reported by: Lennart Ochel Owned by: somebody
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 (1)

comment:1 by Lennart Ochel, 9 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.