Effacer les filtres
Effacer les filtres

Simulink generate input at begining of simulations

3 vues (au cours des 30 derniers jours)
Florian Rössing
Florian Rössing le 15 Nov 2022
Hi everyone,
I want to simulate system behavior for input events with random characteristics.
As I want to study many parameters of the random event characteristics, it is not feasible to generate data in large quanities and store it in a matfile.
My plan is to create an event generator block, that has the event parameters as arguments.
So far my idea is to use a Start function to generate the actual event at the begining of a simulation from those parameters.
How can I get the signal generated in that start function to be the output of my event generator?

Réponses (1)

Jim Riggs
Jim Riggs le 15 Nov 2022
Modifié(e) : Jim Riggs le 15 Nov 2022
I am not sure that I understand your specific question (i.e. the implementation you are describing).
The way it sounds to me, you want to run your model for a large number of different starting conditions. To do this, I would run the Simulink model from a Matlab script. This script would have a section where the initial parameters for the model are defined, then run the Simulink model using the 'sim' command. The simulink model can refer to variables defined in the Matlab workspace.
You can build a loop structure to run your Simulink model many times, and the model can export data using the '"to workspace" block which you can then manipiulate or save for further reference.
  1 commentaire
Florian Rössing
Florian Rössing le 16 Nov 2022
I specifically would not want to do that. I want to make use of Design Studies and the multiple simulations pannel, as my model will have a lot of parameters that need to be tuned.
For event generation imagine something like, you have an event time and then, following a possion distribution, you draw follow up events randomly. The input signal for my simulations would be a time series with 1 at the specific times from this random process and 0 everywhere else.
I want to change the number of follow up events and and the event probability for the distribution.
Does that make it more clear?

Connectez-vous pour commenter.




Community Treasure Hunt

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

Start Hunting!

Translated by