Video length is 4:39

How to Use Variant Manager in Simulink, Part 2: Analyze and Reduce

From the series: Variant Manager

In part 2 of this video series, follow a concise guide to analyzing and reducing models using Variant Manager for Simulink®. See an example of a wiper system model having multiple speed modes that are modeled using variant elements. Learn how to use Variant Analyzer to compare and contrast variant configurations. You’ll also learn how to create a separate model with the required configurations using Variant Reducer.

Published: 4 Dec 2023

Welcome to Part-2 of the Variant Manager video series.

In part 1 we saw the wiper system model, which has an option to run under multiple modes.

We used Variant Manager to visualize model hierarchy, autogenerate configurations and add custom configurations, control variables and constrains. Finally, we stored our configurations and constrains in Simulink variant configuration data object.

In this video we will see how we can analyze our configurations and reduce our model using variant manager.

we have five custom configurations for our model.

When you have multiple configurations in a single model, you may need to compare them to identify errors and inconsistencies in the model, to view behavior of any element in the model or to perform trade studies across configurations.

This brings us to next step which is analyzing our model to compare and contrasts multiple configurations.

Now You can select the Variant analyzer option and then select the configurations you want for the analysis.

Now click on “analyze model”.

This generates variant analysis which shows the selected configurations, model hierarchy and if a block is active or inactive in the selected configurations. This is a heat map where highlighted cell means the block is inactive in the respective configuration and check mark means that the block is active.

The activeness column shows if the blocks are active, inactive, or partially active in the set of selected configurations.

And the annotations mentioned in the table represents the conditions which are shown at the bottom.

Now let’s look at the analysis more closely.

In this example, the analysis show that the fog sensor is never activated for any of these configurations. This shows that we have untested or dead region in our model. No configuration is covering this sensor, so we may choose to add another configuration which activates the Fog sensor or if we don’t want to consider using this sensor then we may choose to remove the Fog sensor input from our model. You can get more such insights using the analysis.

Now, once you have done your analysis. You may consider focusing your efforts on specific set of configurations or selectively share your model with a limited number of configurations.

In such cases, you can create a separate model with the required configurations.

Which brings us to the last part: Reduce

The wiper model consists of multiple blocks encompassing smart and manual speed modes. Now let us reduce this model, go to Variant manager…. and then click on variant reducer.

Now, select any one reduction mode. Here, we will use the “variant configuration” mode.  

Now, let us say we decide not to opt for smart sensors to minimize our expenses and we want to share this model with the supplier. Then we can leverage our analysis to identify configurations that do not rely on smart sensors or smart input blocks.

And by doing so, we can choose and share only those configurations that are relevant and beneficial to the supplier.

Then Select the output folder location which will encompass the reduced model and all related artifacts.

Also, you can select the “generate detailed summary” option if you want a detailed report.

After selection click on reduce model.

This creates and automatically opens a separate Simulink model having only the selected configurations.

You will notice that the reduced model has captured only the necessary blocks which were required in our selected configurations.

And by examining the variant manager of this reduced model, you will find only the selected configurations.

This means we have successfully reduced our model.

To get more information on Variant Manager, you can use the getting started tab or use the help icon at the top.

Now you can easily manage, analyze, and reduce your model with Variant Manager.

Thank you for watching this video. You may refer more such videos on our YouTube channel and MathWorks website.