Automatic performance checks for optimal model settings with Model Advisor | Simscape Electrical Modeling Practices for Fast Simulation - MATLAB & Simulink
Video length is 12:04

Automatic performance checks for optimal model settings with Model Advisor | Simscape Electrical Modeling Practices for Fast Simulation

From the series: Simscape Electrical Modeling Practices for Fast Simulation

The Model Advisor is used to perform several performance checks for your specific model concerning non optimal model settings or blocks. It also suggests counter measures and implements them after confirmation by the user.

Published: 7 May 2024

Hello. My name is Eva and I'm an application engineer at MathWorks. In this video, I would like to present the Model Advisor and the Performance Advisor. The Model Advisor can be used to check your model configurations or to make sure your model meets certain modeling standards to avoid inaccurate or inefficient simulations. The Performance Advisor is designed to investigate your model for possible sources of simulation slowdowns.

The models used in this video were taken from the Simulink examples library. Using an example model, I will walk through the tool. I will start with the Model Advisor, open it by going to Modeling, Model Advisor. Next, I will check the components I want investigated, the entire model, in this case. The Model Advisor presents with built-in checks, and it will display those available for the installed products.

They are ordered either by product I am using or tasks I might be working on, such as performance, accuracy, or adherence to standards. I am running the checks for modeling standards from the MathWorks Advisory board checks. When the checks have run, I can-- appearing next to the individual checks. This will indicate their status such as, passed, failed, warning, or not run.

Selecting one of the Run Checks gives more details about the results. I can see its status and why, here, for example, the warning is thrown. From here, I can go and decide if a fix might be necessary, and I can take the recommended action to fix the model.

Next, I will take a look at the Performance Advisor. The Performance Advisor is built within the same Model Advisor framework. It contains predefined checks looking for certain model configurations that might impact performance. It will create a detailed report of the results and suggest improvements that can be applied automatically or manually.

Again, I'm using this on an example model by going to Debug, Performance Advisor. Be aware that the Performance Advisor will create a baseline simulation before running the checks, so it has to be able to run without errors. Also, data logging should be enabled. The log signals are used by the Performance Advisor to compare simulation results with different settings.

In the left pane, the different checks are listed. This is where specific tasks can be selected and deselected. Either apply global settings for all checks to take action based on recommendations, validation of simulation time, and validation of simulation accuracy. Alternatively, define those settings on an individual check level. I am running the checks with the default settings.

Again, for every check run, the detailed results appear on the right. This is split up into two parts. Under Analysis, you see information about the check, settings to take actions, and the results. And the action section contains a setting to manually accept all recommendations for the checks and a summary of actions taken.

The final validation shows me the overall performance improvement after the selected checks have been completed. As this workflow can repeatedly compile and simulate the model, there is a quick scan option available to deliver an initial analysis of the model in a faster manner. And note that the performance Advisor does not contain specific checks for configurations for Simscape networks.

In the left pane, the different checks are listed. This is where specific tasks can be selected and deselected. Either apply global settings for all checks to take action based on recommendations, validation of simulation time, and validation of simulation accuracy. Alternatively, define those settings on an individual check level. I am running the checks with the default settings here.

Again, for every check run, the detailed results appear on the right. This is split up into two parts. Under analysis, you see information about the check, settings to take actions, and the results. And the Action section contains the setting to manually accept the recommendations from the check and a summary of actions taken.

As this workflow can repeatedly compile and simulate the model, there is a quick scan option available to deliver an initial analysis of the model in a faster manner. And note that the Performance Advisor does not contain specific checks for configurations for Simscape networks.