Tag: modelica

DyMat | HDF5 export and other Modelica/Python projects

DyMat_logoAfter the request of a user I added a very simple HDF5 export to my DyMat package. The code is already in the github repository and will be part of the next release.

If you are interested in the handling of Modelica simulations with Python you should also have a look at these packages:

Happy new year!

Modelica Conference 2012

The conference is over now, it was pretty interesting. My paper about the usage of ncDataReader2 with Modelica is linked at the publications page.

Talk at the Modelica Conference 2012 in Munich

ncDataReader2 Logo

I will have a presentation and talk at the 9. International Modelica Conference in Munich at 3.-5. September 2012. It will focus on:

  • ncDataReader2  – my file reader library,
  • its usage from Modelica and
  • its application in recent research projects.

Version 2.3.0 is out now, but  I hope to get some improvements done til september. The paper and slides of the talk will be linked here when available.

ncDataReader2 | version 2.3 coming soon

ncDataReader2 LogoVersion 2.3 of my data reader library is coming in the next days. Here’s a list of recent improvements and bug fixes:

  • added CosWin approximation
  • added constant extrapolation
  • example GenerateBigFile is much faster now
  • fixed a bug with Akima and default extrapolation near the right border that existed for a long time
  • added functions to dump access statistics, useful to optimize paramters and caches
  • added error dialog for Win32: now you get error mesages within Dymola and other software that  hides stdout from the user
  • added command line client ncdr2Dump1D to dump interpolated values, very useful for testing
  • build with netCDF 4 on Windows including DAP supported
  • documentation updated to include the new features

A source package and binary package for Windows will be uploaded to GitHub within the next days.

Dymolas different mat file formats – the Aclass quest

DyMat_logoWhen playing a bit with the result files of Dymola 2012 I discovered an strange behaviour in the structure of the saved mat-files. Until now I’ve seen three variants of these files:

  1. The format of the regular result files saved automatically by the simulation process. This format is also used by OpenModelica and can be read with DyMat.
  2. When using “Save Result As” in the result browser and choosing “Result files (*.mat)” for the file format the saved file is almost identical to 1. but some matrices are transposed.
  3. When using “Save Result As” in the result browser and choosing “Result files – Only Plotted (*.mat)” the saved file uses a much simpler structure.

For me this makes no sense! Maybe there’s some deeper concept behind it, but I don’t see it yet. Nevertheless I plan to implement all three variants in my DyMat package in the future.

The information on the variant seems to be coded in the “Aclass” variable. This structure differs in a number which looks like a version (1.0 and 1.1) and the strings “binNormal” and “binTrans“. This can be used to handle files in an different way, but I will do more testing.

DyMat | Reading Modelica results with python

DyMat_logoThe simple module has turned into a complete python package including a script, documentation and more output options. This package is released under the BSD License.  The development is hosted on github.com, feel free to contribute!

Project homepage: http://www.j-raedler.de/projects/DyMat

Development hosting: https://github.com/jraedler/DyMat


  • documentation (well,  some …)
  • command-line script DyMatExport
  • export to CSV, Gnuplot, MATLAB and netCDF
  • more list options, including tree view
  • a lot of additional functions


| View all articles regarding DyMat |

DyMat_logoThis package contains some modules to read and process the result files from Dymola and OpenModelica with python. A script is included that will help you to browse and export the contents of these files to other formats.

Both simulation systems save their results in regular mat-files, but use a special variable structure to store the data efficiently. An easy way to access the data is MATLAB, but some people (like me) don’t have it or don’t want to use it. DyMat needs scipy to load the contents of the files.

DyMat started  as a simple python script, but now it’s a package of modules and a powerful script to use the functions from the command line.


The development of this package is hosted on bitbucket.org, you may browse and download the source code and documentation there.

DyMat.py used in LBLs Modelica Buildings Library

My python module DyMat.py will now be part of free Modelica Library for Building Energy and Control Systems developed at the Lawrence Berkeley National Laboratory. The module may be used under the terms of the Modelica License 2. I will add the copyright notice and license information to the file soon.