Displaying 1 result from an estimated 1 matches for "dd_ifelse3".
2012 Mar 19
3
Issue with asin()
...s and the
### minimal threshold temperature (lower growth temperature)
{
### method arcsin
if(method == "DDsin"){
cond1 <- (Tmax <= Tseuil)
cond2 <- (Tmin >= Tseuil)
amp <- ((Tmax - Tmin) / 2)
print((Tseuil-meanT)/amp)
alpha <- asin((Tseuil - meanT) / amp)
DD_ifelse3 <- ((1 / pi) * ((meanT - Tseuil) * ((pi/2) - alpha)) +
amp*cos(alpha))
DD <- ifelse(cond1, 0, ifelse(cond2, (meanT - Tseuil), DD_ifelse3))
}
### method (Tmin + Tmax) / 2
else if(method == "DDt2"){
cond1 <- (meanT > Tseuil)
DD <- ifelse(cond1,(meanT - Tseuil),0)...