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?

 Respuesta aceptada

Jonas
Jonas el 23 de Ag. de 2021

1 voto

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 comentarios

Shemin Sagaria
Shemin Sagaria el 25 de Ag. de 2021
I liked the concept, but I was looking for a continous simulation process, where I dont have to intervene
Jonas
Jonas el 25 de Ag. de 2021
Yes, that's what it does. The first subsystem automatically enables the second one when it is finished by providing a Boolean to the Enable port of the second Enabled Subsystem.
Shemin Sagaria
Shemin Sagaria el 25 de Ag. de 2021
if you have an example, can you share
Shemin Sagaria
Shemin Sagaria el 25 de Ag. de 2021
Thank you :)

Iniciar sesión para comentar.

Más respuestas (1)

Yifeng Tang
Yifeng Tang el 22 de Ag. de 2021

1 voto

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 comentario

Shemin Sagaria
Shemin Sagaria el 25 de Ag. de 2021
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??

Iniciar sesión para comentar.

Productos

Versión

R2021a

Preguntada:

el 18 de Ag. de 2021

Comentada:

el 25 de Ag. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by