Algebraic loop debugging of Simulink delay block
1 次查看(过去 30 天)
显示 更早的评论
It is unclear to me why Simulink flagged this as an algebraic loop:
Assuming the delay block is effectively nothing more than a D-flip flop, and also assuming that the enable input of the delay block is synchronous (sensitive to the clock edge driving the delay block), then the delayed output is a reflection of the state of the inputs (including the enable) one time step later and NOT the same instance in time as the inputs. The delay block has a defined initial condition of 0, so the initial condition of the enable is also known. I cannot figure out why Simulink thinks this is an algebraic loop.
Adding an additional delay between the delayed output and the enable would break the design.
Thoughts? Is there a difference between this delay block and a D-flip flop?
0 个评论
采纳的回答
Kiran Felix Robert
2021-2-9
Hi Tim,
You are getting an algebraic loop error/warning because the enable input of the delay block is driven by the current output. Though the output of the block is at a delay with respect to the input (in values), but the mathematical model input of the block has a direct dependence on the current output which causes an algebraic loop error. Refer the Algebraic Loop Concepts for more information regarding algebraic loops.
Basically, algebraic loops occur when an input port with direct feedthrough is driven by the output of the same block, either directly, or by a feedback path through other blocks which have direct feedthrough.
If an algebraic loop is detected you have two options: leave the algebraic loop intact (suppress the warning), or eliminate it. If the speed of execution of the model is acceptable, leaving the loop is probably the better choice. If the speed of execution is slow, you must eliminate the algebraic loop.
To resolve the loop, you can add a unit-delay to the feedback path and to all other forward paths in the same stage (balance the feedback loop delay with delays in other paths).
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Model Verification 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!