trend_periodic: Periodic temperature trend

Description Usage Arguments Details Value References Examples

View source: R/trend_periodic.R

Description

This function allows simulating the effect of a periodic temperature trend on the abundance of ectotherm populations.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
trend_periodic(
  y_ini = c(N = 400, N = 400, N = 400),
  temp_ini = rep(20, 3),
  temp_cmin = rep(18, 3),
  temp_cmax = c(25, 28, 32),
  ro = rep(0.7, 3),
  lambda = rep(5e-05, 3),
  A = rep(0.5, 3),
  B = rep(0.35, 3),
  time_start = 2005,
  time_end = 2100,
  leap = 1/12
)

Arguments

y_ini

Initial population values (must be written with its name: N).

temp_ini

Initial temperature.

temp_cmin

Minimum critical temperature.

temp_cmax

Maximum critical temperature.

ro

Population growth rate at optimum temperature.

lambda

Marginal loss by non-thermodependent intraspecific competition.

A

Temperature wave amplitude.

B

Parameter affecting the period of the trend (period is (2 pi)/|B|).

time_start

Start of time sequence.

time_end

End of time sequence.

leap

Time sequence step.

Details

Three populations and/or scenarios can be simulated simultaneously. The temperature trend is determined by a trigonometric function characterized by amplitude and period. In each input vector, the parameters for the three simulations must be specified (finite numbers for the initial population abundance). The simulations are obtained by a model that incorporates the effects of temperature over time, which leads to a non-autonomous ODE approach. This is function uses the ODE solver implemented in the package deSolve (Soetaert et al., 2010).

Value

(1) A data.frame with columns having the simulated trends.

(2) A two-panel figure in which (a) shows the population abundance curves represented by solid lines and the corresponding carrying capacities are represented by shaded areas. In (b) the temperature trend is shown. The three simultaneous simulations are depicted by different colors, i.e. 1st brown, 2nd green and 3rd blue.

References

Soetaert, K., Petzoldt, T., & Setzer, R. (2010). Solving Differential Equations in R: Package deSolve. Journal of Statistical Software, 33(9), 1 - 25. doi:http://dx.doi.org/10.18637/jss.v033.i09

Examples

  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
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#######################################################################
  #Example 1: Different initial population abundances.
#######################################################################

trend_periodic(y_ini = c(N = 100, N = 200, N = 400),
              temp_ini = rep(22,3),
              temp_cmin = rep(18,3),
              temp_cmax = rep(35,3),
              ro = rep(0.7,3),
              lambda = rep(0.00005,3),
              A = rep(0.2,3),
              B = rep(0.6,3),
              time_start = 2005,
              time_end = 2100,
              leap = 1/12)

#######################################################################
  #Example 2: Different thermal tolerance ranges.
#######################################################################

temp_cmin3 <- 18
temp_cmin2 <- 10/9*temp_cmin3
temp_cmin1 <- 10/9*temp_cmin2

temp_cmax1 <- 32.4
temp_cmax2 <- 10/9*temp_cmax1
temp_cmax3 <- 10/9*temp_cmax2

trend_periodic(y_ini = c(N = 100, N = 100, N = 100),
              temp_ini = rep(30,3),
              temp_cmin = c(temp_cmin1,temp_cmin2,temp_cmin3),
              temp_cmax = c(temp_cmax1,temp_cmax2,temp_cmax3),
              ro = rep(0.7,3),
              lambda = rep(0.00005,3),
              A = rep(2,3),
              B = rep(0.6,3),
              time_start = 2005,
              time_end = 2100,
              leap = 1/12)

#######################################################################
  #Example 3: Different relationships between initial environmental
  #           temperature and optimum temperature.
#######################################################################

temp_cmin <- 18
temp_cmax <- 35

# Temperature at which performance is at its maximum value.
temp_op <- (temp_cmax+temp_cmin)/3+sqrt(((temp_cmax+temp_cmin)/3)^2-
           (temp_cmax*temp_cmin)/3)

temp_ini1 <- (temp_cmin+temp_op)/2
temp_ini2 <- temp_op
temp_ini3 <- (temp_op+temp_cmax)/2

trend_periodic(y_ini = c(N = 100, N = 100, N = 100),
              temp_ini = c(temp_ini1,temp_ini2,temp_ini3),
              temp_cmin = rep(temp_cmin,3),
              temp_cmax = rep(temp_cmax,3),
              ro = rep(0.7,3),
              lambda = rep(0.00005,3),
              A = rep(2,3),
              B = rep(0.6,3),
              time_start = 2005,
              time_end = 2100,
              leap = 1/12)

#######################################################################
  #Example 4: Different marginal losses by a non-thermodependent
  #           component of intraspecific competition.
#######################################################################


lambda3 <- 0.01
lambda2 <- 1/2*lambda3
lambda1 <- 1/2*lambda2

trend_periodic(y_ini = c(N = 100, N = 100, N = 100),
              temp_ini = rep(22,3),
              temp_cmin = rep(18,3),
              temp_cmax = rep(35,3) ,
              ro = rep(0.7,3),
              lambda = c(lambda1,lambda2,lambda3),
              A = rep(2,3),
              B = rep(0.6,3),
              time_start = 2005,
              time_end = 2100,
              leap = 1/12)

#######################################################################
  #Example 5: Different wave amplitudes.
#######################################################################

A3 <- 4
A2 <- 1/2 * A3
A1 <- 1/2 * A2

trend_periodic(y_ini = c(N = 100, N = 100, N = 100),
              temp_ini = rep(25,3),
              temp_cmin = rep(18,3),
              temp_cmax = rep(35,3),
              ro = rep(0.7,3),
              lambda = rep(0.00005,3),
              A = c(A1,A2,A3),
              B = rep(0.6,3),
              time_start = 2005,
              time_end = 2100,
              leap = 1/12)

#######################################################################
  #Example 6: Different periods.
#######################################################################

B3 <- pi/5
B2 <- 1/2 * B3
B1 <- 1/2 * B2

trend_periodic(y_ini = c(N = 100, N = 100, N = 100),
              temp_cmin = rep(18,3),
              temp_ini = rep(22,3),
              temp_cmax = rep(35,3) ,
              ro = rep(0.7,3),
              lambda = rep(0.00005,3),
              A = rep(2,3),
              B = c(B1,B2,B3),
              time_start = 2005,
              time_end = 2100,
              leap = 1/12)

epcc documentation built on June 29, 2021, 9:07 a.m.