simulate_basicvirus_stochastic {DSAIRM}R Documentation

Basic Virus Model

Description

A basic virus infection model with 3 compartments

Usage

simulate_basicvirus_stochastic(
  U = 1e+05,
  I = 0,
  V = 1,
  n = 0,
  dU = 0,
  dI = 1,
  dV = 2,
  b = 2e-05,
  p = 5,
  g = 1,
  tfinal = 30,
  rngseed = 123
)

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

tfinal

: Final time of simulation : numeric

rngseed

: set random number seed for reproducibility : numeric

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 stochastic equations using the adaptivetau package. The following R packages need to be loaded for the function to work: adpativetau

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.

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_stochastic()
# To choose values other than the standard one, specify them like this:
result <- simulate_basicvirus_stochastic(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'])))

[Package DSAIRM version 0.9.6 Index]