Compartment flow balance function of a compartmental model
g(x_j, f_jk, b_j, d_j) = dx_j/dt
Maps the numbers of people in the compartments of a population model, the flows between compartments per unit time and any inflow from or outflow to outside the model to the rate of change of each compartment, or, after a time step of length dt, to the next set of compartment counts. The flows can be fixed rates times compartment sizes, as in a static model, or can depend on the number infectious through the force of infection, which makes the model dynamic and nonlinear. A Markov cohort update (HE-FN-MM-001, HE-FM-MM-001) applies one fixed transition matrix to a closed cohort, the agent-based update HE-FN-ABM-001 with the per-contact infection probability HE-FM-ABM-001 follows individuals instead of pools, and a per-cycle probability from a constant rate follows HE-FM-TP-001. Reproduction numbers of the SIR model and of stratified models are in HE-FN-BRN-001 (HE-FM-BRN-001 to HE-FM-BRN-005 and HE-CF-BRN-001), and the final size of an epidemic and R_0 estimated from it are in HE-FN-ATR-001, HE-CF-ATR-001 and HE-FM-ATR-005, so none of them is restated here. Notation follows the Compartmental Model article.
Euler step of one compartment from its inflows, outflows, births and deaths
x_next = x_now + (F_in - F_out + b - d) * dt
Force of infection and new infection flow under frequency-dependent transmission
lambda = beta * I / N; F_SI = lambda * S
Force of infection on one group from infectious people in two mixing groups
lambda_1 = beta_11 * I_1 / N_1 + beta_12 * I_2 / N_2
One Euler step of the closed SIR model with frequency-dependent transmission
F = beta * S * I / N * dt; G = gamma * I * dt; S_next = S - F; I_next = I + F - G; R_next = R + G
Infections averted in one step under a static and a dynamic force of infection
lambda_b = beta * I_b / N; A_stat = lambda_b * (S_b - S_p) * dt; A_dyn = beta * (S_b * I_b - S_p * I_p) / N * dt; A_ind = A_dyn - A_stat
