﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5643	Connect-equations in for loop are ignored when using -d=nonfScalarize	Francesco Casella	Per Östlund	"We are working on a project whereby we need to start from the unscalarized output of the NF flattening to compile Modelica models efficiently. The easiest option seems to be getting the flat Modelica output, parsing it, and starting from there. Unfortunately, there are still some quirks concerning connect-equations in the flat Modelica dump when it is called before the scalarization step. 

The attached package contains some simple test cases. The flat, non-scalarized models of the {{{PlainEquations}}} package seem to be ok. Unfortunately, some models in {{{ConnectEquations}}} reveal that connect-equations in for loops are ignored by the flattening process.

For example, {{{ConnectEquations.C}}} is flattened as
{{{
class TestArray.ConnectEquations.C ""A model using arrays of simple models without arrays""
  final parameter Integer N = 3;
  parameter Real[3] p = {1.0, 1.5, 2.0};
  Real[3] a.x;
  parameter Real[3] a.p = p;
  Real[3] a.c.f;
  Real[3] a.c.e;
  parameter Real s.p = 20.0;
  Real s.c.e;
  Real s.c.f;
equation
  a.c.f = 0.0;
  s.c.e = a[1].c.e;
  s.c.f + a[1].c.f = 0.0;
  for $i in 1:3 loop
    der(a[$i].x) = (-a[$i].p * a[$i].x) + 1.0;
  end for;
  a.c.f = a.x;
  s.c.e = s.p;
  for i in 1:3 - 1 loop
  end for;
end TestArray.ConnectEquations.C;
}}}
It is apparent how the effects of connect-equations in the for-loop of model {{{C}}} are missing.

The same happens in {{{ConnectEquations.D}}}"	defect	closed	critical	1.17.0	New Instantiation		fixed		federico.terraneo@… stefano.cherubin@… massimo.fioravanti@… Rüdiger Franke
