Dymola Basics: 5. Variable Browser

October 4th, 2016 by Mahdieh Mehrabi

Written by: David Briant – Project Engineer

This is the fifth in a series of the Basics of Dymola following on from the first blog post about the Component Browser. This post will be describing the Variable Browser in the Simulation window and the features surrounding the use of it to evaluate simulation results.
The Variable Browser is the location that a user can view all the variables that are used and calculated, both inputs and outputs, within a simulation and is highlighted below in Figure 1. A simulation of the DoublePendulum example is shown which can be found in the Modelica Standard Library with the path: Modelica.Mechanics.MultiBody.Examples.Elementary.DoublePendulum.


Figure 1: Location of Variable Browser in Simulation Window

Once a model has been simulated all the variables are shown allowing them to be plotted, such as the variable angle in the joint revolute1 shown plotted above. The list of variables is stored under the name of the model run, in this case DoublePendulum, but when multiple simulations of the same model occur then they are displayed in numerical order according to the time they were run. If another DoublePendulum simulation was run, then it would appear as DoublePendulum 2 and the first would be DoublePendulum 1.


Figure 2: Keeping Result sets within the Variable Browser

If a third simulation was run, then it would become DoublePendulum 2 and the second simulation would now appear as DoublePendulum 1, with the data from the first simulation removed from the Variable Browser. This can be stopped by right clicking on the model name, e.g. DoublePendulum, and selecting Keep Result, as shown in Figure 2. This stops the results from being overridden and is shown by the pin icon to the left of the name, this can be undone by repeating the process. In a similar way, a data set can be removed from the variable browser by selecting Close Result.

The Variable Browser also allows modification to values that are not constrained, in the case of the first image phi and w which is the initial angle and angular speed of the joint. If the variable has a unit associated with it then it is displayed alongside the variable with a description of the variable if made in the variable declaration. The modified variable values can be saved to the model and replace the starting model parameter inputs by selecting Save Start Values in Model from right clicking the name of the model with the preferred values.

While able to change the variable input after a simulation, a user can also change the initial conditions of a simulation after just translating the model by using the Translate button highlighted in Figure 3.

 figure-3Figure 3: Translate Model button in Simulation Taskbar

This shows a list of initial values of the model but as the model has not been simulated it only shows the list of variables able to be modified; as shown below these can be modified in the same way a simulated model can be in order to modify the conditions of the simulation.


Figure 4: Initial Values of each Variable

Within the Variable Browser there is the ability to filter variables and there are also advanced plotting features that can be accessed by clicking Advanced tab shown at the bottom of Figure 4; this accesses the Advanced Mode menu as shown below.


Figure 5: Advanced tab of the Variable Browser

The buttons control what is displayed within the Variable Browser:


Table 1: Table of Advanced Variable Browser controls

The checkboxes modify how the data is displayed in the plotting window:


Table 2: Advanced Variable Browser plotting checkboxes

The Search Filter allows the variables displayed in the Variable Browser to be searched through using either the name of the variable or the path of a variable or a component.
The Time input displays all the values of the variables within the Variable Browser at the time entered.

Figure 6 is an example of the use of the Advanced tab that searches for all variables starting with phi and then displays their values at the time of 1.5 seconds but does not display Constants. The Plotting window displays 2 variables (blue and red) and the difference between them (green) throughout the simulation.


Figure 6: Using The Advanced Variable Browser Plotting features

There is an ability to further filter the search results within the advanced tab of the variable browser. The table below shows the different symbols and their effect on which variables are shown:


Table 3: Advanced filtering terms

Written by: David Briant – Project Engineer