Dymola Dynamic Modeling Laboratory Dymola Release Notes Dymola 2015 FD01
The information in this document is subject to change without notice. Document version: 1 © Copyright 1992-2014 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 Support: URL: Phone: http://www.3ds.com/support http://www.Dymola.
Contents 1 2 3 Important notes on Dymola .................................................................................................... 5 About this booklet ................................................................................................................... 6 Dymola 2015 FD01 .................................................................................................................. 7 3.1 Introduction ...............................................................................
3.6.5 Engine Dynamics Library ..................................................................................................................... 43 3.6.6 Fuel Cell Library .................................................................................................................................. 43 3.6.7 Heat Exchanger Library........................................................................................................................ 44 3.6.8 Hydraulics Library ..........................
1 Important notes on Dymola Installation on Windows For users of Windows XP and Windows Vista, specific conditions apply. Please see section “Support for Windows XP and Windows Vista” on page 26. To translate models on Windows, you must also install a supported compiler. The compiler is not distributed with Dymola. Note that administrator privileges are required for installation.
2 About this booklet This booklet covers Dymola 2015 FD01. The disposition is similar to the one in Dymola User Manual Volume 1 and 2; the same main headings are being used (except for, e.g., Libraries and Documentation).
3 3.1 Dymola 2015 FD01 Introduction 3.1.1 Additions and improvements in Dymola A number of improvements and additions have been implemented in Dymola 2015 FD01. In particular, Dymola 2015 FD01 provides: • Support for FMI 2.0 (page 38) • Extended FMI support: o On Windows, the handling of external resources is now also supported for FMI 2.0. (It was previously already supported for FMI 1.0.) (page 38). o On Windows, Co-simulation export of FMUs with Dymola solvers is now also supported for FMI 2.0.
• • • • • JavaScript interface to Dymola (page 30). Report generator (page 31). Support of Windows 8.1 (page 26). GCC compiler support extended on Windows (page 27): o DLL export supported For users of Windows XP and Windows Vista, specific conditions apply (page 26). 3.1.2 New and updated libraries New libraries No new libraries are released in Dymola 2015 FD01. Updated libraries The following libraries have been updated: • Air Conditioning Library, version 1.9. • DataFiles Library, version 1.0.2.
3.2 Developing a model 3.2.1 Extended connection dialog The connection dialog has been extended to support overlapping (stacked) connectors. The subcomponents selected by the user are shown at the bottom of the dialog. Below is an example how to use this feature when connecting FMUs with stacked connectors. Note 1: Only overlapping connectors of the same parent component are supported by this feature. Note 2: The feature “Smart Connect” is presently not supported when connecting overlapping connectors.
For information about the automatic stacking of connectors when importing FMUs, see section “Improved import of FMUs with many inputs/outputs” on page 41. 3.2.2 Infinite diagram layer In Dymola 2015 FD01, infinite diagram layer is implemented. You can move the diagram/icon layer by pressing Ctrl while moving the mouse. Scrollbars are no longer needed, and are removed when using this feature. The feature is by default active, but can be disabled by setting the flag Advanced.InfiniteDiagramLayer=false 3.2.
Here you can select name and package. To create a new package, click the marked icon. This opens the normal Create New Package dialog. The newly created package gets preselected after creation. To add a currently open class as a favorite, right-click the background of the diagram layer and select Add as Favorite…. As an example, consider a package of favorites: Favorites.
This setting is by default not activated. Activating this setting corresponds to setting the flag Advanced.LogBusSignalSets=true. When the setting is active, you get a new entry in the Translation tab of the Command log (if the model has expandable connectors, like for example the Robot demo).
Expanding this display several instances like: Source means that a causal signal originates at that place, and Use that the signal is used at that place. Clicking on a link highlights both components of connect-statement in the diagram layer. The node can be opened to show detailed content (this information is also shown for some errors in order to help with localizing the error). Note: • Source without Use means that the signal is not used.
• Neither Source nor Use: The signal is only present in the connector definition and is not used. 3.2.5 Improved export of images of diagram/icon layer In Dymola 2015 FD01, images of diagram layer/icon layer can be exported also to SVG files, using the command File > Export > Image…: 3.2.6 Minor improvements Extended UNC path support The current directory can now be an UNC path on Windows. Note: Compilation is handled by copying to a temporary directory.
The options are: • No change (default). No special treatment of inner/outer components. • All inner: Intended to make a model that can be run directly. All inner components • visible from the selected sub-components are included. Make outer: Intended to make a reusable sub-system. Any used inner component is replaced by a corresponding outer component. This Dynamic typing choice is remembered between calls, and is also available as: Advanced.SplitModelDynamicVariant.
Values less than 50 cannot be set. The setting corresponds to the flag Advanced.MaxLineLength. The value can be stored in the setup together with other setting in the Appearance tab, by using the Save Setting tab.
3.3 Simulating a model 3.3.1 Simulation speed-up Multi-core support Dymola can parallelize the evaluation of model equations for calculation of the derivatives for continuous-time integration. This feature is activated by setting the flag Advanced.ParallelizeCode = true Dymola automatically inquires the number of cores. Notes: • Hyper-threading is included in this number, i.e. a dual-core processor is seen as 4 cores, and a quad-core as 8 cores.
The log reports that the calculation of the derivatives (the DynamicsSection) includes 413717 operations, while for the parallelization using 4 cores the longest path is 110030 operations, which means an estimated speed-up of 3.76. The critical path is estimated to have 26131 operations, i.e., the Amdahl speed-up factor is 413717/26131 = 15.3, which indicates an upper limit of what could be obtained having many cores and neglecting overhead.
The method for parallelization is described in the paper: H. Elmqvist, S.E. Mattsson and H. Olsson: “Parallel Model Execution on many cores”, Proceedings of the 10th Internal Modelica Conference: https://www.modelica.org/events/modelica2014/proceedings/html/submissions/ECP140963 63_ElmqvistMattssonOlsson.pdf This paper includes successful uses from the thermodynamic and the electrical domains giving speed-ups of 2.9-3.4 on a quad-core machine.
3.3.4 Animation window Export of animation as X3D supported In Dymola 2015 FD01, exporting animations in X3D format is supported, by using the command File > Export > Animation…: There are two possibilities to export to X3D files: • Pure XML. • As XHTML (HTML/JS). When exporting to this file format, an external library, X3DOM, is used. Improved VRML export The export to VRML files has been improved: • Objects are seen in the same view as in the animation window. • “Follow” is implemented.
3.3.5 Scripting The library DymolaCommands reviewed and updated, and automatically opened New command group “Documentation” added A new subpackage Documentation has been added in DymolaCommand, to support export of, for example, diagram and equations, to create dynamic reports. Improved documentation of the commands The documentation of a number of commands in DymolaCommands has been improved, for most commands examples are given in the documentation.
Commands removed from DymolaCommands The following commands have been removed from DymolaCommands due to low usability; they are however still accessible in Dymola. • continue • experiment • SetVariable • readDataFromFile • RestoreWindow • writeToFile Automatic opening of library In Dymola 2015 FD01, DymolaCommands is automatically opened, like the Modelica Standard Library.
New commands A number of new commands (built-in functions) have been added, for example to support the report generator: clearPlot clearPlot(id=0) Erase curves and annotations in the diagram. Id is identity of window (0 means last). exportAnimation exportAnimation(path, width=-1, height=-1) Exports an animation to file. Supported file formats are AVI, VRML, and X3D. The file format is determined by the file extension. Use wrl as file extension for VRML.
exportEquations exportEquations(path) Export the equations to file. Supported file formats are PNG and MathML. The file format is determined by the file extension. Use mml as file extension for MathML. exportIcon exportIcon(path, width=80, height=80, trim=true) Export the icon layer to a file. Supported file formats are PNG and SVG. The file format is determined by the file extension. To export in SVG, the icon layer must exist.
SignalOperator.Max SignalOperator.ArithmeticMean SignalOperator.RectifiedMean SignalOperator.RMS SignalOperator.ACCoupledRMS SignalOperator.SlewRate Note that First Harmonic and Total Harmonic Distortion are not supported by this function, startTime has default value -1e100 and stopTime has default value 1e100, if the startTime is before the simulated interval the start of the simulation is used instead, and if the stopTime is after the simulated interval the stop time of the simulation is used instead.
Extended support for result file name and sequence name in variable path Variable paths with result file name and sequence name (in brackets) was previously supported only for the plot expression feature. Now this is supported also for the built-in functions createPlot, plot, and signalOperatorValue. Commands created when adding signal operators in the GUI now also generate this longer path alternative. The above commands also support the shorter path alternative.
Note that although the Visual Studio 2013 and 2012 compiler are fully supported, these compilers by default generate a bit less efficient code than previous versions of the compiler, with the selected optimization settings. As a temporary work-around you can set the flag Advanced.Define.GlobalOptimizations = 2; before generating code, to activate global optimization in the compiler. (The default value of the flag is 0.
/usr/local/bin/dymola-- The architecture is RPM standard, and is for 32-bit i586, and for 64-bit x86_64. This gives for example the default directory for a Dymola 2015 FD01 64-bit installation: /opt/dymola-2015FD01-x86_64 Note that it is however still possible to start the latest installation of Dymola by dymola from a terminal, since a soft link is also created.
3.5.2 Real-time simulation Compatibility – dSPACE Dymola 2015 FD01 generated code has been verified for compatibility with the following combinations of dSPACE and Matlab releases. dSPACE DS1005 and DS1006 platforms • dSPACE Release 6.4 with Matlab R2009a • dSPACE Release 6.6 with Matlab R2010a • dSPACE Release 7.0 with Matlab R2009bSP1 and R2010bSP1 • dSPACE Release 7.1 with Matlab R2011a • dSPACE Release 7.2 with Matlab R2011b • dSPACE Release 7.3 with Matlab R2012a • dSPACE Release 7.
tool. In addition, Dymola always support the three latest dSPACE releases with the three latest Matlab releases. Although not officially supported, it is likely that other combinations should work as well. 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 R2009a (xPC Target ver. 4.1) to R2014a (Simulink Real-Time ver. 6.0). Only Microsoft Visual C compilers have been tested. 3.5.
try { var dymola = new DymolaInterface(); var result = dymola.simulateModel("Modelica.Mechanics.Rotational.Examples.CoupledClutches"); if (result) { result = dymola.plot(["J1.w", "J2.w", "J3.w", "J4.w"]); if (result) { result = dymola.ExportPlotAsImage("C:/temp/plot.png"); } } else { alert("Simulation failed."); var log = dymola.getLastError(); alert(log); } } catch (e) { alert("Exception: " + e); } For more information about the JavaScript interface, open the file DymolaInterface.
…\Dymola.exe" –serverport 8082 Note! The report generator is currently only supported on Windows. The report generator has been tested on Firefox, Google Chrome, and Internet Explorer 11. JavaScript functions A set of special report JavaScript functions has been developed which are suitable to include in the HTML code. When the HTML page is opened, the browser communicates with Dymola to retrieve various information, such as model diagrams, plots, and animations.
The text of the model can be edited and submitted to Dymola. If the model is read-only, the editor is disabled and the model is not possible to edit. The dimensions in pixels are given by width and height. insertEquations(result_block, model, format) Inserts the equations and algorithms of a Modelica model. The format is either "PNG" or "MathML". insertDocumentation(result_block, model, width, height) Inserts the formatted documentation of a Modelica model.
SignalOperator.ArithmeticMean SignalOperator.RectifiedMean SignalOperator.RMS SignalOperator.ACCoupledRMS SignalOperator.SlewRate SignalOperator.THD SignalOperator.FirstHarmonic insertAnimation(result_block, model, format, width, height) Inserts an animation. The animation is automatically running. You can rotate the animation object by pressing left button and moving the mouse. Pan by also pressing Ctrl. Zoom by pressing Alt. The format supported is "X3D".
-
Plot
The angular velocities of Modelica.Mechanics.Rotational.Examples.CoupledClutches are shown below: