Simulink start takes long time to compile
100 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
D D
am 20 Jun. 2023
Beantwortet: Andy Bartlett
am 21 Jun. 2023
I have a simulink model, with a few reference models. When I 'Update' the model, it is so fast.. But when I 'Run' the model, compliation takes more than 5 minutes. As per compile stats, below states are taking high time.
Cstat23: 163.72 seconds -- Running model reference normal mode DFS
Cstat28: 85.35 seconds -- Check And Compile Model Reference Normal Modes
Cstat451: 29.99 seconds -- Model initialize conditions_self
Cstat460: 28.79 seconds -- ShutdownModel
Could someone please help me to sort out this problem.
0 Kommentare
Akzeptierte Antwort
Daniel
am 20 Jun. 2023
Bearbeitet: Daniel
am 20 Jun. 2023
In general, setting reference models to Accelerator mode can be useful if they're making your model run slowly. This generates and compiles code for the referenced models so they run as native code rather than going through the Simulink interpreter. You'll probably reduce the time in the run stage by using model referencing. The time spent in checking and compiling will probably increase since it will now need to generate some kind of code and compile the model.
To try accelerator mode, select the reference model that's taking a large chunk of your simulation time, and you can either click on "Normal" in the ribbon and change it to "Accelerator", or you can right-click on the Model block, select Block Properties from the context menu, and set the simulation mode there.
2 Kommentare
Daniel
am 20 Jun. 2023
It will be difficult to provide more targeted suggestions without being able to see the model, I'm afraid. One thing about accelerator mode that I forgot to mention yesterday: Once the compile is complete, it's cached, so you won't go through compile delays every time unless you're updating every model every time. I would still recommend turning on accelerator mode and timing the model twice. Let me know the results after both the first run (when it actually builds the model) and the second run (when it should be cached).
Weitere Antworten (1)
Andy Bartlett
am 21 Jun. 2023
The Tool knows lots of great techniques to speed up models. And even better, the tool conducts experiments to see if specific techniques speed things up or not, and then keeps only the model changes that speed things up.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Event Functions finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!