From 8c0211b7015967890f010581b009643bff1ed39b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Luis=20Cerc=C3=B3s=20pita?= Date: Fri, 22 Jun 2012 16:29:06 +0200 Subject: [PATCH] Added a trim factor multiplier at moment to trim 1cm computation (In order to reduce noise). --- src/Mod/Ship/shipHydrostatics/Tools.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Mod/Ship/shipHydrostatics/Tools.py b/src/Mod/Ship/shipHydrostatics/Tools.py index 591df4603..58fbb3d15 100644 --- a/src/Mod/Ship/shipHydrostatics/Tools.py +++ b/src/Mod/Ship/shipHydrostatics/Tools.py @@ -217,12 +217,13 @@ def moment(ship, draft, trim, disp, xcb): @return Moment to trim ship 1cm (ton m). @note Moment is positive when produce positive trim. """ - angle = math.degrees(math.atan2(0.01,0.5*ship.Length)) + factor = 10.0 + angle = factor*math.degrees(math.atan2(0.01,0.5*ship.Length)) newTrim = trim + angle data = displacement(ship,draft,0.0,newTrim,0.0) mom0 = -disp*xcb mom1 = -data[0]*data[1].x - return mom1 - mom0 + return (mom1 - mom0) / factor def FloatingArea(ship, draft, trim): """ Calculate ship floating area.