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

Warning: The initial conditions are not fully specified

Warning: The initial conditions are not fully specified

Hi There ,

when I compile my modelica project with the command :  "omc run.mos" ,   the compiler shows  the attached message :


"Notification: The given system is mixed-determined.   [index = 2]
Warning: The initial conditions are not fully specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions(\"-d=initialization\").
Warning: The initial conditions are over specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions(\"-d=initialization\").

I can't  figure out how / where set the parameter -d initialization.

Furthermore, I can't get in OMEdit the OMCFlags option.

Any experience/suggestion to share ?

Thanks a lot in advance;

Francesco

Re: Warning: The initial conditions are not fully specified

There are several options:

Code:


omc -d=initialization run.mos

or in your script run.mos add it as the first line:

Code:


// --- start run.mos script
setCommandLineOptions("-d=initialization"); getErrorString();
// ...
// --- end run.mos script

Re: Warning: The initial conditions are not fully specified

In OMEdit go Tools->Options->Simulation->Additional Translation Flags: -d=initialization
It seems we forgot to change the warning text after we changed the name of the label in OMEdit, I'll fix it.

Re: Warning: The initial conditions are not fully specified

Hi adrpo,

Thx a lot for the prompt reply.

Appling your suggestion : "omc -d=initialization run.mos" , the compiler returns :

"Notification: The given system is mixed-determined.   [index = 2]
Warning: Assuming fixed start value for the following 2 variables:
         m.w:DISCRETE(fixed = true )  type: Boolean
         m2.w:DISCRETE(fixed = true )  type: Boolean

I'm a little bit confused as I declared in my module :

" OutputBoolean out;

Boolean w;

initial equation

out = false;
w = false; "

So i can't figure out the reason m.w is set as "true".

Any suggestion / experience ?

Thx a lot again,

Francesco

Re: Warning: The initial conditions are not fully specified

Is not "m.w" that is set as "true" is its "fixed" attribute that is set to true. Which means it cannot change during initialization.

For example

Code:


// non fixed parameter, can change during initialization, starts at 1 but if the solver can find a better value from the other equations it will use that one.
parameter Real a(start = 1, fixed = false);
// fixed parameter, it will fixed during initialization, basically equivalent to: parameter Real a = 1;
parameter Real a(start = 1, fixed = true);

Edited by: adrpo - Apr-10-21 19:24:33

Re: Warning: The initial conditions are not fully specified

Hi adrpo,

based to your suggestion I declared :

"Boolean w(start = false,fixed = false);"

The compiler returned :

Warning: Assuming fixed start value for the following 2 variables:
         m.w:DISCRETE(start = false fixed = true )  type: Boolean
         m2.w:DISCRETE(start = false fixed = true )  type: Boolean
Warning: The initial conditions are over specified. The following 3 initial equations are redundant, so they are removed from the initialization sytem:
         a.Postiprenotabili = a.prenotabili0
         a.PostiPrenotati = a.prenotati0
         g.capienza = g.cap0.

Even though I set  the variable as " fixed = false " it returned "fixed = true".

Where is my fault  ?  What do you suggest ?

Have a good day ,

Francesco

Edited by: Somma - Apr-11-21 15:21:50

Re: Warning: The initial conditions are not fully specified

If you do this:

Code:


  Boolean w(start = false, fixed = false);
initial equation
  w = false; // this is overspecified as you already have (start=false).

Then the compiler will detect that w is (fixed=true) during initialization as it has an equation with a constant value.

Basically:

Code:


  Boolean w(start = false, fixed = false);

is equivalent to:

Code:


  Boolean w(fixed = false);
initial equation
  w = false;

You should use x(fixed = false) only if you need to calculate "x" during initialization from the values of other variables, i.e.

Code:


Boolean x(fixed = false);
initial equation
  x = y and b;

Basically in your case I would do:

Code:


  Boolean w(start = false, fixed = true);

and remove the initial equation w = false;

You can read more here:
https://specification.modelica.org/main … -algorithm

Edited by: adrpo - Apr-11-21 17:17:15

Re: Warning: The initial conditions are not fully specified

Hi adrpo ,

sorry bothering you.

As per your suggestion I removed the initial equation w = false; but the result is still not the expected one.

Indeed I am getting  the following

Code:

 Warning: Assuming fixed start value for the following 2 variables:

         m.w:DISCRETE(start = false fixed = true )  type: Boolean
         m2.w:DISCRETE(start = false fixed = true )  type: Boolean
Warning: The initial conditions are over specified. The following 3 initial equations are redundant, so they are removed from the initialization sytem:
         a.Postiprenotabili = a.prenotabili0
         a.PostiPrenotati = a.prenotati0
         g.capienza = g.cap0.
   

What do you think about the above ?

Thanks a lot again ,

Francesco

Re: Warning: The initial conditions are not fully specified

No bother. Without seeing more of your model is impossible to tell why you get a warning about the redundant equations.
If your model simulate fine even with the warning then just ignore it.

If you can share your model with us we could probably tell you what is wrong.
You can send it via email to OpenModelica @ ida.liu.se and we will have a look
and then delete it after we found the problem. If you cannot send the model then
have a look at the declarations of components:
  a.Postiprenotabili, a.prenotabili0, a.PostiPrenotati, a.prenotati0, g.capienza, g.cap0
and see if they have a start value an what fixed attribute is set to and their use in initial
equation sections.

Re: Warning: The initial conditions are not fully specified

Hi adrpo,

As per your request I send out my models to the specified email address.

My email is : ****@gmail.com

Have a good day ,

Francesco

Edited by: adrpo - Apr-13-21 14:40:56

Re: Warning: The initial conditions are not fully specified

Hi adrpo,

Any news for me about the uploaded models ?

Thanks a lot ,

Francesco.

Re: Warning: The initial conditions are not fully specified

Sorry, I didn't yet had time to look at them. I will try to look into this asap.

Re: Warning: The initial conditions are not fully specified

Thank you to adrpo ,

The solution is :

Before :

Code:

Boolean w;

After :

Code:

Boolean w(start=false, fixed=true); 

Thanks a lot again,

Francesco

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