Ticket #2024: Pendulum_N_MultiBody.mo

File Pendulum_N_MultiBody.mo, 564 bytes (added by Christian Schubert, 12 years ago)
Line 
1within ;
2model 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});
7equation
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")));
12end Pendulum_N_MultiBody;