What is causing my algebraic loop?
Show older comments
I have a somewhat complex model utilizing the general blockset, Specialized Power Systems, and Simscape Electrical physical systems. I am receiving an error that I have an algebraic loop, containing blocks that contain persistent states, which are not allowed in algebraic loops. I have seen answers explaining that these blocks tend to be integrators, Stateflow charts, Matlab function blocks, and physical systems circuits. Of those things, I only have the physical systems circuit. The physical systems circuit contains capacitors which could count as "persistent states", but if that is the cause, I do not know the solution. The error message is copied below. Can anyone help me spot the cause of the error?
Edit: After digging further, the identified loop goes Voltage Measurement -> Gain -> Subtract -> Gain -> Controlled Current Source. The Controlled Current Source does not directly interact with the Voltage Measurement. I don't see loop here..
'Full_Model_2/Control/Voltage Loop/Solver Configuration' or the model referenced by it contains a block that updates persistent or state variables while computing outputs and is not supported in an algebraic loop. It is in an algebraic loop with the following blocks.
Component:Simulink | Category:Model error
Input ports (1) of 'Full_Model_2/powergui/EquivalentModel1/State-Space' are involved in the loop.
Component:Simulink | Category:Model error
Input ports (1) of 'Full_Model_2/Converter 3/Voltage Measurement/do not delete this gain' are involved in the loop.
Component:Simulink | Category:Model error
Input ports (1) of 'Full_Model_2/Control/LM5170/Current Loop 3/Gain1' are involved in the loop.
Component:Simulink | Category:Model error
Input ports (1) of 'Full_Model_2/Control/LM5170/Product' are involved in the loop.
Component:Simulink | Category:Model error
Input ports (1, 2) of 'Full_Model_2/Control/LM5170/Current Loop 3/Subtract' are involved in the loop.
Component:Simulink | Category:Model error
Input ports (1) of 'Full_Model_2/Control/LM5170/Current Loop 3/Gain' are involved in the loop.
Component:Simulink | Category:Model error
Input ports (1) of 'Full_Model_2/Control/LM5170/Current Loop 3/Saturation' are involved in the loop.
Component:Simulink | Category:Model error
Input ports (1) of 'Full_Model_2/Converter 2/Voltage Measurement/do not delete this gain' are involved in the loop.
Component:Simulink | Category:Model error
Input ports (1) of 'Full_Model_2/Control/LM5170/Current Loop 2/Gain1' are involved in the loop.
Component:Simulink | Category:Model error
Input ports (1, 2) of 'Full_Model_2/Control/LM5170/Current Loop 2/Subtract' are involved in the loop.
Component:Simulink | Category:Model error
Input ports (1) of 'Full_Model_2/Control/LM5170/Current Loop 2/Gain' are involved in the loop.
Component:Simulink | Category:Model error
Input ports (1) of 'Full_Model_2/Control/LM5170/Current Loop 2/Saturation' are involved in the loop.
Component:Simulink | Category:Model error
Input ports (1) of 'Full_Model_2/Converter 1/Voltage Measurement/do not delete this gain' are involved in the loop.
Component:Simulink | Category:Model error
Input ports (1) of 'Full_Model_2/Control/LM5170/Current Loop 1/Gain1' are involved in the loop.
Component:Simulink | Category:Model error
Input ports (1) of 'Full_Model_2/Control/Vbus^UF/do not delete this gain' are involved in the loop.
Component:Simulink | Category:Model error
Input ports (1) of 'Full_Model_2/Control/Voltage Loop/Solver Configuration' are involved in the loop.
Component:Simulink | Category:Model error
Input ports (2) of 'Full_Model_2/Control/Voltage Loop/Solver Configuration' are involved in the loop.
Component:Simulink | Category:Model error
Input ports (2, 3) of 'Full_Model_2/Control/Voltage Loop/Solver Configuration' are involved in the loop.
Component:Simulink | Category:Model error
Input ports (1, 2) of 'Full_Model_2/Control/LM5170/Current Loop 1/Subtract' are involved in the loop.
Component:Simulink | Category:Model error
Input ports (1) of 'Full_Model_2/Control/LM5170/Current Loop 1/Gain' are involved in the loop.
Component:Simulink | Category:Model error
Input ports (1) of 'Full_Model_2/Control/LM5170/Current Loop 1/Saturation' are involved in the loop.
Component:Simulink | Category:Model error
4 Comments
James Tursa
on 12 Jan 2022
Algebraic loop can sometimes be caused by feedback without a delay. I.e., feeding the output back as an input without any delay, essentially using the current state as an input to calculate the current state. You can sometimes fix this by adding a delay in the output that feeds back into the input.
Jamie Shaffer
on 13 Jan 2022
Jamie Shaffer
on 13 Jan 2022
Edited: Jamie Shaffer
on 13 Jan 2022
Ankit
on 14 Jan 2022
if you can't share model, could you please share some screenshots? it would be easy to find out the root cause. Solution is already mentioned by @James Tursa
Answers (1)
Jamie Shaffer
on 14 Jan 2022
0 votes
Categories
Find more on Choose and Parameterize Blocks in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!