) ; infected, i ( t ) ; and recovered, r ( t ) . the compartments used for this model consist of three classes: s ( t ) is used to represent the individuals not yet infected with the disease at time t, or those susceptible to the disease of the population. i ( t ) denotes the individuals of the population who have been infected with the disease and are capable of spreading the disease to those in the susceptible category. r ( t ) is the compartment used for the individuals of the population who have been infected and then removed from the disease, either due to immunization or due to death. those in this category are not able to be infected again or to transmit the infection to others. the flow of this model may be considered as follows: s → i → r \rightarrow \rightarrow using a fixed population, n = s ( t ) + i ( t ) + r ( t ) in the three functions resolves that the value n should remain constant within the simulation, if a simulation is used to solve the sir model. alternatively, the analytic approximant can be used without performing a simulation. the model is started with values of s ( t = 0 ) , i ( t = 0 ) and r ( t = 0 ) . these are the number of people in the susceptible, infected and removed categories at time equals zero. if the sir model is assumed to hold at all times, these initial conditions are not independent. subsequently, the flow model updates the three variables for every time point with set values for β and γ . the simulation first updates the infected from the susceptible and then the removed category is updated from the infected category for the next time point (t=1). this describes the flow persons between the three categories. during an epidemic the susceptible category is not shifted with this model, β changes over the course of the epidemic and so does γ . these variables determine the length of the epidemic and would have to be updated with each cycle. d s d t = − β s i n =- d i d t = β s i n − γ i =-\gamma i} d r d t = γ i =\gamma i} several assumptions were made in the formulation of these equations: first, an individual in the population must be considered as having an equal probability as every other individual of contracting the disease with a rate of a and an equal fraction b of people that an individual makes contact with per unit time. then, let β be the multiplication of a and b . this is the transmission probability times the contact rate. besides, an infected individual makes contact with b persons per unit time whereas only a fraction, s / n of them are susceptible. thus, we have every infective can infect a b s = β s susceptible persons, and therefore, the whole number of susceptibles infected by infectives per unit time is β s i . for the second and third equations, consider the population leaving the susceptible class as equal to the number entering the infected class. however, a number equal to the fraction γ (which represents the mean recovery/death rate, or 1 / γ the mean infective period) of infectives are leaving this class per unit time to enter the removed class. these processes which occur simultaneously are referred to as the law of mass action, a widely accepted idea that the rate of contact between two groups in a population is proportional to the size of each of the groups concerned. finally, it is assumed that the rate of infection and recovery is much faster than the time scale of births and deaths and therefore, these factors are ignored in this model. steady-state solutions the expected duration of susceptibility will be e ⁡ [ min ( t l ∣ t s ) ] } where t l reflects the time alive (life expectancy) and t s reflects the time in the susceptible state before becoming infected, which can be simplified to: e ⁡ [ min ( t l ∣ t s ) ] = ∫ 0 ∞ e − ( μ + δ ) x d x = 1 μ + δ , =\int _^e^\,dx=,} such that the number of susceptible persons is the number entering the susceptible compartment μ n times the duration of susceptibility: s = μ n μ + λ . .} analogously, the steady-state number of infected persons is the number entering the infected state from the susceptible state (number susceptible, times rate of infection) λ = β i n , ,} times the duration of infectiousness 1 μ + v : i = μ n μ + λ λ 1 μ + v . \lambda .} other compartmental models there are many modifications of the sir model, including those that include births and deaths, where upon recovery there is no immunity (sis model), where immunity lasts only for a short period of time (sirs), where there is a latent period of the disease where the person is not infectious (seis and seir), and where infants can be born with immunity (msir). compartmental models can also be used to model multiple risk groups, and even the interaction of multiple pathogens. variations on the basic sir model the sis model yellow=susceptible, maroon=infected some infections, for example, those from the common cold and influenza, do not confer any long-lasting immunity. such infections may give temporary resistance but do not give long-term immunity upon recovery from infection, and individuals become susceptible again. sis compartmental model we have the model: d s d t = − β s i n + γ i d i d t = β s i n − γ i &=-+\gamma i\\&=-\gamma i\end note that denoting with n the total population it holds that: d s d t + d i d t = 0 ⇒ s ( t ) + i ( t ) = n +=0\rightarrow s(t)+i(t)=n} . it follows that: d i d t = ( β − γ ) i − β n i 2 =(\beta -\gamma )i-i^ , i.e. the dynamics of infectious is ruled by a logistic function, so that ∀ i ( 0 ) > 0 : β γ ≤ 1 ⇒ lim t → + ∞ i ( t ) = 0 , β γ > 1 ⇒ lim t → + ∞ i ( t ) = ( 1 − γ β ) n . &\leq 1\rightarrow \lim _i(t)=0,\\&>1\rightarrow \lim _i(t)=\left(1-\right)n.\end it is possible to find an analytical solution to this model (by making a transformation of variables: i = y − 1 and substituting this into the mean-field equations), such that the basic reproduction rate is greater than unity. the solution is given as i ( t ) = i ∞ 1 + v e − χ t . where i ∞ = ( 1 − γ / β ) n =(1-\gamma /\beta )n} is the endemic infectious population, χ = β − γ , and v = i ∞ / i 0 − 1 /i_-1} . as the system is assumed to be closed, the susceptible population is then s ( t ) = n − i ( t ) . whenever the integer nature of the number of agents is evident (populations with fewer than tens of thousands of individuals), inherent fluctuations in the disease spreading process caused by discrete agents result in uncertainties. in this scenario, the evolution of the disease predicted by compartmental equations deviates significantly from the observed results. these uncertainties may even cause the epidemic to end earlier than predicted by the compartmental equations. as a special case, one obtains the usual logistic function by assuming γ = 0 . this can be also considered in the sir model with r = 0 , i.e. no removal will take place. that is the si model. the differential equation system using s = n − i thus reduces to: d i d t ∝ i ⋅ ( n − i ) . \propto i\cdot (n-i).} in the long run, in the si model, all individuals will become infected. the sird model diagram of the sird model with initial values s ( 0 ) = 997 , i ( 0 ) = 3 , r ( 0 ) = 0 and the rates of infection β = 0.4 , recovery γ = 0.035 and mortality μ = 0.005 animation of the sird model with initial values s ( 0 ) = 997 , i ( 0 ) = 3 , r ( 0 ) = 0 , and rates of recovery γ = 0.035 and mortality μ = 0.005 . the animation shows the effect of reducing the rate of infection from β = 0.5 to β = 0.12 . if there is no medicine or vaccination available, it is only possible to reduce the infection rate (often referred to as "flattening the curve") by measures such as "social distancing". the susceptible-infectious-recovered-deceased model differentiates between recovered (meaning specifically individuals having survived the disease and now immune) and deceased. this model uses the following system of differential equations: d s d t = − β i s n , d i d t = β i s n − γ i − μ i , d r d t = γ i , d d d t = μ i , &=-,\\&=-\gamma i-\mu i,\\&=\gamma i,\\&=\mu i,\end where β , γ , μ are the rates of infection, recovery, and mortality, respectively. the sirv model the susceptible-infectious-recovered-vaccinated model is an extended sir model that accounts for vaccination of the susceptible population. this model uses the following system of differential equations: d s d t = − β ( t ) i s n − v ( t ) s , d i d t = β ( t ) i s n − γ ( t ) i , d r d t = γ ( t ) i , d v d t = v ( t ) s , &=--v(t)s,\\&=-\gamma (t)i,\\&=\gamma (t)i,\\&=v(t)s,\end a cartoon for the sirv model. where β , γ , v are the rates of infection, recovery, and vaccination, respectively. for the semi-time initial conditions s ( 0 ) = ( 1 − η ) n , i ( 0 ) = η n , r ( 0 ) = v ( 0 ) = 0 and constant ratios k = γ ( t ) / β ( t ) and b = v ( t ) / β ( t ) the model had been solved approximately. the occurrence of a pandemic outburst requires k + b < 1 − 2 η and there is a critical reduced vaccination rate b c beyond which the steady-state size s ∞ of the susceptible compartment remains relatively close to s ( 0 ) . arbitrary initial conditions satisfying s ( 0 ) + i ( 0 ) + r ( 0 ) + v ( 0 ) = n can be mapped to the solved special case with r ( 0 ) = v ( 0 ) = 0 . the numerical solution of this model to calculate the real-time reproduction number r t of covid-19 can be practiced based on information from the different populations in a community. numerical solution is a commonly used method to analyze complicated kinetic networks when the analytical solution is difficult to obtain or limited by requirements such as boundary conditions or special parameters. it uses recursive equations to calculate the next step by converting the numerical integration into riemann sum of discrete time steps e.g., use yesterday's principal and interest rate to calculate today's interest which assumes the interest rate is fixed during the day. the calculation contains projected errors if the analytical corrections on the numerical step size are not included, e.g. when the interest rate of annual collection is simplified to 12 times the monthly rate, a projected error is introduced. thus the calculated results will carry accumulative errors when the time step