model try
Real x(start = 1);
algorithm
when x >= 7 then
reinit(x, 5);
end when;
equation
der(x) = 1 ;
end try;
The when statement should be triggered whenever the guard condition is changed from false to true.
But it is not the case in OpenModelica. The example try in OpenModelica showes that when is triggered only once. I was wondering whether it is the bug of OpenModelica or some misunderstanding from my side.
You are correct. I am pretty sure this would be a bug in OpenModelica. The model works as you would expect in Dymola 2013.
My guess is that it is related to the fact that your when condition involves
xand the statements inside end up changingx(the same variable). It may be that it somehow fails to notice the reinit in the monitor function used to determine the point at which the when clause should trigger.