
Speed up compilation time Matlab simulink/simscape
    4 views (last 30 days)
  
       Show older comments
    
Hello everybody,
i am modeling an electrical machine using simulink/simscape. More precisely, I am observing the thermal behavior. Thus, using the thermal domain of Simscape.
However, the compilation time is very long compared to the simulation time and takes about 99% of the whole simulation time.
Is there any option to speed up the compilation time?  For example a pre-compilation of the block that no compilation is needed if parameters are changed.
I think using Rapid Accelerator mode just speeds up the simulation itself. At least it has no influence for my model.
Best regards
Felix 
0 Comments
Answers (1)
  Aabha
 on 7 Feb 2025
        
      Edited: Aabha
 on 7 Feb 2025
  
      I understand that you are trying to reduce the compilation time for your Simscape model. To achieve this, Simscape has run-time parameters, which are MATLAB variables or “Simulink.Parameter” objects that are run-time configurable. These parameters allow to skip recompiling the model when parameter values are changed.  Simscape supports run-time configurability for most parameters that need a numerical value input. To determine whether a parameter is run-time configurable, you can review the settings for the parameter in the block property inspector. If a parameter is run-time configurable, you will see the property inspector set to the default setting, “Compile-time”. This can be changed to “Run-time” if necessary. 

Please refer to the following documentation to understand more about run-time parameters.
There are a few other ways in which you can speed up the compilation of a Simscape model in general. You can use optimization techniques such as scalable compilation, incremental compilation, and memory or disk caching for model compilation. 
Please refer to the following documentation to understand more about techniques for improving compilation performance. 
0 Comments
See Also
Categories
				Find more on Run-Time Parameters in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!