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:
First, check that you have made all the desired changes to your model.
The Multiple Simulations panel allows you to perform similar operations as the
parsimcommand 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 .
The Multiple Simulations panel appears docked on the right side of the Simulink canvas.
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.
Now, you can add a block parameter to the created design study. Click 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.
You can also add variables for your simulations by clicking .
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 , select Exhaustive combination. An exhaustive combination is denoted by . 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.
To create a sequential combination, select the specified block parameters. Then, from the parameter combinations drop-down list , 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 . 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.
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.
In the Details: Design Study section, on the Run Options tab, you can also specify the option to run in parallel.
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.
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.
Click the save button in the Multiple Simulations panel to save the design study. The design study is saved in
.mldatxformat. 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.
The following video walks through the overview of the Multiple Simulations panel.