How to reduce the startup time of the simulink model

74 views (last 30 days)
Hello everyone,
I have a simulink model involving some masked C-sfunctions and some blocks from a user-defined library.
Every time that I have to launch a simulation, the simulink model is incredibly slow to start up. I understood that simulink takes its time at the startup to compile the model, and to resolve the references..... But the elapsed time is huge (3mins). I'm wondering if there is a way to speed up these operation.
Is there a way to compile the simulink model just one time and not at every simulation?
I try to use the accelerate mode as simulation mode, but it is still too much slow
I read this guide
but I don't get it, I found it too much oriented to profiling and memory allocation...
do you have any suggestions? I have Matlab 7.8 R2009a
thanks 4 reading
  6 Comments
grapevine
grapevine on 14 Sep 2012
Edited: grapevine on 14 Sep 2012
Actually, I forgot to say that I have some callback functions, which are running at the beginning of the simulation,these ones are intended to modify the maskdisplay based on the value of the mask parameters
Ryan G
Ryan G on 14 Sep 2012
If possible, after the masks have been set, try removing as many callbacks as possible and see how it helps.

Sign in to comment.

Accepted Answer

Ryan G
Ryan G on 14 Sep 2012
If this continues I would try model referencing.
You could wrap up as much of the model as possible in a subsystem and leave constants/tunable parameters on the top level and create the reference for the subsystem. Once that is done you set the reference to accelerator mode, see how well this works.
If it is still taking a long time to initialize try setting the rebuild option to none in the configuration parameters for model references.

More Answers (2)

Luc Gendre
Luc Gendre on 14 Sep 2012
Hey there!
I was just passing around when I saw your problem. It seems close to something me and other people had recently. But since you are using a 2009a version, I don't know if I will be of some help (I am using 2012a), but I'll tell you what anyway...
My problem came from the fact that matlab tried to connect to the server to check if I can use my toolbox. It does that every first time I am using a toolbox after startup, or if I use a reset command in one of my script (daqreset for example, when I use the DAQ toolbox). So if when you launch a simulation, you use a reset function in Matlab to have a "clean software", then matlab will check again with the server if you can you the different toolboxes.
Try to run this line in matlab:
theInfo = internal.matlab.licensing.getFeatureInfo;
If it takes a couple minutes to be executed, then you might have the same problem as I had. One solution (maybe not the best one), can be found here:
Other wise, sorry for the post, but I would not be of any help...
Good luck! Luc

Federico Rosellini
Federico Rosellini on 25 Jan 2017
Hello everyone!
I have a similar problem with my simulink model. When I try to run the simulation, the compiling process takes a very long time (about 10 minutes!), then the simulation runs normally. This problem started when I introduced a "Distributed Parameters Line" in my model.
Is there a way to fix this problem? I have model version 1.76 R2016b.
Thanks for the attention. Federico

Categories

Find more on Simulink Environment Customization in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!