This model allows for the simulation of different direct transmission modes

simulate_directtransmission_ode(
S = 1000,
I = 1,
bd = 0.01,
bf = 0,
A = 1,
m = 0,
n = 0,
g = 0.1,
w = 0,
scenario = 1,
tmax = 120
)

## Arguments

S : initial number of susceptibles : numeric : initial number of infected hosts : numeric : rate of transmission for density-dependent transmission : numeric : rate of transmission for frequency-dependent transmission : numeric : the size of the area in which the hosts are assumed to reside/interact : numeric : the rate of births : numeric : the rate of natural deaths : numeric : the rate at which infected hosts recover : numeric : the rate of waning immunity : numeric : choice between density dependent (=1) and frequency dependent (=2) transmission : numeric : maximum simulation time, units of months : numeric

## Value

This function returns the simulation result as obtained from a call to the deSolve ode solver.

## Details

A compartmental ID model with several states/compartments is simulated as a set of ordinary differential equations. The function returns the output from the odesolver as a list, with the element ts, which is a dataframe whose columns represent time, the number of susceptibles, the number of infected, and the number of recovered.

## Warning

This function does not perform any error checking. So if you try to do something nonsensical (e.g. any negative values or fractions > 1), the code will likely abort with an error message

## References

See e.g. Keeling and Rohani 2008 for SIR models and the documentation for the deSolve package for details on ODE solvers

  # To run the simulation with default parameters just call this function:
plot(result$ts[,"time"],result$ts[,"S"],xlab='Time',ylab='Number Susceptible',type='l')