Why does algebraic loop not use values from previous time step

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?

 Accepted 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.

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Products

Release

R2018b

Community Treasure Hunt

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

Start Hunting!