首页 > 解决方案 > 什么是错误:尚未生成应用程序文件?

问题描述

我想在 Spyder 中的工具箱 OMPython 的帮助下模拟 Openmodelica 的模型。

这是脚本:

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() 

但是控制台中有一条错误消息:

 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

我在 Internet 上没有找到有关此错误的任何信息。有人能帮我吗?多谢。

标签: pythonanacondaspydermodelicaopenmodelica

解决方案


推荐阅读