This model allows for the simulation of 2 IDs in a single host

simulate_multipathogen_ode(
S = 1000,
I1 = 1,
I2 = 0,
I12 = 0,
b1 = 0.001,
b2 = 0,
b12 = 0,
g1 = 1,
g2 = 1,
g12 = 1,
a = 0,
tmax = 120
)

## Arguments

S : initial number of susceptible hosts : numeric : initial number of hosts infected with type 1 : numeric : initial number of hosts infected with type 2 : numeric : initial number of double infected hosts : numeric : rate at which type 1 infected hosts transmit : numeric : rate at which type 2 infected hosts transmit : numeric : rate at which double infected hosts transmit : numeric : the rate at which infected type 1 hosts recover : numeric : the rate at which infected type 2 hosts recover : numeric : the rate at which double infected hosts recover : numeric : fraction of type 1 infections produced by double infected hosts : 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 matrix, with one column per compartment/variable. The first column is time.

## 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 the function:
plot(result$ts[,"time"],result$ts[,"I1"], xlab="Time",ylab="Number Infected Type 1",type="l")