In Dymola 2019 FD01, it has been made easier than ever to carry out a parameter sweep study. There is indeed an integrated capability in the software and its interface has been improved in this latest release.
Let’s have a look at an example. Let’s run the example DoublePendulum from the Modelica Standard Library (Modelica.Mechanics.MultiBody.Examples.Elementary.DoublePendulum).
Figure 1: Double pendulum example from MSL.
To enable the parameter sweep functionality, in the simulation window, we need to click on Simulation -> Sweep Parameters.
Figure 2: How to enable the parameter sweep functionality.
Doing this will open a window on the right hand side of the screen (by default).
After we have run the model once, we can drag and drop the parameter(s) we want to sweep from the Variable Browser to this new window. For example, if we want to sweep the damping coefficient of the damper, it looks like this:
Figure 3: We want to sweep the damping coefficient.
After we have dragged and dropped one or several parameters to the Sweep Parameters window, we need to click on the red “S” as we can see on Figure 3 above and then on the grey Edit button to choose what values to assign to the damping parameter.
Figure 4: Let’s set values to the damping parameter.
In this case, we will run the Double Pendulum experiment 3 times with damping values of 0.1 then 0.2 then 0.3 N.m/rad. Optionally, we can drag and drop one or several variables to the Sweep Parameters window and click on the plot icon next to the red “S” to automatically plot the values of these variables for all the iterations. If we decide to plot the damper’s relative angular velocity, this is what we get, after clicking on the Run Sweep button at the bottom of the Sweep Parameters window:
Figure 5: Plot of the damper’s relative angular velocity for the 3 test cases.
Written by: Romain Gillot – Powertrain Modelling Engineer