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

Problem using initial equations

Problem using initial equations

Hi,
Please see the follwing model

Code:

model Test

    import SI = Modelica.SIunits;
  parameter SI.Temperature T;
initial equation
    T = (300+400)/2;
end Test;

When I simulate this, I get the following warnings

Code:


[:0:0-0:0] Warning: No system for the symbolic initialization was generated. A method using numerical algorithms will be used instead.
[:0:0-0:0] Warning: It was not possible to solve the over-determined initial system (2 equations and 1 variables)
[:0:0-0:0] Warning: System is over-determined in Equations 1: T = 350.0;
2: T = 288.15;

[:0:0-0:0] Warning: Trying to fix over-determined initial system with 1 variables and 2 equations... [not implemented yet!]
[:3:3-3:29] Warning: Parameter T has no value, and is fixed during initialization (fixed=true), using available start value (start=288.15) as default value.

Firstly, I dont understand why it tells me that there are 2 equations and 1 variable. When instantiating it says that there are 0 equations and 0 variables which is correct.

Secondly, By default, all parameters will have fixed = false by default.  Why is OMEdit taking fixed = true?

Re: Problem using initial equations

I set fixed = false for the above problem. In this case, I dont get any warnings and the plot shows me T = 350degC. But the Variables browser shows T = 288.15 degC

Re: Problem using initial equations

The variables browser will show the start-value because that is all that is available to it (the information before simulation starts).

In Modelica, variables will have fixed=false by default. But parameters have fixed=true.

Re: Problem using initial equations

Can i know why the model was giving that the system was an overdetermined one?

Re: Problem using initial equations

Code:

model Test 

    import SI = Modelica.SIunits;
  parameter SI.Temperature T;
initial equation
    T = (300+400)/2;
end Test;

is basically transformed into:

Code:

model Test 

    import SI = Modelica.SIunits;
  parameter SI.Temperature T(fixed=false);
initial equation
    T = T.start;
    T = (300+400)/2;
end Test;

Re: Problem using initial equations

Thanks current/smile

There are 0 guests and 0 other users also viewing this topic
You are here: