iteration              package:simecol              R Documentation

_D_i_s_c_r_e_t_e _S_i_m_u_l_a_t_i_o_n

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

     Solver function to simulate discrete ecological (or other) dynamic
     models. It is normally called indirectly from 'sim'.

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

       iteration(y, times=FALSE, func=FALSE, parms=FALSE, animate = FALSE, ...)

_A_r_g_u_m_e_n_t_s:

       y: The 'simObj' object to be iterated.

   times: Placeholder for compatibility with the 'odesolve' package.

    func: Placeholder for compatibility with the 'odesolve' package.

   parms: Placeholder for compatibility with the 'odesolve' package.

 animate: Animation during the simulation (if available for the
          specified class.

     ...: Optional arguments passed to the 'plot' function if
          'animate=TRUE'.

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

     The solver method 'iteration' is used to simulate discrete event
     models. It creates a local environment in a way that parameters,
     inputs and equations are visible within the main function of the
     'simObj'.

     In contrast to the ODE solvers, the 'main' function of the model
     must not return the first derivative but instead of this the new
     state at the specified times explicitly.

     The actual value of time is available in the 'main' function as
     'time' and the current increment as 'parms$DELTAT' or
     'parms["DELTAT"]' depending on the data type of 'parms'.

     Normally, this function is run indirectly from 'sim'.

_V_a_l_u_e:

     A list of the model outputs (states ...) for each timestep.

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

     'sim', 'parms', 'lsoda', 'rk4', 'euler'.

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

         data(conway)
         ## plot after simulation:
         plot(sim(conway), delay=100)

         ## plot during simulation
         sim(conway, animate=TRUE, delay=100)

