Physics teaching model of a generic civilian cargo ship (no weapons, no combat). Numbers are textbook-level and illustrative; they are not for real loading or operational decisions.
1. Buoyancy, B, G and the metacentre
Archimedes: the hull is in equilibrium when the displaced water weighs as much as the ship and the centre of buoyancy B lies on the same vertical line as the centre of gravity G. B is the centroid of the submerged volume, computed here by clipping every hull cross-section polygon exactly with the tilted waterline (Sutherland-Hodgman) and integrating along the length with Simpson's rule.
KM = KB + BM, BM = I_wl / V, GM = KB + BM - KG
I_wl is the second moment of the waterplane about the centreline. For a box barge BM = B^2/(12 T) exactly. GM > 0 means a small heel creates a righting moment M = W GM sin(phi).
2. The righting-arm curve GZ(phi)
GZ is the horizontal distance between the vertical lines through B and G at heel phi, with sinkage and trim re-solved at every angle (Newton iteration on volume and the longitudinal moment). Righting moment = W g GZ.
wall-sided: GZ = sin(phi) (GM + 1/2 BM tan^2 phi)
Dynamic stability is the area under GZ (work needed to heel the ship). The page shows public-style criteria for general cargo ships (GM at least 0.15 m, area to 30 deg at least 0.055 m rad, area to 40 deg at least 0.09 m rad, GZ at 30 deg at least 0.2 m, GZ max at 25 deg or more) in the spirit of the IMO 2008 Intact Stability Code. They are illustrative here, not a certification tool.
Deck buoyancy: the deck is treated as watertight and superstructure buoyancy is ignored, so GZ falls off after the deck edge is immersed.
3. Loading: KG, free surface, shifted cargo, wind
Weights and heights: lightship, hold cargo and container tiers set the displacement and KG. Raising weight raises KG and lowers GM one-for-one.
free surface: GG_fs = rho_f i / (rho V), i = l b^3 / 12 (small angle)
A slack tank behaves as if G were raised by GG_fs. The page does not use the small-angle formula in the curve: the liquid is modelled exactly (horizontal surface clipped in the tank section at each heel) and the check compares both.
Shifted cargo moves G sideways (G_y = m d / W) so GZ(0) is negative and the ship lists to about G_y/GM. Wind gives a heeling lever HL = rho_a C_d v^2 A z /(2 W g) (cos^2 phi), with the equilibrium where GZ = HL cos^2 phi, and a sudden gust is judged by the equal-area rule (area between GZ and HL beyond equilibrium).
4. Flooding and damage stability (lost buoyancy)
A compartment opened to the sea contributes no buoyancy; the ship's weight is unchanged. A permeability mu (fraction of the compartment that can fill, about 0.6 for cargo, 0.85 for machinery) removes mu of the section from the buoyant volume (lost-buoyancy method). Equilibrium heel, trim and sinkage follow from the same Newton solver. One-sided (wing) flooding makes the ship list.
box barge, length l open: T' = T L / (L - mu l)
Survivability here (illustrative): final heel under 15 deg, deck edge not immersed, GZ max at least 0.10 m and at least 15 deg of positive range beyond the equilibrium. The bulkhead study repeats this for 3 to 8 compartments.
5. Roll motion, waves and parametric roll
k^2 phi'' = -g GZ(phi - alpha(t)) + g HL cos^2 phi - 2 zeta w0 k^2 phi' - q k^2 phi'|phi'|
T_roll = 2 pi k / sqrt(g GM) with k about 0.4 B (includes added mass). The restoring term is the full nonlinear GZ curve, so the ship rolls over if the swing exceeds the angle of vanishing stability. Beam seas act through the effective wave slope alpha = (pi H / lambda) exp(-k_w T) (the ship tends to follow the wave surface; the exponential is the usual reduction of sub-surface wave pressure with depth, the Smith effect); lambda = g T_w^2 / 2 pi.
In head or following seas GZ itself changes as the crest passes: the page re-solves the hydrostatics with a wavy waterline (a different local waterline height at each station) for 12 wave phases and interpolates GZ(phi, phase). When the encounter frequency is about twice the roll frequency (T_e about T_roll / 2) and the GM variation exceeds the damping, the Mathieu-type parametric resonance grows the roll from a tiny disturbance. This is the mechanism behind several well-documented container-ship events (France et al., 2003, Marine Technology 40(1)). Pure box barges show it weakly: the effect needs flared, tapered ends.
6. Numerical checks and simplifications
The Checks tab runs: BM two ways vs B^2/(12T); GZ(1 deg) vs GM sin phi; the wall-sided formula at 5 to 20 deg; displaced volume and B from a 3-D grid integration; lost-buoyancy draft of a box barge; exact slack-tank model vs rho i / (rho V); roll period vs 2 pi k / sqrt(g GM); energy conservation of undamped nonlinear roll; and the equal-area dynamic heel vs a time-domain integration.
Simplifications: prismatic mid-body with tapered, flared ends; one hull shape family at a time; quasi-static waves (no diffraction, no heave/pitch dynamics, no wave-making); roll only (single degree of freedom) with linear plus optional quadratic damping; flooding is instantaneous (no progressive flooding, no down-flooding through openings); superstructure buoyancy ignored; beyond 70 deg of heel the trim is held fixed (the trim axis becomes the world vertical) and only the draft is solved; the 3-D model is scaled from a reference hull when beam or depth change. Generic ship, not any real vessel or company.
7. References
Biran and Lopez Pulido, Ship Hydrostatics and Stability, 2nd ed. (2014); Tupper, Introduction to Naval Architecture; IMO Resolution MSC.267(85), 2008 Intact Stability Code; SOLAS Chapter II-1; France, Levadou, Treakle, Paulling, Michel and Moore, "An investigation of head-sea parametric rolling and its influence on container lashing systems", Marine Technology 40(1), 2003; Mathieu (1868).