﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1943	Wrong equation count for enum in when equations	Christian Schubert	Jens Frenkel	"if an enum is set using an if equation inside a when equation, the OpenModelica Compiler the number of equations is set the possible states the enum can have rather than the dimensionality of the variable itself. Thus such models seem to be unbalanced.
Consider the model
{{{
model WhenCount
  type EnumA = enumeration(
      Value1,
      Value2);
  
  EnumA a;

equation 
  when (time > 0.5) then
    if (time < 1) then
      a = EnumA.Value1;
    else
      a = EnumA.Value2;
    end if;
  end when;

end WhenCount;
}}}

OMC reports:
Too many equations, overdetermined system. The model has 2 equation(s) and 1 variable(s). "	defect	closed	critical	1.9.0	Backend	trunk	fixed	equation count	Adrian Pop Martin Sjölund
