WOLFRAM SYSTEMMODELER TUTORIAL

Simulation CenterExperiment Browser

Introduction | Options | Experiment Browser | Plot Windows | 3D Animation | Initializing Experiments | FFT Analysis | Importing and Exporting | Keyboard Shortcuts | Input Variable Data Files | CombiTimeTable File | Simulation Settings Files | Simulation Result Files | Communication with Simulation

The Experiment Browser is used to browse experiments and to perform operations on the experiments. Each experiment has four views for different types of operations:

  • Plot: a view from which you can select which variables and parameters to plot.
  • Parameters: a view from which you can edit the parameter values of the experiment.
  • Variables: a view from which you can set the initial values for state variables.
  • Settings: contains all settings for the experiment.

To change the active view of the Experiment Browser, click the tabs at the top of the browser.

Additionally, there is a Stored Plots section for easy plotting access, showing any plots stored in the model that is simulated.

Pinned and Unpinned Experiments

An experiment can be either pinned or unpinned. The consequence of being unpinned is that when a class is simulated from Model Center, it will search in Simulation Center for the first unpinned experiment for that class and reuse it by rebuilding that experiment. If no unpinned experiment is found for the selected class, a new experiment will be created in the unpinned state.

All experiments created from within Simulation Center will be created in the pinned state.

Setting Parameter Values

The Parameters view of the Experiment Browser contains all parameters of the experiment. The parameters are presented in a tree view that is built up hierarchically with components as branches. Double-click a component name to expand or collapse its branch. By expanding a branch, you will be able to access and edit the parameters of the corresponding component. All parameters that are changed compared to the default value in the model are highlighted in bold. Items higher up in the hierarchy are also highlighted to easily find modified parameters. A button is also shown next to modified parameters to easily change back to the default value.

Values are by default displayed in the displayUnit defined in the model. To change the displayUnit, click the Unit field and select the desired unit from the combo box. Then the value in the Value field is converted to the desired unit.

When editing the value in the Value field, a different displayUnit can be chosen without automatically converting the value while the variable is selected.

1.gif

The Parameters view of the Experiment Browser.

Setting Initial Values of State Variables

The Variables view of the Experiment Browser contains all state variables of the experiment. The state variables are presented in a tree view that is built up hierarchically with components as branches. Double-click a component name to expand or collapse its branch. By expanding a branch, you will be able to access and edit the state variables of the corresponding component. All variables that are changed compared to the default value in the model are highlighted in bold. Items higher up in the hierarchy are also highlighted to easily find modified variables. A button is also shown next to modified initial values to easily change back to the default value.

Values are by default displayed in the displayUnit defined in the model. To change the displayUnit, click the Unit field and select the desired unit from the combo box. Then the value in the Value field is converted to the desired unit.

When editing the value in the Value field, a different displayUnit can be chosen without automatically converting the value while the variable is selected.

2.gif

The Variables view of the Experiment Browser.

Changing Experiment Settings

The settings for a specific experiment can be changed from the Settings view of the Experiment Browser. Click the Settings tab to open the Settings view. The settings are divided into General, Advanced, Options, Input, and Output.

3.gif

The Settings view of the Experiment Browser.

General

4.gif

General experiment settings.

  • Start time: specifies the start time of the simulation.
  • Stop time: specifies the stop time of the simulation.
  • Solver: specifies the solver used to solve the dynamic system. There are five different solver choices:
  • DASSL: a variable step size and variable order solver that uses a backward differentiation formula method.
  • CVODES: a variable step size and variable order solver that uses a backward differentiation formula method. The added benefit of CVODES is that it supports forward sensitivity analysis. For more information on CVODES, see http://computation.llnl.gov/casc/sundials.
  • Explicit Euler, Heun's method, and Runge Kutta (RK4): fixed step size solvers suitable for real-time simulations. The step size is controlled by the Interval length setting, which also controls the number of output values in the simulation result.
  • Step size: specifies the step size to be used by fixed step solvers.
  • Tolerance: specifies the local tolerance that is used in each solver step. The final (global) error is in some way an accumulation of those per step errors. As a rule of thumb, reduce the desired global tolerance with a factor of 0.01 and use that as tolerance.
  • Interval length: specifies the length of the interval between output points from the solver. Note that the solver will output at least two data points for every event that is generated in the model in addition to what is specified by the interval length.
  • Number of intervals: specifies the number of output intervals that the solver generates. The default setting is 2000 intervals.
  • All solver steps: when set, all internal solver steps are returned as result. This can potentially lead to huge datasets. Therefore, it might be better to use a fixed Number of intervals, or Interval length, for more complex models.

Advanced

5.gif

Advanced experiment settings.

  • Maximum step size: specifies the maximum step size that the solver is allowed to use.
  • Event hysteresis epsilon: specifies the hysteresis threshold used for detecting events.
  • Accurate event detection: toggles root finding when using fixed step solvers. If turned off, events will occur at the next output point.
  • Nonlinear solver tolerance: specifies the tolerance for the nonlinear solver.
  • Maximum no. of internal steps: specifies the maximum number of internal steps that the solver is allowed to take before reaching the next output point. This setting can be used to abort the simulation when the solver encounters a stiff system.

Options

6.gif

Experiment settings options.

  • Check min/max attributes: if enabled, the simulation will terminate if any variable with min/max attributes goes outside its valid region.
  • Stop at steady state: if enabled, the simulation will terminate if all state derivatives become equal to zero.
  • Synchronize with real-time: if enabled, the simulation will be synchronized with real time. That is, the simulation will be slowed down so that the simulation progresses with the same pace as real time.

Input

7.gif

Experiment input settings.

  • Input Variable Data File: if an input variable data file is specified, variables declared as input variables and which are found (by matching names) in the specified file will receive their values from the data available in the file during the simulation. The file can either be specified as relative to the simulation executable file or with an absolute path. A more detailed description of the input variable data files can be found here.

Output

8.gif

Experiment output settings.

  • Save results to file: if enabled, the simulation result is written to a file. This is the default behavior and it only makes sense to uncheck this when running long real-time simulations.
  • Store state variables: if enabled, all states (except protected if store protected is disabled) are stored in the result file.
  • Store derivatives: if enabled, all derivatives (except protected if the store protected option is disabled) are stored in the result file.
  • Store algebraic variables: if enabled, all algebraics (except protected if the store protected option is disabled) are stored in the result file.
  • Store parameters: if enabled, all parameters (except protected if the store protected option is disabled) are stored in the result file.
  • Store protected variables: if enabled, all protected variables are stored in the result file.
  • Store event points: if enabled, the solver outputs extra output points at event points with the value before and after the event.
  • Store simulation log: if enabled, variables for the number of events, number of RHS evaluations, and how real time progresses during the simulation are stored in the result file.

Saving Experiment Settings in Model

9.gif

The Save Experiment Settings in Model dialog.

To save the experiment settings in the model, choose File Save Experiment Settings in Model. There are two ways of saving the experiment settings in the model:

  • In the original model. This option is only available if the original model is not read-only.
  • In a new model. The new model is created by extending the original model.

Time settings and solver settings are saved using the experiment annotation (see this section). Parameters and initial values are set directly or by using modifiers depending on where in the hierarchy the variable is located.

After saving the settings, the model still needs to be saved in Model Center for them to be permanent.

Closing Experiments

An experiment can be closed by right-clicking its title bar and choosing Close from the popup menu. Choose Close All to close all experiments. Choose Close All But This to close all experiments except the selected one. When closing an experiment, any plotted variables or parameters from that experiment are removed from all plot windows.

Duplicating Experiments

An experiment can be duplicated by right-clicking its title bar and choosing Duplicate from the menu. This will create a new experiment with the same parameter values, initial values, and experiment settings as the original experiment. Note that the model is not rebuilt when duplicating an experiment.

Sensitivity Analysis

When the CVODES solver is used, it is possible to perform forward sensitivity analysis on parameters. To enable sensitivity analysis for a parameter, check its SA checkbox in the Parameters view of the Experiment Browser. After a simulation, the result of the sensitivity analysis is available in the Plot view of the Experiment Browser. Now each state variable is expandable, and the sensitivities for that state will be listed as sens(parameter name).

10.gif

Available sensitivity result for the state inertia1.w.

Plotting Variables and Parameters

After an experiment has been simulated, there are two ways to show plots for the simulation. If there are any stored plots from the model, they will be shown under the Stored Plots at the top of the Experiment Browser. Below that, the Plot view contains all available variables and parameters of the experiment.

Stored Plots

The Stored Plots will show all plots stored from the simulated model, as well as from any model it extends. These stored plots can easily be shown by double-clicking the name, and a new plot window will be opened.

11.gif

The Stored Plots view.

This view can also be used to change the stored plots, such as renaming, deleting, or reorganizing them. This can be done through the right-click menu, as well as using drag and drop to reorder and move plots between classes.

Preferred plots are indicated by a name shown in bold and will automatically be opened when first simulating an experiment. Plots can be made preferred by right-clicking the name and choosing Preferred Plot.

Note that stored plots are stored in the model, but the model is only saved to a file by going to Model Center and choosing File Save for the specific model.

Plot View

In the Plot view, the variables and parameters are presented in a tree view that is built up hierarchically with components as branches. Double-click a component name to expand or collapse its branch. By expanding a branch, you will be able to access the variables and parameters of the corresponding component. Each variable and parameter has a checkbox for selecting that item for plotting. The behavior when selecting a variable for plotting differs depending on the type of the active plot window. There are two different plot windows: the Y(T) plot window, which is used for plotting variables and parameters versus time, and the Y(X) plot window, which is used for plotting a variable or parameter versus another variable or parameter.

Y(T) Plot: Time Plot

If the active window is a Y(T) plot window, see this section for information on how to create a new Y(T) plot window. The selected variable is plotted immediately when clicking the corresponding checkbox. A variable or parameter can be removed from the plot window by clicking its checkbox a second time.

Plotting the inertia1.w variable versus time from the IntroductoryExamples.MultiDomain.DCMotor model using the Plot view of the Experiment Browser.

Y(X) Plot: Parametric Plot

If the active window is a Y(X) plot window, see this section for information on how to create a new Y(X) plot window. The first selected parameter or variable is queued as the variable for the plot. When the variable is selected by clicking on a second variable or parameter, the Y(X) plot is shown in the active plot window. A variable or parameter can be removed from the plot window by clicking its checkbox a second time. When you remove a variable or parameter from a Y(X) plot window, the other variable or parameter in that Y(X) plot will also be removed.

15.gif

The chaotic behavior of the Chua circuit (Modelica.Electrical.Analog.Examples.ChuaCircuit) is illustrated by the parametric plot of C2.v versus C1.v.

Changing Display Unit

The first plotted variable in a plot window is by default displayed in the displayUnit defined in the model. Subsequent plots of variables with a compatible unit will be converted to the unit of the first plotted variable. To change the unit, click the Unit field of a plotted variable and select the desired unit from the combo box. This will change the plot unit for all variables that can be converted to the selected unit in the active plot.

Introduction | Options | Experiment Browser | Plot Windows | 3D Animation | Initializing Experiments | FFT Analysis | Importing and Exporting | Keyboard Shortcuts | Input Variable Data Files | CombiTimeTable File | Simulation Settings Files | Simulation Result Files | Communication with Simulation