﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4525	Wrong handling and unclear reporting of redundant initial equations	Francesco Casella	Patrick Täuber	"Consider the following test case:
{{{
model Test
  Real p1, p2, p3;
  Real q1, q2, q3;    
equation
  der(p1) = q1 + q2;
  der(p2) = -q2;
  der(p3) = q3;
  q2 = 3*(p2 - p1 +1);
  p1 = 0;
  p3 = if time > 1 then 1 else 0;
initial equation
  der(p1) = 0;
  der(p2) = 0;
  der(p3) = 0;
end Test;
}}}

The system has three potential states, but due to the algebraic constraints on p1 and p3 it has index 2. Two states will be removed by index reduction, so only one initial equation is necessary. The other two happen to be redundant and consistent.

OMC can figure this out and obtain the correct result. However, the output of the compiler is confusing:
{{{
[1] 15:14:55 Translation Notification
The following equation is consistent and got removed from the 
initialization problem: $DER.p3 = 0.0
}}}

In fact, two initial equations needs to be removed, why is only one mentioned?

{{{
[2] 15:14:55 Translation Warning
Assuming redundant initial conditions for the following 2 initial equations:
         0.0 = 0.0
         $DER.p3 = 0.0
}}}

This message is totally obscure. First of all, what does ""Assuming redundant initial conditions for the following X initial equations"" mean? There is no assumption here, the initial conditions *are* indeed redundant and consistent. Do you mean
 ""The following initial equations are redundant and consistent, so they will be removed from the initialization problem"" ?
In this case, can you please change the message accordingly?

Furthermore, it is not at all clear where 0.0 = 0.0 comes from. I guess we should give some more information about this (e.g. by using the debugging information).

Last but not least, the original problem from which we derived the test case reported here (which we cannot post for confidentiality reasons) also gives out this message:
{{{
[1] 14:44:01 Translation Notification
It was not possible to analyze the given system symbolically, because
the relevant equations are part of an algebraic loop. This is not supported yet.
}}}
In fact, the code is generated and the simulation is initialized correctly, so we wonder what this message actually means: what analysis is referred to here, what is the algebraic loop, and more in general whether this is something to be worried about or not."	defect	closed	high	1.13.0	Backend	v1.13.0-dev-nightly	fixed		
