- Index
- » Programming
- » Modelica Language
- » Structurally singular, why?
Structurally singular, why?
Structurally singular, why?
Hey everybody,
hope you can help me with this problem. I have a programm code about an electric drive and some physical properties. I want to calculate some values. But every compiler says, that the code is singular. But I don't understand why, cause I have 4 unknowns and 4 equations...
maybe you can give me a hint.
Here's the code:
model E_Motor
import Modelica.SIunits;
input SIunits.Frequency freqHzIst(start=50);
input SIunits.Voltage UIst(start=400);
input SIunits.Current IMax(start=5);
parameter SIunits.Inertia JAntrieb(start=30);
parameter Real i(start=5);
parameter Integer p(start=2);
parameter SIunits.Frequency freqHzNenn(start=50);
parameter SIunits.AngularVelocity nNenn(start=1430);
parameter SIunits.Inertia JRot(start=0.003);
parameter Real pi=2*Modelica.Math.asin(1.0);
parameter SIunits.AngularVelocity nIst;
parameter SIunits.AngularVelocity w;
parameter SIunits.KineticEnergy EKinMax;
parameter SIunits.Power PMax;
equation
nIst=((freqHzIst/p)*(nNenn/(freqHzNenn/p)))/i;
w=2*pi*nIst;
EKinMax=0.5*(JAntrieb+JRot)*w^2;
PMax=UIst*IMax;
end E_Motor;
thank you very much in advanced!
Re: Structurally singular, why?
Which compilers did you try? OpenModelica claims to solve the model although it probably should not. The model is pretty bad (not all variables/parameters given initial values so compilers have to guess which variables are fixed).
The dangerous ones set to 0.0 by OpenModelica are:
nIst, w, EKinMax, PMax (which can cause division by zero / singularity)
w=2*pi*nIst actually says 0=2*3.14*0, which is what may cause tools to (rightfully) claim the model is singular. I believe OpenModelica just removed this equation as it was fulfilled and added an equation for w=0 according to the standard...
Try setting fixed=false for parameters that you want to set in INITIAL equations.
Either:
Code:
parameter SIunits.AngularVelocity w(fixed=false);
initial equation
w=2*pi*nIst;
Or:
Code:
parameter SIunits.AngularVelocity w=2*pi*nIst;
- sjoelund.se
- 1700 Posts
- Index
- » Programming
- » Modelica Language
- » Structurally singular, why?