I want to simulate a Model from Openmodelica with help from toolbox OMPython in Spyder.
Here is the script:
import numpy as np
from numpy import linalg as la
import matplotlib.pyplot as plt
from OMPython import ModelicaSystem
from OMPython import OMCSessionZMQ
font = {'family': 'sans-serif',
'color': 'darkblue',
'weight': 'normal',
'size': 14}
h = 0.0001 # Simulationsschrittweite
STime = 0.1
omc = OMCSessionZMQ()
mod=ModelicaSystem("SystemZweiterOrdnungKausalTotal.mo","SystemZweiterOrdnungKausal")
mod.setSimulationOptions(["stopTime="+str(STime),"stepSize=" + str(h),"solver=euler"])
mod.simulate()
mod.getSolutions()
But there is an error message in console:
2020-11-28 20:23:48,407 - OMPython - INFO - OMC Server is up and running at file:///C:/Users/zhout/AppData/Local/Temp/openmodelica.port.e2c1a098db6645b48dd844f1925af6c8 pid=6492
2020-11-28 20:23:48,690 - OMPython - INFO - OMC Server is up and running at file:///C:/Users/zhout/AppData/Local/Temp/openmodelica.port.e6fe4b6d6426461586a0ea54038b6559 pid=5424
'utf-8' codec can't decode byte 0xd7 in position 103: invalid continuation byte
None
stopTime !is not a simulation-option variable
Traceback (most recent call last):
File "C:\Users\zhout\OneDrive\desktop\Simulation und technische Diagnose\Aufgabe Phase 1-20201128\VorlageAuswertung——Muster.py", line 37, in <module>
mod.simulate()
File "C:\Users\zhout\anaconda3\lib\site-packages\OMPython\__init__.py", line 1108, in simulate
raise Exception("Error: application file not generated yet")
Exception: Error: application file not generated yet
I didn't find any information in Internet about this Error. can someone help me? thanks a lot.