如何在Modelica中描述dy/dx的导数?

我工作的一个简单的模型,其中包括的DY / DX衍生物,但在Modelica的,我不能这个方程直接写,我可以使用组合的x=timeder(y),但我认为这是因为Modelica的语言限制的妥协.

我的问题是:是否有另一种更好的方法来描述 Modelica 中的导数?

这是代码:

model HowToExpressDerivative "dy/dx=5, how to describe this equation in Modelica?"
  Real x,y;
equation 
  x = time;
  der(y) = 5;
end HowToExpressDerivative;

我也试过用der(y)/der(x)来表达dy/dx,但是当 x 等于 时出现错误time^2

model HowToExpressDerivative "dy/dx=5, how to describe this equation in Modelica?"
  Real x,y;
equation 
  x=time^2;
  der(y)/der(x)=5;
end HowToExpressDerivative;
Error: The following error was detected at time: 0

Model error - division by zero: (1.0) / (der(x)) = (1) / (0)

Error: Integrator failed to start model.
... "HowToExpressDerivative.mat" creating (simulation result file)

ERROR: The simulation of HowToExpressDerivative FAILED

回答

给定焓h和曲柄角,phi您可以替换dh/dphi=...为:

  der(h)/der(phi)=...

但是,即使正确,该公式也会在发动机静止时失效(der(phi)=0),因此并不理想。

另一种方法是重写公式。仔细观察公式似乎是:

  dh/dphi=(partial a/partial T)*dT/dphi+...

这表明它们可以重写为:

  der(h)=(partial a/partial T)*der(T)+...


以上是如何在Modelica中描述dy/dx的导数?的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>