-
Notifications
You must be signed in to change notification settings - Fork 44
Description
Consider the following MWE, courtesy of @AnHeuermann (OpenModelica/OpenModelica#7484):
model algorithmTest
Real x;
algorithm
x := sin(time);
if x < 0 then // <-- relation 1
x := 0;
end if;
x := cos(time);
if x < 0 then // <-- relation 2
x := 0;
end if;
x := pi;
end algorithmTest;Is this supposed to generate events every when relation 1 changes, when relation 2 changes, when any of the two change, or never?
I read Section 8.5 which doesn't explicitly mention event generation inside algorithms, though the last example features a (time) event generating expression inside an algorithm section. Section 11.1.2 says
An algorithm section is treated as an atomic vector-equation, which is sorted together with all other
equations. For the sorting process (BLT), every algorithm section with N different left-hand side variables,
is treated as an atomic N-dimensional vector-equation containing all variables appearing in the algorithm
section. This guarantees that all N equations end up in an algebraic loop and the statements of the
algorithm section remain together.
but it doesn't explain how events should be handled.
Is there any consensus on when events should be generated in the reported MWE?