- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Time units and Python plots
Time units and Python plots
Time units and Python plots
Dear forum,
I have run a Modelica model through Python. Here some questions:
1) The default time units in OM are seconds (s), how to change them to years (and also plotting years in X axis and add legends)?
2) I would like to plot variables in Python instead of in OM, without reading them from a file. Is it possible to transfer them directly through any Python command, instead of "omc.SendExpression("plot(v)")"?
Thanks!
Here the script:
from OMPython import OMCSessionZMQ
omc = OMCSessionZMQ()
omc.sendExpression("loadModel(Modelica)")
omc.sendExpression("loadFile(HIV.mo)")
omc.sendExpression("simulate(HIV, startTime=0, stopTime=315360000)")
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Time units and Python plots