Using if/action blocks within an algebraic loop?
조회 수: 6 (최근 30일)
이전 댓글 표시
In Simulink, I am trying to use an algebraic loop to solve for a parameter. However, calculating this parameter requires a if/action block. Original code uses a Newton Raphson method, so I wanted to use an algebraic loop in place. It seems like it is not "allowed". I have "Input data dependency violation due action subsystems" and I'm pretty sure it's the feedback loop to create the algebraic loop.
In short: Is it possible to use if/action blocks within an algebraic loop? If not, then what other methods can I use?
댓글 수: 0
채택된 답변
Guy Rouleau
2012년 5월 8일
As you figured out, the algebraic loop solver uses a gradient descent method to solve the loop. The If/Else construct causes a discontinuity in the loop which is problematic for a gradient descent method.
When you have an algebraic loop, the blocks in the loop should be continuous both in time and values.
I recommend looking at the demo "sl_subsys_semantics". This demo contains many small models illustrating good and bad practices in this area.
very likely, you will need to either introduce a delay in the loop or rearrange your equations to avoid algebraic loops.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Model and Validate Requirements에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!