Unit delay in algebraic loop causes overshoot / instability

5 views (last 30 days)
Hi there,
I'm modeling a variable resistor as a controlled voltage source. This "variable resistor" is then in series with a constant voltages source, a resistor and a varying current source as a load. So I'm measuring the current, and I multiply the current with the resistance at that moment to get the right voltage. So this involves an algebraic loop. To break the algebraic loop, I used an unit delay, or a memory block. both result in an overshoot, when the power demand suddenly changes. But if I don't use a delay block, simulink will eventually get stuck in an algebraic loop when I expand my system. You can see the problem in the images I included.
If I use more of these "variable resistors" in my system, the problem gets even worse, to the point it goes to inf.
If I dont use the delay block, simulink can not complete the simulation.
How can I solve this?
Many thanks in advance!
  3 Comments
Werner van Dijk
Werner van Dijk on 8 Jan 2021
Hi Mathieu,
Thank you for your response. Rudicing the step size does help me one step further. However, when I add another "variable resistor" in the system, the system becomes unstable again and goes to infinity
Mathieu NOE
Mathieu NOE on 8 Jan 2021
Hi Werner
I wish I could help further but I don't have the right toolbox to help you - I do everything in the regular Simulink environment

Sign in to comment.

Answers (1)

Zuber Khan
Zuber Khan on 20 Sep 2024
Hi,
I understand that you are using a delay block to remove the algebraic loop.
In some cases, adding a small delay (either discrete delay block or continuous memory block) to the system at its highest level might remove the loop. However, this can, in some situations, add unnecessary dynamics which may affect the results.
An alternative approach could be to use a transfer function such as a first-order Transfer Function. Like the delay block, this will introduce a new dynamic in the system. The trick is to make the time constant of the Transfer Function small enough (like 1e-6) to not affect the dynamics of the system significantly.
For more information on Transfer Function block, you can refer to the following documentation link:
You can also experiment with different solver settings. Sometimes, switching from a fixed-step solver to a variable-step solver (or vice-versa) can improve stability.
Regards,
Zuber

Community Treasure Hunt

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

Start Hunting!