Simulink generate input at begining of simulations

3 次查看(过去 30 天)
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?

回答(1 个)

Jim Riggs
Jim Riggs 2022-11-15
编辑:Jim Riggs 2022-11-15
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 个评论
Florian Rössing
Florian Rössing 2022-11-16
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?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Sources 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by