How can I call an OpenModelica model in Python with OMPython?

后端 未结 3 1821
逝去的感伤
逝去的感伤 2021-02-15 23:27

I have an OpenModelica model made with OMEdit. In order to get a concrete example I designed the following:

\"OpenMo

3条回答
  •  囚心锁ツ
    2021-02-16 00:13

    You can send more flags to the simulate command. For example simflags to override parameters. See https://openmodelica.org/index.php/forum/topic?id=1011 for some details.

    You can also use the buildModel(...) command followed by system("./ModelName -overrideFile ...") to avoid re-translation and re-compilation or with some minor scripting parallel parameter sweeps. If you use Linux or OSX it should be easy to call OMPython to create the executable and then call it yourself. On Windows you need to setup some environment variables for it to work as expected.

提交回复
热议问题