R/simulate_chronicvirusir_ode.R
simulate_chronicvirusir_ode.Rd
A model for a chronic virus infection with a simple immune response
simulate_chronicvirusir_ode(
U = 1e+05,
I = 0,
V = 10,
F = 1,
T = 1,
n = 10000,
dU = 0.1,
dI = 1,
dV = 4,
b = 1e-06,
p = 100,
g = 1,
rF = 0.001,
dF = 1,
kF = 0.01,
rT = 0.001,
dT = 1,
kT = 0.01,
tstart = 0,
tfinal = 200,
dt = 0.1
)
: starting value for Uninfected cells : numeric
: starting value for Infected cells : numeric
: starting value for Virus : numeric
: starting value for Innate Response : numeric
: starting value for Adaptive Response : 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
: rate of innate response induction : numeric
: rate of innate response decay : numeric
: strength of innate response action : numeric
: rate of adaptive response induction : numeric
: rate of adaptive response decay : numeric
: strength of adaptive response action : 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 includes uninfected and infected target cells, virus, and the innate and adaptive immune response. The processes that are modeled are cell birth and death, infection, virus production, infected cell and virus death. Immune response dynamics and action are also modeled. See the DSAIRM documentation for model details.
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.
2022-05-09
2022-05-09
# To run the simulation with default parameters:
result <- simulate_chronicvirusir_ode()
# To choose values other than the standard one, specify them like this:
result <- simulate_chronicvirusir_ode(U = 2e+05,I = 0,V = 2,F = 2,T = 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"