EXPERIMENTS🔗
The main purpose of Modelon Impact is to simulate and analyze models. To do this, you can perform Experiments in Impact by using models.
When pressing the PLAY button, Impact always runs an Experiment.
Experiment layer🔗
An Experiment can be thought of as a layer on top of the active model containing experiment values.
An Experiment is therefore based on a simulation model. It inherits the structure/diagram, properties, and parameters of the model and it allows you to vary parameters without changing the model, i.e. the Modelica code itself.
In other words, you can run different scenarios without changing the actual model and you can create and store as many Experiments as you want on the same model.
An Experiment "calls" a Custom Function, meaning that the Experiment setting defines, which kind of simulation/analysis is executed (Dynamic, Steady-State, etc).
With an Experiment, you can:
- Modify/Change model parameters
-
Determine which type of simulation to perform:
- Analysis in the time domain (Dynamic, custom funtion. also dynamic settings),
- Steady-State analysis (custom function. steady-state setting), or a
- user defined/Library-specific Custom function (cf. also Custom function settings).
-
Modify/Adjust execution settings
Simulation models🔗
It's only possible to run and define Experiments for simulation models. As defined in the Modelica language specification, simulation models are
model
s,block
s, andclass
es.
All the above mentioned classes without declaration prefixes like partial
or replaceable
.
Inheritance🔗
Experiments are inherited. If you extend a given simulation model, which has Experiments, then these Experiments are also available for the child classes.
Note
Depending on how the child class has been modified in comparison to the parent class, it may happen that the Experiments of the parent class no longer work completely. For example, if new components are introduced that require customized solver configuration.
Default Experiment🔗
There must be always one Experiment marked as default. If no Experiment is selected (e.g. when you are in Modeling mode, this default Experiment is executed when pressing the PLAY button).
- If your simulation model inherits Experiments from a parent class, then it takes the default Experiment from there.
- If you create a further Experiment in the child class, then this child class Experiment is set as the new default Experiment.
Default settings🔗
-
When you open a simulation model that does not have a predefined Experiment, Impact will generate a "virtual" Experiment, to ensure that you can immediately run a Dynamic simulation.
-
As soon as you change something in the virtual Experiment, it will be stored as a file (e.g., changing the stop time or the Custom Function).
-
The automatically created virtual Experiment or a newly created Experiment has preset values, e.g. for the start or stop time.
-
Modelon Impact first tries to read these values from the Simulation model, more precisely from the
experiment
annotation in the Modelica source code. -
If there are no values there, Impact retrieves the default values from the Custom Function that is selected in the Experiment.
-
By default, Dynamic simulation in the time domain (a Custom Function) is always set initially.
-
So, when a new Experiment is created, the default values will be read first from the model and second from the Custom Function.
-
If you "reset" an Experiment, its value modifications are reset to the default values given by the model or Custom Function.
Storing Experiments🔗
Experiments are always created on top of both, editable and read-only models. They are stored as separate JSON files in Projects.
-
For editable models, Experiments are saved in the same Project as the model.
-
For read-only models, Experiments are saved in the "Default Project".
Further information about the data storage model can be found in chapter Workspace.
Note
Undo and Redo operations are not supported for creating/deleting experiments.
Simulation🔗
When the model is simulated, settings and parameters will be taken from both, the model and the Experiment.
Parameters in the Experiment take priority! This means that any Experiment values will replace the underlying values in the model.
Modifying a parameter in Experimentation mode will not change anything in the original Modelica source of the model!