Пример #1
0
def main():
    """The main function. Used to test the other functions."""

    cb_at_10m = c.cb_extrapolation(0.75, 7.3, 10.0)
    print("Estimated block coefficient at 10.0 m: {0:.3f}\n".format(cb_at_10m))

    fr = c.fineness_ratio(160.0, 34000.0)
    print("Fineness ratio for a vessel with lwl = 160.0 m and displacement of 34000 tons: {0:.2f}".
        format(fr))

    fr = c.fineness_ratio(0.97*68.3, 4800.0)
    print("Fineness ratio for a vessel with lwl = 66.2 m and displacement of 4800 tons: {0:.2f}".
        format(fr))
Пример #2
0
    def test_cb_extrapolation_downwards(self):
        """Unit test for block coefficient extrapolation, extrapolating upwards"""

        self.assertAlmostEqual(c.cb_extrapolation(0.80, 10.0, 7.3), 0.778, 3)