15. Release notes for JModelica.org version 1.4

15.1. Highlights

  • Improved Python user interaction functions

  • Improvements in compiler front-end

  • Support for sensitivity analysis of DAEs using Sundials

  • Introduced new model concept, jmu-models.

  • Support for enumerations

15.2. Compilers

15.2.1. Enumerations

Added support for enumerations to the same extent as Integers, except that arrays indexed with enumerations are not supported.

15.2.2. Miscellaneous

Fixed many compiler bugs, especially concerning complex class structures.

15.2.3. Improved reporting of structural singularities

Systems which are structurally singular now generates an error message. Also, high-index systems, which are not yet supported, are reported as structurally singular systems.

15.2.4. Automatic addition of initial equations

A matching algorithm is used to automatically add initial equations to obtain a balanced DAE initialization system. If too few initial equations are given, the algorithm will set the fixed attribute to true for some of the differentiated variables in the model.

15.3. Python interface

15.3.1. Models

  • Introduced new model class jmodelica.jmi.JMUModel which replaced jmodelica.jmi.JMIModel.

  • jmodelica.fmi.FMIModel changed name to jmodelica.fmi.FMUModel.

  • jmodelica.jmi.JMIModel.get_value and set_value have changed to jmodelica.jmi.JMUModel.get and set, which have also been introduced for jmodelica.fmi.FMUModel

15.3.2. Compiling

  • Introduced JMU files which are compressed files containing files created during compilation.

  • Introduced new method jmodelica.jmi.compile_jmu which compiles Modelica or Optimica models to JMUs. These JMUs are then used when creating a JMUModel which loads the model in a Python object.

  • Removed possibility to compile models directly in high-level functions, initialize, simulate and optimize. Instead compile_jmu should be used.

15.3.3. initialize, simulate and optimize

  • initialize, simulate and optimize are no longer functions under jmodelica but methods of jmodelica.jmi.JMUModel and jmodelica.fmi.FMUModel (initialize and simulate only).

  • New objects for options to initialize, simulate and optimize have been introduced. The alg_args and solver_args parameters have therefore been removed. The options from alg_args and solver_args can now be found in the options object. Each algorithm for initialize, simulate and optimize have their own options object.

15.3.4. Result object

Added convenience methods for getting variable trajectories from the result. The result trajectories are now accessed as objects in a dictionary:

res = model.simulate()
yres = res['y']

15.4. Simulation

15.4.1. Input trajectories

Changed how the input trajectories are handled. The trajectories now have to be connected to an input variable as a 2-tuple. The first argument should be a list of variables or a single variable. The second argument should be a data matrix with the first column as the time vector and the following columns corresponding to the variables in the first argument.

15.4.2. Sensitivity calculations

Sensitivity calculations have been implemented when using the solver IDA from the Assimulo package. The sensitivity calculations are activated with the the option:

opts['IDA_options']['sensitivity'] = True

which calculates sensitivities of the states with respect to the free parameters.

15.4.3. Write scaled simulation result to file

In some cases, it is useful to be able to write the scaled simulation result when the option enable_variable_scaling is set to true. Specifically, this supports debugging to detect if additional variables should have a nominal value. This feature is available also for initialization and optimization.

15.5. Contributors

Christian Andersson

Tove Bergdahl

Magnus Gäfvert

Jesper Mattsson

Johan Ylikiiskilä

Johan Åkesson

15.5.1. Previous contributors

Philip Nilsson

Roberto Parrotto

Jens Rantil

Philip Reuterswärd