step_ODE_decoupled {MGDrivE2} | R Documentation |
Make Mean-field Approximation (ODE) Numerical Integrator for a SPN Model for Decoupled Epi Dynamics
Description
Make a function closure to implement a first order mean-field ODE approximation for a SPN.
Usage
step_ODE_decoupled(S, Sout, haz, method = "lsoda", human_ode = "SIS")
Arguments
S |
a stoichiometry |
Sout |
an optional matrix to track of event firings. In the deterministic case it will return the rate of that event at the end of the time step |
haz |
a list of hazard functions |
method |
a character giving the type of numerical integrator used, the default is "lsoda" |
human_ode |
ODE function used for human states |
Details
This method is equivalent to considering the ODEs describing the time evolution of the mean trajectory (first moment) and setting all higher order moments which appear on the right hand side to zero.
The solvers used within can be found in the deSolve
package, see
ode
. For inhomogeneous systems, consider using the "rk4"
method to avoid excessive integration times.
The stoichiometry matrix (S
) is generated in spn_S
.
The list of hazards (haz
) come from spn_hazards
.
For other samplers, see: step_CLE
, step_PTS
, step_DM
Value
function closure for use in sim_trajectory_R
or sim_trajectory_CSV