I am starting to use Python to run my Dymola models since I think that it has more potential than the Dymola scripts “.mos”. I’ve already set a similar code than the “DymolaExample.py”.
from dymola.dymola_interface import DymolaInterface
import os
# Instantiate the Dymola interface and start Dymola
dymola = DymolaInterface()
# Call a function in Dymola and check its return value
result = dymola.simulateModel(
"Modelica.Mechanics.Rotational.Examples.CoupledClutches",
resultFile=r"N:\SOLAR\3.PROYECTOS\3.4 OTROS\GRUPO HIBRIDO CSP-FV\InterfacePythonDymola\python_interface\examples\nf")
if not result:
print("Simulation failed. Below is the translation log.")
log = dymola.getLastErrorLog()
print(log)
exit(1)
# dymola.plot(["J1.w", "J2.w", "J3.w", "J4.w"])
# plotPath = os.getcwd() + "/plot.png"
# dymola.ExportPlotAsImage(plotPath)
However, I am running models to evaluate the annual performance of a system with high computational cost. Is it possible to see the Dymola results while the code is running? Or at least see what is the Simulating Time in “real-time” from Python to see if the simulation is going to take much more time?