不同的 Modelica 模拟环境之间有什么区别? [英] What are the differences between diffferent Modelica Simulation Environments?

查看:47
本文介绍了不同的 Modelica 模拟环境之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有不同的 Modelica 仿真环境,包括 Dymola、Wolfram SystemModeler、OpenModelica 和 Jmodelica.所以,我尝试加载一个热流体库(ThermoSysPro https://github.com/Dwarf-Planet-Project/ThermoSysPro),但除 Dymola 外,其他软件的结果均以错误结尾.

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.

如果库和仿真环境都是基于Modelica Specification Standard,为什么会出现兼容性问题?我认为该库可能包含一些仅 Dymola 支持的功能.谁能解释一下这些模拟环境之间的区别?

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. 您使用的工具可能不支持某些 Modelica 语言元素

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

仅仅因为工具支持 Modelica,并不意味着它已经实现了 Modelica 标准定义的所有内容.以OpenModelica为例,它在v1.12之前不完全支持同步特性.

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.

库的代码可能不符合您的工具使用的 Modelica 语言规范(Modelica 规范)的版本

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

某些工具允许某些在 Modelica 规范中未定义的内容:可能是因为 Modelica 规范在某个主题上不够精确,或者它们有点领先并且已经支持可能成为未来规范版本一部分的内容.

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.

在 Dymola 中,您有两个选项可以更严格地检查您的代码是否符合当前的 Modelica 语言规范:使用迂腐模式进行检查并设置标志 Advanced.EnableAnnotationCheck=true 以让Dymola 还会检查注释

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

在您的具体示例中:ThermoSysPor 库存在各种问题,这可能可以解释您的问题.

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

  1. 该库是用相当老的 Modelica 标准库 (MSL) 3.2.1 编写的,它基于 Modelica 语言规范 3.2.

  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.

当前的 Dymola 版本 (2020) 使用 Modelica 语言规范 3.4(请参阅每个版本的 Dymola 发行说明以了解这一点).OpenModelica 显然支持 Modelica 3.3(如发行说明中所述).

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).

在此期间,MSL 也发生了一些变化,当前版本为 3.2.3.

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

因此,需要将 ThermoSysPro 更新到最新的 MSL 版本 3.2.3 和工具支持的 Modelica 规范.然后,您可以开始比较它在哪些工具中有效,哪些无效.

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.

该库在 Dymola 中也不能完全运行

The library does not fully work in Dymola either

我使用最新的 Dymola 版本和 Dymola 2016 FD01 进行了测试,其中包含 MSL 3.2.1.

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

  1. Dymola 2016 FD01:31 个错误,62 个警告
  2. Dymola 2020:175 个错误,095 个警告

  • 库包含无效的语言元素.两个例子:

  • The library contains invalid language elements. Two examples:

    1. ThermoSysPro.Examples.SimpleExamples.TestCentrifugalPump OpenModelica v1.14 beta 2 中抱怨说,cardinality 没有以合法的方式使用.显然 Dymola 2020 不在乎(即使在迂腐模式下),但它违反了 Modelica Spec 3.4.

    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.

    许多模型包含注释DymolaStoredErrors,不符合标准.自定义工具注释必须以__"开头.

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

  • 这篇关于不同的 Modelica 模拟环境之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆