With the release of the latest version of Dymola, 2020, comes a slew of new features. Notably, this version of Dymola arrives with the latest edition of the Modelica Standard Library, version 3.2.3. Here’s a selection of the highlights in Dymola 2020.
Plotting connector variables
Earlier, my colleague Alessandro wrote about the new ability in Dymola to plot variables directly from the modelling diagram layer in the simulation tab. As it turns out, in Dymola 2020 the user is able to specify not only the plotting of component variables, but also those from connectors. This is done in the same way as components, but by clicking the connect statement instead.
Found in the package browser, the favorites package provides a handy way of collecting all your most used components in a single package, making them easily accessible. If you find yourself repeatedly using the same components time and again, this new feature provides a way of avoiding having to scroll through many libraries to find specific components, or relying on using the search function. The favorites package is created in the Dymola working directory. For more info, see Dymola 2020 Release notes page 10.
Setting connector units from the GUI
Traditionally, parameter units could be selected from the dialog window of a component. Now, it is possible to select the units of a connector by right clicking. This action automatically generates the unit conversion text within the model for the connector. See page 17 of the Dymola 2020 release notes for more info.
A new advanced flag provides the ability to log which variables are defined as parameters post translation. This is achieved by setting the flag:
Adavanced.Translation.LogParameters = true
With this flag set, a text file is generated in the working directory listing all the parameters in one column, with the alternatives (fixed, tunable or dependent) listed in a second column. The file generated is called parameters.log, and is not generated (flag is set to false) by default. See page 26 of the Dymola 2020 release notes for more details.
Event logging GUI
Chasing down and removing events is a key aspect of making Dymola models run efficiently. Dymola 2020 aids this task by introducing a user interface method of identifying these events, and where they are in the model code.
A new option under the Simulation menu on the task bar in the Simulation window called Analyze Numerics generates the Event Log window. This is provided that the simulation flags for logging events (during simulation/initialization) or states which dominate the error are enabled within the Simulation Setup. The Event Log details each event within the model, including the time, the expression(s) generating the events at that time step, the value triggering expression and any warning regarding Bifurcation, which refer to expression which almost trigger an event.
More details can be determined about each event, notably determining the code responsible. This can be done by right clicking an event in the log and selecting Show component. This provides the user with option to open the component containing the event expression, or to open the declaration directly.
For more details, see page 32 of the Dymola 2020 release notes.
Steady state initialization
Model initialization is an important topic in any dynamic simulation model. In Dymola, a model which initializes in as steady a state as possible will take less time to simulate, as well as being more robust. To support this, a flag was introduced in previous versions:
Setting this flag to true enables Dymola to utilize steady states to complete the initialization process (states with fixed=true are always initialized to their proscribed values regardless). In Dymola 2020 this flag has been improved to include more applications, including working better in combination with models featuring dynamic states.
Beyond this, a new built in function has been added, which enables the flag to be used within code:
This function returns the setting of the advanced flag (true or false), so it can be used within the code. This means special settings can be programmed into models which only are enabled during steady-state initialization. To learn more about this, please see page 27 of the Dymola 2020 release notes.
Improved external function handling
Dymola 2020 now supports the exchanging of arrays (of 3 or more dimensions) with external Modelica function executables. For more details, please see page 61 of the Dymola 2020 release notes.
Nate Horn – Vice President
Please get in touch if you have any questions or have got a topic in mind that you would like us to write about. You can submit your questions / topics via: Tech Blog Questions / Topic Suggestion.