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.

Binary toy for the Museum of Technology, Berlin

My first larger project using the Arduino platform is an exhibit for the German Museum of Technology in Berlin. It will be shown in the Konrad Zuse exhibition.

The device shows a random number (left display). By activating the correct bits in a binary representation (center display) the visitor has to assemble this number (right display). From a programmers point of view this is really not a big deal, but for most people this can be a challenge.

This device was created in cooperation with Felix Scharstein who has a long experience in objects and machines for museums. An article on a more mechanical device for the same exhibition will follow soon.

Technical Facts

The device is controlled by an Arduino Duemilanove. All buttons are connected to digital inputs: eight buttons for the digits, two buttons to increase (+1) or decrease (-1) the number and one button to request a new random number. The front panel was made from white Corian.

The displays consist of 14 single 7-Seg-modules (Kingbright SA10-21GWA) connected to two MAX7221 controllers. One controller drives the center display, the other drives the left and right display. The controllers are cascaded and connected to the Arduino using a serial interface (3 pins). The Arduino library LedControl is used to control the displays from the software. By using this excellent library the main program can be kept really small and simple (~150 lines). The program logic is trivial, no special programming skills were required.

All wiring was done by hand (~800 soldered joints). This was a hard job, but finally everything is working. The device will be installed in the museum in the next weeks.

Many thanks to the creators and contributors of Arduino and LedControl!

Polygon development moves to GitHub

The development of the python package Polygon was moved to github. I created two projects for the code for python 2 and 3.

The project pages at origo.ethz.ch will be closed soon. The information was updated at pypi.python.org, but no code was changed yet. Since there are no known bugs and feature requests right now, new versions are not scheduled for the near future.

Polygon 2: https://github.com/jraedler/Polygon2

Polygon 3: https://github.com/jraedler/Polygon3

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

Highlights:

  • 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

Polygon | 2.0.4 & 3.0.4

New versions of my python package Polygon have been released today for python 2 and python 3. The source can be checked out from https://svn.origo.ethz.ch/polygon/tags/2.0.4/ and https://svn.origo.ethz.ch/polygon/tags/3.0.4/ , binary packages will follow in the next days.

The changes include:

  • added a function Utils.gpfInfo() to check files for the number of contours, holes and points and the hole flag
  • updated the documentation about the handling of files with the optional hole flag
  • fixed a bug in the function IO.writeSVG()
  • 3.0.4: fixed a bug in the function IO.encodeBinary()