How are the data types in dsin.txt defined?

2019-07-26 16:53发布

问题:

I am currently developing a python interface for running Modelica simulations using Dymola and I can't find any documentation on the data types used in the dsin.txt file :

...
 0   0   0    0   4  328   # timeToEmpty
-1   0   0  100   2  272   # level
 0   0   0    0   3  256   # der(level)
-1  10   0    0   1  280   # initialFlowRate
 0   0   0    0   6  320   # flowRate
...

There is some documentation inside the file itself, but it's not very helpful :

...
# column 6: Data type of variable.
#           = 0: real.
#           = 1: boolean.
#           = 2: integer.
...

As you can see, the types I'm getting are completely different than the ones described. I want to know if the data is of type Real, Integer, Boolean or something else to adapt the representation in my interface accordingly.

回答1:

Did you have a look at ModelicaRes? It might already have built in the functions you are looking for.



回答2:

After looking everywhere, i found that the description of the variables contain a text field in brackets at the end where the unit, the display unit and the type are written, if it is not Real. I only need to parse it.



回答3:

Unfortunately I cannot help you to indentify the types either, but for running Modelica simulations using Dymola you can also have a look at BuildingsPy, which uses .mos-Scripts to run and setup simulations in Dymola.