!********************************************************** !* MACRO GEOMETRY MODULE shwstab(); !* Displays a list of principle stability data based on !* vertical position of waterline. !* !* (C)Microform AB 1998-09-23, J.Kjellander !* Stephan Helma !* !********************************************************** INT status; FLOAT k1(1),k2(2),k3(3),k4(4),k6(6); FLOAT displ,wparea,lwl,ywl,density; BEGINMODULE !* !***Get the displacement. !* status:=getdat_gm("DISPLACEMENT",k4); if status = 4 then displ:=k4(1); else displ:=-1; endif; !* !***Get length water line. !* status:=getdat_gm("LWL",k2); if status = 2 then lwl:=k2(1); ywl:=k2(2); else lwl:=-1; endif; !* !***Get the density of water. !* status:=getdat_gm("DENSITY_WATER",k1); if status = 1 then density:=k1(1); else density:=-1; endif; lst_ini("Current stability data @ WL ("+str(ywl/1E3,1,3)+"m) !"); !* !***MMTINERTIA. !***Moments of inertia and metacentric heights !***(longitudinal & transversal). !* status:=getdat_gm("WPAREA",k6); wparea:=k6(1); if status = 6 then lst_lin("IL Long. moment of AWL = "+str(k6(5)/1E12,-8,3)+" meters^4"); lst_lin("IT Trans. moment of AWL = "+str(k6(6)/1E12,-8,3)+" meters^4"); lst_lin(" ¤ @ x-station = "+str(k6(2)/1E3,-8,3)+" meters"); lst_lin(" ¤ @ y-waterline = "+str(k6(3)/1E3,-8,3)+" meters"); lst_lin(" ¤ @ z-buttock = "+str(k6(4)/1E3,-8,3)+" meters"); if displ > 0 then lst_lin("BML Long. metacentric height = "+str(k6(5)/displ/1E3,-8,3)+" meters"); lst_lin("BM Trans. metacentric height = "+str(k6(6)/displ/1E3,-8,3)+" meters"); else lst_lin("BM Misc metacentric heights = "+"No displacement defined"); endif; if density > 0 then lst_lin("ETM M req to trim hull 1mm = "+str(density*k6(5)/lwl/1E3,-8,3)+" kg*m/mm"); else lst_lin("ETM M req to trim hull 1mm = "+"No density defined"); endif; else lst_lin("I Moments of AWL = "+"Not defined"); endif; lst_lin(""); lst_lin(" Volume per mm immersion = "+str(wparea/1E6*1E-3,-8,3)+" m³/mm"); if density > 0 then lst_lin(" Weight per mm immersion = "+str(density*wparea,-8,3)+" kg/mm"); endif; !* !***SIMPSON_SLICES. !***Number of Simpson slices. !* status:=getdat_gm("SIMPSON_SLICES",k1); if status = 1 then lst_lin(""); lst_lin("< Calculated with "+str(k1(1),-1,0)+" Simpson double slices (2*dx="+str((lwl/1E3)/k1(1),-1,2)+"m). >"); endif; !* !***DENSITY_WATER. !***Density of water. !* status:=getdat_gm("DENSITY_WATER",k1); if status = 1 then lst_lin("< Density of water = "+str(k1(1)*1E9,-6,4)+" kg/m³ >"); else lst_lin("< Density of water = "+"Not defined >"); endif; lst_exi(); ENDMODULE !**********************************************************