Where is the algebraic loop? How to get rid of it?

조회 수: 1 (최근 30일)
Daniel H
Daniel H 2018년 6월 5일
편집: Sourabh 2025년 4월 23일
I want to simulate a simple feedback amplifier in Simulink:
where the "Open Loop Amplifier" looks as follows:
Most of the time I get "Simulink cannot solve the algebraic loop containing '...' at time 4.1951420214177304E-9 using the TrustRegion-based algorithm due to one of the following reasons: the model is ill-defined i.e., the system equations do not have a solution; or the nonlinear equation solver failed to converge due to numerical issues.
for fixed step as well as variable step.
I built exactly the same model in a Spice simulator where it works flawlessly without any issues. For that reason I do not see what's the problem. There are dyanmic elements in the loop such that there should be no "algebraic loop".
But in any case ... How do I get (reliably) rid of this error in this setup?
It is important to note that sometimes I may be able to avoid this by inserting some high frequency filters or adjusting simulation parameters but not reproducible and not reliably.
For example, inserting 1/(1+10e-12 s) directly after "Vin" in the open loop amplifier block gets rid of the error but then I run into "Derivative of state '1' in block '...' at time 3.9498179964744583E-9 is not finite." errors.
No matter where I place these, I either get algebraic loop of derivative not zero errors.
(No, 10e-12 is not too small - it is only a factor of 10 smaller than the smallest dynamic)
  댓글 수: 2
Birdman
Birdman 2018년 6월 5일
Can you share your model?
Daniel H
Daniel H 2018년 6월 5일
Yes, I have attached the model.

댓글을 달려면 로그인하십시오.

답변 (1개)

Sourabh
Sourabh 2025년 4월 23일
편집: Sourabh 2025년 4월 23일
I too got an algebraic loop when I simulated the attached model.
  1. To view where the algebraic loop is, click the “Open” button as suggested in the Diagnostic Viewer by Simulink
The yellow highlighted section is where the algebraic loop is:
2. To solve the loop, insert an integrator block on the “Vout” signal as shown below:
3. Then, open “Model Settings” in Modelling > Setup > Model Settings.
Expand the solver details and change the fixed step size from “1/84e6/20” to “1/84e7/20” as shown below:
Click Apply and Ok.
The model now runs successfully without any errors.
For more information on algebraic loop, kindly refer the following MATLAB documentations:
I hope this helps!

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by