FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
Ball in Box

Balls that elastically bounce inside a box.

+ Collaboration diagram for Ball in Box:

Simulation model of balls bouncing in a specified box in three degrees of freedom.

The balls are modeled as spheres with linear springs between contact surfaces and other balls. The model is intended for use with the companion class CBox.

The side of each wall a ball is on when the forces are first evaluated is its inside, for the rest of the run.

The analytic Jacobian is complete for the states: the kinematic coupling, and the contact stiffness of every wall and ball pair in contact at the given states. It is exact away from the contact kinks, where a ball just touches a wall or another ball, and one-sided there. The dependence on the box ports is not part of it: the class has no port Jacobians.

Author
Joakim Haugen
Date
12.06.2014: Initial version

Example configuration excerpt

<Lib
LibName = "fhsim_base"
SimObject = "Ballbox/Ball"
Name = "B"
Stiffnesses = "1e7"
Radii = "1"
Masses = "1"
Gravity = "9.81"
BoxDimensions = "5,5,5"
/>
...
<Connection
B.BoxPos = "0,0,0"
B.BoxRot = "0,0,0"
/>
...
<InitialCondition
B.Pos="0,0,-2.5"
B.Vel="10,10,30"
/>

Input Ports

Name Width Description
BoxPos 3 The position of the centroid of the box.
BoxRot 3 The orientation of the box. Euler angles.

Output Ports

Name Width Description @addoption{Pos, 3*Count, The positions of the balls, three per ball. } @addoption{Vel, 3*Count, The velocities of the balls, three per ball. }
ForceOut 3 The forces from the balls on the box.

Configuration parameters

Name Width Description
Count 1 Number of balls.
Gravity 1 Gravity along z-axis [kg per meter squared].
Stiffnesses Count Linear stiffnesses of the balls [N/m].
Radii Count Radii of the balls [m].
Masses Count Masses of the balls [kg].
BoxDimensions 3 Dimensions of the box in meter,

\[ L_x, L_y, L_z\]

Material 1 String name for sphere material (Default: "Simple/Black"). (Visualization only)
Mesh 1 String name for sphere mesh (Default: "fhSphere.mesh"). (Visualization only)
Scale 1 Scale of rendered ball objects, typically 1. (Visualization only)

Initial conditions

Name Width Description
Pos

\[ 3\cdot \text{Count}\]

North, East, Down, position; repeated Count times.
Vel

\[ 3\cdot \text{Count}\]

North, East, Down, velocity; repeated Count times.

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>
<SIMULATION>
<Timing TStart="0" TEnd="10"/>
<Integrator Method="RK45_i" NumCores="1" LogStates="0" UseRSSNorm="0">
<StepControl Step="0.0006" StepMax="0.002" StepMin="0.0000001" AbsTol="1e-3" RelTol="1e-3"/>
</Integrator>
</SIMULATION>
</Contents>

This SimObject is referred to as Ballbox/Ball