Speeding up Simulink simulations with event charts and random events
2 views (last 30 days)
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.