World
World coordinate system + gravity field + default animation definition
Library
Mechanics/MultiBody
Description
Model World represents a global coordinate system fixed in ground. This model serves several purposes:
- It is used as inertial system in which the equations of all elements of the MultiBody library are defined.
- It is the world frame of an animation window in which all elements of the MultiBody library are visualized.
- It is used to define the gravity field in which a multi-body model is present. Default is a uniform gravity field where the gravity acceleration vector g is the same at every position. Additionally, a point gravity field or no gravity can be selected. Also, function gravityAcceleration can be redeclared to a user-defined function that computes the gravity acceleration, see example Examples.Elementary.UserDefinedGravityField.
- It is used to define default settings of animation properties (e.g., the diameter of a sphere representing by default the center of mass of a body, or the diameters of the cylinders representing a revolute joint).
- It is used to define a visual representation of the
world model (= 3 coordinate axes with labels), of the defined
gravity field and of a ground plane perpendicular to the gravity direction.
Since the gravity field function is required from all bodies with mass and the default settings of animation properties are required from nearly every component, exactly one instance of model World needs to be present in every model on the top level. The basic declaration needs to be:
inner Modelica.Mechanics.MultiBody.World world
Note, it must be an inner declaration with instance name world in order that this world object can be accessed from all objects in the model. When dragging the "World" object from the package browser into the diagram layer, this declaration is automatically generated (this is defined via annotations in model World).
All vectors and tensors of a mechanical system are resolved in a frame that is local to the corresponding component. Usually, if all relative joint coordinates vanish, the local frames of all components are parallel to each other, as well as to the world frame (this holds as long as a Parts.FixedRotation, component is not used). In this "reference configuration" it is therefore alternatively possible to resolve all vectors in the world frame, since all frames are parallel to each other. This is often very convenient. In order to give some visual support in such a situation, in the icon of a World instance two axes of the world frame are shown and the labels of these axes can be set via parameters.
Parameters
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
mo_enableAnimation | enableAnimation | = true, if animation of all components is enabled | Scalar | true |
mo_animateWorld | animateWorld | = true, if world coordinate system shall be visualized | Scalar | true |
mo_animateGravity | animateGravity | = true, if gravity field shall be visualized (acceleration vector or field center) | Scalar | true |
mo_animateGround | animateGround | = true, if ground plane shall be visualized | Scalar | true |
mo_label1 | label1 | Label of horizontal axis in icon | String | |
mo_label2 | label2 | Label of vertical axis in icon | String | |
mo_gravityType | gravityType | Type of gravity field | Structure | |
mo_gravityType/choice1 | No gravity field | Number | 0 | |
mo_gravityType/choice2 | Uniform gravity field | Number | 0 | |
mo_gravityType/choice3 | Point gravity field | Number | 0 | |
mo_g | g | Constant gravity acceleration | Scalar | |
mo_n | n | Direction of gravity resolved in world frame (gravity = g*n/length(n)) | Vector of size 3 | |
mo_mue | mue | Gravity field constant (default = field constant of earth) | Scalar | |
mo_driveTrainMechanics3D | driveTrainMechanics3D | = true, if 3-dim. mechanical effects of Parts.Mounting1D/Rotor1D/BevelGear1D shall be taken into account | Scalar | true |
mo_gravityAcceleration | gravityAcceleration | Function to compute the gravity acceleration, resolved in world frame | FromModelica('Modelica.Mechanics.MultiBody.Forces.Internal.standardGravityAcceleration') | |
mo_ndim | ndim | Scalar | ||
mo_ndim2 | ndim2 | Scalar | ||
mo_headLength | headLength | Scalar | ||
mo_headWidth | headWidth | Scalar | ||
mo_lineLength | lineLength | Scalar | ||
mo_lineWidth | lineWidth | Scalar | ||
mo_scaledLabel | scaledLabel | Scalar | ||
mo_labelStart | labelStart | Scalar | ||
mo_gravityHeadLength | gravityHeadLength | Scalar | ||
mo_gravityHeadWidth | gravityHeadWidth | Scalar | ||
mo_gravityLineLength | gravityLineLength | Scalar | ||
mo_ndim_pointGravity | ndim_pointGravity | Scalar |
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
mo_axisLength | axisLength | Length of world axes arrows | Scalar | |
mo_axisDiameter | axisDiameter | Diameter of world axes arrows | Scalar | |
mo_axisShowLabels | axisShowLabels | = true, if labels shall be shown | Scalar | true |
mo_axisColor_x | axisColor_x | Color of x-arrow | Vector of size 3 | |
mo_axisColor_y | axisColor_y | Vector of size 3 | ||
mo_axisColor_z | axisColor_z | Color of z-arrow | Vector of size 3 | |
mo_gravityArrowTail | gravityArrowTail | Position vector from origin of world frame to arrow tail, resolved in world frame | Vector of size 3 | |
mo_gravityArrowLength | gravityArrowLength | Length of gravity arrow | Scalar | |
mo_gravityArrowDiameter | gravityArrowDiameter | Diameter of gravity arrow | Scalar | |
mo_gravityArrowColor | gravityArrowColor | Color of gravity arrow | Vector of size 3 | |
mo_gravitySphereDiameter | gravitySphereDiameter | Diameter of sphere representing gravity center (default = mean diameter of earth) | Scalar | |
mo_gravitySphereColor | gravitySphereColor | Color of gravity sphere | Vector of size 3 | |
mo_groundAxis_u | groundAxis_u | Vector along 1st axis (called u) of ground plane, resolved in world frame (should be perpendicular to gravity direction) | Vector of size 3 | |
mo_groundLength_u | groundLength_u | Length of ground plane along groundAxis_u | Scalar | |
mo_groundLength_v | groundLength_v | Length of ground plane perpendicular to groundAxis_u | Scalar | |
mo_groundColor | groundColor | Color of ground plane | Vector of size 3 |
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
mo_nominalLength | nominalLength | "Nominal" length of multi-body system | Scalar | |
mo_defaultAxisLength | defaultAxisLength | Default for length of a frame axis (but not world frame) | Scalar | |
mo_defaultJointLength | defaultJointLength | Default for the fixed length of a shape representing a joint | Scalar | |
mo_defaultJointWidth | defaultJointWidth | Default for the fixed width of a shape representing a joint | Scalar | |
mo_defaultForceLength | defaultForceLength | Default for the fixed length of a shape representing a force (e.g., damper) | Scalar | |
mo_defaultForceWidth | defaultForceWidth | Default for the fixed width of a shape representing a force (e.g., spring, bushing) | Scalar | |
mo_defaultBodyDiameter | defaultBodyDiameter | Default for diameter of sphere representing the center of mass of a body | Scalar | |
mo_defaultWidthFraction | defaultWidthFraction | Default for shape width as a fraction of shape length (e.g., for Parts.FixedTranslation) | Scalar | |
mo_defaultArrowDiameter | defaultArrowDiameter | Default for arrow diameter (e.g., of forces, torques, sensors) | Scalar | |
mo_defaultFrameDiameterFraction | defaultFrameDiameterFraction | Default for arrow diameter of a coordinate system as a fraction of axis length | Scalar | |
mo_defaultSpecularCoefficient | defaultSpecularCoefficient | Default reflection of ambient light (= 0: light is completely absorbed) | Scalar | |
mo_defaultN_to_m | defaultN_to_m | Default scaling of force arrows (length = force/defaultN_to_m) | Scalar | |
mo_defaultNm_to_m | defaultNm_to_m | Default scaling of torque arrows (length = torque/defaultNm_to_m) | Scalar |
Ports
Name | Type | Description | IO Type | Number |
---|---|---|---|---|
frame_b | implicit | Coordinate system fixed in the origin of the world frame | output | 1 |