Skip to content

Setup a Parameter Sweep🔗

Modelon Impact offers the possibility to create and perform Parameter sweeps as batch-like multi-run experiments for a given model. This lets the user investigate the parameter space of the model and gain an understanding of its behavior relative to certain parameters.

  1. Go to Experiment layer -> Diagram View -> Right sidebar.
  2. In the EXPERIMENT browser, - Click "+ New experiment" button to add a new Experiment, or - Select another Experiment from the list

Note

Via Diagram View, you can select parameters you want to modify (sweep) by selecting a model component and changing a parameter in the PROPERTIES panel (right side-bar). These settings are in sync with the Experiment Setup View.
To specify distribution operators, please continue on the Experiment Setup View.

  1. Switch to Experiment Setup View ("Experiment" tab)
  2. Select "Parameter sweep"
  3. Click "+ Add modifier" to select a parameter you want to change.
    (Use the IntelliSense, to help you to find the right path.)
  4. Click
    • "Checkmark" button to confirm/submit, or
    • "Crossmark" button to discard.
  5. By default, Impact adds the value from the model to the parameter.
    Click into the field to switch to "edit mode"

Repeat steps 5 to 7 until all the parameters to be modified are in the list.

  1. In the "Method" column, you can select the way you want to modify a parameter:

    • "Value": Just a modification, no variants
    • "Range": Set a range of values for a parameter.
    • "Choices": Define an arbitrary sequence to sweep, that enables different values for a parameter regardless of its relationship to each other.
  2. "Value" is selected:
    Enter a single value to modify the parameter, and make sure your value returns the required datatype.

  3. "Range" is selected:

    • Enter the start and the end value of the value range in the corresponding fields
    • Enter the number of steps in the field "Steps"
    • Note: The "Range" operator can only be used for numbers (Real and Integer)

  1. "Choices" is selected:
  • Enter a list of values to the Value field, make sure you separate by comma (see figure)
  • Notes:

    • For Booleans, the list is hardcoded to true, false, because there are only 2 choices.
    • For Strings, don't forget the quotation marks, like "foo", "bar".
    • For Enumeration, enter a list of alternatives, like .Modelica.Blocks.Types.SimpleController.PI, .Modelica.Blocks.Types.SimpleController.P

  1. Click
    • "Checkmark" button to confirm/submit, or
    • "Crossmark" button to discard.

Total number cases🔗

Impact calculates the total number of cases, based on the number of list items in "Choices" and the number of steps in "Range" operators. Both, "Choices" and "Range", can be set for as many parameters as you like.

Note, however, that all combinations of settings are simulated so the number of simulations increases rapidly, for example:

  • Parameter_1: choices(1,2,3) --> 3 cases
  • Parameter_2: range(from 11, to 33, with 10 steps) --> 10 cases
  • Final no. of simulations (cases): 3 x 10 = 30 simulations.

Datatypes🔗

By hovering over the parameter name on the left, a tooltip shows the datatype of the parameter. Make sure that the entered values return the required datatype of the parameter:

  • Real: any number with or without a decimal operator, like 12 or 3.14 or -6e2
  • Integer: any number w/o decimal operator, like 12 or -6e2
  • String: any value/text in quotation marks, like "foo"
  • Boolean: a Boolean value, means either true or false
  • Enum (enumeration): a value that returns the Modelica path of an alternative like .Modelica.Blocks.Types.SimpleController.PI

Note

Modelica expressions, as they are used in the modeling layer, are not yet supported! The modifications must be constant values.

Example:
Modify a parameter p with 12.5.
Do not modify p like that: m + 4.5. That is an expression because it references other parameters (here m) and it uses mathematical operators (here +).


Dynamic Simulation | Steady State | Cancelled Simulation | Multi-run | Statistical analysis | Experiment Types