What are the differences between diffferent Modelica Simulation Environments?

为君一笑 提交于 2020-04-10 03:42:25

问题


There are different Modelica Simulation Environments, including Dymola, Wolfram SystemModeler, OpenModelica, and Jmodelica. So, I try to load a thermal fluid library(ThermoSysPro https://github.com/Dwarf-Planet-Project/ThermoSysPro), but except Dymola, the results on the other software all end with errors.

If the library and the simulation environment are all based on the Modelica Specification Standard, why there is a compatibility issue? I think that maybe the library includes some features that are only supported by Dymola. Could anyone clarify the difference between these simulation environments?


回答1:


In general:

  1. The tool you use might not support certain Modelica language elements

    Just because a tool supports Modelica, it does not mean that it has implemented everything yet what the Modelica standard defines. Take OpenModelica for example, which did not fully support synchronous features before v1.12.

  2. The code of the library might not be conform with the version of the Modelica Language Specification (Modelica spec) used by your tool

    Some tools allow certain things, which are not defined in the Modelica spec: maybe because the Modelica spec was not precise enough on a topic, or maybe they are a bit ahead and already support things which might be part of future spec versions.

    In Dymola you have two options to check a bit stricter if your code is conform with the current Modelica Language Specification: use the pedantic mode for checking and set the flag Advanced.EnableAnnotationCheck=true to let Dymola also check annotations

In your concrete example: There are various troubles with the ThermoSysPor library, which might explain your problems.

  1. The library was written with the rather old Modelica Standard Library (MSL) 3.2.1., which is based on the Modelica Language Specification 3.2.

    The current Dymola version (2020) uses the Modelica Language Specification 3.4 (see the Dymola release notes of each version to find that out). OpenModelica apparently supports Modelica 3.3 (as noted in the release notes).

    The MSL has also evolved a bit in the meantime, with the current version being 3.2.3.

    Hence, it is required to update ThermoSysPro to the latest MSL version 3.2.3 and to the Modelica spec the tool supports. Then you can start comparing in which tools it works and in which not.

  2. The library does not fully work in Dymola either

    I tested with the latest Dymola version and Dymola 2016 FD01, which contained the MSL 3.2.1.

    1. Dymola 2016 FD01: 31 errors, 62 warnings
    2. Dymola 2020: 175 errors, 095 warnings
  3. The library contains invalid language elements. Two examples:

    1. In ThermoSysPro.Examples.SimpleExamples.TestCentrifugalPump OpenModelica v1.14 beta 2 complains, that cardinality is not used in a legal way. Apparently Dymola 2020 does not care (even in pedantic mode), but it's against the Modelica Spec 3.4.

    2. Many models contain the annotation DymolaStoredErrors, which is not standard conform. Custom tool annotations must start with '__'.



来源:https://stackoverflow.com/questions/58939793/what-are-the-differences-between-diffferent-modelica-simulation-environments

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