In the modelica specification, the modelica builtin operator reinit() can be equally used inside an algorithm or an equation section. However, the OpenModelica simulator is issuing a simulation error when I try to use the reinit() operator inside an algorithm section.
In fact, I'm trying to model a Hybrid Automaton Behavior in modelica. So, I'm using When-Statements to define the state machine. Each When-Branch of the When-Statement correponds to a transition in the original automaton. here is an example :
CODE
model toto
algorithm
when (x >= tmax) and (state == on) then
state := off;
reinit(x, expression1); // openModelica does not accept the reinit() operator : generates a simulation error
elsewhen (x <= tmin) and (state == off) then
state := on;
reinit(x, expression2);
end when;
equation
some equations...;
end toto;
So is the reinit() operator not supported in algorithm section in OpenModelica? or am I missing some thing?
Thank you.
