Speeding up Simulink simulations with event charts and random events
1 次查看(过去 30 天)
显示 更早的评论
I have a simulink model which consists of about more than 300 blocks that contain basically 5 different custom library blocks. Each block contains 1-2 Discrete Event Charts. The blocks communicate with each other in a hierarchical manner using messages. The communication between the blocks are not one directional meaning the blocks at any level on the hierarchy can be communicating with other blocks in the upper and lower levels. Immediate connections to lower levels are established with duplicated messages and to higher levels are established by making use of the entity multicast blocks.
Events in the discrete event charts take place at some randomly generated times from a matlab function that is defined in the base workspace.
I need to get this simulation as fast as possible such that I can run +10K Monte-Carlo iterations in a reasonable time. I recently read that model referencing is more favourable to get the simulation speed up. Are there any other significant changes that I can make to increase the simulation speed? For instance the profiler in "Normal" mode tells me that a huge amount of time is spent in the initialization phase. It is also the case when I start the simulation with "Step Forward". After that when I click it again, the complete simulation runs in the fraction of a second.
Trying to run the simulation in an automated way via a Matlab Script for Monte Carlo simulations also take a huge amount of time regardless of choosing "FastRestart" option or not due to the initialization.
I would appreaciate any comments and suggestions for improvement.
0 个评论
回答(1 个)
Abdolkarim Mohammadi
2022-3-29
编辑:Abdolkarim Mohammadi
2022-3-29
You should try parsim() with fast restart enabled. Read my answer here for further details about this methodology.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Discrete-Event Simulation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!