Main Content

simulink.multisim.DesignStudy

Create design study for multiple simulations

Since R2024a

Description

The simulink.multisim.DesignStudy object represents a design study that allows you to run multiple simulation at a large scale. With the simulink.multisim.DesignStudy object, you can specify values for massive simulations using parameter combinations. The table summarizes the objects you can use to configure values for massive simulations. Using the simulink.multisim.DesignStudy function with Parallel Computing Toolbox™ allows you to automate the creation of parallel pools, identifies file dependencies, and manages build artifacts for multiple simulations. simulink.multisim.DesignStudyruns simulations in serial if a Parallel Computing Toolbox license is not available.

ObjectsPurpose
simulink.multisim.ExternalInputSpecify a range of external inputs
simulink.multisim.ModelParameterSpecify a range of values for model parameters
simulink.multisim.BlockParameterSpecify a range of values for block parameters
simulink.multisim.VariableSpecify a range of values for model variables

When running massive simulations, you can specify the values for simulations in terms of parameter combinations. Providing simulation specifications in terms of parameter combinations allows you to easily configure design space to run large scale simulations in a concise manner. Once you use the above objects to specify values for massive simulations, you can use either of the following objects to specify the type of parameter combination for the values.

ObjectsPurpose
simulink.multisim.ExhaustiveCreate all the possible combinations for the specified values
simulink.multisim.SequentialCreates a sequential combination for the specified values

Once you have specified values for your simulation, and then created a parameter combination with those values, you can use the DesignStudy object to run simulations. DesignStudy object takes model name and a parameter combination as inputs to run simulations.

Creation

Description

d = simulink.multisim.DesignStudy(mdlname,parameterCombination) creates the DesignStudy object d for the model mdlname.

example

d = simulink.multisim.DesignStudy(mdlname,parameter) creates the DesignStudy object d for the model mdlname with the specified parameterthat is a model parameter, block parameter, external input or a variable.

Input Arguments

expand all

Model name, specified as a string or a character vector.

Data Types: char | string

Parameter combination for massive simulations, specified as a simulink.multisim.Exhaustive or simulink.multisim.Sequential object.

Parameter for massive simulations, specified as a simulink.multisim.Variable object, simulink.multisim.ModelParameter object, simulink.multisim.BlockParameter object, or simulink.multisim.ExternalInput object.

Properties

expand all

This property is read-only.

Name of model to simulate, returned as a string or a character vector.

Data Types: string

Parameter space containing the parameter combination object for massive simulations, returned as a simulink.multisim.Exhaustive or simulink.multisim.Sequential object.

MATLAB function to run before the start of the simulation.

MATLAB function to run after each simulation.

Examples

collapse all

This example shows the syntax for using the simulink.multisim.DesignStudy API. The example uses the simulink.multisim.Variable object to specify a range of values for certain variables, and then uses the ssimulink.multisim.Exhaustive object to create a parameter combination from the specified variables.

Specify value ranges for the variables

n = 1000;
thetaX0 = 0;
thetadotX0 = 1;
thetaRange = linspace(-pi,pi,n);
thetadotRange = linspace(-5,5,n);

Specify these values to the simulink.multisim.Variable object

thetaVar = simulink.multisim.Variable("thetaX0", thetaRange);
thetadotVar = simulink.multisim.Variable("thetadotX0",  thetadotRange);

Create an exhaustive parameter combination with the simulink.multisim.Exhaustive object

exhaustive = simulink.multisim.Exhaustive([thetaVar,  thetadotVar]);

Create a simulink.multisim.DesignStudy to run your simulations with

designStudy = simulink.multisim.DesignStudy("myModel", exhaustive);

Run simulations with the simulink.multisim.DesignStudy object

simOut = parsim(designStudy);

simOut is returned as a simulink.multisim.Future object. You can use this object to monitor the status of your simulations and to fetch outputs.

outputs = simOut.fetchOutputs();

Version History

Introduced in R2024a