Opened 12 years ago
Closed 12 years ago
#2114 closed defect (fixed)
strange behavior of event iteration
Reported by: | Lennart Ochel | Owned by: | Willi Braun |
---|---|---|---|
Priority: | high | Milestone: | 1.9.0 |
Component: | Backend | Version: | trunk |
Keywords: | Cc: | Lennart Ochel |
Description
model test Boolean b[2]; Boolean vec[2]; Boolean ac; equation vec = b; b[1] = time < 0.25 or time > 0.75; b[2] = time < 0.5; when ac then .Modelica.Utilities.Streams.print("foo\n",""); end when; algorithm ac := false; for i in 1:2 loop ac := ac or change(vec[i]); end for; end test;
produces the following error during simulation
assert | assert | ERROR: Too many event iterations. System is inconsistent. Simulation terminate.
and prints "foo\n" a lot of times. That is probably because of the wrong event handling for this model.
Change History (3)
comment:1 by , 12 years ago
Status: | new → accepted |
---|
comment:2 by , 12 years ago
The following model demonstrates the effect, and has a lot wrong memory access,
what could be observed by valgrind.
model t1 Boolean b[3]; equation for i in 2:3 loop b[i] = time>0.1+i/10; end for; algorithm b[1] := false; for i in 2:3 loop b[1] := b[1] or change(b[i]); end for; end t1;
Note:
See TracTickets
for help on using tickets.
It's not event handling, it's our code generation for pre-variables in for loop has a wrong index, so that in the example above for $PRE$Pvec values is $PRE$Pac as value taken.