1 | PredictVariablesInterest.3PG(state, parms, cod.pred)
|
state |
|
parms |
|
cod.pred |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (state, parms, cod.pred)
{
SLA0 <- parms[["SLA0"]]
SLA1 <- parms[["SLA1"]]
tSLA <- parms[["tSLA"]]
fracBB0 <- parms[["fracBB0"]]
fracBB1 <- parms[["fracBB1"]]
tBB <- parms[["tBB"]]
t <- state[["t"]]
N <- state[["N"]]
Wl <- state[["Wl"]]
Wr <- state[["Wr"]]
Wsbr <- state[["Wsbr"]]
SLA <- SLA1 + (SLA0 - SLA1) * exp(-log(2) * (t/tSLA)^2)
LAI <- Wl * SLA * 0.1
fracBB <- fracBB1 + (fracBB0 - fracBB1) * exp(-log(2) * (t/tBB))
Ww <- Wsbr * (1 - fracBB)
Wb <- (Wsbr - Ww) * 0.5675
Wbr <- (Wsbr - Ww) - Wb
Wa <- Wl + Wsbr
W <- Wl + Wr + Wsbr
hdom <- EstimateH.3PG(N = N, Wa = Wa)
wsbrg <- Wsbr * 1000/N
if (cod.pred == "3PG") {
rhoMax <- parms[["rhoMax"]]
rhoMin <- parms[["rhoMin"]]
tRho <- parms[["tRho"]]
WoodDensity <- rhoMax + (rhoMin - rhoMax) * exp(-log(2) *
t/tRho)
Vu <- Wsbr * (1 - fracBB)/WoodDensity
dg <- (wsbrg/parms[["aS"]])^(1/parms[["nS"]])
G <- (dg/200)^2 * pi * N
}
else if (cod.pred == "Allometric") {
G <- EstimateG.3PG(N = N, Wa = Wa)
Vub <- EstimateV.3PG(N = N, Ww = Ww)
dg <- ObtainDg(N = N, G = G)
}
state[c("LAI", "Ww", "Wb", "Wbr", "Wa", "W", "hdom", "wsbrg",
"G", "Vu", "dg")] <- c(LAI, Ww, Wb, Wbr, Wa, W, hdom,
wsbrg, G, Vu, dg)
return(state)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.