How to use variable time step in action subsystems ?
Afficher commentaires plus anciens
I want to activate/inactivate a subsystem in my model thanks to a constant (use=0 or 1), previously set with matlab. I therefore use an action subsystem linked to an If block, so that I can run two simulations and compare the influence of this subsystem on the final results. Moreover, I use ode45 solver and I need time step for energy calculation.
My problem is I can't send time step from my general clock to my action subsystem because "Goto/From connections cannot cross nonvirtual subsystem boundaries". For the moment I couldn't find a better way than let simulink do the whole simulation, and then multiply my "use" constant to the output data. This way, if my constant was set to 0, it annuls the results, which have no longer influence on the rest of the model. But that's careless work and it wastes a lot of simulation time.
I tried to :
- use another clock inside my action subsystem but it introduced "Input data dependency violation due to action subsystems" error.
- directly link my blocks, without from/goto connections --> impossible too.
- use Enable subsystem instead of Action subsystem --> worked only with an intern clock, but this clock didn't run on the same time step (I already asked this particular question here (in french) : http://www.developpez.net/forums/d1303551/environnements-developpement/matlab/simulink/probleme-temps-enabled-subsystem/)
Are my problems due to the atomic nature of action/enable subsystems ?
Thanks a lot in advance
Réponses (0)
Catégories
En savoir plus sur Modeling dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!