Dymola Dynamic Modeling Laboratory Dymola Release notes Dymola 2013 FD01
The information in this document is subject to change without notice. Document version: 1 © Copyright 1992-2012 by Dassault Systèmes AB. All rights reserved. Dymola® is a registered trademark of Dassault Systèmes AB. Modelica® is a registered trademark of the Modelica Association. Other product or brand names are trademarks or registered trademarks of their respective holders. Dassault Systèmes AB Ideon Science Park SE-223 70 Lund Sweden E-mail: URL: Phone: Fax: Dymola.Support@3ds.com http://www.Dymola.
Contents 1 2 3 Important notes on Dymola .................................................................................................... 5 About this booklet ................................................................................................................... 5 Dymola 2013 FD01 .................................................................................................................. 6 3.1 Introduction ...............................................................................
3.6.4 External functions in other languages ................................................................................................... 44 3.6.5 Minor improvements ............................................................................................................................ 44 3.7 New libraries .................................................................................................................................................. 45 3.7.1 Electric Power Library................
1 Installation on Windows Important notes on Dymola To translate models in Dymola 7.x and later you must also install a supported Microsoft Visual Studio C++ compiler. The compiler is not distributed with Dymola. Note that free Microsoft compiler versions earlier than Microsoft Visual Studio Express 2008 are not supported (concerning full versions, some earlier versions are supported). Refer to section “Software requirements” on page 34 for more information.
3 3.1 Dymola 2013 FD01 Introduction 3.1.1 Additions and improvements in Dymola A number of improvements and additions have been implemented in Dymola 2013 FD01. In particular, Dymola 2013 FD01 provides • Extendable user interface; special packages can be used to define content of menus and toolbars, enabling e.g. defining own commands and define packages with your own collections of favorite models. • Modelica Text editor improvements. • More default settings can be saved between sessions, e. g.
For more information about the new libraries, please see section “New libraries” starting on page 45. Updated libraries The following libraries have been updated: • AirConditioning Library, version 1,8.3 • Hydraulics Library, version 3.3 • Modelica_LinearSystems2, version 2.3 • Pneumatics Library, version 1.5.3 • PowerTrain Library, version 2.2.0 • SmartElectricDrives Library, version 1.4.2 • Vehicle Dynamics Library, version 1.
3.2 Developing a model 3.2.1 Extendable user interface Defining content of menus and toolbars It is possible to extend the graphical user interface of Dymola by introducing own menus and toolbars from which Modelica functions can be called. The following picture shows a new menu My Functions. It contains a sub-menu My Matrix Functions and two menu items sin and cos. When selecting My Functions > My Matrix Functions > eigen values, the dialog of the Modelica.Math.Matrices.
package MyFunctions "My Functions" package MyMatrixFunctions "My Matrix Functions" function solve=Modelica.Math.Matrices.solve(A=[1,2;3,4],b={1,1}) annotation (Icon(graphics={…})); function eigenValues=Modelica.Math.Matrices.eigenValues "eigen values" annotation (Icon(graphics={…})); annotation(Icon(graphics={…})); end MyMatrixFunctions; function sin=Modelica.Math.sin; function cos=Modelica.Math.
package MyModels model Inertia=Modelica.Mechanics.Rotational.Components.Inertia annotation (__Dymola_shortcut=true); model Mass=Modelica.Mechanics.Translational.Components.Mass(L=1) annotation (__Dymola_shortcut=true); end MyModels; The models appear in the package browser in the usual way: When dragging from such a shortcut, an instance of the original model is created, possible with prefilled parameter values if a modifier has been used in the short class definition. 3.2.
A new group “Modelica editor” is added in the dialog. The expand modes are selectable: Manual formatting is selected by ticking the Manual formatting checkbox. The above settings can also be saved between sessions. Please see next section. Other improvements • Collapsed content can be deleted, a question will be displayed whether to do it. • Decrease of indentation using Shift+Tab. 3.2.
The Save button now saves more settings in the Appearance tab (see first figure in previous section); including the Modelica editor settings. 3.2.4 Splitting models The creation of submodels introduced in previous version of Dymola has been extended to also cover base classes. Selecting component/components, then right-clicking and selecting Split Model in the context menu will display the dialog box to the left below: Selecting Move to base class will display the dialog box to the right above.
Basic Functionality A selection of all variables called “phi” in a model can be made using the following annotation. model Selection1 annotation (__Dymola_selections={ Selection(name="MySelection", match={MatchVariable(name="*.phi")})}); end Selection1; The selection feature can be activated by extending the model containing the selections annotation: model MyFullRobot extends Modelica.Mechanics.MultiBody.Examples.Systems.RobotR3.
Including several variables in the selection can be made by using | in the regular expression for name: model Selection3 annotation (__Dymola_selections={ Selection(name="MySelection", match={ MatchVariable (name="*.(phi|tau)", newName="%path%")})}); end Selection3; Resulting in: Alternatively of using |, several matchings can be used. They are or’ed. model Selection4 annotation (__Dymola_selections={ Selection(name="MySelection", match={ MatchVariable (name="*.
model Selection5 annotation (__Dymola_selections={ Selection(name="MySelection", match={ MatchVariable (name="*.phi", newName="Angles.%path%")}), Selection(name="MySelection", match={ MatchVariable (name="*.tau", newName="Torgues.
i.e. the local variable phi of angleSensor is present. The reason was that the search pattern given was “*.phi”, i.e. any prefix to .phi. The pattern matching is performed from the top level model so the path “axis1.angleSensor.phi” was found. It is possible to make the pattern matching locally in certain classes only, by providing a (pattern for the) class name. In this case the pattern for the name is just “phi”.
Summary The matching constructor MatchVariable has the following fields: record MatchVariable String className="" "Classes to look in"; String name="*" "Regular expression for variable name"; String description="" "If non-empty, regular expressions that should exactly match description"; String tag[:]=fill("",0) "If non-empty, regular expressions that should exactly match any tag"; String newName ="" "New name"; end MatchVariable; Regular expressions can be used in all fields.
they can be activated or deactivated individually: 3.2.7 Minor improvements Search in model package hierarchy The search engine used in the command File > Search… and the corresponding context menu entry Search… is now enhanced to allow regular expressions in all fields. To use regular expressions, the checkbox Regular expression search in the Search options group in the dialog box should be ticked. Special symbols in the regular expressions are: * Match everything. ? Match any single character.
Presentation of enumeration values If an enumeration is used for a parameter, a combo box is created in the parameter dialog. If only enumeration values should be used (and not parameter propagation) the annotation annotation(__Dymola_editText=false) can be used. In such case only the selected value of the enumeration is shown in the input field, not the entire path including the name of the type.
3.3 Simulating a model 3.3.
Note that the name of the signal also contains the name of the result and the sequence number (in brackets). The identifiers end and end-1 are generated for the latest and second latest results; in other cases the absolute sequence number of the result is generated. The expression in the dialog can then be created by a combination of manual editing and by selecting other signals from the variable browser.
Alternative ways of invoking this function is through the command Plot expression in the Dymola toolbar, or by the command Plot > Plot Expression…. Since the function is not invoked on a signal, the Plot Expression dialog will not contain any pre-populated signal in this case: The “Plot expression” functionality has support in the scripting environment through the function plotExpression. This function can, for example, be used to change the default legend generated for an expression in a plot window.
Signal operators A fixed set of signal operators are available through the context menu of signals in plot windows.
Selecting an operator launches a dialog where the user can define the time range over which the operator will be applied. The default time range is from the start time to the stop time of the simulation. For the operators First Harmonic and Total Harmonic Distortion, the period of the signal must be entered. An error message is raised if the specified time range is out of bounds or if the minimum is larger than the maximum.
The result is then visualized in the plot in different ways depending of which operator that was selected. The time range and the associated text are using black color by default. If the plot contains more than one curve the text is written in the same color as the plotted signal. The picture below shows the appearance of all available operators: Common for all cases is that the time range is represented with a horizontal line with clearly marked end points.
Depending on the operator, the computed value is written either above or below the line representing the time range. This can be changed manually using the command Label Above Line in the context menu of the time range: Using this context menu you can also copy the value of the signal operator to the clipboard.
Plot Parametric Curve A new function plotParametricCurve is available for plotting curves defined by a parameter: function plotParametricCurve "plot parametric curve" input Real x[:] "x(s) values"; input Real y[size(x, 1)] "y(s) values"; input Real s[size(x, 1)] "s values"; input String xName = "" "The name of the x variable"; input String yName = "" "The name of the y variable"; input String sName = "" "The name of the s parameter"; input String legend = "" "Legend describing plotted data"; input Integer i
Copy curve values to clipboard The values of a curve can be copied to the clipboard by the Copy context command. As an example, copying J1.
(The previous copy command for copying the tooltip to the clipboard has been renamed to Copy Point.) Plot table In Dymola 2013 FD01 a plot can be displayed as a table instead of a curve. To create a plot table, select the command Plot > New Window > New Table Window. In the below example, a table has been displayed with the same signals selected as in the curve plot.
Copy copies the selected cells to the clipboard, making it possible to e.g. copy a part of a table to Microsoft Excel. Delete Row deletes the selected row(s). A row can also be deleted by deselecting the corresponding signal in the variable browser. Copy Entire Table copies the entire table to the clipboard. Erase All erases all table values. 3.3.
3.3.3 Scripting Call function dialog with output fields The Call function dialog now also contains entries to fill in output variables, i.e. in what variables of the scripting environment to store the results. If none of the output variable entries are filled-in, the results are output in the scripting window.
3.3.4 Selection of 32-bit or 64-bit executable In the 64-bit version of Dymola, the user can decide whether models should be compiled as 32-bit or 64-bit executables, using the flag Advanced.CompileWith64. The flag has three possible values: • 0 (default value); dymosim.exe compiled as 32-bit, dymosim.dll, dymosim as DDE server, and FMUs compiled as 64-bit.
Ticking All variables; ignore selections in model, all variables, given the Store settings, will be saved to the result file. If not ticked (default), only selected variables, given the Store settings, will be saved to the result file. If no selections are available, the value of the flag has no effect. To clarify what is actually stored, this setting, and the setting Protected variables setting, have been put in a new group: Store additional variables.
3.4 Installation 3.4.1 Adding libraries and demos to the File menu A new category “persistent” in the built-in function LibraryInfoMenuCommand makes it possible to automatically load a package containing user-defined menus and toolbars using a libraryinfo.mos file. Such menus and toolbars will not be removed by the File > Clear All command. For an example, see section “Defining content of menus and toolbars” on page 8. 3.4.
supported only by specific editions of Windows (“Home”, “Professional”, “Enterprise” etc.); all such editions are thus supported if the main version is supported. For the Windows platform, Microsoft C/C++ compiler must be installed separately. The following compilers are supported for Dymola 2013 FD01 on Windows: Free editions: • Visual Studio 2008 Express Edition (9.0) • Visual C++ 2010 Express (10.0) Professional editions: • Visual Studio 2005 (8.0) • Visual Studio 2008 (9.0) • Visual Studio 2010 (10.
Compatibility The Dymola – Simulink interface now supports Matlab releases from R2007a (ver. 7.4) up to R2012a (ver. 7.14). Only Visual Studio C++ compilers are supported to generate the DymolaBlock S-function. The LCC compiler is not supported. Note: Matlab R2010bSP1, R2011a, R2011b, and R2012a will give warnings that files in the Dymola/Mfiles folder are generated with an old p-code version.
Compatibility – xPC Target Compatibility with Matlab xPC Target has been verified for all Matlab releases that are supported by the Dymola – Simulink interface, which means R2007a (xPC Target ver. 3.2) to R2012a (xPC Target ver. 5.2). Only Microsoft Visual C compilers have been tested. 3.5.3 FMI Support in Dymola 64-bit export and import of FMUs Dymola 2013 FD01 64-bit version now supports both export and import of 64-bit FMUs.
For description of the new options, see below, section “FMU export extensions”. FMU export extensions FMUs can optionally be exported with source code included, by setting the new Boolean argument includeSource = true in translateModelFMU. This function has also become more explicit in that its complete behavior is controlled via arguments instead of global flags.
can be set to “me”, “cs” and “all” for inclusion of “model exchange”, “co-simulation” and “all” respectively. In addition, the new string argument fmiVersion controls the FMI verision (“1” or “2”) of the FMU. For FMI 2.0, see below. The default values for the new arguments to translateModelFMU are chosen in a backward compatible manner; old calls to it will behave the same except that fmiType defaults to “all” instead of “me”.
This argument, default being true, can be set to false to disable the prompting before replacing any existing Modelica model that was the result from a previous import. This is useful for scripting. Import of FMUs for Co-Simulation 1 The Co-Simulation FMU import is enabled by setting the input argument integrate of the function importFMU to false. The macro step size can be set as the parameter fmi_CommuncationStepSize in the FMI tab in the parameter dialog of the generated Modelica model.
Finally, the resulting trajectories can be plotted and compared visually with the original (non-FMU) simulation. Note that, since the imported model is flattened, the trajectory names are somewhat different; e.g. J1.w becomes J1_w: The blue trajectory is from the reference simulation and the red is from the co-simulation. Note that the latter is rendered as constant between the sample points.
• Test of FMI version 1.0 or 2.0 Beta4. It is available in Modelica\Library under the Dymola installation. Below call validates CoupledClutches as a co-simulation FMU for FMI 1.0: validateModelAsFMU( "Modelica.Mechanics.Rotational.Examples.CoupledClutches"); An excerpt from the log file is given below: In this case we may argue that the comparison tolerance should be increased to avoid the report of this trajectory. FMI 2.0 Beta 4 (LA) Partial support is provided for FMI 2.0 Beta 4.
All mandatory features are supported in FMI 2.0 Beta 4. The optional (in the sense that they have associated capability flags) features not supported are: • FMUs can only be instantiated once per process. • The internal FMU state cannot be serialized. • Estimates of output derivatives are not provided. • fmiDoStep cannot run asynchronously. The Files > Import > FMU… commands and script function importFMU accepts FMUs created according to FMI 2.0 Beta 4 Model Exchange specification.
3.6.2 Support for String variables in models String variables can now be used in models, not only in functions used in models and for scripting. String variables in model are allocated with a maximum string length. It is defined by the scripting variable Advanced.MaxStringLength with default=500. If assignment to a string variable in a model fails because of the string being too short, truncation is done and a warning is given in the simulation log window.
3.7 New libraries 3.7.1 Electric Power Library Electric Power Library is a new library that provides a framework for efficient modeling, simulation and analysis of electric power systems. The models can be used for simulation of steady state as well as transient operation of power systems.
3.7.2 Engine Dynamics Library Engine Dynamics Library is a new library that a framework for combustion engine system modeling, simulation and analysis, including the complete gas exchange. The library is well suited to represent transient engine response and related engine control. Applications include control design with the purpose of reducing emission transients from the engine, transient exhaust condition modeling for optimum EATS operation conditions, and engine response dynamics.
3.7.3 Hydro Power Library The Hydro Power Library is a new library that provides a framework for modeling and simulation of hydropower plant operation. The library components enable performance analysis and optimization of the operation of hydropower plants. It offers an excellent environment for testing new control strategies and tuning plant controllers for optimal performance.
3.7.4 Liquid Cooling Library The Liquid Cooling Library is a new library is targeted to liquid cooling system design with compressible or incompressible flow. It is suitable for a broad range of applications, including automotive, industrial equipment and process industry. Applications include engine cooling, battery thermal management, and cooling of power electronics and machines.
3.7.6 Thermal Power Library The Thermal Power Library provides a framework for modeling and simulation of thermal power plant operation. The comprehensive set of components enables performance analysis and optimization of all kinds of thermal power plants. Different plant designs and their respective dynamic behavior can be studied already in the concept design phase. The Thermal Power Library is also well suited for control system development and verification, e.g.
3.8 Updated libraries 3.8.1 AirConditioning Library A minor version, 1.8.3, has been released, with some modifications, e.g. • Dialog annotations added to variables in summary records. • Outlet enthalpy h_out in heat exchangers now always corresponds to the state in the last control volume independent of flow direction. • Compressor outlet enthalpy guarded against very high values at low efficiencies. 3.8.2 Hydraulics Library Hydraulics 3.
• • • • All physical models that dissipate heat (such as gears, clutches or dampers), have now an optional heat port to which the dissipated energy is flowing, if activated. Improved functionality of torque division for controllers of (hybrid) electric vehicles. Upgraded documentation of controllers, converters, and electric drives. Redesigned visualization elements to be compatible with those used in Modelica Standard Library. The version is backward compatible to PowerTrain 2.0.x. 3.8.