JModelica.org
User Guide

Version 1.3.0

2010-08-29


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. Binary distribution
2.1. Linux
2.2. Mac OS X
2.3. Windows
2.3.1. Prerequisites
2.3.2. Windows installer
3. Getting started
1. Compilation of models
1.1. Compilation
1.1.1. Simple compilation example
1.1.2. Targets
1.1.3. Compilation in more detail
2. Simulation of models
2.1. Simulation of an electrical circuit
2.2. Simulation and parameter sweeps
3. Solving optimal control problems
3.1. The van der Pol Oscillator
3.2. The Hicks Ray Continuously Stirred Reactor (CSTR)
3.2.1. Compile and instantiate a model object
3.2.2. Solve the DAE initialization problem
3.2.3. Solving an optimal control problem
3.2.4. Verify optimal control solution
3.2.5. Exercises
3.2.6. References
4. Solving parameter estimation problems
5. Working with file I/O
5.1. I/O functionality
5.2. Loading result data
6. Setting and saving model parameters
6.1. Model parameter XML files
6.2. Get and set value
6.3. Loading from and saving to XML
6.3.1. Loading XML values file
6.3.2. Writing to XML values file
4. FMI Interface
1. Overview of JModelica.org FMI Python package
2. Examples
2.1. Simulation using the native FMI interface
2.1.1. Implementation
2.2. Example using a compiled FMU
2.2.1. Implementation
5. High-level functions: initialize, simulate and optimize
1. Overview
1.1. Importing the high-level functions
1.2. Default arguments
1.2.1. Function arguments
1.2.2. Algorithm argument alg_args
1.2.3. Algorithm argument solver_args
1.3. Result object
1.4. Algorithms
1.5. Short simulation example
6. Advanced topics
1. Tutorial on Abstract Syntax Trees (ASTs)
1.1. About Abstract Syntax Trees
1.2. Start the Python shell
1.3. Load the Modelica standard library
1.4. Count the number of classes in the Modelica standard library
1.5. Dump the instance AST
1.6. Flattening of the filter model
7. 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
8. Limitations
9. Release notes
1. Release notes for JModelica.org version 1.2
1.1. Highlights
1.2. Compilers
1.2.1. The Modelica compiler
1.2.2. The Optimica Compiler
1.3. The JModelica.org Model Interface (JMI)
1.3.1. General
1.4. The collocation optimization algorithm
1.4.1. Piecewise constant control signals
1.4.2. Free initial conditions allowed
1.4.3. Dens output of optimization result
1.5. New simulation package: Assimulo
1.6. FMI compliance
1.7. XML model export
1.8. Python integration
1.8.1. New high-level functions for optimization and simulation
1.9. Contributors
1.9.1. Previous contributors
2. Release notes for JModelica.org version 1.3
2.1. Highlights
2.2. Compilers
2.2.1. The Modelica compiler
2.2.2. The Optimica compiler
2.3. JModelica.org Model Interface (JMI)
2.3.1. The collocation optimization algorithm
2.4. Assimulo
2.5. FMI compliance
2.6. XML model export
2.6.1. noEvent operator
2.6.2. static attribute
2.7. Python integration
2.7.1. High-level functions
2.7.2. File I/O
2.8. Contributors
2.8.1. Previous contributors
Bibliography
Index

List of Figures

1.1. JModelica platform architecture.
3.1. Electric Circuit
3.2. Simulation result
3.3. Simulation result-phase plane
3.4. Van der Pol optimization result.
3.5. Optimization result
3.6. Simulated system response
3.7. A schematic figure of the quadruple tank process.
3.8. Measured state profiles
3.9. Input profiles used in estimation experiment
3.10. Simulation result for the nominal model
3.11. State profiles corresponding to estimated values of a1 and a2.
3.12. State profiles corresponding to estimated values of a1, a2, a3 and a4
4.1. Simulation result
4.2. Full Robot
4.3. Full Robot Results
4.4. Comparison with Dymola
5.1. Result data from a simulation of s of the RLC Circuit
5.2. Result data from a simulation of 30s of the RLC Circuit
7.1. Optimization result

List of Tables

2.1. Python prerequisities
3.1. Selection of solver arguments for IDA
3.2. Quadruple tank parameter values
4.1. Conversion table.
4.2. Selection of solver arguments for CVode
5.1. alg_args options for AssimuloAlg
5.2. alg_args options for AssimuloFMIAlg
5.3. alg_args options for CollocationLagrangePolynomialsAlg
5.4. The jmodelica.algorithm_drivers.ResultBase class
5.5. Algorithms accessible from high-level functions