Calculate static stability of a vessel.
A Ship object provides a calculateStability method to calculate stability parameters. The structural weight is estimated with a top-down approach following an empirical formula. The parameters used in the estimation are stored in designState.calculationParameters. For example, for the PX121.json specification, they read:
The stability parameters can be calculated with:
// create a state object to store the data state = new Vessel.ShipState(); stability = ship.calculateStability(state);
As an empty state object was used, all tanks are half loaded by default.
This yields as results: