<!DOCTYPE OMNotebook>
<Notebook>
 <GroupCell closed="false" >
  <GroupCell closed="false" >
   <TextCell style="Title" >
    <Text>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Arial; font-size:38pt; font-weight:600; color:#000000;">A 3D Double Pendulum&lt;/p>&lt;/body>&lt;/html></Text>
   </TextCell>
   <TextCell style="Text" >
    <Text>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Times New Roman; font-size:12pt; color:#000000;">&lt;br />In this section an idealized model of a double pendulum is considered. This pendulum consists of two boxes linked by a hinge. The upper box is lined by a hinge to a non-movable platform, i.e. an inertial system. Both the boxes can move in the XY plane. The corresponding kinematic outline consists of two revolute joints, one frame translation and one inertial system. &lt;br />&lt;br />The motion of dynamic system cannot be defined just by its kinematic outline, since an outline does not contain mass objects yet. The class &lt;span style=" font-family:Courier New;">Body&lt;/span> represents mechanical objects with mass. This class has a connector &lt;span style=" font-family:Courier New;">frame_a&lt;/span> as well as the parameters &lt;span style=" font-family:Courier New;">m&lt;/span> (mass of the body), &lt;span style=" font-family:Courier New;">rCM[3]&lt;/span> (position of center of mass with respect to frame a) and &lt;span style=" font-family:Courier New;">I[3, 3]&lt;/span> (inertia tensor with respect to the position of the center of the mass; it's defined by 6 numbers since it's symmetric).&lt;br />&lt;br />In the double pendulum example two bodies can be added to the kinematic outline. &lt;br />Since the description of class &lt;span style=" font-family:Courier New;">Body&lt;/span> contains the distance between its frame A and its center of mass, such objects can be directly connected to connector &lt;span style=" font-family:Courier New;">frame_b&lt;/span> of the revolute joints &lt;span style=" font-family:Courier New;">Revolute1&lt;/span> and &lt;span style=" font-family:Courier New;">Revolute2.&lt;br />&lt;/span>&lt;/p>&lt;/body>&lt;/html></Text>
   </TextCell>
   <InputCell style="Input" closed="true" >
    <Input>class doublePendulumNoGeometry 
  import ModelicaAdditions.MultiBody.Parts;
  import ModelicaAdditions.MultiBody.Joints;
  parameter Real         L1 = 1   "length of 1st arm";
  parameter Real         L2 = 1.3 "length of 2nd arm";
  parameter Real         M = 1.0  "mass";
  Parts.InertialSystem   inertialSystem1;
  Joints.Revolute        revolute2;
  Joints.Revolute        revolute1;
  Parts.Body             body1(rCM = {L1/2, 0, 0}, m = M);
  Parts.FrameTranslation frameTranslation1(r = {L1, 0, 0});
  Parts.Body             body2(rCM = {L2/2, 0, 0}, m = M);
equation 
  connect(inertialSystem1.frame_b,   revolute1.frame_a);
  connect(revolute1.frame_b,         body1.frame_a);
  connect(revolute1.frame_b,         frameTranslation1.frame_a);
  connect(frameTranslation1.frame_b, revolute2.frame_a);
  connect(revolute2.frame_b,         body2.frame_a);
end doublePendulumNoGeometry;</Input>
    <Output></Output>
   </InputCell>
   <GroupCell closed="false" >
    <TextCell style="Section" >
     <Text>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Times; font-size:18pt; font-weight:600; color:#000000;">A Double Pendulum Consisting of two Cylinders&lt;/p>&lt;/body>&lt;/html></Text>
    </TextCell>
    <TextCell style="Text" >
     <Text>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Times New Roman; font-size:12pt; color:#000000;">In this example the pendulum consists of two cylinders. The textual representation of Modelica model is following: &lt;/p>&lt;/body>&lt;/html></Text>
    </TextCell>
    <InputCell style="Input" closed="true" >
     <Input>class doublePendulum
  import ModelicaAdditions.MultiBody.Parts;
  import ModelicaAdditions.MultiBody.Joints;
  parameter Real          L1 = 1   "length of 1st arm";
  parameter Real          L2 = 1.3 "length of 2nd arm";
  Parts.InertialSystem    inertialSystem1;
  Joints.Revolute         revolute1;
  Parts.CylinderBody      cylinderBody1(r = {L1, 0, 0});
  Joints.Revolute         revolute2;
  Parts.CylinderBody      cylinderBody2(r = {L2, 0, 0}, Material = {1, 1, 0, 0.5});
equation 
  connect(inertialSystem1.frame_b, revolute1.frame_a);
  connect(revolute1.frame_b,       cylinderBody1.frame_a);
  connect(cylinderBody1.frame_b,   revolute2.frame_a);
  connect(revolute2.frame_b,       cylinderBody2.frame_a);
end doublePendulum;</Input>
     <Output></Output>
    </InputCell>
   </GroupCell>
   <GroupCell closed="false" >
    <TextCell style="Section" >
     <Text>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Times; font-size:18pt; font-weight:600; color:#000000;">Simulation of DoublePendulum&lt;/p>&lt;/body>&lt;/html></Text>
    </TextCell>
    <InputCell style="Input" closed="true" >
     <Input>simulate( doublePendulum );</Input>
     <Output></Output>
    </InputCell>
    <TextCell style="Output" >
     <Text>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Courier New; font-size:11pt; color:#000000;">&lt;/p>&lt;/body>&lt;/html></Text>
    </TextCell>
    <InputCell style="Input" closed="true" >
     <Input>plot( cylinderBody1.body.frame_a.a[1] );</Input>
     <Output>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Courier New; font-size:11pt; color:#000000;">&lt;/p>&lt;/body>&lt;/html></Output>
    </InputCell>
    <TextCell style="Output" >
     <Text>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Courier New; font-size:11pt; color:#000000;">&lt;img src="file:///C:/OpenModelica132/bin/OMNoteboook_tempfiles/19.png" width="382" height="284" />&lt;/p>&lt;/body>&lt;/html></Text>
     <Image name="file:///C:/OpenModelica132/bin/OMNoteboook_tempfiles/19.png" >AAAAAYlQTkcNChoKAAAADUlIRFIAAAF+AAABHAgDAAAA9zgvnwAAAwBQTFRFAAAAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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