(* Bühlmann constants for tissue 6 with b close to 0.83 *)

b5 =0.8434

a5 = 0.5043

(*tolerated ambient pressure with gradient factor g*)

ptol[p_,g_, a_, b_] := g p/b + g a + (1-g) p

Plot[{p,ptol[p],ptol[p,.8]},{p,1,10}]

(* tolerated ambient pressure with gfh at the surface with p==1 and gfl at ambient pressure pm *)

gfm[gfl_, gfh_,p_,pm_, a_, b_] := (p-1) (ptol[pm, gfl,a,b]-ptol[1,gfh,a,b])/(pm -1) + ptol[1,gfh,a,b]

FullSimplify[gfm[gfl, gfh, p, pm,a,b]]

Plot[Evaluate[{p,gfm[1,1,p,pm,a5, b5],gfm[b5 .8,.8,p,pm,a5,b5],gfm[(b5-1-a5 b5)/(b5 pm -pm- a5 b5) .8,.8,p,pm,a5,b5]}/. pm->4],{p,1,6},PlotStyle->{Red, Green, Blue, Orange} 
]

(* solve slope of this =1 in terms of gfl/gfh *)

x /.Solve[D[gfm[x g,g,p,pm,a,b],p]==1,x][[1]]

FullSimplify[%]

Series[%,{pm,1,2}]

(* at 30m, a reasonable first stop depth *)

(b5-1-a5 b5)/(b5 4 -4- a5 b5)

(* plot gflow/gfhigh such that slope = 1 as function of first stop depth *)

Plot[(b5-1-a5 b5)/(b5 pm-pm-a5 b5),{pm,1,10}]