Component Sorting

Description of how component order is sorted during the compilation step

During a simulation, states and outputs of all model components are updated on each component’s simulation step. Component execution order of the signal processing component diagram is determined by the component sorting algorithm called in the process of model compilation.

In order to define a valid component ordering, it is necessary for the sorting algorithm to distinguish two categories of input ports in respect to their relationship to output ports:
  • Direct feedthrough: an input port whose current value determines the current value of one of the component's outputs
  • Non-direct feedthrough: an input ports not classified as “direct feedthrough”

Examples of components that have direct-feedthrough ports are the Gain and Sum components. Examples of components that have non-direct-feedthrough inputs are the Integrator and Unit Delay components.

The algorithm relies on two basic rules to sort the components:
  • A component outputs must be updated before any of the components whose direct-feedthrough ports it drives.
  • Outputs of the components that do not have direct feedthrough inputs can be updated in any order as long as the previous rule is satisfied