I have an OpenModelica model created using OMEdit. To get a concrete example, I developed the following:

Now I would like to run the model in Python. I can do this using OMPython. After importing OMPython and downloading the files, I use the following command to start the simulation:
result = OMPython.execute ("simulate (myGain, numberOfIntervals = 2, outputFormat = \" mat \ ")")
Now the simulation is running and the results are written to a file.
Now I would like to run the same model, but with a different parameter for the constant block.
How can i do this?
Since the parameter is compiled into a model, it cannot be changed. So I need a model like this:

Is it possible to call a model from Python and set the variable "a" to a specific value?
Using the OMPython.execute ("simulate (...)") command, I can specify some environment variables, such as "numberOfIntervals" or "outputFormat", but no more.
source share