library(oce)
data(geosecs235)
## reproduce part of Figure 10 of Kelley and Van Scoy (1999)
plotProfile(geosecs235, xtype="tritium", type='p', ylim=c(600, 0))
trit <- tritium(geosecs235)
p <- pressure(geosecs235)
m <- nls(trit~a*exp(-((p-p0)/D)^2)+a*exp(-((p+p0)/D)^2), start=list(a=10,p0=200,D=100))
pp <- seq(600, 0, -10)
lines(predict(m, newdata=list(p=pp)), pp)
Run the code above in your browser using DataLab