Why a free surface matters
When a ship heels, liquid in a partly filled tank stays level with gravity rather than rotating rigidly with the hull. Its centre of mass moves toward the low side. That movement reduces the vessel's righting ability.
Equations used
Iφ φ̈ + c φ̇ + ΔgGM0 sinφ + ρgLAδx = Mw sin(2πfwt)
FSC = ρL b³ / (12Δ) ; GMeff = GM0 − FSC
Here φ is heel angle, Iφ is roll inertia, c is linear damping, Δ is displacement mass, GM₀ is the frozen-liquid metacentric height, ρ is liquid density, L and b are tank length and breadth, A is liquid cross-sectional area, and δx is the liquid centroid's lateral shift relative to a rigidly carried liquid mass. The gravity constant is 9.80665 m/s² (textbook).
What is calculated
The tank is a rectangular prism. At each integration stage, the tank rectangle is rotated, clipped by a world-horizontal free-surface line, and its liquid area and centroid are found with polygon geometry. The roll equation is advanced with fixed-step fourth-order Runge–Kutta integration.
Simplifications
The ship's intact righting arm is represented by GM₀ sinφ. The tank is prismatic, liquid is incompressible, and sloshing is assumed quasi-static: no internal waves, impact, vortex flow, or phase lag are resolved. Roll damping is linear and the external wave moment is sinusoidal. The displayed vessel is a scaled schematic, not a naval-architecture design.
All vessel dimensions, masses, densities, controls and forcing values are illustrative. The gravity constant is textbook. The drawing is scaled. This educational model is not a stability assessment for a real vessel.