Skip to content
Snippets Groups Projects
Commit 8432684c authored by Rob Moss's avatar Rob Moss
Browse files

Limit infections to available uRBC counts

This ensures that the RBC population is conserved when the number of RBC
infections exceeds the available uRBC count. Without this restriction,
chronic infections with low phagocytosis rates can yield exponential
growth in total-body RBC counts.
parent cb06546c
Branches
No related tags found
No related merge requests found
......@@ -344,6 +344,24 @@ step_spleenrbc_model <- function(p, s, t) {
* (1 - exp_lambda_i)
)
# Limit RBC infections in the spleen to the spleen uRBC population.
Drr_t_1[2:p$T_urbc] <- pmin(Drr_t_1[2:p$T_urbc], U_r_to_r + U_c_to_r)
# Limit RBC infections in the circulation to the circulating uRBC population.
# Calculate the difference between the intended RBC infections and the
# circulating uRC population.
net_Dc <- Dc_t_1[2:p$T_urbc] + Dq_t_1[2:p$T_urbc] + Drc_t_1[2:p$T_urbc]
net_Uc <- U_c_to_c + U_r_to_c
# Calculate the number of possible RBC infections in the circulation.
actual_Dc <- pmin(net_Dc, net_Uc)
# Down-scale the infections from each source (circulation, microvasculature,
# and spleen) where intended infections exceed available uRBCs.
frac_Dc <- actual_Dc / net_Dc
frac_Dc[net_Dc == 0] <- 0
Dc_t_1[2:p$T_urbc] <- frac_Dc * Dc_t_1[2:p$T_urbc]
Dq_t_1[2:p$T_urbc] <- frac_Dc * Dq_t_1[2:p$T_urbc]
Drc_t_1[2:p$T_urbc] <- frac_Dc * Drc_t_1[2:p$T_urbc]
# Update reticulocyte population in the bone marrow.
r_at <- numeric(p$T_R)
r_at[1] <- s$n_at_1[p$T_n]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment