Body
Rigid body with mass, inertia tensor and one frame connector (12 potential states)
Library
Modelica/Mechanics/MultiBody/Parts
Description
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 acoordinate system that is parallel to frame_a with theorigin at the center of mass of the body.
By default, this component is visualized by a cylinder locatedbetween frame_a and the center of mass and by a sphere that hasits center at the center of mass. If the cylinder length is smaller asthe radius of the sphere, e.g., since frame_a is located at thecenter of mass, the cylinder is not displayed. Note, thatthe animation may be switched off via parameter animation = false.
States of Body Components
Every body has potential states. If possible a tool will selectthe states of joints and not the states of bodies because this isusually the most efficient choice. In this case the position, orientation,velocity and angular velocity of frame_a of the body will be computedby the component that is connected to frame_a. However, if a body is movingfreely in space, variables of the body have to be used as states. The potentialstates 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 anon-linear constraint equation between the 4 quaternions.Therefore, at least one non-linear equation has to be solvedduring simulation. A tool might, however, analytically solve thissimple constraint equation. Using the 3 angles as states has thedisadvantage that there is a singular configuration in which adivision by zero will occur. If it is possible to determine in advancefor an application class that this singular configuration is outsideof the operating region, the 3 angles might be used as potentialstates by setting useQuaternions = false.
In text books about 3-dimensional mechanics often 3 angles and theangular velocity are used as states. This is not the case here, since3 angles and their derivatives are used as potential states(if useQuaternions = false). The reasonis that for real-time simulation the discretization formula of theintegrator might be "inlined" and solved together with the body equations.By appropriate symbolic transformation the performance isdrastically increased if angles and theirderivatives are used as states, instead of angles and the angularvelocity.
Whether or not variables of the body are used as states is usuallyautomatically selected by the Modelica translator. If parameterenforceStates is set to true in the "Advanced" menu,then body variables are forced to be used as states accordingto the setting of parameters "useQuaternions" and"sequence_angleStates".
Parameters
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
mo_animation | animation | = true, if animation shall be enabled (show cylinder and sphere) | Scalar | true |
mo_r_CM | r_CM | Vector from frame_a to center of mass, resolved in frame_a | Vector of size 3 | |
mo_m | m | Mass of rigid body | Scalar | |
mo_I | I | inertia tensor | Matrix of size 3x3 | |
mo_R_start | R_start | Orientation object from world frame to frame_a at initial time | FromModelica('Modelica.Mechanics.MultiBody.Frames.Orientation') | |
mo_z_a_start | z_a_start | Initial values of angular acceleration z_a = der(w_a), i.e., time derivative of angular velocity resolved in frame_a | Vector of size 3 | |
mo_Q_start | Q_start | Quaternion orientation object from world frame to frame_a at initial time | Vector of size 4 | |
mo_phi_start | phi_start | Potential angle states at initial time | Vector of size 3 | |
mo_I_11 | I_11 | (1,1) element of inertia tensor | Scalar | |
mo_I_22 | I_22 | (2,2) element of inertia tensor | Scalar | |
mo_I_33 | I_33 | (3,3) element of inertia tensor | Scalar | |
mo_I_21 | I_21 | (2,1) element of inertia tensor | Scalar | |
mo_I_31 | I_31 | (3,1) element of inertia tensor | Scalar | |
mo_I_32 | I_32 | (3,2) element of inertia tensor | Scalar | |
mo_w_a | w_a | w_a | Structure | |
mo_w_a/fixed | fixed | Cell of vectors of size 3 | true | |
mo_w_a/start | start | Cell of vectors of size 3 | ||
mo_z_a | z_a | z_a | Structure | |
mo_z_a/fixed | fixed | Cell of vectors of size 3 | true | |
mo_z_a/start | start | Cell of vectors of size 3 | ||
mo_Q | Q | Q | Structure | |
mo_Q/fixed | fixed | Cell of vectors of size 4 | true | |
mo_Q/start | start | Cell of vectors of size 4 | ||
mo_phi | phi | phi | Structure | |
mo_phi/fixed | fixed | Cell of vectors of size 3 | true | |
mo_phi/start | start | Cell of vectors of size 3 |
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
mo_r_0 | r_0 | r_0 | Structure | |
mo_r_0/fixed | fixed | Cell of vectors of size 3 | true | |
mo_r_0/start | start | Cell of vectors of size 3 | ||
mo_v_0 | v_0 | v_0 | Structure | |
mo_v_0/fixed | fixed | Cell of vectors of size 3 | true | |
mo_v_0/start | start | Cell of vectors of size 3 | ||
mo_a_0 | a_0 | a_0 | Structure | |
mo_a_0/fixed | fixed | Cell of vectors of size 3 | true | |
mo_a_0/start | start | Cell of vectors of size 3 | ||
mo_angles_fixed | angles_fixed | = true, if angles_start are used as initial values, else as guess values | Scalar | true |
mo_angles_start | angles_start | Initial values of angles to rotate frame_a around 'sequence_start' axes into frame_b | Vector of size 3 | |
mo_sequence_start | sequence_start | Sequence of rotations to rotate frame_a into frame_b at initial time | Vector of size 3 | |
mo_w_0_fixed | w_0_fixed | = true, if w_0_start are used as initial values, else as guess values | Scalar | true |
mo_w_0_start | w_0_start | Initial or guess values of angular velocity of frame_a resolved in world frame | Vector of size 3 | |
mo_z_0_fixed | z_0_fixed | = true, if z_0_start are used as initial values, else as guess values | Scalar | true |
mo_z_0_start | z_0_start | Initial values of angular acceleration z_0 = der(w_0) | Vector of size 3 |
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
mo_sphereDiameter | sphereDiameter | Diameter of sphere | Scalar | |
mo_sphereColor | sphereColor | Color of sphere | Vector of size 3 | |
mo_cylinderDiameter | cylinderDiameter | Diameter of cylinder | Scalar | |
mo_cylinderColor | cylinderColor | Color of cylinder | Vector of size 3 | |
mo_specularCoefficient | specularCoefficient | Reflection of ambient light (= 0: light is completely absorbed) | Scalar |
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
mo_enforceStates | enforceStates | = true, if absolute variables of body object shall be used as states (StateSelect.always) | Scalar | true |
mo_useQuaternions | useQuaternions | = true, if quaternions shall be used as potential states otherwise use 3 angles as potential states | Scalar | true |
mo_sequence_angleStates | sequence_angleStates | Sequence of rotations to rotate world frame into frame_a around the 3 angles used as potential states | Vector of size 3 |
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
mo__nmodifiers | Number of Modifiers | Specifies the number of modifiers | Number | |
mo__modifiers | Modifiers | Add new modifier | Structure | |
mo__modifiers/varname | Variable name | Cell of strings | 'g_0' | |
mo__modifiers/attribute | Attribute | Cell of strings | 'start' | |
mo__modifiers/value | Value |
Ports
Name | Type | Description | IO Type | Number |
---|---|---|---|---|
frame_a | implicit | Coordinate system fixed at body | input | 1 |