During the simulation, the compuational functions will be called with a given flag
that corresponds to the task to be realized and with the event number by which it has been activated.
Flag 4: Initialization
This is done only once in the initialization phase for all blocks.
Input event numbers are not used in that case.
Outputs and states can be initialized.
Some blocks use also this flag to open files, to do allocation and initialization of the field block->work or initialize
graphic windows.
Flag 6: Initialization, fixed-point computation
Flag 6 is used to set constraints that must be satisfied at the initial
time. Scicos uses a fixed point computation scheme to force the
constraints so the blocks are called more than once with flag 6 at
time 0.
This is a special initialization technique for example to find the steady state of a system before running the simulation.
Input event numbers are not used in this case.
Flag 1: Output computation
The output computation can be performed many times in one time step of
the simulation in particular when the diagram contains blocks
that use both discrete and continuous states and zero crossing surfaces.
In the current version of Scicos all blocks are called with flag = 1 at least once in every simulation time step,
even if they don't have any outputs.
Flag 2: Discrete state computation
If blocks use states, this flag is when the state registers
block->x, block->z, block->oz, block->work
must be set during discrete activation (with block->nevptr0)
but also to compute block->x in the case of activation due to an
internal zero crossing, in which case the input event number block->nevptr will be -1.
Flag 0: Continuous state derivative computation
This flag is used when the derivative block->xd or residual block->res of the continuous state needs to be set.
Only blocks that use continuous state are called with flag=0.
Flag 3: Output event computation
Output event computation is done for blocks with output event register
during discrete activation but also zero crossing activation.
Note that in this latter case, the input event number block->nevptr will be -1.
Flag 9: Modes and zero crossing computation
Flag 9 is used to evaluate the function of zero crossings block->g and to set the modes, block->mode.
Flag 5: Ending
All blocks are called with flag = 5 before the end of the simulation or when the simulator aborts the simulation in case
an error occurs during the simulation. Input event numbers are not used in that case.
Flag 7: Properties of the continuous state variables
Set the properties of the continuous state variables. Used for the description of DAE system (also internally used and generated by Scicos/Modelica implementation).
Flag 10: Jacobian computation
Computation of Jacobian matrix of the system (internally used and generated by Scicos/Modelica implementation).