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

后端 未结 3 1889
逝去的感伤
逝去的感伤 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:22

    I believe you are looking for the setParameterValue command. You can read about it here: https://openmodelica.org/download/OMC_API-HowTo.pdf

    Basically you would add a line similar to OMPython.execute("setParameterValue(myGain, a, 20)") to your python script before the line where you run the simulation, so long as a is a parameter in your model.

提交回复
热议问题