Simulink generate input at begining of simulations

3 ビュー (過去 30 日間)
Florian Rössing
Florian Rössing 2022 年 11 月 15 日
コメント済み: Florian Rössing 2022 年 11 月 16 日
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 Center および File ExchangeSources についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by