co-simulation within Simulink

4 次查看(过去 30 天)
I am looking for options for co-simulation within simulink.
Scenario: I need one subsystem in simulink to run for 60 sec and send the average result (lets say 'a') to next subsystem, which takes 'a' as input and will continue the simualtion for 600 secs. How can I do that with in simulink?

采纳的回答

Jonas
Jonas 2021-8-23
I would put each subsystem inside an Enabled subsystem, and enable the second subsystem after the first subsystem had finished and the result is averaged. The first subsystem can then be disabled and its outputs set to 'Held' to fix its outputs.
  5 个评论

请先登录,再进行评论。

更多回答(1 个)

Yifeng Tang
Yifeng Tang 2021-8-22
It sounds to me that the easiest way is to set up two Simulink simulations. Save the output from the 1st one to the MATLAB workspace, so the 2nd simulation can use it as the input. You can also use MATLAB code to manipulate the result form the first one, say taking average. Use out=sim() function to run the Simulink models from script.
  1 个评论
Shemin Sagaria
Shemin Sagaria 2021-8-25
To make it clear,
I have to make two sim models, make a main MATLAB script and run 'model a' , store the results and then run 'model b', right??

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Programmatic Model Editing 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by