R/simulate_Vector_transmission_model_ode.R
simulate_Vector_transmission_model_ode.Rd
A basic model with several compartments to model vector-borne transmission
simulate_Vector_transmission_model_ode(
Sh = 1000,
Ih = 1,
Rh = 0,
Sv = 1000,
Iv = 1,
b1 = 0.003,
b2 = 0.003,
g = 2,
w = 0,
n = 200,
m = 0.1,
tstart = 0,
tfinal = 100,
dt = 0.1
)
: starting value for Susceptible hosts : numeric
: starting value for Infected hosts : numeric
: starting value for Recovered hosts : numeric
: starting value for Susceptible Vectors : numeric
: starting value for Infected Vectors : numeric
: rate at which susceptible hosts are infected by vectors : numeric
: rate at which susceptible vectors are infected by hosts : numeric
: recovery rate of hosts : numeric
: wanning immunity rate : numeric
: vector birth rate : numeric
: vector death rate : numeric
: Start time of simulation : numeric
: Final time of simulation : numeric
: Time step : numeric
The function returns the output as a list.
The time-series from the simulation is returned as a dataframe saved as list element ts
.
The ts
dataframe has one column per compartment/variable. The first column is time.
The model tracks the dynamics of susceptible, infected, and recovered hosts, and susceptible and infected vectors. Infection, recovery, and waning immunity processes are implemented for hosts. Births and deaths and infection processes are implemented for vectors.
This code was generated by the modelbuilder R package. The model is implemented as a set of ordinary differential equations using the deSolve package. The following R packages need to be loaded for the function to work: deSolve.
This function does not perform any error checking. So if you try to do something nonsensical (e.g. have negative values for parameters), the code will likely abort with an error message.
2020-09-01
2021-07-19
# To run the simulation with default parameters:
result <- simulate_Vector_transmission_model_ode()
# To choose values other than the standard one, specify them like this:
result <- simulate_Vector_transmission_model_ode(Sh = 2000,Ih = 2,Rh = 0,Sv = 2000,Iv = 2)
# You can display or further process the result, like this:
plot(result$ts[,'time'],result$ts[,'Sh'],xlab='Time',ylab='Numbers',type='l')
print(paste('Max number of Sh: ',max(result$ts[,'Sh'])))
#> [1] "Max number of Sh: 2000"