A basic virus infection model with 3 compartments

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
)

Arguments

U

: starting value for Uninfected cells : numeric

I

: starting value for Infected cells : numeric

V

: starting value for Virus : numeric

n

: rate of new uninfected cell replenishment : numeric

dU

: rate at which uninfected cells die : numeric

dI

: rate at which infected cells die : numeric

dV

: rate at which virus is cleared : numeric

b

: rate at which virus infects cells : numeric

p

: rate at which infected cells produce virus : numeric

g

: possible conversion factor for virus units : numeric

tstart

: Start time of simulation : numeric

tfinal

: Final time of simulation : numeric

dt

: Time step : numeric

Value

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.

Details

The model includes uninfected and infected target cells, as well as free virus. The processes that are modeled are infection, virus production, uninfected cell birth and death, infected cell and virus death.

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.

Warning

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.

Model Author

Andreas Handel

Model creation date

2021-07-19

Code Author

generated by the modelbuilder R package

Code creation date

2021-07-19

Examples

# To run the simulation with default parameters:
result <- simulate_basicvirus_ode()
# To choose values other than the standard one, specify them like this:
result <- simulate_basicvirus_ode(U = 2e+05,I = 0,V = 2)
# You can display or further process the result, like this:
plot(result$ts[,'time'],result$ts[,'U'],xlab='Time',ylab='Numbers',type='l')

print(paste('Max number of U: ',max(result$ts[,'U'])))
#> [1] "Max number of U:  2e+05"