This function runs a simulation of a compartment model which tracks uninfected and infected cells, virus, innate immune response, T-cells, B-cells and antibodies. The model is implemented as set of ordinary differential equations using the deSolve package.

simulate_virusandir_ode(
  U = 1e+05,
  I = 0,
  V = 10,
  T = 0,
  B = 0,
  A = 0,
  n = 0,
  dU = 0,
  dI = 1,
  dV = 4,
  b = 1e-05,
  p = 1000,
  sF = 0.01,
  kA = 1e-05,
  kT = 1e-05,
  pF = 1,
  dF = 1,
  gF = 1,
  Fmax = 1000,
  hV = 1e-06,
  hF = 1e-05,
  gB = 1,
  gT = 1e-04,
  rT = 0.5,
  rA = 10,
  dA = 0.2,
  tstart = 0,
  tfinal = 30,
  dt = 0.05
)

Arguments

U

: initial number of uninfected target cells : numeric

I

: initial number of infected target cells : numeric

V

: initial number of infectious virions : numeric

T

: initial number of T cells : numeric

B

: initial number of B cells : numeric

A

: initial number of antibodies : 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 infectious virus is cleared : numeric

b

: rate at which virus infects cells : numeric

p

: rate at which infected cells produce virus : numeric

sF

: strength of innate response at reducing virus production : numeric

kA

: rate of virus removal by antibodies : numeric

kT

: rate of infected cell killing by T cells : numeric

pF

: rate of innate response production in absence of infection : numeric

dF

: rate of innate response removal in absence of infection : numeric

gF

: rate of innate response growth during infection : numeric

Fmax

: maximum level of innate response : numeric

hV

: innate growth saturation constant : numeric

hF

: B-cell growth saturation constant : numeric

gB

: maximum growth rate of B cells : numeric

gT

: T-cell induction rate : numeric

rT

: T-cell expansion rate : numeric

rA

: rate of antibody production by B cells : numeric

dA

: rate of antibody decay : numeric

tstart

: start time of simulation : numeric

tfinal

: final time of simulation : numeric

dt

: times for which result is returned : numeric

Value

A list. The list has only one element, called ts. ts contains the time-series of the simulation. The 1st column of ts is time, the other columns are the model variables.

Details

A compartmental infection model is simulated as a set of ordinary differential equations, using an ode solver from the deSolve package. This code is part of the DSAIRM R package. For additional model details, see the corresponding app in the DSAIRM package.

Warning

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

See also

See the Shiny app documentation corresponding to this simulator function for more details on this model. See the manual for the deSolve package for details on the underlying ODE simulator algorithm.

Author

Andreas Handel

Examples

# To run the simulation with default parameters just call the function:
result <- simulate_virusandir_ode()
# To choose parameter values other than the standard one, specify them, like such:
result <- simulate_virusandir_ode(V = 100, tfinal = 50, n = 1e5, dU = 1e-2, kT=1e-7)
# You should then use the simulation result returned from the function, like this:
plot(result$ts[,"time"],result$ts[,"V"],xlab='Time',ylab='Virus',type='l',log='y')
#> Warning: 271 y values <= 0 omitted from logarithmic plot