modelWorld

World coordinate system + gravity field + default animation definition

Information

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.
    MultiBody.World

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

TypeNameDefaultDescription
BooleanenableAnimationtrue= true, if animation of all components is enabled
BooleananimateWorldtrue= true, if world coordinate system shall be visualized
BooleananimateGravitytrue= true, if gravity field shall be visualized (acceleration vector or field center)
BooleananimateGroundfalse= true, if ground plane shall be visualized
Types.AxisLabellabel1"x"Label of horizontal axis in icon
Types.AxisLabellabel2"y"Label of vertical axis in icon
Types.GravityTypesgravityTypeGravityTypes.UniformGravityType of gravity field
SI.AccelerationgModelica.Constants.g_nConstant gravity acceleration
Types.Axisn{0, -1, 0}Direction of gravity resolved in world frame (gravity = g*n/length(n))
Realmu3.986004418e14Gravity field constant (default = field constant of earth)
BooleandriveTrainMechanics3Dtrue= true, if 3-dim. mechanical effects of Parts.Mounting1D/Rotor1D/BevelGear1D shall be taken into account
Animation › if animateWorld = true
SI.DistanceaxisLengthnominalLength/2Length of world axes arrows
SI.DistanceaxisDiameteraxisLength/defaultFrameDiameterFractionDiameter of world axes arrows
BooleanaxisShowLabelstrue= true, if labels shall be shown
Animation › if animateGravity = true and gravityType = UniformGravity
SI.Position[3]gravityArrowTail{0, 0, 0}Position vector from origin of world frame to arrow tail, resolved in world frame
SI.LengthgravityArrowLengthaxisLength/2Length of gravity arrow
SI.DiametergravityArrowDiametergravityArrowLength/defaultWidthFractionDiameter of gravity arrow
Animation › if animateGravity = true and gravityType = PointGravity
SI.DiametergravitySphereDiameter12742000Diameter of sphere representing gravity center (default = mean diameter of earth)
Animation › if animateGround = true and gravityType = UniformGravity
MultiBody.Types.AxisgroundAxis_uif abs(n[1]) >= 0.99 then {0, 1, 0} else {1, 0, 0}Vector along 1st axis (called u) of ground plane, resolved in world frame (should be perpendicular to gravity direction)
SI.LengthgroundLength_u2Length of ground plane along groundAxis_u
SI.LengthgroundLength_vgroundLength_uLength of ground plane perpendicular to groundAxis_u
Defaults
SI.LengthnominalLength1Nominal length of multi-body system
SI.LengthdefaultAxisLengthnominalLength/5Default for length of a frame axis (but not world frame)
SI.LengthdefaultJointLengthnominalLength/10Default for the fixed length of a shape representing a joint
SI.LengthdefaultJointWidthnominalLength/20Default for the fixed width of a shape representing a joint
SI.LengthdefaultForceLengthnominalLength/10Default for the fixed length of a shape representing a force (e.g., damper)
SI.LengthdefaultForceWidthnominalLength/20Default for the fixed width of a shape representing a force (e.g., spring, bushing)
SI.LengthdefaultBodyDiameternominalLength/9Default for diameter of sphere representing the center of mass of a body
RealdefaultWidthFraction20Default for shape width as a fraction of shape length (e.g., for Parts.FixedTranslation)
SI.LengthdefaultArrowDiameternominalLength/40Default for arrow diameter (e.g., of forces, torques, sensors)
RealdefaultFrameDiameterFraction40Default for arrow diameter of a coordinate system as a fraction of axis length
RealdefaultSpecularCoefficient0.7Default reflection of ambient light (= 0: light is completely absorbed)
RealdefaultN_to_m1000Default scaling of force arrows (length = force/defaultN_to_m)
RealdefaultNm_to_m1000Default scaling of torque arrows (length = torque/defaultNm_to_m)

Connectors

TypeNameDefaultDescription
Interfaces.Frame_bframe_bCoordinate system fixed in the origin of the world frame

Components

TypeNameDefaultDescription
Types.ColoraxisColor_xModelica.Mechanics.MultiBody.Types.Defaults.FrameColorColor of x-arrow
Types.ColoraxisColor_yaxisColor_x
Types.ColoraxisColor_zaxisColor_xColor of z-arrow
Types.ColorgravityArrowColor{0, 230, 0}Color of gravity arrow
Types.ColorgravitySphereColor{0, 230, 0}Color of gravity sphere
Types.ColorgroundColor{200, 200, 200}Color of ground plane

Contents

NameDescription
gravityAcceleration