MATLAB: What is the difference between using Data Store Blocks & Delay block to avoid algebraic loop error

algebraic loop errordata store blockssimulink

I had created a simple simulink model that results in algebraic loop error.Solved the error by following below two aprroaches
  1. Using delay block
  2. Using Data Store blocks(Data Store Read, Data Store Write & Data Memory block)
I know that delay block uses Newton iterative method to converge & Data store blocks re-route the data.
In what way(s) these two approches affect the performance of the model as a whole?

Best Answer

The performance is the same and both options are computationally equivalent. In my opinion here what should guide your choice is the clarity of the resulting model.
In your case, the goal is to break the algebraic loop by introducing a delay. Consequently I would recommend using a delay block.
I typically use Data Store Memory only in cases where I have some specific constraints the code generated from the model must to respect.
Related Question