
JModelica.org User Guide Version 2.2 JModelica.org User Guide: Version 2.2 Publication date 2018-03-15 Copyright © 2017 Modelon AB Acknowledgements This document is produced with DocBook 5 using XMLMind XML Editor for authoring, Norman Walsh's XSL stylesheets and a GNOME xsltproc + Apache fop toolchain. Math contents is converted from LaTeX using the TeX/LaTeX to MathML Online Translator by the Ontario Research Centre for Computer Algebra and processed by JEuclid. iii Table of Contents 1. Introduction .............................................................................................................................. 1 1.1. About JModelica.org ........................................................................................................ 1 1.2. Mission Statement ........................................................................................................... 1 1.3. Technology ..................................................................................................................... 1 2. Installation ................................................................................................................................ 3 2.1. Supported platforms ......................................................................................................... 3 2.2. Installation on Windows ................................................................................................... 3 2.2.1. Installation ........................................................................................................... 3 2.2.2. Verifying the installation ........................................................................................ 3 2.2.3. Compilation from sources ....................................................................................... 4 2.3. Installation on Linux systems ............................................................................................ 4 2.3.1. Prerequisites ......................................................................................................... 4 2.3.2. Compiling ............................................................................................................ 6 2.3.3. Testing JModelica.org ............................................................................................ 7 3. Getting started ........................................................................................................................... 8 3.1. The JModelica.org Python packages ................................................................................... 8 3.2. Starting a Python session .................................................................................................. 8 3.2.1. Windows ............................................................................................................. 8 3.2.2. Linux .................................................................................................................. 8 3.3. Running an example ........................................................................................................ 9 3.4. Redefining the JModelica.org environment ........................................................................... 9 3.4.1. Example redefining IPOPT_HOME .......................................................................... 9 3.5. The JModelica.org user forum .......................................................................................... 10 4. Working with Models in Python ................................................................................................. 11 4.1. Introduction to models .................................................................................................... 11 4.1.1. The different model objects in JModelica.org ........................................................... 11 4.2. Compilation .................................................................................................................. 11 4.2.1. Simple FMU-ME compilation example .................................................................... 11 4.2.2. Simple FMU-CS compilation example .................................................................... 12 4.2.3. Compiling from libraries ....................................................................................... 13 4.2.4. Compiler settings ................................................................................................ 13 4.3. Loading models ............................................................................................................. 16 4.3.1. Loading an FMU ................................................................................................. 16 4.3.2. Transferring an Optimization Problem ..................................................................... 16 4.4. Changing model parameters ............................................................................................. 17 4.4.1. Setting and getting parameters ............................................................................... 17 4.5. Debugging models ......................................................................................................... 18 4.5.1. Compiler logging ................................................................................................ 18 4.5.2. Runtime logging .................................................................................................. 18 4.5.3. Compiler Diagnostic Output .................................................................................. 21 iv JModelica.org User Guide 5. Simulation of FMUs in Python ................................................................................................... 22 5.1. Introduction .................................................................................................................. 22 5.2. A first example ............................................................................................................. 22 5.3. Simulation of Models ..................................................................................................... 24 5.3.1. Convenience method, load_fmu ............................................................................. 25 5.3.2. Arguments ......................................................................................................... 25 5.3.3. Return argument .................................................................................................. 30 5.4. Examples ...................................................................................................................... 30 5.4.1. Simulation of a high-index model ........................................................................... 30 5.4.2. Simulation and parameter sweeps ........................................................................... 32 5.4.3. Simulation of an Engine model with inputs .............................................................. 34 5.4.4. Simulation using the native FMI interface ................................................................ 37 5.4.5. Simulation of Co-Simulation FMUs ........................................................................ 42 6. Dynamic Optimization in Python ................................................................................................ 44 6.1. Introduction .................................................................................................................. 44 6.2. A first example ............................................................................................................. 44 6.3. Solving optimization problems ......................................................................................... 46 6.4. Scaling ......................................................................................................................... 49 6.5. Dynamic optimization of DAEs using direct collocation with CasADi ...................................... 49 6.5.1. Algorithm overview ............................................................................................. 49 6.5.2. Examples ........................................................................................................... 57 6.5.3. Investigating optimization progress ......................................................................... 79 6.5.4. Eliminating algebraic variables .............................................................................. 83 6.6. Derivative-Free Model Calibration of FMUs ....................................................................... 88 7. Graphical User Interface for Visualization of Results ...................................................................... 95 7.1. Plot GUI ...................................................................................................................... 95 7.1.1. Introduction ........................................................................................................ 95 7.1.2. Edit Options ....................................................................................................... 97 7.1.3. View Options .................................................................................................... 101 7.1.4. Example ........................................................................................................... 101 8. The Optimica Language Extension ............................................................................................. 103 8.1. A new specialized class: optimization
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages172 Page
-
File Size-