# NOT RUN {
#######################################################################
#Example 1: Different thermal tolerance ranges (scenario RCP2.6).
#######################################################################
temp_cmin <- 18
# Temperature that occurs before the minimum simulation time.
temp_i <- 22
time_end <- 2100
# Temperature that occurs in the maximum time of the simulation.
temp_max <- get_RCP2.6(time_end)+temp_i
# Simulation thermal range.
RS <- temp_max-temp_cmin
temp_cmax1 <- 4/3*RS+temp_cmin
temp_cmax2 <- 2/3*RS+temp_cmin
temp_cmax3 <- 1/3*RS+temp_cmin
temp_ini <- (temp_cmin+temp_cmax3)/2
predation(y_ini = c(V = 800, V = 800, V = 800,
P = 600, P = 600, P = 600),
temp_ini = rep(temp_ini,3),
temp_cmin = rep(temp_cmin,3),
temp_cmax = c(temp_cmax1,temp_cmax2,temp_cmax3),
ro = rep(0.7,3),
lambda = rep(0.0004,3),
e = rep(0.9,3),
mp = rep(0.1,3),
q = rep(0.7,3),
a = rep(1000,3),
RCP = 2.6,
time_start = 2005,
time_end = time_end,
leap = 1/50)
# }
# NOT RUN {
#######################################################################
#Example 2: Different thermal tolerance ranges (scenario RCP8.5).
#######################################################################
temp_cmin <- 18
# Temperature that occurs before the minimum simulation time.
temp_i <- 22
time_end <- 2100
# Temperature that occurs in the maximum time of the simulation.
temp_max <- get_RCP8.5(time_end)+temp_i
# Simulation thermal range.
RS <- temp_max-temp_cmin
temp_cmax1 <- 4/3*RS+temp_cmin
temp_cmax2 <- 2/3*RS+temp_cmin
temp_cmax3 <- 1/3*RS+temp_cmin
temp_ini <- (temp_cmin+temp_cmax3)/2
predation(y_ini = c(V = 800, V = 800, V = 800,
P = 600, P = 600, P = 600),
temp_ini = rep(temp_ini,3),
temp_cmin = rep(temp_cmin,3),
temp_cmax = c(temp_cmax1,temp_cmax2,temp_cmax3),
ro = rep(0.7,3),
lambda = rep(0.0004,3),
e = rep(0.9,3),
mp = rep(0.1,3),
q = rep(0.7,3),
a = rep(1000,3),
RCP = 8.5,
time_start = 2005,
time_end = time_end,
leap = 1/50)
#######################################################################
#Example 3: Different conversion efficiencies (scenario RCP2.6).
#######################################################################
e1 <- 0.2
e2 <- 2*e1
e3 <- 2*e2
predation(y_ini = c(V = 800, V = 800, V = 800,
P = 400, P = 400, P = 400),
temp_ini = rep(22,3),
temp_cmin = rep(20,3),
temp_cmax = rep(35,3),
ro = rep(0.9,3),
lambda = rep(0.0006,3),
e = c(e1,e2,e3),
mp = rep(0.1,3),
q = rep(0.7,3),
a = rep(800,3),
RCP = 2.6,
time_start = 2005,
time_end = 2100,
leap = 1/50)
#######################################################################
#Example 4: Different conversion efficiencies (scenario RCP8.5).
#######################################################################
e1 <- 0.2
e2 <- 2*e1
e3 <- 2*e2
predation(y_ini = c(V = 800, V = 800, V = 800,
P = 400, P = 400, P = 400),
temp_ini = rep(22,3),
temp_cmin = rep(20,3),
temp_cmax = rep(35,3),
ro = rep(0.9,3),
lambda = rep(0.0006,3),
e = c(e1,e2,e3),
mp = rep(0.1,3),
q = rep(0.7,3),
a = rep(800,3),
RCP = 8.5,
time_start = 2005,
time_end = 2100,
leap = 1/50)
# }
Run the code above in your browser using DataLab