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

2 次查看(过去 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