GHS Port Reference Center
Information for maritime designers, engineers and builders
Maintained by Creative Systems, Inc., Creators of GHS
Click here for information about GHS and other fine marine software.
Go to Main page

This run produces a Displacement Correction Table
    `This run produces a Displacement Correction Table
    proj displcor
    
    variable (string) gfr,pf
    variables draftloc,w0,lwl,d,d1,dd,ndrafts,t1,dt
    
    
    macro resetdr
     draft @ {draftloc} = {d}
    /
    
    macro trim
     trim= {t%1}/
     .resetdr
     solve weight
     variable dw%1
     set dw%1 = {weight} minus {w0}
    /
    
    macro draft
     trim=0
     .resetdr
     solve weight
     set w0={weight}
    .trim 1
    .trim 2
    .trim 3
    .trim 4
    .trim 5
    .trim 6
    .trim 7
    .trim 8
    \{ d:2} { dw1:1} { dw2:1} { dw3:1} { dw4:1} { dw5:1} { dw6:1} { dw7:1} { dw8:1}
    /
    
    macro st
     variable t%1
     set t%1 = %2
    /
    
    macro trims
     .st {n} {t}
     set n = {n} plus 1
     set t = {t} plus {dt}
    /
    
    macro drafts
     .draft
     set d = {d} plus {dd}
    /
    
    macro dctab
     variables n,t
     set n = 1
     set t = {t1}
     .trims (8)
     \
     \                      Displacement Correction Table
     \------------------------ Trim per{ lwl} {lunit }------------------------------
     \ Draft {  t1:2} {  t2:2} {  t3:2} {  t4:2} {  t5:2} {  t6:2} {  t7:2} {  t8:2}
     set d = {d1}
     .drafts ({ndrafts})
     \------------------------------------------------------------------------------
     \    Draft location: {draftloc }      Displacement corrections in {WUNIT}
     \
    /
    
    macro displcor
     read {gfr}
     report {pf}
     lwl={lwl}
     .dctab
     view
     report off
    /
    
    set gfr = "tanker.gf"
    set lwl = 100       `Length over which trim is taken
    set draftloc = 0.0  `Location at which drafts are taken
    set t1 = -2.0
    set dt = 0.5
    set d1 = 2.0
    set dd = 0.5
    set ndrafts = 8
    
    macro go
     template dc1 "Displacement Correction Table Dialog"
      "Geometry File" file gfr
      "Report File" file pf
      "LBP" lwl
      "Draft Loc" draftloc
      "First trim" t1 | "Trim increment" dt
      "First draft" d1 | "Draft increment" dd
      "Number of drafts" ndrafts
      "Calculate" .displcor
      exit
     //
     .dc1
    /
    .go
    

Add a free link to your site
Copyright © , Creative Systems, Inc.