How can I simulate a model which is triggered at specific simulation times with a variable step solver?

4 views (last 30 days)
Hello,
I have a simulink subsystem which shall be triggered at specific simulation times. The subsystem starts with the trigger and is finished after a short period of time. This process is repeated for the specific simulation times. These specific times are determined at simulation start by a random number generator.
Due to obtain a high performance I want to use a variable step solver. Now I have encountered the problem that with my current model some trigger points are skipped (due to the fact that the simulation step size becomes large). I can avoid this skipping by setting a maximum step size. Are there other possible solutions to avoid this skipping?
Thanks and best regards,
Martin Griese

Answers (1)

Nirja Mehta
Nirja Mehta on 28 Jul 2017
Yes, you are on the right track. You can control the maximum step size which will not skip certain steps during simulation. Also, I am guessing your variable-step solver is set to Auto - which should pick the best one. however, feel free to play around with other variable step solvers in the list.
Another good documentation page that guides you through choosing the right solver for you is the following: https://www.mathworks.com/help/simulink/ug/types-of-solvers.html#f11-41989
Hope this helps.

Categories

Find more on General Applications 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!