﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2024	Problem with connects and array components	Christian Schubert	Per Östlund	"Hi,

I tried to write a simple pendulum model in a very dense form
{{{
model Pendulum_N_MultiBody
  constant Integer N = 2 ""Number of individual elements"";
  inner Modelica.Mechanics.MultiBody.World world(enableAnimation=false);
  Modelica.Mechanics.MultiBody.Joints.Revolute revolute[N];
  Modelica.Mechanics.MultiBody.Parts.BodyCylinder bodyCylinder[N](each r={1,0,0});
equation 
  connect(world.frame_b, revolute[1].frame_a);
  connect(revolute.frame_b, bodyCylinder.frame_a);
  connect(bodyCylinder[1:N-1].frame_b, revolute[2:N].frame_a);
end Pendulum_N_MultiBody;
}}}

It seems, however, that there is a problem with the connect-statements, as the model is unbalanced. If the second and third connect is written for each individual component, then it works fine:
{{{
  connect(revolute[1].frame_b, bodyCylinder[1].frame_a);
  connect(revolute[2].frame_b, bodyCylinder[2].frame_a);
  connect(bodyCylinder[1].frame_b, revolute[2].frame_a);
}}}

A closer look at the equations reveals, that omc thinks that none of the connections to bodyCylinder[1] exists as
{{{
bodyCylinder[1].frame_a.t[:] = 0.0
bodyCylinder[1].frame_a.f[:] = 0.0
bodyCylinder[1].frame_b.t[:] = 0.0
bodyCylinder[1].frame_b.f[:] = 0.0
bodyCylinder[2].frame_a.t[:] = 0.0
bodyCylinder[2].frame_a.f[:] = 0.0
}}}
These quantities are also missing from the flow-balances they are supposed to be in.
which are the superflous equations.

I attached both models:
 - Pendulum_N_MultiBody -> Array-Connects
 - Pendulum_N_MultiBody -> Flat-Connects"	defect	closed	high	1.9.0	Frontend	trunk	fixed	connect array components	Adrian Pop Jens Frenkel
