Simulink start takes long time to compile
94 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
D D
el 20 de Jun. de 2023
Respondida: Andy Bartlett
el 21 de Jun. de 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 comentarios
Respuesta aceptada
Daniel
el 20 de Jun. de 2023
Editada: Daniel
el 20 de Jun. de 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 comentarios
Daniel
el 20 de Jun. de 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).
Más respuestas (1)
Andy Bartlett
el 21 de Jun. de 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 comentarios
Ver también
Categorías
Más información sobre Event Functions en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!