# Algebric loop Error in a feedback

2 views (last 30 days)
ABHAY KUMAR GUPTA on 18 Jun 2019
Edited: Jesús Zambrano on 4 Aug 2019
I have built a Dynamic model power system where i am feeding generator current and load current to transmission line which gives bus voltage as output.Using this bus voltage i am calculating Load current which is feeded back to transmission line.it is giving algebric loop error at 50 micro second step size but runs when step size is reduced to 0.5 micro second. It makes the simulation very slow. I used memory block to provide feedback but as i used memory block system became unstable.

Jesús Zambrano on 4 Aug 2019
Edited: Jesús Zambrano on 4 Aug 2019
Hi Abhay,
I share with you some content from documentation regarding algebraic loops:
When a model contains an algebraic loop, Simulink uses a nonlinear solver at each time step to solve the algebraic loop. The solver performs iterations to determine the solution to the algebraic constraint, if there is one. As a result, models with algebraic loops can run more slowly than models without algebraic loops.
I don't know the details of your Simulink implementation. However, here I give you some recommendations according to the setup you could have:
• Remove the algebraic loop manually: If possible, write down the equations of your system and solve it for the variable you have in the output.
• Create initial guess using IC and algebraic constraint block: Your model might contain loops for which the loop solver cannot converge without a good, initial guess for the algebraic states. You can specify an initial guess for the algebraic state variables, but use this technique only when you think the loop is legitimate.
• When using subsystems or model references, you can enable the 'Minimize algebraic loop occurrences' option to remove algebraic loops that would not normally exist if all blocks were at the same level of a model.
• Add a delay: There are many blocks that are not direct feedthrough that can be inserted into a feedback loop. These blocks, such as the Unit Delay block or Memory block, effectively add a delay in the feedback loop to break the algebraic loop. This technique is simple, but it can significantly change system dynamics.
• Eliminate artificial algebraic loops caused by atomic subsystems: If an atomic subsystem causes an artificial algebraic loop, convert the atomic subsystem to a virtual subsystem. This change has no effect on the behavior of the model. When the subsystem is atomic and you simulate the model, Simulink invokes the algebraic loop solver. The solver terminates after one iteration. The algebraicloop is automatically solved because there is no algebraic constant. After you make the subsystem virtual, Simulink does not invoke the algebraic loop solver during simulation.
Hope you can solve your algebraic loop problem with any of these alternatives.