# BodyBox

Rigid body with box shape. Mass and animation properties are computed from box data and density (12 potential states)

## Library

Modelica/Mechanics/MultiBody/Parts

## Description

**Rigid body** with **box** shape.
The mass properties of the body (mass, center of mass,
inertia tensor) are computed
from the box data. Optionally, the box may be hollow.
The (outer) box shape is by default used in the animation.
The hollow part is not shown in the animation.
The two connector frames **frame_a** and **frame_b**
are always parallel to each other. Example of component
animation (note, that
the animation may be switched off via parameter animation = **false**):

A BodyBox component has potential states. For details of these states and of the "Advanced" menu parameters, see model MultiBody.Parts.Body.

## Parameters

Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|

| animation | = true, if animation shall be enabled (show box between frame_a and frame_b) | Scalar | true |

| r | Vector from frame_a to frame_b resolved in frame_a | Vector of size 3 | |

| r_shape | Vector from frame_a to box origin, resolved in frame_a | Vector of size 3 | |

| lengthDirection | Vector in length direction of box, resolved in frame_a | Vector of size 3 | |

| widthDirection | Vector in width direction of box, resolved in frame_a | Vector of size 3 | |

| length | Length of box | Scalar | |

| width | Width of box | Scalar | |

| height | Height of box | Scalar | |

| innerWidth | Width of inner box surface (0 <= innerWidth <= width) | Scalar | |

| innerHeight | Height of inner box surface (0 <= innerHeight <= height) | Scalar | |

| density | Density of cylinder (e.g., steel: 7700 .. 7900, wood : 400 .. 800) | Scalar | |

| color | Color of box | Vector of size 3 | |

| specularCoefficient | Reflection of ambient light (= 0: light is completely absorbed) | Scalar | |

| mo | Mass of box without hole | Scalar | |

| mi | Mass of hole of box | Scalar | |

| m | Mass of box | Scalar | |

| R | Orientation object from frame_a to coordinates system spanned by r and widthDirection | FromModelica('Modelica.Mechanics.MultiBody.Frames.Orientation') | |

| r_CM | Position vector from origin of frame_a to center of mass, resolved in frame_a | Vector of size 3 | |

| I | Inertia tensor of body box with respect to center of mass, parallel to frame_a | Matrix of size 3x3 |

Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|

| angles_fixed | = true, if angles_start are used as initial values, else as guess values | Scalar | true |

| angles_start | Initial values of angles to rotate frame_a around 'sequence_start' axes into frame_b | Vector of size 3 | |

| sequence_start | Sequence of rotations to rotate frame_a into frame_b at initial time | Vector of size 3 | |

| w_0_fixed | = true, if w_0_start are used as initial values, else as guess values | Scalar | true |

| w_0_start | Initial or guess values of angular velocity of frame_a resolved in world frame | Vector of size 3 | |

| z_0_fixed | = true, if z_0_start are used as initial values, else as guess values | Scalar | true |

| z_0_start | Initial values of angular acceleration z_0 = der(w_0) | Vector of size 3 |

Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|

| enforceStates | = true, if absolute variables of body object shall be used as states (StateSelect.always) | Scalar | true |

| useQuaternions | = true, if quaternions shall be used as potential states otherwise use 3 angles as potential states | Scalar | true |

| 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 |
---|---|---|---|---|

| r_0 | r_0 | Structure | |

| fixed | Cell of vectors of size 3 | true | |

| start | Cell of vectors of size 3 | ||

| v_0 | v_0 | Structure | |

| fixed | Cell of vectors of size 3 | true | |

| start | Cell of vectors of size 3 | ||

| a_0 | a_0 | Structure | |

| fixed | Cell of vectors of size 3 | true | |

| start | Cell of vectors of size 3 |

## Ports

Name | Type | Description | IO Type | Number |
---|---|---|---|---|

| implicit | Coordinate system fixed to the component with one cut-force and cut-torque | input | 1 |

| implicit | Coordinate system fixed to the component with one cut-force and cut-torque | output | 1 |