Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register
  • Index
  • » Users
  • » shru
  • » Profile

Posts

Posts

Hi ! I came across this command to override parameter values of a plant model made in OMedit using OMPython - omc.sendExpression('simulate(P_win3, simflags="-override  constantVoltage1.V=12.0", stopTime = 10)').

I just wanted to know if there's any other way to do this without using omc.sendExpression, OMPython.execute or mod.simulate methods wherein i can directly do the overriding using python.

Below i include a pseudo code of what i want to do :

temp = ModelicaSystem(C:/OpenModelica1.12.0-64bit/share/doc/omc/testmodels/P_win3.mo)
temp.simulate("-override  constantVoltage1.V=12.0")

What is the right syntax to use if i want to override the parameter in the above mentioned way?

Thank you!

Jan-08-19 12:13:08
Topic: OMPython
Changing (overriding) openmodelica parameters using OMPython
Category: Programming

Hi ! I came across this command to override parameter values of a plant model made in OMedit using OMPython - omc.sendExpression('simulate(P_win3, simflags="-override  constantVoltage1.V=12.0", stopTime = 10)').

I just wanted to know if there's any other way to do this without using omc.sendExpression, OMPython.execute or mod.simulate methods wherein i can directly do the overriding using python.

Below i include a pseudo code of what i want to do :

temp = ModelicaSystem(C:/OpenModelica1.12.0-64bit/share/doc/omc/testmodels/P_win3.mo)
temp.simulate("-override  constantVoltage1.V=12.0")


What is the right syntax to use if i want to override the parameter in the above mentioned way?

Thank you!

  • Index
  • » Users
  • » shru
  • » Profile
You are here: