# Algebraic state in algebraic loop

10 views (last 30 days)
Meddour Aissam riad on 15 Jul 2020
Answered: maiaL on 16 Jul 2020
Hi there, i hope you're doing fine!
i simplified my problem in order to get a fast answer.
My complicated simulink model dosen't work fo the same problem as this simplified example ( because of the derivative bloc).
is there ani tricks to make it work and to make the derivative block ignore the fact that it don't have the first point of the first itteration.
Thanks a lot for your help
##### 2 CommentsShowHide 1 older comment
Walter Roberson on 16 Jul 2020
I do not understand the question.
"is there ani tricks to make it work and to make the derivative block ignore the fact that it don't have the first point of the first itteration."
No, that model has an algebraic loop. It expresses
sin(t) / diff(f(t),t) == diff(f(t),t)
which is
sin(t) == diff(f(t),t)^2
which has solutions
C1 - 2*ellipticE(t/2 - pi/4, 2)
C2 + 2*ellipticE(t/2 - pi/4, 2)
At t = 0 that gives you
C1 + 2*ellipticE(pi/4, 2)
C2 - 2*ellipticE(pi/4, 2)
however, no initial conditions were specified for your model.
If you say that the initial conditions are 0 then f(t) is
- 2*ellipticE(pi/4, 2) - 2*ellipticE(t/2 - pi/4, 2)
2*ellipticE(pi/4, 2) + 2*ellipticE(t/2 - pi/4, 2)
... at least it has a solution in theory. But the solution goes imaginary after t = pi.

maiaL on 16 Jul 2020
You could try adding a Delay block before the input to the derivative block.
I don't know if the signal in your actual model is also sinewave-like, but the derivative will be zero on every half-period, so that's another problem on top of the algebraic loop.

R2019b

### Community Treasure Hunt

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

Start Hunting!