Why does putting a S function inside an Enabled Subsystem cause an algebraic loop?

조회 수: 4 (최근 30일)
Hi,
I have a Simulink model consisting of a controller and a plant. The plant is described using a S function with the Directfeedthrough of all inputs set to FALSE. The Simulink model ran well until I put the S function inside an Enabled Subsystem. Even when a constant "1" was connected to the enable port, there was still an algebraic error reported by Simulink. I could not understand why.
BTW, the reason why I put my S function in an Eanbled Subsystem is for resetting the states of the S function at some point of the simulation (following the idea at https://www.mathworks.com/matlabcentral/answers/39407-simulink-change-continuous-state-value-at-a-given-time-point).
It seems that my question may be relevant to the problem that an enabled system introduces direct feedthrough introduced here https://www.mathworks.com/matlabcentral/answers/20220-conditionally-executed-subsystem-introduces-direct-feedthrough?s_tid=answers_rc1-3_p3_MLT. But there is no answer for that question as well.
Any comments are appreciated!

채택된 답변

Pan Zhao
Pan Zhao 2017년 6월 23일
By referring to the document at http://physics.fme.vutbr.cz/~rudolf/Download/Matlab/Literature/sl_using.pdf, I solved the algebraic problem by 1. right-click the Enabled Subsystem and select Block Parameters (Subsystems) 2. check the option Minimize algebraic loop occurrences
Also see the figures for the solution
.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Subsystems에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by