Python-Modelica interface: Data
Question: what is in your opinion the best way to get data (measure date for example)
into modelica (dymola)? Is it possible, to import data from python to modelica
(for example into a combi-time-table)? My idea would be as follows:

  1. pre processing of measured data in python
  2. load the data from python into modelica (comi-time-table)
  3. rund simulation studies (scripted in python)

I would appreciate any suggestions.


Answer: That's probably a matter of opinion. But since you have to do much of your
data post- and preprocessing in Python I would definitely export my (plant)
model from Dymola as a co-simulation FMU and run it in Python.

In Dymola you can export FMU's and 'execute' them **on the same pc** that
holds the Dymola license file. If you need to run the FMU on another pc you'll
have to buy a special binary export license.

There is a free Python package called PyFMI
([www.pyfmi.org](http://www.pyfmi.org)) which makes it easy to run an FMU in
Python. See the examples at
[http://www.jmodelica.org/page/4924](http://www.jmodelica.org/assimulo_home/pyfmi_1.0/examples.html).

PyFMI can be a bit tricky to get up and running (with the right Python package
dependencies and so on). So if you are not an experienced Python user I would
suggest that you download the installer for
[JModelica.org](http://www.jmodelica.org/binary) which will do much the
setting up for you.

Best regards,

Rene Just Nielsen

