A short script to fit a W-L-F model to experimental data. This is flaky, depending on the input guesses and convergence is poor. We simply stop the convergence at the point we have an acceptable fit. This is not robust!

options(scipen = 10)

aT <- structure(list(Temp.F = c(64.4, 86, 104, 122, 149, 176, 203,

230, 257, 284, 311), aT = c(16.7, 1.76, 1, 0.358, 0.00965, 0.000722,

0.000000308, 0.0000000733, 0.00000000357, 0.000000000202, 0.0000000000191

)), .Names = c("Temp.F", "aT"), class = "data.frame", row.names = c(NA,

-11L))

at.nls<-nls(log(aT) ~ ((-C1*(Temp.F-104))/(C2+(Temp.F-104))),

data = aT,

start = list(C1 = 100, C2 = 202),

trace = 1,

# weights = c(10,rep(1,length(aT)-1)),

nls.control(maxiter = 3,

tol = 1e-16,

minFactor = 1/1000000000024,

warnOnly = TRUE))

plot(log(aT$aT)~aT$Temp.F)

lines(predict(at.nls)~aT$Temp.F)

C1 <- summary(at.nls)$coefficients[[1]]

C2 <- summary(at.nls)$coefficients[[2]]

plot((aT$aT)~aT$Temp.F, log = "y", ylim = c(1e-20,100), xlim = c(0,500))

lines(exp(predict(at.nls))~aT$Temp.F)

curve(exp((-C1*(x-104))/(C2+(x-104))), add = TRUE)