12. Release notes for JModelica.org version 1.7

12.1. Highlights

  • Improved support for hybrid systems, including friction models and ideal diodes

  • Support for tearing of equation systems

  • Support for external Fortran functions

  • Support for function inlining

  • Reorganization of the Python code: a new stand-alone package, PyFMI, provided

  • A novel dynamic optimization algorithm implemented in Python based on collocation and CasADi is provided

12.2. Compilers

12.2.1. Support for mixed systems of equations

Mixed systems of equations, i.e., equation systems containing both real and integer/boolean variables are supported. Such systems commonly occurs in, e.g., friction models and diode models.

12.2.2. Support for tearing

Tearing is a technique to improve simulation efficiency by reducing the number of iteration variables when solving systems of equations. A tearing algorithm relying on graph-theoretical methods has been implemented, which is used to generate more efficient simulation code.

12.2.3. Improved Modelica compliance

With added support for external Fortran function and many bug fixes, the compiler now handles many models that previously would not compile.

12.2.4. Function inlining

Calls to Modelica functions (i.e. not external functions) in equations can now be inlined, by adding the equivalent equations and temporary variables. This allows some transformations that are specific to equations to be performed on the function calls as well. It also allows compilation targets that does not handle functions, such as CasADi, to be used with models containing functions. Currently, only functions that only contains assignment statements are supported. Such function are common in e.g. media libraries.

12.3. Python

12.3.1. New package structure

The Python code has been refactored into three packages:

  • PyFMI A package for working with FMUs, perform simulations, interact with the model, plotting of result data and more. This package can be used stand-alone, see www.pyfmi.org.

  • PyJMI A package for working with JMUs, solve optimization problems, perform simulations, model interaction and more.

  • PyModelica A package containing Modelica and Optimica compilers.

12.3.2. Support for shared libraries in FMUs

The FMU import and export now supports dependencies on extra shared libraries. For the export, the shared libraries are placed in the same folder as the model binary. Similarly, any shared libraries packed with the model binary will be found when importing the FMU.

12.4. Simulation

12.4.1. Simulation of hybrid systems

The improved compiler support for mixed systems of equations is matched by extensions to the JModelica.org simulation runtime system, enabling simulation of more sophisticated hybrid models. Amongst others, the classic Modelica.Mechanics.Rotational.Examples.CoupledClutches benchmark model can be now simulated.

12.5. Optimization

12.5.1. A novel CasADi-based collocation algorithm

A novel CasADi-based collocation algorithm is provided. The new algorithm is implemented in Python and relies on the CasADi package for computation of derivatives and interaction with IPOPT. The new algorithm is an order of magnitude faster than the existing collocation algorithm on many problems, and provides significantly improved flexibility.

12.6. Contributors

Bengt-Arne Andersson

Christian Andersson

Tove Bergdahl

Magnus Gäfvert

Petter Lindgren

Fredrik Magnusson

Jesper Mattsson

Patrik Meijer

Iakov Nakhimovski

Johan Ylikiiskilä

Johan Åkesson

12.6.1. Previous contributors

Sofia Gedda

Lennart Moraeus

Philip Nilsson

Kristina Olsson

Roberto Parrotto

Jens Rantil

Philip Reuterswärd