Speeding up Simulink simulations with event charts and random events
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Abdolkarim Mohammadi
le 29 Mar 2022
Modifié(e) : Abdolkarim Mohammadi
le 29 Mar 2022
You should try parsim() with fast restart enabled. Read my answer here for further details about this methodology.
Voir également
Catégories
En savoir plus sur Discrete-Event Simulation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!