﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3293	Array of records containing array get wrong equation count.	Gustaf Thorslund	somebody	"This is a bit like #3217, but with an array in the record. Given the following model:

{{{#!mo
model ArrayRecordArrayTest
 record Field
   Real value[3,5,7](each start=11);
 end Field;

 function Func
   input Field f;
   output Field result;
 algorithm
   result.value := 13*f.value;
 end Func;

 function FuncArray
   input Field f[:];
   output Field result[size(f)];
 algorithm
   for i in 1:size(f,1) loop
     result[i] := Func(f[i]);
   end for;
 end FuncArray;

 Field x;
 Field a[2];
algorithm
 when sample(0, 0.1) then
   x := Func(x);
   a := FuncArray(a);
 end when;
end ArrayRecordArrayTest;
}}}

Flattening seems to work fine, but then it fails with too few equations.

{{{
Error processing file: ArrayRecordArrayTest.mo
Error: Too few equations, under-determined system. The model has 107 equation(s) and 315 variable(s).
Error: Internal error Transformation Module PFPlusExt index Reduction Method Pantelides failed!
}}}

So it seems to only count the number of variables in the record when using an array or records, but count the length of the array when only using one record."	defect	new	high	Future	Backend	trunk		array, record	Mahder Alemseged Gebremedhin Adrian Pop Willi Braun
