Algebraic loop
Algebraic loop is a situation in modeling when the input of one or more blocks directly depends on their outputs through a chain of connections without a time delay. As a result, a circular dependence arises that the system cannot solve on its own within a single time step, which leads to 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 block Add. A signal is sent to the input of the Add block from its output, which leads to the formation of a closed loop (loop) and a system error Algebraic Loop:
In this case, the solution to the problem with the algebraic loop will be the correct connection of the signal lines, in which the Add block will not close on itself. Go to the block with the algebraic loop error and correct it by setting the signal line correctly or adding a block Delay in 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 a certain number of iterations, an error message is displayed in diagnostic window. Therefore, modeling systems with algebraic loops should be avoided.
How to deal with algebraic loops:
-
Use blocks Transport Delay or Unit Delay to break the closed circuit by introducing a small delay;
-
Change the structure of the schema to eliminate the need for direct dependence of variables.