Marine systems simulation
Box with Ball

3D box to contain a ball

+ Collaboration diagram for Box with Ball:

Uses CBox class for its implementation. This SimObject is meant for showcasing the SimObject interfaces and interconnection with other SimObjects.

Author
Therese Frostad
Date
12.06.2014 TF: Initial version.

Example configuration excerpt

<Lib
LibName = "fhsim_base"
SimObject = "Ballbox/Box"
Name = "B"
BoxDimensions = "1,1,1"
Scale = "1"
/>
...
<InitialCondition
S.Pos="0,0,-2.5"
S.Vel="0.1,-0.2,0.5"
S.Rot="0,0,0"
/>

Input Ports

This SimObject does not contain any inputs.

Output Ports

Name Width Description
Pos 3 The box centroid position.
Vel 3 The box centroid velocity.
Rot 3 The box orientation in Euler angles.

Configuration parameters

Name Width Description
BoxDimensions 3 Box length, width, height, in meters along axes x, y, , z, respectively.
Scale 1 Scale of rendered body objects, typically 1. (Visualization only)

Initial conditions

Name Width Description
Pos 3 North, East, Down, position.
Vel 3 North, East, Down, velocity.
Rot 3 Euler angles of axes North, East, Down, (x,y,z) in radians.

Full example file

Note
Try to press x while running the simulation to look inside the box.
<Contents>
<OBJECTS>
<Lib
LibName="fhsim_base"
SimObject="Ballbox/Box"
Name="S"
BoxDimensions="5,5,5"
/>
<Lib
LibName="fhsim_base"
SimObject="Ballbox/Ball"
Name="B"
Count="1"
Stiffnesses="1e7"
Radii="1"
Masses="1"
Gravity="9.81"
BoxDimensions="5,5,5"
/>
</OBJECTS>
<INTERCONNECTIONS>
<Connection
B.BoxPos = "S.Pos"
B.BoxRot = "S.Rot"
/>
</INTERCONNECTIONS>
<INITIALIZATION>
<InitialCondition
B.Pos="0,0,-2"
B.Vel="0,0,2"
S.Pos="0,0,-2.5"
S.Vel="0.1,-0.2,0.5"
S.Rot="0,0,0"
/>
</INITIALIZATION>
<INTEGRATION>
<Engine
IntegratorMethod="2"
NumCores="1"
TOutput="0, 10"
LogStates ="0"
stepsize ="0.0006"
HMax="0.002"
HMin="0.0000001"
AbsTol="1e-3" RelTol="1e-3"
UseRSSNormInsteadOfInfNorm="0"
FileOutput="union(objects:ports,objects:states)"
/>
</INTEGRATION>
</Contents>

This SimObject is referred to as Ballbox/Box