I have been facing some problem with Modelica initialisation. I want to simulate the initial step of a finite state machine and I would like the initial state to start from false and instantly turns to true at the beginning of the simulation.
equation
OUTPUT=active;
algorithm
when change(INPUT) then X:= not X; reinit(t,0); end when;
initial algorithm
active:=true;
Here is the code. Variable INPUT, OUTPUT and X are all Boolean type. INPUT is a variable that makes the state changes ( from true to false and vice versa).
What the code does is to set variable active to true at the initialisation. What I would like to get is that it starts from false and it gets to true at time t=0; basically I would like to see the transition from false to true at the first instant of the simulation. Is it possible?
