我想将 Dymola 模型导出到 Simulink。该模型由导数块 (der)、RealInput、RealOutput 和连接组成。
\n\n当我翻译这个模型时,出现以下错误:
\n\n“该模型需要一些输入的导数,如下所列:\n1 u”
\n\n对我来说,为什么需要衍生品是合乎逻辑的,但是为什么导出获得衍生品很重要以及为什么它会导致错误?我无法\xc2\xb4t 继续导出并出现此错误。我知道simulink中有导数块,但是实际模型更复杂并且出现相同类型的错误。有可能避免吗?\n我的 dymola 版本是 2014(64 位)。我使用“Visual Studio 2010/ Visual C++ 2010 Express”作为编译器。
\n我使用“滚动图”示例作为pyqtgraph.examples模板来创建一个图,该图显示了连续的正弦波。现在,我想使用按钮来改变正弦波的幅度。这就是我使用另一种结构的原因(参见下面的代码)。这不起作用,它只绘制静态正弦波。如何使用更新函数绘制连续正弦波?如何使用按钮更改幅度?我已经检查过这个和这个但没有成功。
import sys
from PyQt4 import QtGui, QtCore
import numpy as np
import pyqtgraph as pg
class sinus_wave(QtGui.QWidget):
def __init__(self):
super(sinus_wave, self).__init__()
self.initUI()
def initPlot(self, plots):
a = 10
ptr1 = 30
data1 = a*np.sin(np.linspace(0,30,121))
plots.plot(data1)
timer = pg.QtCore.QTimer()
timer.timeout.connect(lambda: self.update(self,p1 = plots,data1= data1, ptr1 = ptr1))
timer.start(50)
def initUI(self):
IncreaseButton = QtGui.QPushButton("Increase Amplitude")
DecreaseButton = QtGui.QPushButton("Decrease Amplitude")
p1 = pg.PlotWidget()
hbox = QtGui.QVBoxLayout()
hbox.addWidget(p1)
hbox.addWidget(IncreaseButton)
hbox.addWidget(DecreaseButton)
self.initPlot(p1)
self.setLayout(hbox)
self.setGeometry(10, 10, 1000, 600)
self.setWindowTitle('Sinuswave') …Run Code Online (Sandbox Code Playgroud)