proj skypt
`Forces a given point on the stern down to a given height above the water.
`Note: Beginning with version 8.16 this can also be done with a negative
`ground reaction.

read fv
`Initial condition:
draft = 7
vcg = 8
solve weight, lcg

`The given point:
part hull
ref = 40, 0, 12

`The desired height of this point above the water:
variable wantht
set wantht = 2.0

`The point at which the weight is applied is given in the ADD command below.

macro try
ADD "Downward force at stern", {f}, 40a, 0, 12 /nowarn
`message trying force = {f}
solve
set dh = {height} minus {wantht}
if {dh} > 0 then set f = {f} plus {df} else set f = {f} minus {df}
set df={df} mult 0.6
/

variable f,dh,df
set dh = {height} minus {wantht}
set f = {fweight} div {depth} times {dh} div 2
set df = {f} div 2
\ Initial height: {height:2}
.try (15)
\ Final height: {height:2}
status