A general epidemic model and its application to mask design considering different preferences towards masks

While most masks have a limited effect on personal protection, how effective are they for collective protection? How to enlighten the design of masks from the perspective of collective dynamics? In this paper, we assume three preferences in the population: (i) never wearing a mask; (ii) wearing a mask if and only if infected; (iii) always wearing a mask. We study the epidemic transmission in an open system within the Susceptible-Infected-Recovered (SIR) model framework. We use agent-based Monte Carlo simulation and mean-field differential equations to investigate the model, respectively. Ternary heat maps show that wearing masks is always beneficial in curbing the spread of the epidemic. Based on the model, we investigate the potential implications of different mask designs from the perspective of collective dynamics. The results show that strengthening the filterability of the mask from the face to the outside is more effective in most parameter spaces, because it acts on individuals with both preferences (ii) and (iii). However, when the fraction of individuals always wearing a mask achieves a critical point, strengthening the filterability from outside to the face becomes more effective, because of the emerging hidden reality that the infected individuals become too few to utilize the filterability from their face to outside fully.


Introduction
As the COVID-19 pandemic is ravaging the world, the protection of masks is a topic of interest. A news article published in Nature indicates that wearing a surgical mask leads to an 11% drop in risk, while a 5% drop for cloth [1]. The protective effect of masks on individuals may seem minimal, but it is also necessary to focus on the protective effect on collectives.
Since Kermack and McKendrick [2] proposed the Susceptible-Infected-Recovered (SIR) compartment model, various epidemic models have been developed considerably. In the classic SIR model, the population is divided into three compartments: (i) the susceptible (S); (ii) the infected (I); (ii) the recovered (R). Through human-to-human contact or self-healing, individuals flow from one compartment to another. A simple modified version is the SEIR model, which adds an exposed (E) compartment to the SIR model. Recently, Barlow et al. [3,4] derived the analytical solutions of the SIR [3] and the SEIR [4] models.
Researchers, in recent years, have explored additional factors and mechanisms to the classic epidemic Running head models, such as isolation [5] and vaccination [6][7][8][9][10][11]. The dynamics of the epidemic transmission can also be applied to the information spreading, creating rumor spreading models [12,13] or the public opinion dynamics model [14,15]. From the perspective of verification and validation, the global stability of this class of nonlinear dynamical systems is widely studied [16][17][18][19][20][21]. In particular, researchers have proved the global stability of endemic equilibria in various epidemic models in multigroup populations [19][20][21], which are general cases of the model proposed in this work. A common approach to prove global stability is constructing a Lyapunov function (not limited to epidemiology, but also widely applied to other complex systems such as evolutionary dynamics [22,23]), which measures the system's "energy." If the energy continues to decay, then the system will stabilize at an equilibrium point.
When it comes to the protective effect of masks, several works [24][25][26][27][28] are noticed to have emerged in the COVID-19 period after 2020. Li et al. [24] treated whether people wear masks or not as an evolutionary game. Gondim [25] considered masks in the SEIR model and validated the model by real-world data. Auger and Moussaoui [26] studied the confinement's release threshold, taking the masks into account. Lasisi and Adeyemo [27] modeled the effect of wearing masks on COVID-19 infection dynamics. Han et al. [28] investigated the effect of three different preferences on wearing a mask.
Based on the existing literature, we find the previous works on masks have three shortcomings. First, when classifying the population into three categories with different preferences on wearing masks according to their assumptions, there is no work classifying them into three independent variables. They set only two variables as the fraction of two categories, and the remaining category's fraction is one minus these two variables. This leads to an inability to ensure constant relative proportions of the other two categories when investigating the effect of the proportion of a certain category. Second, previous work did not carry out a complete analysis of the stability of their models. This makes verification and validation challenging. Third, only focusing on the effect of masks on epidemic spreading, there is no previous work considering providing applications of the epidemic models to the design of masks itself. This paper builds a general epidemic model in an open system considering three different preferences on wearing masks. We start from a set of agent-based rules, and use mean-field analysis to verify and validate the model. In addition to filling in the gaps of previous work by treating three preferences as independent variables and considering global stability analysis, we explore [29,30] the effect of different preferences towards wearing masks on the epidemic transmission through our model's eyes. Considering that in the traditional perception, masks are designed at an individual level, we also try to reveal the design strategies of the masks by the collective dynamics based on our model.

Model
There is an epidemic disease spreading in the system. To prevent this epidemic, individuals hold different preferences for wearing masks. Concerning the infection state, we divide the population into: (i) the susceptible (x); (ii) the infected (y); (iii) the recovered (z). In terms of different preferences towards wearing masks, we divide the population into: (i) those who never wear masks (subscript 0); (ii) those who wear masks if and only if infected (subscript 1); (iii) those who always wear masks (subscript 2). Therefore, we have up to 9 categories according to different combinations of the classification of the two dimensions mentioned above.
Before describing evolutionary rules, we list the definition of our mathematical symbols in Table 1.

The agent-based rules
Consider an open system containing initially n t=0 agents (i.e., individuals). Within a Monte Carlo step, an agent i is randomly selected, and the following parallel events occur.
(1) If agent i is susceptible, we again select an agent j randomly. If agent j is infected, then agent i is infected with a probability α (α > 0). If agent j wears a mask, then agent i spares from infection with a probability p I (0 < p I < 1). If agent i wears a mask, then agent i spares from infection with a probability p S (0 < p S < 1).
(2) If agent i is infected, then it recovers with a probability r (the average infection cycle is 1/r). This does not happen at the same Monte Carlo step as the event (1).
(3) Agent i naturally dies with a probability µ (the average lifespan is 1/µ). We do not consider deaths due to the epidemic. The number of susceptible individuals never wearing a mask. y 0 The number of infected individuals never wearing a mask. z 0 The number of recovered individuals never wearing a mask.
The number of susceptible individuals wearing a mask if and only if infected. y 1 The number of infected individuals wearing a mask if and only if infected. z 1 The number of recovered individuals wearing a mask if and only if infected.
The number of susceptible individuals always wearing a mask. y 2 The number of infected individuals always wearing a mask. z 2 The number of recovered individuals always wearing a mask. n The number of individuals in the system. Λ The number of new individuals entering the system within unit time. µ The rate of natural death. r The rate of recovering. α The rate of human-to-human infection. ε 0 The fraction of new individuals never wearing a mask. ε 1 The fraction of new individuals wearing a mask if and only if infected. ε 2 The fraction of new individuals always wearing a mask. p I The protective effect produced when an infected individual wears a mask. p S The protective effect produced when a susceptible individual wears a mask.
To ensure the population remains almost unchanged, we must let new agents enter the system. We set the following very first event in a Monte Carlo step, where the number (0) means it happens before the event (1).
(0) A new agent enters the system with a probability p e . The agent's personal preference determines it never wears a mask with a probability ε 0 (0 < ε 0 < 1), wears a mask if and only if infected with a probability ε 1 (0 < ε 1 < 1), or always wears a mask with a probability ε 2 (0 < ε 2 < 1), yielding ε 0 + ε 1 + ε 2 = 1. The preference of an agent on masks does not change over time.
For the population n remaining almost unchanged with time, we let one time step t contains n t=0 Monte Carlo steps, such that each agent can be selected once on average. Therefore, the expected number of new agents entering the system within one time step t is Λ = n * p e . The solution is p e = µ (see Theorem 1).

The mean-field equations
Performing mean-field analysis, we can approximate the agent-based dynamics into a set of differential equations. We do not dwell on the principles of mean-field analysis, but only explain some important points. (i) Within unit time, each agent is selected once on average, such that the number of events descending in a category is the population in the category. (ii) The probability of selecting an infected agent never wearing a mask from the population is y 0 /n, and y 1 /n, y 2 /n for selecting an infected agent holding the other two preferences, respectively. (iii) Thanks to the mask, the probability of sparing from infection is p I or p S , which means the probability of infection is (1 − p I ) or (1 − p S ). (iv) If there are two layers of protection, they must be both breached for the infection to succeed.
We denote the state of the system by a vector Ψ, containing the population in nine categories. The mean-field differential equations depicting the agent-based dynamics isΨ where The system depicted by Eq. (1) is an extended version of the SIR model with a standard incidence rate.

Results and discussion
In this section, we demonstrate the numerical results of the model from both Monte Carlo simulation and meanfield equations. The algorithm of the Monte Carlo simulation was described in Section 2.1. In the numerical simulation of mean-field equations, we use iteration Ψ(t + ∆t) = Ψ(t) +Ψ(t)∆t, where ∆t = 0.01.

Impact of masks on epidemic spreading
Figures 1 and 2 show the time evolution of p x , p y , and p z with different parameters and initial conditions. From Figures 1 and 2, we find the proportions of different individuals always achieve stability after time evolution. The results of the Monte Carlo simulation fluctuate, while the results of mean-field equations are stable. They corroborate each other. In addition, we obverse two phenomena. First, the epidemic may either die out or exist at the end, dependent on different parameters. Second, with the same parameters and different initial conditions, the steady-states are the same.
Next, in the heat maps Figure 3 and 4, we present the steady-states of p y and p x as a ternary function of ε 0 , ε 1 , ε 2 , respectively. The results of the Monte Carlo simulation are the average of the last 200 time steps (t). The results of mean-field equations are retrieved from the state Ψ(t + ∆t) when max{|Ψ(t)|∆t} < 0.0001.
From Figures 3 and 4, we find that the results of Monte Carlo simulation and mean-field equations corroborate each other. In Figure 3, we observe that more individuals wearing masks reduce the proportion of infected individuals in the population. In particular, always wearing a mask has a better effect on reducing infected individuals. In Figure 4, we observe that more individuals wearing masks increases the proportion of susceptible individuals in the population. Different from increasing recovered individuals, it means that more people are spared from getting infected once. Also, always wearing a mask has a better effect on increasing susceptible individuals (Figure 4), making more individuals spared from being infected.

Potential implication of different mask design
Based on our model, we can reveal the potential implication of different mask designs. When an infected individual wears a mask, it is the filterability from the face to the outside that provides protection (to the population), and when a susceptible individual wears a mask, the filterability from the outside to the face matters. We show in Figure 5 (a) and (b) the steady infected fraction p y as a binary function of the protective effect produced when an infected individual wears a mask (p I ) and when a susceptible individual wears a mask (p S ).
We can observe that in both the Monte Carlo simulation [ Figure 5 , an increase in protective effect p I or p S leads to a decrease in the steady infected fraction p y . On this basis, we further ask which one in increasing p I or p S is more effective in reducing the infected fraction?
We show in Figure 5(c) the steady-state of ∂p y /∂p I and ∂p y /∂p S as a binary function of p I and p S . If ∂p y /∂p I < ∂p y /∂p S , increasing the unit protective effect from the infected side is more conducive to reducing the infected fraction, and vice versa. Intuitively, increasing p I should have always been more conducive than increasing p S , because the former acts on individuals with two preferences, (ii) those who wear masks if and only if infected and (iii) those who always wear masks. In contrast, the latter only acts on individuals with one preference, (iii) those who always wear masks. Increasing , as well as y t=0 and z t=0 .
, as well as y t=0 and z t=0 .   p I obviously has a broader scope of action than the increasing p S and covers the latter's population. However, Figure 5(c) presents a different phenomenon. This indicates that we can provide the designs of the masks with different insights from the group dynamics. We will give this further analysis in Section 4.5.

Verification and validation
This section verifies and validates the properties that we concluded in numerical results by analyzing them at a mathematical level.

The total population dynamics
The total population dynamics follows Theorem 1.

The basic reproduction number
The basic reproduction number R 0 is one of the most important measures in epidemiology. It can assist in analyzing both the stability of the system and the effect of parameters on the epidemic transmission.
We letΨ = 0 and solve for the epidemic-free equilibrium, denoted by Ψ * , Then, we can follow the method in Ref. [31] to find the basic reproduction number (see Appendix A): The basic reproduction number reveals the following theorem.
Theorem 2 The epidemic-free equilibrium Ψ * is locally asymptotically stable if R 0 < 1, and the epidemicfree equilibrium Ψ * is not stable if R 0 > 1.
(See Ref. [31] for proof) Substituting the parameters in Figure 1 into Eq. (6), we can calculate R 0 = 0.9167 < 1, which means the epidemic-free equilibrium is stable, consistent with that shown in Figure 1. Similarly, substituting parameters in Figure 2 produces R 0 = 2.1167 > 1, such that the epidemic-free equilibrium is not stable, which is also consistent with that shown in Figure 2

Epidemic-free and endemic equilibria
We separate Ψ into From Eq. (1), we can assert that the steady-state of Φ 1 can determine the steady-state of Φ 2 , and Φ 2 does not affect the evolution of Φ 1 . Therefore, the stability of Ψ is equivalent to (i) the stability of Φ 1 and (ii) the stability of Φ 2 when Φ 1 achieves stability.
We first prove the global stability of the epidemicfree equilibrium by constructing the Lyapunov function.
The equationΨ = 0 has two solutions. We denote the second solution by Ψ * * . The infected population is non-zero; thus, we call it the endemic equilibrium. This equilibrium Ψ * * corresponds to the results shown in Figure 2. It is not easy to express it analytically, but we can still show its existence condition.
Proof First, we show the relationship between the existence and uniqueness of positive y * * i , i = 0, 1, 2 (y * * 0 > 0, y * * 1 > 0, y * * 2 > 0) and R 0 > 1 (see Appendix C). Then, the existence and uniqueness of x * * i , z * * i , i = 0, 1, 2 can be naturally confirmed, hence the existence and uniqueness of Ψ * * . Figure 1, the steady-state with the same parameters is independent of the initial conditions. Theorem 4 is consistent with Figure 2.

Application to mask design
The basic reproduction number R 0 can play the same role as the infected fraction p y in measuring the outbreak severity. From Eq. (6), we see that the coefficient (1 − p I ) acts on both ε 1 and ε 2 while (1 − p S ) only acts on ε 2 , which means the mask protection from the infected side acts on two population categories and that from the susceptible side acts on only one. This brings us a misleading intuition that increasing the protective effect from the infected side is always more conducive. However, we can reveal a hidden different reality by group dynamics.
We write the partial derivatives of R 0 with respect to p I and p S in Eq. (10) and (11).
Increasing the protective effect from the infected side is better than that of the susceptible one means or and, increasing the protective effect from the susceptible side is better than that of the infected one means We can discuss the parameter space in two cases. First, if p S < p I , then Eq. (12) always holds. Second, if p S > p I , then Eq. (14) does not always hold. This suggests that the "intuitive" phenomena (increasing p I is more effective) occupy more parameter space, which can be verified by Figure 5(c).
For the latter case, p S > p I , we can transform Eq. (15) into ε 2 > ε 1 /(p S − p I ). This indicates that if the fraction of individuals always wearing a mask (ε 2 ) exceeds a critical point, ε 1 /(p S − p I ), then, increasing p S is more effective than increasing p I , even if p I can act on both category ε 1 and ε 2 . We can interpret this result in daily language by taking into account the fraction of existing infected individuals. As we showed in Section 4.4, R 0 decreases (i.e., infected individuals increasing) with an increase in ε 2 . In this way, the critical point of ε 2 is rational to exist, over which the infected individuals are too few to exert the protective effect that the mask produces on their side.

Conclusion
Although most masks have little to no effect on personal protection [1], we are still interested in the protective effects of masks on a population. We proposed a general epidemic model in the classic SIR framework considering three different preferences towards wearing masks. Some individuals never wear masks; others wear masks if and only if infected, and some always wear masks. We started from agent-based rules and used a set of mean-field differential equations to approximate the model. The results of the two corroborate each other. In this work, the three preferences are independent of each other.
The first aspect is the effect of masks on epidemics. The ternary heat maps revealed that wearing masks can reduce the number of infected individuals and increase the number of susceptible individuals. We provided the global stability analysis of the results and showed the robustness of the effectiveness of masks by analyzing the basic reproduction number of the epidemic. We concluded that wearing masks are beneficial to the control of epidemics.
The second aspect is the application of the epidemic model to mask design. The protective effect from the infected side (p I ) can be understood as the filterability of the mask from the face to the outside against viruses, while the protective effect to the susceptible side (p S ) can be interpreted as the filterability from the outside to the face. This can be influenced by the material and design of the mask [33], and we analyzed which side strengthening would provide better results. We showed that strengthening the infected side is more effective in most parameter spaces. This is intuitive since strengthening the infected side acts on two categories of individuals (those wearing masks only if infected and those always wearing masks), while strengthening the susceptible side acts on only one category (those always wearing masks). However, there is a hidden reality from the perspective of group dynamics. We found that once the fraction of individuals always wearing masks exceeds a critical point, ε 2 > ε 1 /(p S − p I ), then, strengthening the susceptible side becomes more effective. This is because the preference of always wearing masks reduces the infected fraction in the population, so that the infected individuals are too few to exert the protective effect of masks produced on their side. In the daily language, both the cases above seem to make sense. However, noticing the latter case from the group perspective and further giving the mask design strategies according to parameter spaces are not straightforward without the help of system dynamics.
Real-world situations may have more complexity and different insights. For instance, the underlying assumptions-people's preferences do not change with time, ignores human subjectivity, which has the potential to reveal more insights. In fact, people can change their preference on whether to wear masks by either estimating the epidemic severity (evolutionary games) or being affected by the propaganda of the effectiveness of masks (opinion dynamics). In this way, future work may consider time-dependent preferences, and apply any modified model to mask design.

Acknowledgement
Publication of this article was funded in part by the George Mason University Libraries Open Access Publishing Fund.

Data availability
Data sharing not applicable to this article as no datasets were generated or analyzed during the current study.

Conflict of interest statement
On behalf of all authors, the corresponding author states that there is no conflict of interest.

Appendix A Finding the basic reproduction number
Let us decompose the infected compartments in Eq. (1) as (ẏ 0 ,ẏ 1 ,ẏ 2 ) Solve for the Jacobian matrix of F and V at Ψ * , denoted by F and V, Then, the spectral radius (i.e., maximum eigenvalue) of F · V −1 is the basic reproduction number R 0 , Please see Ref. [31] for more information on how to find the basic reproduction number.
We can see that a > 0 always holds. The signs of b and c, however, depend on R 0 . Then, the simple use of Vieta's theorem can judge the existence of Y . When R 0 < 1, we have c/a > 0 and −b/a < 0; therefore, both roots are negative. When R 0 > 1, we have c/a < 0; therefore, one root is positive and the other is negative. The positive root is the unique solution of Y and y * * 0 + (1 − p I )(y * * 1 + y * * 2 ). Then, Eq. (C.4) can provide the unique solution of y * * 0 , y * * 1 , and y * * 2 (note that the negative root of Y cannot lead to positive y * * 0 , y * * 1 , and y * * 2 because we have previously shown y * * 0 > 0, y * * 1 > 0, and y * * 2 > 0 if R 0 > 1).