Hi,

I am currently writing a function to determine surface soil temperature (SST) defined as : T(t) = Tave + Asin[(w(t-t0)). w is a constant equal to 2π/24. t0 is qual to 8. To check that my function works, I have to plug in t = 7, Tave = 28, A = 5 to get 32.896. However, when I input my code (se below), I get 28.25104. I am suspecting that my t value is not correct since it is equal to the time since something occurred. I figured that would translate to the absolute value, but now I'm not sure.

t <- sum(t + 6)

Tave <- mean(t)

A <- (1/2) * (t)

SST = function(t = sum(t + 6), Tave = mean(t + 6), A = (0.5(t-8))) {

Tave + ((sin(A)) * ((6.283/24) * (t - 8)))

}

SST(t = 7, Tave = 28, A = 5)