Opened 10 years ago

#3293 new defect

Array of records containing array get wrong equation count.

Reported by: Gustaf Thorslund Owned by: somebody
Priority: high Milestone: Future
Component: Backend Version: trunk
Keywords: array, record Cc: Mahder Alemseged Gebremedhin, Adrian Pop, Willi Braun

Description

This is a bit like #3217, but with an array in the record. Given the following model:

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.

Change History (0)

Note: See TracTickets for help on using tickets.