Hi I have some puzzles about event and when in Modelica. Below is my code:
model test
Integer bar(start=5, fixed=true);
equation
when (time < 2) then
bar = 1;
end when;
annotation(experiment(StopTime=3));
end test;
My question is why I got 5 instead of 1 when time is less than 2? How can I understand the event(time < 2) in this case? What is the difference of when clause in Modelica and other programming language, like c.