Using Simulink    

Processing at Each Time Step

At each time step, Simulink

  1. Updates the outputs of the models' blocks in sorted order (see Determining Block Update Order).

    Simulink computes a block's outputs by invoking the block's output function. Simulink passes the current time and the block's inputs and states to the output function as it may require these arguments to compute the block's output. Simulink updates the output of a discrete block only if the current step is an integral multiple of the block's sample time.

  1. Updates the states of the model's blocks in sorted order.

    Simulink computes a block's discrete states by invoking its discrete state update function. Simulink computes a block's continuous states by numerically integrating the time derivatives of the continuous states. It computes the time derivatives of the states by invoking the block's continuous derivatives function.

  1. Optionally checks for discontinuities in the continuous states of blocks.

    Simulink uses a technique called zero crossing detection to detect discontinuities in continuous states. See "Zero Crossing Detection" on page 3-14 for more information.

  1. Computes the time for the next time step.

Simulink repeats steps 1 through 4 until the simulation stop time is reached.


 Model Execution Phase Determining Block Update Order