﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4862	The NF does not evaluate expressions with Integer indeces	Francesco Casella	Martin Sjölund	"Please check the [https://libraries.openmodelica.org/branches/newInst/ScalableTestSuite/files/ScalableTestSuite_ScalableTestSuite.Power.ConceptualPowerSystem.Verification.TwoGeneratorsStepLoad.err ScalableTestSuite.Power.ConceptualPowerSystem.Verification.TwoGeneratorsStepLoad] model. It currently fails during C code compilation.

Flattening the model with the NF leads to equations such as 

{{{
generator[2].T_s[2] = 
  (generator[2].T_s[2 - 1] + generator[2].NTU / 4.0 * generator[2].T_source) /
  (1.0 + generator[2].NTU / 4.0);
}}}
and
{{{
  if 1 == 1 then
    P_diss[1,1] = 0.0;
    P_ex[1,1] = 0.0;
  else
    P_diss[1,1] = P_d * (generator[1].omega - generator[1].omega);
    P_ex[1,1] = P_f / /*Real*/(abs(1 - 1)) * sin(generator[1].theta - generator[1].theta);
  end if;
}}}

In the first case, the indeces of the array elements should be evaluated to literal constants (as with the old FE). 

In the second case, the condition should be evaluated and only the first branch should be included in the flat code."	defect	closed	high	2.0.0	New Instantiation		fixed		
