Embedded Function Error-algebraic loop error message in Simulink
1 view (last 30 days)
Show older comments
Hi,Help please,when i try to run my Simulink model, i obtain this error:
Cannot solve algebraic loop involving 'Nussbaum/Switch' because it consists of blocks that cannot be assigned algebraic variables, i.e., blocks with discrete-valued outputs, blocks with non-double or complex outputs, Stateflow blocks, or nonvirtual subsystems
0 Comments
Accepted Answer
Kaustubha Govind
on 21 Jun 2012
Do you have an output connect as an input (in a loop)? Perhaps you might want to avoid the algebraic loop in the first place so that Simulink doesn't have to solve it. Please see What are algebraic loops in Simulink and how do I solve them? and this blog post: http://blogs.mathworks.com/seth/2008/07/03/how-did-i-get-an-algebraic-loop-error-when-the-diagnostic-was-set-to-warning/
Also, this previously answered question has a lot of good tips: http://www.mathworks.com/matlabcentral/answers/34478-is-this-the-way-to-solve-algebraic-loops
2 Comments
Kaustubha Govind
on 22 Jun 2012
Iman: Ideally, you should post this as a new question, but I'll try and answer it anyway. I think you need to "pre-allocate" sn1. Just add something like "sn1=0" before the if block.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!