# 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
competition(y_ini = c(N1 = 400, N1 = 400, N1 = 400,
N2 = 300, N2 = 300, N2 = 300),
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),
r2 = rep(0.7,3),
lambda1 = rep(0.0005,3),
K2 = rep(1400,3),
alpha = rep(0.02,3),
beta = rep(0.3,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
competition(y_ini = c(N1 = 400, N1 = 400, N1 = 400,
N2 = 300, N2 = 300, N2 = 300),
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),
r2 = rep(0.7,3),
lambda1 = rep(0.0005,3),
K2 = rep(1400,3),
alpha = rep(0.02,3),
beta = rep(0.3,3),
RCP = 8.5,
time_start = 2005,
time_end = time_end,
leap = 1/50)
#######################################################################
#Example 3: Different marginal losses by a non-thermodependent
# component of intraspecific competition for species-1
# (scenario RCP2.6).
#######################################################################
lambda3 <- 0.002
lambda2 <- 1/2*lambda3
lambda1 <- 1/2*lambda2
competition(y_ini = c(N1 = 400, N1 = 400, N1 = 400,
N2 = 200, N2 = 200, N2 = 200),
temp_ini = rep(25,3),
temp_cmin = rep(20,3),
temp_cmax = rep(30,3),
ro = rep(0.5,3),
r2 = rep(0.4,3),
lambda1 = c(lambda1,lambda2,lambda3),
K2 = rep(1200,3),
alpha = rep(0.02,3),
beta = rep(0.3,3),
RCP = 2.6,
time_start = 2005,
time_end = 2100,
leap = 1/50)
#'#######################################################################
#Example 4: Different marginal losses by a non-thermodependent
# component of intraspecific competition for species-1
# (scenario RCP8.5).
#######################################################################
lambda3 <- 0.002
lambda2 <- 1/2*lambda3
lambda1 <- 1/2*lambda2
competition(y_ini = c(N1 = 400, N1 = 400, N1 = 400,
N2 = 200, N2 = 200, N2 = 200),
temp_ini = rep(25,3),
temp_cmin = rep(20,3),
temp_cmax = rep(30,3),
ro = rep(0.5,3),
r2 = rep(0.4,3),
lambda1 = c(lambda1,lambda2,lambda3),
K2 = rep(1200,3),
alpha = rep(0.02,3),
beta = rep(0.3,3),
RCP = 8.5,
time_start = 2005,
time_end = 2100,
leap = 1/50)
#######################################################################
#Example 5: Different competition coefficients (scenario RCP2.6).
#######################################################################
alpha1 <- 0.02
alpha2 <- 2*alpha1
alpha3 <- 2*alpha2
competition(y_ini = c(N1 = 400, N1 = 400, N1 = 400,
N2 = 200, N2 = 200, N2 = 200),
temp_ini = rep(25,3),
temp_cmin = rep(20,3),
temp_cmax = rep(30,3),
ro = rep(0.5,3),
r2 = rep(0.4,3),
lambda1 = rep(0.0005,3),
K2 = rep(1200,3),
alpha = c(alpha1,alpha2,alpha3),
beta = rep(0.3,3),
RCP = 2.6,
time_start = 2005,
time_end = 2100,
leap = 1/50)
#######################################################################
#Example 6: Different competition coefficients (scenario RCP8.5).
#######################################################################
alpha1 <- 0.02
alpha2 <- 2*alpha1
alpha3 <- 2*alpha2
competition(y_ini = c(N1 = 400, N1 = 400, N1 = 400,
N2 = 200, N2 = 200, N2 = 200),
temp_ini = rep(25,3),
temp_cmin = rep(20,3),
temp_cmax = rep(30,3),
ro = rep(0.5,3),
r2 = rep(0.4,3),
lambda1 = rep(0.0005,3),
K2 = rep(1200,3),
alpha = c(alpha1,alpha2,alpha3),
beta = rep(0.3,3),
RCP = 8.5,
time_start = 2005,
time_end = 2100,
leap = 1/50)
# }
Run the code above in your browser using DataLab