Where is the algebraic loop coming from?
Afficher commentaires plus anciens
Dear all,
I faced an issue with algebraic loop in simulink (see the model attached).
When I update the model it says "Algebraic loop error", even though there seem to be no algebraic loop at all.
The issue is resolved if I combine these two subsystems into a one.
Could you please explain where the algebraic loop is coming from?
Thank you!
Réponse acceptée
Plus de réponses (1)
Hi @Sergei
Unmasking the 'FIFO' and 'toRAM_interface' blocks allows you to observe the signal dependence and identify the algebraic loop issue. The StreamFIFO block requires a feedback signal (ready_signal) that appears to originate from the Bus Object registered in both the toRAMctrl and fromRAMctrl ports. By default, Simulink's data type propagation for input and output ports uses the "Inherit: Auto" setting.
If you merely want to test the functions of the three SoC blocks, you can temporarily replace the toRAMctrl and fromRAMctrl ports with the Terminator and Ground blocks, respectively.
[data signal, valid_signal, ~] = StreamFIFO(data_in, valid_in, ready_signal)
toRAMctrl = SoCBusCreator(0, 0, valid_signal)
[ready_signal, ~, ~] = SoCBusSelector(fromRAMctrl)
Unmasked SoC subsystem

Workaround

3 commentaires
Sam Chak
le 1 Oct 2025
Hi @Sergei
In the actual scenario, this SoC subsystem is probably connected to a much larger system via the RAM Controller for signal processing tasks, through multiple Simulink blocks that may be static (where signals are transmitted instantaneously) or dynamic (where a delay occurs as data travels from a sending point to a receiving point on a network).
If the blocks on the RAM side of the system are all static, a circular dependency will arise. Conversely, if the RAM side of the system includes some dynamic blocks with properly specified initial conditions, a circular loop will still exist, but it will not depend algebraically.
Note: If you cannot view the "Workaround" block diagram, click the attached image in this post.
Sergei
le 1 Oct 2025
Catégories
En savoir plus sur Schedule Model Components dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!