rk4                 package:simecol                 R Documentation

_R_u_n_g_e-_K_u_t_t_a _4_t_h _o_r_d_e_r _i_n_t_e_g_r_a_t_i_o_n

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

     Solving initial value problems for  systems of first-order
     ordinary differential equations (ODEs) using the classical
     Runge-Kutta 4th order integration. This is a special version
     designed to work with 'odeModel' objects.

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

       rk4(y, times, func, parms, ...) 
       # rk4(y) 

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

       y: The 'odeModel' object to be solved.

   times: Placeholder for compatibility with the odesolve package

    func: Placeholder for compatibility with the odesolve package

   parms: Placeholder for compatibility with the odesolve package

     ...: Additional parameters, reserved for extensions

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

     The solver method 'rk4' is used to simulate ODE  models. It
     creates a local environment in a way that parameters, inputs and
     equations are visible within the main function of the 'odeModel'.
     Normally, this function is called indirectly from 'sim'.

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

     A list of the model outputs (states ...) for all timesteps.

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

     'sim', 'parms' 'lsoda', 'euler', 'iteration', original 'rk4' from
     the 'odesolve' package.

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

         # ordinary usage
         data(lv)
         solver(lv) <- "rk4"
         plot(sim(lv))

         # alternative usage
         rk4(lv)

