How can I use "If block" and "action subsystems" multiple times in a time step?

1 view (last 30 days)
Hi everyone, I'm new user in Simulink.
I have some problems with if block and action subsystems when input changes during a time step, for example when using blocks with continuous state like Integration block.
Example: https://dl.dropboxusercontent.com/u/48322092/untitled.slx
When algorithm's argument becomes negative, the If block must switch the input signal of Integration block to zero to avoid the input signal of Integration block becomes indeterminate. The if block doesn't work correctly when the change happens during time step in the solver phase.
From mathworks documentation center I found this link http://www.mathworks.it/it/help/simulink/ug/modeling-dynamic-systems.html
In this article, under the section "system and subsystem" is written : 'Action subsystems can be executed at most once by the action subsystem initiator. ... Function-call subsystems can be executed more than once at any given time step whereas action subsystems can be executed at most once.'
I changed my file in this way https://dl.dropboxusercontent.com/u/48322092/untitled_chart.slx
It works correctly but I can't use it because I will use it inside an algebraic loop and it's not possible use stateflow chart inside algebraic loop in Accelerated mode.
If someone would suggest me how can I use correctly the if block, I will be gratefull.
Thanks a lot for your kindness.

Answers (0)

Categories

Find more on Schedule Model Components in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!