Algebraic loop debugging of Simulink delay block

조회 수: 1 (최근 30일)
Tim Nash
Tim Nash 2021년 2월 3일
답변: Kiran Felix Robert 2021년 2월 9일
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?

채택된 답변

Kiran Felix Robert
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개)

카테고리

Help CenterFile Exchange에서 Model Verification에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by