modelBody

DS Library version of Modelica.Mechanics.MultiBody.Parts.Body, with "final" keyword removed from some parameters

Information

Attribution Notice

This model is a modification of the Body block in the Mechanics.MultiBody.Parts package of the Modelica Standard Library
Copyright © 1998-2016, Modelica Association and DLR.

Rigid body with mass and inertia tensor. All parameter vectors have to be resolved in frame_a. The inertia tensor has to be defined with respect to a coordinate system that is parallel to frame_a with the origin at the center of mass of the body.

By default, this component is visualized by a cylinder located between frame_a and the center of mass and by a sphere that has its center at the center of mass. If the cylinder length is smaller as the radius of the sphere, e.g., since frame_a is located at the center of mass, the cylinder is not displayed. Note, that the animation may be switched off via parameter animation = false.

Parts.Body

States of Body Components

Every body has potential states. If possible a tool will select the states of joints and not the states of bodies because this is usually the most efficient choice. In this case the position, orientation, velocity and angular velocity of frame_a of the body will be computed by the component that is connected to frame_a. However, if a body is moving freely in space, variables of the body have to be used as states. The potential states of the body are:

  • The position vector frame_a.r_0 from the origin of the world frame to the origin of frame_a of the body, resolved in the world frame and the absolute velocity v_0 of the origin of frame_a, resolved in the world frame (= der(frame_a.r_0)).
  • If parameter useQuaternions in the "Advanced" menu is true (this is the default), then 4 quaternions are potential states. Additionally, the coordinates of the absolute angular velocity vector of the body are 3 potential states.
    If useQuaternions in the "Advanced" menu is false, then 3 angles and the derivatives of these angles are potential states. The orientation of frame_a is computed by rotating the world frame along the axes defined in parameter vector "sequence_angleStates" (default = {1,2,3}, i.e., the Cardan angle sequence) around the angles used as potential states. For example, the default is to rotate the x-axis of the world frame around angles[1], the new y-axis around angles[2] and the new z-axis around angles[3], arriving at frame_a.

The quaternions have the slight disadvantage that there is a non-linear constraint equation between the 4 quaternions. Therefore, at least one non-linear equation has to be solved during simulation. A tool might, however, analytically solve this simple constraint equation. Using the 3 angles as states has the disadvantage that there is a singular configuration in which a division by zero will occur. If it is possible to determine in advance for an application class that this singular configuration is outside of the operating region, the 3 angles might be used as potential states by setting useQuaternions = false.

In text books about 3-dimensional mechanics often 3 angles and the angular velocity are used as states. This is not the case here, since 3 angles and their derivatives are used as potential states (if useQuaternions = false). The reason is that for real-time simulation the discretization formula of the integrator might be "inlined" and solved together with the body equations. By appropriate symbolic transformation the performance is drastically increased if angles and their derivatives are used as states, instead of angles and the angular velocity.

Whether or not variables of the body are used as states is usually automatically selected by the Modelica translator. If parameter enforceStates is set to true in the "Advanced" menu, then body variables are forced to be used as states according to the setting of parameters "useQuaternions" and "sequence_angleStates".

Copyright © 2018
ATA ENGINEERING, INC.
ALL RIGHTS RESERVED

Parameters

TypeNameDefaultDescription
Booleananimationtrue= true, if animation shall be enabled (show cylinder and sphere)
SI.Position[3]r_CMVector from frame_a to center of mass, resolved in frame_a
SI.MassmMass of rigid body
SI.Massmassm*qsFac
RealqsFacif DSLglb.quasiStatic then DSLglb.quasiStaticFactor else 1.0Quasi-static factor
SI.Inertia[3,3]I[I_11, I_21, I_31; I_21, I_22, I_32; I_31, I_32, I_33]*qsFacinertia tensor
Frames.OrientationR_startModelica.Mechanics.MultiBody.Frames.axesRotations(sequence_start, angles_start, zeros(3))Orientation object from world frame to frame_a at initial time
Frames.Quaternions.OrientationQ_startFrames.to_Q(R_start)Quaternion orientation object from world frame to frame_a at initial time
Inertia tensor (resolved in center of mass, parallel to frame_a)
SI.InertiaI_110.001(1,1) element of inertia tensor
SI.InertiaI_220.001(2,2) element of inertia tensor
SI.InertiaI_330.001(3,3) element of inertia tensor
SI.InertiaI_210(2,1) element of inertia tensor
SI.InertiaI_310(3,1) element of inertia tensor
SI.InertiaI_320(3,2) element of inertia tensor
Initialization
SI.Angle[3]angles_start{0, 0, 0}Initial values of angles to rotate frame_a around 'sequence_start' axes into frame_b
Types.RotationSequencesequence_start{1, 2, 3}Sequence of rotations to rotate frame_a into frame_b at initial time
Animation › if animation = true
SI.DiametersphereDiameterworld.defaultBodyDiameterDiameter of sphere
SI.DiametercylinderDiametersphereDiameter/Types.Defaults.BodyCylinderDiameterFractionDiameter of cylinder
Advanced
BooleanenforceStatesfalse= true, if absolute variables of body object shall be used as states (StateSelect.always)
BooleanuseQuaternionstrue= true, if quaternions shall be used as potential states otherwise use 3 angles as potential states

Connectors

TypeNameDefaultDescription
Modelica.Mechanics.MultiBody.Interfaces.Frame_aframe_aCoordinate system fixed at body

Components

TypeNameDefaultDescription
SI.Position[3]r_0Position vector from origin of world frame to origin of frame_a
SI.Velocity[3]v_0Absolute velocity of frame_a, resolved in world frame (= der(r_0))
SI.Acceleration[3]a_0Absolute acceleration of frame_a resolved in world frame (= der(v_0))
SI.Acceleration[3]a_aAcceleration of frame_a resolved in frame_a
Types.ColorsphereColorModelica.Mechanics.MultiBody.Types.Defaults.BodyColorColor of sphere
Types.ColorcylinderColorsphereColorColor of cylinder
Types.SpecularCoefficientspecularCoefficientworld.defaultSpecularCoefficientReflection of ambient light (= 0: light is completely absorbed)
SI.AngularVelocity[3]w_aAbsolute angular velocity of frame_a resolved in frame_a
SI.AngularAcceleration[3]z_aAbsolute angular acceleration of frame_a resolved in frame_a
SI.Acceleration[3]g_0Gravity acceleration resolved in world frame
Modelica.Mechanics.MultiBody.Worldworld
DeployStructLib.DSL_GlobalsDSLglb
Frames.Quaternions.OrientationQQuaternion orientation object from world frame to frame_a (dummy value, if quaternions are not used as states)
SI.Angle[3]phiDummy or 3 angles to rotate world frame into frame_a of body
SI.AngularVelocity[3]phi_d= der(phi)
SI.AngularAcceleration[3]phi_dd= der(phi_d)
Visualizers.Advanced.Shapecylinder
Visualizers.Advanced.Shapesphere