A basic virus infection model with 3 compartments, implemented as ODEs. The model tracks uninfected and infected target cells and free virus. The processes modeled are infection, virus production, uninfected cell birth and death, infected cell and virus death.
simulate_basicvirus_ode(U = 1e+05, I = 0, V = 1, n = 0, dU = 0,
dI = 1, dV = 2, b = 2e-05, p = 5, g = 1, tstart = 0,
tfinal = 30, dt = 0.1)
: Starting value for uninfected cells : numeric
: Starting value for infected cells : numeric
: Starting value for virus : numeric
: Rate of new uninfected cell replenishment : numeric
: Rate at which uninfected cells die : numeric
: Rate at which infected cells die : numeric
: Rate at which virus is cleared : numeric
: Rate at which virus infects cells : numeric
: Rate at which infected cells produce virus : numeric
: Possible conversion factor for virus units : numeric
: Start time of simulation : numeric
: Final time of simulation : numeric
: Times for which result is returned : 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 parameter dt only determines for which times the solution is returned, it is not the internal time step. The latter is set automatically by the ODE solver.
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.
The model is implemented as a set of ordinary differential equations (ODE) using the deSolve package. This code is part of the DSAIRM R package. For additional model details, see the corresponding app in the DSAIRM package.
# NOT RUN {
# To run the simulation with default parameters:
result <- simulate_basicvirus_ode()
# }
Run the code above in your browser using DataLab