Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the differences between diffferent Modelica Simulation Environments?

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?

like image 815
Jack Avatar asked Nov 19 '19 17:11

Jack


People also ask

Is Modelica free?

Free Modelica Simulation Environments OpenModelica is freely available for use. It can be combined with open source software according to the OSMC-GPL license.

What is Modelica language?

The Modelica Language is a language for modeling of cyber-physical systems, supporting acausal connection of components governed by mathematical equations to facilitate modeling from first principles.

How do I open an OpenModelica file?

Starting the Interactive Session Under Windows, go to the Start Menu and run OpenModelica->OpenModelica Shell which responds with an interaction window. Under Linux, run OMShell-terminal to start the interactive session at the prompt.


1 Answers

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 '__'.

like image 100
marco Avatar answered Sep 22 '22 16:09

marco