Search code examples
pythonmodelicadymola

How can I analyse the results of a DymolaSimulation (simulated via python interface)


I simulated some Dymola Models via the python interface (result files are dsres.mat and dsres.txt), now I would like to compare and analyse these results (or to be clear some of the outputs) with python.

Is there a possibility to do so with the python interface or do I need to work with modelicares/PySimulator/buildspy or something like that?

I don't get how to read and understand the dsres.txt file.

I would like not only to have a diagramm with the outputs but also a table (including time, output1, output2 etc.) like when I simulate with Dymola.

I'm working with python2.7 and Dymola 2015


Solution

  • One of the most simple and efficient ways is to read the result file (dsres.mat) with Dymat, a tool which can be found at https://www.j-raedler.de/projects/dymat/.

    This way you will have all values available in Python and can process them with all the capabilities of Python...