Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

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;

Re: Structurally singular, why?

it works!

Thanks for your quick help. You help me to understand Modelica a little more current/smile

edit: just for the records: both variants are working current/wink

Edited by: JK - Jun-27-16 08:51:06
There are 0 guests and 0 other users also viewing this topic
You are here: