Algebraic loop
An algebraic loop is a situation in modelling where the input of one or more blocks depends directly on their outputs through a chain of links with no time delay. This results in a circular dependency that the system cannot solve on its own within a single time step, resulting in an error. This circular dependence, in which the signal affects itself, is called a closed circuit or loop.
For example, there is a model with a Add block. A signal from its output is fed to the input of the Add block, which leads to the formation of a closed loop and the Algebraic Loop system error:
In this case, the solution to the algebraic loop problem is to connect the signal lines correctly, where the Add block will not short-circuit itself. Go to the block with the algebraic loop error and correct it by putting the signal line correctly or adding the Delay block to the return signal.
Engee does not break algebraic loops. If there is such a loop, the simulation will stop and the error in the diagnostic window will show in which block it occurred. |
If Engee cannot solve the equation in some number of iterations, an error message is displayed in diagnostic window. Hence, modelling systems with algebraic loops should be avoided.
How to deal with algebraic loops:
-
Use the blocks Transport Delay or Unit Delay, to break a closed loop by introducing a small delay;
-
Modify the circuit structure to eliminate the need for direct dependence of variables.