1 | within ;
|
---|
2 | model Pendulum_N_MultiBody
|
---|
3 | constant Integer N = 2 "Number of individual elements";
|
---|
4 | inner Modelica.Mechanics.MultiBody.World world(enableAnimation=false);
|
---|
5 | Modelica.Mechanics.MultiBody.Joints.Revolute revolute[N];
|
---|
6 | Modelica.Mechanics.MultiBody.Parts.BodyCylinder bodyCylinder[N](each r={1,0,0});
|
---|
7 | equation
|
---|
8 | connect(world.frame_b, revolute[1].frame_a);
|
---|
9 | connect(revolute.frame_b, bodyCylinder.frame_a);
|
---|
10 | connect(bodyCylinder[1:N-1].frame_b, revolute[2:N].frame_a);
|
---|
11 | annotation (uses(Modelica(version="3.2")));
|
---|
12 | end Pendulum_N_MultiBody;
|
---|