Dymola / Modelica中的openModelFile和openModel命令有什么区别?

时间:2013-08-23 18:46:38

标签: modelica dymola

this question中,我问我如何在启动时向MODELICAPATH添加自定义程序包,但答案中有些含糊不清。根据答案,我可以使用

openModel("path\to\file.mo")

openModelFile("Fully.Qualified.Model.Name")

我想知道这些命令有何不同,如果有的话,以及何时使用其中一个。

编辑:如果您回答,请在Modelica文档中提供来源。我不知道如何导航文档来查找这些命令,所以这可能是一个很大的障碍。

1 个答案:

答案 0 :(得分:3)

乍得,

如果您对Dymola中的“内置”命令有任何疑问,请注意,您可以使用document(...)功能获取一些基本文档(显然,help太行人了{ {1}}过于自命不凡了?)可以从Dymola中“Simulation”选项卡底部的命令行调用此命令。它需要一个函数名字符串作为参数。所以,回答你的问题:

elucidate

可悲的是,我认为文档并没有在这里找到差异。事实上,如果你考虑一下,我会说这些名字真的落后了。 document("openModel"); function openModel "open a Modelica-file" input String path "File-path to open"; input Boolean mustRead := true "If false we can skip reading the file"; output Boolean result "true if successful"; "Opens a Modelica-file and pops up a window with the model in it" end openModel; document("openModelFile"); function openModelFile "open a Modelica-model from a file" input String model "Model to open"; input String path := "" "File-path to open (can be the empty string)"; input String version := "" "Version to open (can be the empty string)"; output Boolean result "true if successful"; "Opens a Modelica-file and pops up a window with the given model in it" end openModelFile; 文件作为参数,并打开该文件中包含的定义(通常为openModel但不一定)。另一方面,package模型名称作为参数,并在模型浏览器中打开该模型(如有必要,搜索MODELICAPATH以查找并打开模型)。

我希望有所帮助。