How are the data types in dsin.txt defined?

自闭症网瘾萝莉.ら 提交于 2019-12-24 12:26:30

问题


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.



来源:https://stackoverflow.com/questions/26023434/how-are-the-data-types-in-dsin-txt-defined

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!