Using Simulink Profiler for run time analysis per block or subsystem | Simscape Electrical Modeling Practices for Fast Simulation
From the series: Simscape Electrical Modeling Practices for Fast Simulation
The Simulink Profiler is used to figure out how much simulation time is needed for the whole model, per subsystem or per block. It works for normal and accelerator mode and gives a fast insight which blocks cause speed bottlenecks.
Published: 7 May 2024
Hello. My name is Eva, and I'm an application engineer at MathWorks. In this video, I would like to show you the Simulink profiler. The Simulink profiler can be used to point to possible sources of assimilation slowdown and to identify components of the model that take longer to execute. And the model used in this video was taken from the Simulink examples library.
Using this example model, I will present the tool. Open it by going to Debug, Performance Advisor, and then the Simulink profiler. To profile the model execution, start the simulation from the Profiler tab. This will run the model and collect information on its execution.
The report shows the collected information on subsystem and block level. You can use this to navigate into different portions of the model. The columns list the number of individual calls to the component, as well as its total execution time and its self time. The self time refers to the total duration of execution of that specific block. The total time refers to the execution time for component with all its subcomponents. The Property Inspector will break this down in more detail.
Note that this report specifically can give you more details about which blocks are expensive to run, meaning which ones take a long time to execute. This can identify which elements should be investigated. If you're using a variable-step solver and your more significant bottleneck is that too many time steps are taken by the solver, use the Solver Profiler. This tool will be covered in a separate video.
And in case you use this on a model containing a Simscape network, all collected profiling information on a Simscape network will be cumulated as one item. To investigate the Simscape network, consider using other tools such as the Statistics Viewer or the Solver Profiler.