Info

此问题已关闭。 请重新打开它进行编辑或回答。

How to accelerate the FastRestart workflow ?

1 次查看(过去 30 天)
I have to run multiple simulations iteratively. Between simulations steps I change input parameters through a constant block. I followed the FastRestart workflow, but it is quite slow when running multiple iterations.
I noticed:
- Case 1) Running programaticlly from the workspace: For 20 iterations of 10s (total simulation time = 200s) with a constant input, it takes around 10s to complete. (it is displayed in the bottom of the screen "Ready (Fast Restart)" most of the time.
- Case 2) While running the model directly in simulink (setting explicitely the input in the constant block, and not from the WS) for 200s, the simulation is executed almost instantly.
Since in the two cases the input is the same and is constant (to make things comparable for the testing situation), I am expecting the same running time in both cases (it is what I understood from the FastRestart workflow page). Or when running programatically from the workspace (sim command), it it much longer...
One of my guess is that it is saving the SimState that takes time. I would like to find a solution to make it faster since I have to run thousands of iterations.
Note: I am using the accelerator mode and I have also a To Workspace block for the outputs of the model (type timeseries).

回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by