`DNV Marine Operations Range of Stability Criterion 4.2.2.2
`Demonstration

proj dnvmo

units mt

enter pm
create hull
ends 0 100
out 15
top 10
bot 0
/
write barge.gf
quit pm

draft 5
vcg 12
solve weight, lcg
report DNVMO.PF

`This macro produces the limit command representing subpart 4.2.2.2
macro lim4222 `%1: "maximum dynamic heel angle"
variable h2,hmax,hramax,gmt1

`Find angle at max RA:
hmmt off
lim off
lim angle from abs 0 to max > 0
ra 0 2 /lim /noprint
set hramax={LIMMARG}
\
\\Angle at MaxRA is {limmarg}\
\
`Find GMT:
heel 0
solve trim
set gmt1={GMT}
\ GMT is {GMT}\
\

`Max dynamic heel angle (given):
set hmax=%1

`Calculate required range of stability:

set h2=40
if {hmax} < {hramax} then set h2 = 15 div {gmt1} plus 15 plus {hmax}
if {h2} > 40 then set h2 = 40

\Calculate required range of stability:\
\If {hmax} < {hramax} then set h2 = 15 div {gmt1} plus 15 plus {hmax}\
\GHS Limit for DNV subpart 4.2.2.2 is: lim angle from abs 0 to RA0 > {h2}\
\

lim off
lim angle from abs 0 to RA0 > {h2}
/

.lim4222 20.0 `<-- "maximum dynamic heel angle calculated elsewhere"
ra /lim
print preview