Simulink - How to run a simulation in a simulation?

烂漫一生 提交于 2019-12-10 12:16:46

问题


I am running a simulation that contains among other things a subsystem (or referenced model) that is a simulation by itself and that needs to be run fully at certain times before resuming the main simulation.

Basically, at time t the main simulation needs the outputs of the subsystem. The subsystem is then triggered and runs a simulation for 6 seconds (the subsystem simulation is time dependent). Then the main simulation uses the outputs of the subsystem. The problem here is that when the main simulation resumes, it should resume at time t+ts (sampling time) and not t+6s... So the subsystem should run on a kind of virtual clock.

Is this somehow possible? If not, what are the alternatives?

Thanks in advance for your help!!!

Fabien


回答1:


I realize that I never gave feedback about my attempts. I'll do it now: the solution I found was to replace my simulation subsystem by a Matlab Function block that runs/calls the referenced model as a simulation independent of the main simulation. This works perfectly fine!



来源:https://stackoverflow.com/questions/23608436/simulink-how-to-run-a-simulation-in-a-simulation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!