Creation of a system by integrating multiple validated subcomponents is a task common to Simulink® and C. In both environments integration issues arise as the number of components increases. Problems include miss-matched data types, scaling and ensuring the correct signals are available, to name a few. These are all challenges that systems integrators are used to solving. However; the integration process in Simulink exposes data dependency issues that are normally hidden in the C development environment.
Data dependency is the requirement that for any calculation, all the values on the right hand side (RHS) of equation are known prior to starting the calculation. The value on the left hand (LHS) side is dependent on the values of the right hand side. In the contexts of subsystems, the concept of calculation order is equivalent to execution order of the subsystems.
LHSn = f (RHSn)
The C language does not prevent users from writing equations where the LHS is assigned before the RHS. This means that an old or non-initialized data can be used which can result in unexpected or incorrect results.
LHSn = f (RHSn-1)
LHSn = f (??)
Unlike C, Simulink contains built in analysis tools that prevent this from happening. Users of Simulink are familiar with these diagnostic, which are most commonly referred to as algebraic loops. Loops are broken by explicitly setting the order of calculation. This paper focuses on how to easily and systematically break these loops.
Two methods are covered in this paper, using function-call subsystems and unit delay blocks. Both of these methods can be used to define the execution order of the system.