I build a model that includes a derivative of dy/dx=5
, as shown in the following segment, but the model fails during initialization in Dymola, in another question, it has been answered. The reason is that at time=0, the values of der(x)
and der(y)
are both 0. So there would be an error of division by 0.
model HowToExpressDerivative "dy/dx=5, how to describe this equation in Modelica?"
extends Modelica.Icons.Example;
Real x, y;
equation
x = time ^ 2;
der(y) / der(x) = 5;
end HowToExpressDerivative;
But when I try the same model in the Wolfram System Modeler and OpenModelica, the model works fine.
In the Wolfram System Modeler, it uses the equation of der(y)/der(x)=5
directly.
My questions are: