Main Content

Configure and Run Simulations with Multiple Simulations Panel

The Multiple Simulations panel allows you to set up multiple simulations for a block parameter that you want to vary, for example, for a parameter sweep or Monte-Carlo simulations. You can pick a block parameter of interest from the model canvas and specify values that you want to use for the simulations. With the Multiple Simulations panel, you can provide configurations such as Use Parallel to run your simulations in parallel. To run the simulations that you have set up, first, select the design study, then click Run All button on Simulation tab on the Simulink® toolstrip. Once the simulations are complete, you can view and manage the results in Simulation Manager.

To learn how to use the Multiple Simulations panel through an example, see Multiple Simulations Panel: Simulate for Different Values of Stiffness for a Vehicle Dynamics System.

Workflow for Multiple Simulations Panel

Open the model and access the supporting files by using the following command:


To configure and run multiple simulations from the Simulink Editor:

  1. First, check that you have made all the desired changes to your model.

  2. The Multiple Simulations panel allows you to perform similar operations as the parsim command line API, but through the Simulink Editor. To open the Multiple Simulations panel, navigate to the Prepare section on the Simulink toolstrip. In the Inputs & Parameter Tuning section, click Multiple Simulations Icon of Multiple Simulations.

  3. The Multiple Simulations panel appears docked on the right side of the Simulink canvas.

    Multiple Simulations panel on opening

  4. In the panel, click the right most button to create a new design study. A design study is an object that allows you to set up simulations. The name of the new design study is automatically populated as DesignStudy. To change the name, double-click on the name and enter your preferred name. Once you configure and enter the values for the simulations, select the design study and click Run All on the Simulink toolstrip to run the simulations.

    The design study section of the Multiple Simulations panel

  5. Now, you can add a block parameter to the created design study. Click Add clock parameter icon to add a new block parameter to the design study. You can enter the block path or use a picker to select a block from the model canvas, or you can enter the block parameter name. Once you have added the block parameter, specify its values. If the block is a Signal Editor block, you can choose your specification from the list of scenarios. By default, all scenarios will be selected.

    Image of the added block parameter in the design study

    You can also add variables for your simulations by clicking Icon to add new variables.

    Parameter Combinations

    For the block parameters or variables that you add, you can use parameter combinations. Parameter combinations allow you to specify either an exhaustive combination or a sequential combination of the parameters. By default, all parameters at the top level are combined exhaustively.

    To create an exhaustive combination, select the specified block parameters. Then, from the parameter combinations drop down list Parameter Combinations icon, select Exhaustive combination. An exhaustive combination is denoted by Exhaustive combination icon. An exhaustive combination creates all possible combinations from the parameter values. For example, if there are ten values of one parameter and five values of another, an exhaustive combination creates a total of 10x5=50 different combinations.

    Exhaustive combination parameter set

    To create a sequential combination, select the specified block parameters. Then, from the parameter combinations drop-down list Parameter Combinations icon , select Sequential combination. For example, if you have two properties that each specify ten different values, sequential combination creates total of ten different simulations, one for each set of values. A sequential combination is denoted by Sequential combination icon. A sequential combination combines values sequentially. The number of values specified for each parameter must be the same. You can choose the sequence in which parameters are combined.

    Sequential combination parameter set

    Diagram explaining how exhaustive and sequential combinations work

    You can also nest parameter combinations. Based on the parameter combination specification, the Multiple Simulations panel shows the number of simulations that correspond to the design study.

    Nested parameter set

  6. In the Details: Design Study section, on the Run Options tab, you can also specify the option to run in parallel.

    Run Options tab showing the Use Parallel check box

  7. Now that you have entered specifications, select the scenarios and the design study that you want to run. Once you select the design study, the Run button on the Simulink toolstrip changes to Run All. Click Run All to run the simulations.

    The Simulink canvas showing the Multiple Simulations panel, with the design study selected and Run All button activated.

  8. Once the simulations complete, you can view and manage the results in the Simulation Manager . To open the Simulation Manager, click Open Simulation Manager on the status bar at the bottom of the canvas.

  9. Click the save button in the Multiple Simulations panel to save the design study. The design study is saved in .mldatx format. To reuse the design study, open the Multiple Simulations panel, click the open button, and select the design study file from the file browser.

    You can also save the Simulation Manager session information, which includes simulation data for all the plot configurations. To save the Simulation Manager session, use the save button on the Simulation Manager toolstrip.

Video Walkthrough

The following video walks through the overview of the Multiple Simulations panel.

Thumbnail for a video which walks through the usage of the Multiple Simulations panel. This video creates a design study in the Multiple Simulations panel, selects block parameter, and specifies different sets of values for the block parameter to run the simulations with.

See Also


Related Topics