JModelica.org
User Guide

Version 1.5.0

2011-02-03


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.

Table of Contents

1. Introduction
1. About JModelica.org
2. Mission Statement
3. Technology
4. Architecture
5. Extensibility
2. Installation
1. Supported platforms
2. Prerequisites
2.1. Java
2.2. Python
3. Binary distribution
3.1. Windows
3.1.1. Installing JModelica.org with Windows installer
3.2. Linux
3.3. Mac OS X
4. Software Development Kit
4.1. Prerequisites
4.2. Installing the JModelica.org SDK
4.2.1. Bundled tools
4.2.2. Step-by-step instructions
4.3. Changing Ipopt solver
3. Getting started
1. Starting a Python session
1.1. Windows
1.2. Linux or Mac OS
2. Run an example
3. Check your installation
4. The JModelica.org user forum
4. Working with Models
1. Introduction to models
1.1. The JMUModel and FMUModel
2. Compilation
2.1. Simple JMU compilation example
2.2. Simple FMU compilation example
2.3. Compiler settings
2.3.1. compile_jmu parameters
2.3.2. compile_fmu parameters
2.3.3. Compiler options
2.3.4. Compiler targets
2.4. Compilation in more detail
2.4.1. Create a compiler
2.4.2. Source tree generation and flattening
2.4.3. Code generation
3. Loading models
3.1. The JMU
3.2. The FMU
3.3. Loading a JMU
3.4. Loading an FMU
4. Variable and parameter manipulation
4.1. Model variable XML files
4.2. Setting and getting variables
4.3. Loading and saving parameters
4.3.1. Loading XML values file
4.3.2. Writing to XML values file
5. FMI Interface
1. Overview of JModelica.org FMI Python package
2. Example
2.1. Simulation using the native FMI interface
2.1.1. Implementation
6. Initialization
1. Solving DAE initialization problems
2. How JModelica.org creates the initialization system of equations
3. Initialization algorithms
3.1. Initialization using IPOPT
3.2. Initilization using KInitSolveAlg
3.2.1. The use of constraints
3.2.2. Verbosity of KINSOL
7. Simulation
1. Introduction
2. A first example
3. Simulation of Models
3.1. Arguments
3.1.1. Options for JMUModel
3.1.2. Options for FMUModel
3.2. Return argument
4. Examples
4.1. Simulation with inputs
4.2. Simulation of a discontinuous system
4.3. Simulation and parameter sweeps
4.4. Simulation with sensitivities
4.5. Simulation of an FMU
8. Optimization
1. Introduction
2. A first example
3. Solving optimization problems
3.1. Algorithms
3.1.1. Direct collocation
4. Optimal control
4.1. Compile and instantiate a model object
4.2. Solve the DAE initialization problem
4.3. Solving an optimal control problem
4.4. Verify optimal control solution
4.5. Exercises
4.6. References
5. Minimum time problems
6. Parameter optimization
7. Scaling
9. Optimica
1. A new specialized class: optimization
2. Attributes for the built in class Real
3. A Function for accessing instant values of a variable
4. Class attributes
5. Constraints
10. Abstract syntax tree access
1. Tutorial on Abstract Syntax Trees (ASTs)
1.1. About Abstract Syntax Trees
1.2. Load the Modelica standard library
1.3. Count the number of classes in the Modelica standard library
1.4. Dump the instance AST
1.5. Flattening of the filter model
11. Limitations
12. Release notes
1. Release notes for JModelica.org version 1.5
1.1. Highlights
1.2. Compilers
1.2.1. When clauses
1.2.2. Equation sorting
1.2.3. Connections
1.2.4. Eclipse IDE
1.2.5. Miscellaneous
1.3. Simulation
1.3.1. FMU export
1.3.2. Simulation of ODEs
1.3.3. Simulation of hybrid and sampled systems
1.4. Initialization of DAEs
1.5. Optimization
1.6. Contributors
1.6.1. Previous contributors
2. Release notes for JModelica.org version 1.4
2.1. Highlights
2.2. Compilers
2.2.1. Enumerations
2.2.2. Miscellaneous
2.2.3. Improved reporting of structural singularities
2.2.4. Automatic addition of initial equations
2.3. Python interface
2.3.1. Models
2.3.2. Compiling
2.3.3. initialize, simulate and optimize
2.3.4. Result object
2.4. Simulation
2.4.1. Input trajectories
2.4.2. Sensitivity calculations
2.4.3. Write scaled simulation result to file
2.5. Contributors
2.5.1. Previous contributors
3. Release notes for JModelica.org version 1.3
3.1. Highlights
3.2. Compilers
3.2.1. The Modelica compiler
3.2.2. The Optimica compiler
3.3. JModelica.org Model Interface (JMI)
3.3.1. The collocation optimization algorithm
3.4. Assimulo
3.5. FMI compliance
3.6. XML model export
3.6.1. noEvent operator
3.6.2. static attribute
3.7. Python integration
3.7.1. High-level functions
3.7.2. File I/O
3.8. Contributors
3.8.1. Previous contributors
4. Release notes for JModelica.org version 1.2
4.1. Highlights
4.2. Compilers
4.2.1. The Modelica compiler
4.2.2. The Optimica Compiler
4.3. The JModelica.org Model Interface (JMI)
4.3.1. General
4.4. The collocation optimization algorithm
4.4.1. Piecewise constant control signals
4.4.2. Free initial conditions allowed
4.4.3. Dens output of optimization result
4.5. New simulation package: Assimulo
4.6. FMI compliance
4.7. XML model export
4.8. Python integration
4.8.1. New high-level functions for optimization and simulation
4.9. Contributors
4.9.1. Previous contributors
Bibliography
Index

List of Figures

1.1. JModelica platform architecture.
5.1. Simulation result
7.1. Simulation result of the Van der Pol oscillator.
7.2. A schematic picture of the quadruple tank process.
7.3. Tank levels
7.4. Input trajectories
7.5. Electric Circuit
7.6. Simulation result
7.7. Simulation result-phase plane
7.8. Sensitivity results.
7.9. Full Robot
7.10. Robot Results
7.11. Comparison with Dymola
8.1.
8.2. Optimal profiles for the CSTR problem.
8.3. Optimal control profiles and simulated trajectories corresponding to the optimal control input.
8.4. Minimum time profiles for the Van der Pol Oscillator.
8.5. A schematic picture of the quadruple tank process.
8.6. Measured state profiles.
8.7. Control inputs used in the identification experiment.
8.8. Simulation result for the nominal model.
8.9. State profiles corresponding to estimated values of a1 and a2.
8.10. State profiles corresponding to estimated values of a1, a2, a3 and a4.
9.1. Optimization result

List of Tables

2.1. Python prerequisites
4.1. Compiler options
5.1. Conversion table.
6.1. Options for the collocation-based optimization algorithm
6.2. Options for KInitSolveAlg
6.3. Options for KINSOL contained in the KINSOL_options dictionary
6.4. Values allowed in the constraints array
6.5. Verbosity levels in KINSOL
7.1. General options for AssimuloAlg.
7.2. Selection of solver arguments for CVode
7.3. Selection of solver arguments for IDA
7.4. General options for AssimuloFMIAlg.
7.5. Selection of solver arguments for CVode
7.6. Result Object
8.1. Options for the collocation-based optimization algorithm
8.2. Parameters for the quadruple tank process.