Simulink-如何在仿真中运行仿真? [英] Simulink - How to run a simulation in a simulation?

查看:124
本文介绍了Simulink-如何在仿真中运行仿真?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个仿真,其中包含一个子系统(或参考模型),该子系统本身就是一个仿真,并且需要在恢复主仿真之前的特定时间完全运行.

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.

基本上,在时间t,主要仿真需要子系统的输出.然后触发子系统并运行6秒钟的仿真(子系统仿真与时间有关).然后,主要仿真使用子系统的输出.这里的问题是,当主仿真恢复时,它应该在t + ts(采样时间)而不是t + 6s时恢复...因此子系统应该在一种虚拟时钟上运行.

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?

在此先感谢您的帮助!

Fabien

推荐答案

我意识到我从未对自己的尝试提供反馈.现在,我要做:找到的解决方案是用Matlab功能块代替我的仿真子系统,该块运行/调用引用的模型作为独立于主仿真的仿真.效果很好!

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!

这篇关于Simulink-如何在仿真中运行仿真?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆