search for: tsoil

Displaying 1 result from an estimated 1 matches for "tsoil".

Did you mean: soil
2012 May 17
3
nls and if statements
...is wrong, especially given the error message I get that indicates I can't do this using an 'if' statement. Essentially, I have data where I think a relationship enters when a variable (here Pwd) is below some value (z). I don't know that value, so I want to fit it. The data is Pw, Tsoil, and Cfl. nlstest=nls(if(Pw>z){Cfl~K*exp(-b*Pw)+c }else{ Cfl~K*(exp(-a*Tsoil))*exp(-b*Pw)+c },start=c(K=5.5, a=0.1, b=0.1, c=2, z=5)) Which returns the error: Error in inherits(object, "formula") : object 'z' not found Is there a better way to try and allow a conditional...