FirstExample

class FirstExample "A first example"
    extends Modelica.Icons.Information;

    annotation (Documentation(info = "<html>\n<p>\nAs a first example it shall be demonstrated how to build up, simulate\nand animate a <strong>simple pendulum</strong>.\n</p>\n<p>\nA simple pendulum consisting of a <strong>body</strong> and a <strong>revolute</strong> joint\nwith <strong>linear damping</strong> in the joint, is first build-up as\nModelica composition diagram, resulting in:\n</p>\n\n<p>\n<img src=\"modelica://Modelica/Resources/Images/Mechanics/MultiBody/UsersGuide/Tutorial/FirstExample/PenulumSchematic1.png\"\nalt=\"Modelica composition diagram of simple pendulum\">\n</p>\n\n<p>\nIn the following figure the location of the used\nmodel components is shown. Drag these components in the diagram layer\nand connect them according to the figure:\n</p>\n\n<p>\n<img src=\"modelica://Modelica/Resources/Images/Mechanics/MultiBody/UsersGuide/Tutorial/FirstExample/PenulumSchematic2.png\">\n</p>\n\n<p>\nEvery model that uses model components from the MultiBody library\nmust have an instance of the Modelica.Mechanics.MultiBody.World model on highest level.\nThe reason is that in the world object the gravity field is defined\n(uniform gravity or point gravity), as well as the default sizes of\nanimation shapes and this information is reported to all used\ncomponents. If the World object is missing, a warning message is\nprinted and an instance of the World object with default settings is\nautomatically utilized (this feature is defined with annotations).\n</p>\n<p>\nIn a second step the parameters of the dragged components need to be\ndefined. Some parameters are vectors that have to be defined with respect\nto a local coordinate system of the corresponding component. The easiest\nway to perform this is to define a <strong>reference configuration</strong> of your\nmulti-body model: In this configuration, the relative coordinates of\nall joints are zero. This means that all coordinate systems on all\ncomponents are parallel to each other. Therefore, this just means\nthat all vectors are resolved in the world frame in this configuration.\n</p>\n<p>\nThe reference configuration for the simple pendulum shall be defined\nin the following way: The y-axis of the world frame is directed\nupwards, i.e., the opposite direction of the gravity acceleration.\nThe x-axis of the world frame is orthogonal to it. The revolute joint\nis placed in the origin of the world frame. The rotation axis of the revolute\njoint is directed along the z-axis of the world frame. The body is\nplaced on the x-axis of the world frame (i.e., the rotation angle of the\nrevolute joint is zero, when the body is on the x-axis).\nIn the following figures the definition of this reference configuration\nis shown in the parameter menus of the revolute joint and the body:\n</p>\n\n<p>\n<img src=\"modelica://Modelica/Resources/Images/Mechanics/MultiBody/UsersGuide/Tutorial/FirstExample/ActuatedRevolute.png\">\n<br>\n<img src=\"modelica://Modelica/Resources/Images/Mechanics/MultiBody/UsersGuide/Tutorial/FirstExample/Body.png\">\n</p>\n\n<p>\nTranslate and simulate the model.\nAutomatically, all defined components are visualized in\nan animation using default absolute or relative sizes\nof the components. For example, a body is visualized as\na sphere and as a cylinder. The default size of the sphere is defined\nas parameter in the world object. You may change this size\nin the \"Animation\" parameter menu of the body (see parameter menu\nabove). The default size of the cylinder is defined relatively\nto the size of the sphere (half of the sphere size).\nWith default settings, the following animation is defined:\n</p>\n\n<p>\n<img src=\"modelica://Modelica/Resources/Images/Mechanics/MultiBody/Examples/Elementary/Pendulum.png\">\n</p>\n\n<p>\nThe world coordinate system is visualized as coordinate system\nwith axes labels. The direction of the gravity acceleration\nvector is shown as green arrow. The red cylinder represents\nthe rotation axis of the revolute joint and the light blue\nshapes represent the body. The center of mass of the body is\nin the middle of the light blue sphere.\n</p>\n</html>"));
end FirstExample;