Simulink algebraic loop matlab function error

Hi,
I am trying to get around an algebraic loop error (see attached picture). I have an embedded Matlab function that computes the variable dirc, but it requires it's own output as an input (making a loop). I have tried putting in an IC block to give it an initial guess, and I have tried an algebraic constant block, but both have failed. Any suggestions?
Thanks

回答 (1 件)

Sebastian Castro
Sebastian Castro 2014 年 10 月 2 日

0 投票

Dylan,
Algebraic loops happen in these situations where the output of your block directly depends on the input.
If you're running this algorithm at a particular time-step, and can get away with delaying the input dir by one step (i.e., you use the previously calculated value to compute a new output), you should insert a Unit Delay block in the feedback loop from dirc to dir.
- Sebastian

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

製品

質問済み:

2014 年 9 月 8 日

回答済み:

2014 年 10 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by