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

how to save parameter changed modelica model in OMPython

how to save parameter changed modelica model in OMPython

Using OMPython interface I'm able to edit the parameters of the modelica model using setParameters option.
But now after changing the parameters i want to save the model. How to do that in OMPython. Also I want save the results in .CSV format not in .MAT format.

omc = OMCSessionZMQ()
mod=ModelicaSystem("D:/FRND/Open_Modelica/_dev/Mar/" + "HP.mo","HP.Systems.SysHeadl")
#mod.buildModel()
mod.setParameters(["headlamp.UCfile=D:/FRND/Open_Modelica/_dev/Mar/Usecases/TA_Combi.txt"])
#after setting this parameter, Have to save the model.
h = mod.getParameters()
r = h['headlamp.UCfile']
print(r)
mod.buildModel()
mod.simulate(resultfile="tmout.csv") #this CSV file also contains the mat file output in csv format. But I want to have it like how it got exported in csv file via Openmodelica software



Edited by: Thamizh - Dec-27-21 13:07:55
There are 0 guests and 0 other users also viewing this topic
You are here: