Dymola 中的多个 MSL 版本

Multiple MSL versions in Dymola

Dymola 2019FD01 默认自带 MSL 3.2.2,
Dymola 2020 默认带有 MSL 3.2.3。

如果我在 Dymola 2019FD01 中使用 annotation(uses(Modelica(version="3.2.3"))); 打开库,会显示以下弹出窗口,建议使用找到的旧版本:

另一方面,如果我在 Dymola 2020 中使用 annotation(uses(Modelica(version="3.2.2"))); 打开一个库,则会显示以下弹出窗口,建议进行转换:

这个问题与Update Modelica standard Library in Dymola in Linux密切相关 未收到答复,并且还与 相关,后者确实收到了答复,其中的解决方法可能不足以应对所有情况。

In my opinion, the correct way to solve this would be to make MSL 3.2.3 available in Dymola 2019FD01. Any comments on this assumption?

较旧的工具可能不支持较新的库功能,请参阅 https://github.com/modelica/ModelicaStandardLibrary/issues/2091#issuecomment-272687901 我记得最近的一个例子。或者以Modelica同步语言特性为例

Could I also use the MSL as tagged & released on github or are there any changes?

  • GitHub 发布的 MSL 中的 ModelicaServices 只是占位符,需要替换为特定于工具的 ModelicaServices。
  • 可能不会使用 GitHub 发布的 MSL 中的 ModelicaStandardTables 等 C 源代码,但会使用分布式工具。

Is there a better (official, documented) way how to handle this?

还没有。有关相应的 Modelica 规范问题,请参阅 https://github.com/modelica/ModelicaSpecification/issues/1023 or https://github.com/modelica/ModelicaSpecification/issues/556

在 Dymola 2020(及更高版本)中还有另一种方法,它甚至可以确保使用 MSL 版本特定的 C 源代码。

  • 设置全局标志Advanced.PlaceDymolaSourceFirst=2
  • 确保您已使用正确的编译器在 MSL 中编译 C 源代码。
  • 可能在“编辑”>“选项版本”选项卡中将版本设置为默认版本。
  • 不要从 GitHub 安装 ModelicaServices。

这在 Dymola 用户手册第 1 卷中有记载;第 6.1.5 节 其他设置>使用比 Dymola 2020 版本中第 909-910 页的分发版本更新的 Modelica 版本。 (我只是没有早点找到它。)