Embedded Matlab function, simulink loop
이전 댓글 표시
Hello.
I have been working with the matlab Embedded function in simulink and I have a problem. I am doing an on-off controller by adding many if statements like this:
if a>10
a=-1;
else
a=9;
end
In this case, a is an input and an output, so I need to feedback it. I have tried to feedback it by conect them directly, by using the workspace and using a Memory block, however I always get this warning:
"Found algebraic loop containing..."
The result is the simulation runs for some seconds but suddently it stops without a reason.
How can I solve this problem?
Thanks
답변 (1개)
Kaustubha Govind
2012년 6월 11일
0 개 추천
How about if you insert a Unit Delay block in the feedback loop?
댓글 수: 3
Robinson Medina
2012년 6월 11일
Nicholas
2012년 6월 11일
Have you considered using a persistent variable type?
http://www.mathworks.com/help/techdoc/ref/persistent.html
Kaustubha Govind
2012년 6월 13일
Robinson: Could you explain what you mean by "unstable" - did you mean in the context of controller dynamics? Did the error about algebraic loops go away though?
Nicholas' comment answers the rest of your question.
카테고리
도움말 센터 및 File Exchange에서 Simulink에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!