upca                 package:simecol                 R Documentation

_T_h_e _U_n_i_f_o_r_m _P_e_r_i_o_d _C_h_a_o_t_i_c _A_m_p_l_i_t_u_d_e _M_o_d_e_l

_D_e_s_c_r_i_p_t_i_o_n:

     'simecol' example: resource-predator-prey model, which is able to
     exhibit chaotic behaviour.

_U_s_a_g_e:

       data(upca)

_F_o_r_m_a_t:

     S4 object according to the 'odeModel' specification. The object
     contains the following slots:

     '_m_a_i_n' The differential equations for predator prey and resource
          with:

          '_u' resource (e.g. grassland or phosphorus),

          '_v' producer (prey),

          '_w' consumer (predator).

     '_e_q_u_a_t_i_o_n_s' Two alternative (and switchable) equations for the
          functional response.

     '_p_a_r_m_s' Vector with the named parameters of the model, see
          references for details.

     '_t_i_m_e_s' Simulation time and integration interval.

     '_i_n_i_t' Vector with start values for 'u', 'v' and 'w'.

     '_s_o_l_v_e_r' Character string with the integration method.

_D_e_t_a_i_l_s:

     To see all details, please have a look into the implementation
     below and the original publications.

_R_e_f_e_r_e_n_c_e_s:

     Blasius, B., Huppert, A., and Stone, L. (1999) Complex dynamics
     and phase synchronization in spatially extended ecological
     systems. _Nature_, *399* 354-359.

     Blasius, B. and Stone, L. (2000) Chaos and phase synchronization
     in ecological systems.  _International Journal of Bifurcation and
     Chaos_, *10* 2361-2380.

_S_e_e _A_l_s_o:

     'sim', 'parms', 'init', 'times'.

_E_x_a_m_p_l_e_s:

     ##============================================
     ## Basic Usage:
     ##   explore the example
     ##============================================
     data(upca)
     plot(sim(upca))

     # omit stabilizing parameter wstar
     parms(upca)["wstar"] <- 0
     plot(sim(upca))

     # change functional response from
     # Holling II (default) to Lotka-Volterra
     equations(upca)$f <- function(x, y, k) x * y
     plot(sim(upca))

     ##============================================
     ## Implementation:
     ##   The code of the UPCA model
     ##============================================
     upca <- new("odeModel",
       main = function(time, init, parms) {
         u      <- init[1]
         v      <- init[2]
         w      <- init[3]
         with(as.list(parms), {
           du <-  a * u           - alpha1 * f(u, v, k1)
           dv <- -b * v           + alpha1 * f(u, v, k1) +
                                  - alpha2 * f(v, w, k2)
           dw <- -c * (w - wstar) + alpha2 * f(v, w, k2)
           list(c(du, dv, dw))
         })
       },
       equations  = list(
         f1 = function(x, y, k){x*y},           # Lotka-Volterra
         f2 = function(x, y, k){x*y / (1+k*x)}  # Holling II
       ),
       times  = c(from=0, to=100, by=0.1),
       parms  = c(a=1, b=1, c=10, alpha1=0.2, alpha2=1,
         k1=0.05, k2=0, wstar=0.006),
       init = c(u=10, v=5, w=0.1),
       solver = "lsoda"
     )

     equations(upca)$f <- equations(upca)$f2

