MATLAB: Does algebraic loop not use values from previous time step

algebraicdelayerrorloopoutputsimulinkunitwrong

I am expecting the output of a block in an algebraic loop at time step (n-1), to be the input to the next block in the loop at time step n. But it does not use the previous value, and uses a different value. Why is that?

Best Answer

If you want the output of a block in an algebraic loop at time step (n-1), to be the input to the next block in the loop at time step n, then you would have to introduce a memory/state element in the loop.
This can be achieved by introducing a 'Unit Delay' anywhere in the loop, preferably where you know the exact initial conditions.