# Hydrostatic equilibrium¶

Modeling a floating body with a specific loading requires first to determine its hydrostatic equilibrium. A dedicated solver is included in FRyDoM, based on the developments for the nonlinear hydrostatic model.

## Linear iterative solver¶

The workflow is very similar to what already exists in Meshmagick. The hydrostatic equilibrium solver thus require the mesh of the body, correctly located relatively to the body reference frame, and a loading (mass and COG position).

A Newton-Raphson solver is used to find iteratively the hydrostatic equilibrium, according to the well-known equation

where \(\mathbf{B}\) and \(\mathbf{G}\) are respectively the buoyancy center and the center of gravity, and \(\nabla\) is the volume displacement.

At each iteration, the body mesh position and orientation is then updated accordingly to the previous solutions \((z, \phi, \theta)\). The mesh is then clipped by the free-surface plane and the hydrostatic quantities (buoyancy center, restoring coefficients, etc.) are computed. A new system can finally be solved, using the stiffness matrix newly computed and the residuals, corresponding to the second hand term of the previous equation.

A relaxation is imposed on the solutions, by ensuring the solutions are not greater than user-defined values.

## Hydrostatic quantities expressions¶

The hydrostatic quantities are given by the following expressions

where \(R_t\) and \(R_l\) are respectively the transversal and longitudinal metacentric radius, \(GM_t\) and \(GM_l\) are respectively the transversal and longitudinal metacentric heights, \(x_f\) and \(y_f\) are the horizontal position of the center of the flotation plane.

Corrections can be added on the metacentric radii and stiffness coefficients, to express them on a particular point \(R = (x_R,y_R,z_R)\).

These corrections correspond simply to an offset in position of the body mesh.