﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1733	range in connect equation fails	Jens Frenkel	Jens Frenkel	"For the simple Model
{{{
model IndexConnect
  connector A
    Real a;
  end A; 
  
  constant Integer n=5;
  A a[n];
equation
  a[1].a = 1;
  connect(a[1:n-1],a[2:n]);
end IndexConnect;
}}}
instantiateModel result with 
{{{
class IndexConnect
  constant Integer n = 5;
  Real a[1].a;
  Real a[2].a;
  Real a[3].a;
  Real a[4].a;
  Real a[5].a;
equation
  a[1].a = 1.0;
end IndexConnect;
}}}
As you can see the connect equation is not expand to 
{{{
a[1].a = a[2].a;
a[2].a = a[3].a;
a[3].a = a[4].a;
a[4].a = a[5].a;
}}}
Even try to rewrite the connect as a loop:  
{{{
for i in 2:n loop
  connect(a[i-1],a[i]);
end for;
}}}
results in: 
{{{
a[1].a = a[2].a;
a[1].a = a[3].a;
a[1].a = a[4].a;
a[1].a = a[5].a;
}}}"	defect	closed	critical	1.9.0	Frontend	trunk	fixed		Frenkel TUD Adrian Pop Per Östlund
