How to transfer output data from one simulation to another as its initial condition
1 回表示 (過去 30 日間)
古いコメントを表示
I have two Simulations A and B in seperate files. I would want A to run from seconds 0-100 and produce output X. B should be running from seconds 100-200 and uses X as its initial conditions at time 100. Is there any way to achieve this sort of behaviour ?
Thanks in advance for any help!
5 件のコメント
Fangjun Jiang
2019 年 9 月 6 日
"then start B at 100 take X as initial condition"?
X is taken for its value to assign to some states in system B?
or, X is feeded into system B as the inputs of system B?
採用された回答
Roshni Garnayak
2019 年 9 月 13 日
You can try using “Model Callbacks” for implementing this.
- Set the simulation time for the first model as 100 seconds.
- Use the “CloseFcn” or “StopFcn” callback for saving the output of the first model after the simulation stops.
- Include an “In1” block or a “From Workspace” block in the second model to collect the output of first model. You can also use “InitFcn” callback to achieve the same.
For details about setting “Model Callbacks”, refer to the following link:
You can also look at the following link to know about callbacks for customized model behavior:
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Schedule Model Components についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!