## 2 Materials and Methods
### The Proposed Model  
The model determines the variation of risks/impacts of heatwave phenomena in urban settlements generated by the presence of periods of pandemic or epidemic crisis. The pandemic/epidemic crisis is modeled as a stressor that produces an increase in exposure to the phenomenon. The impact of this stressor on exposure is assessed by measuring the relevance of unpleasant emotions detected in posts by citizens to a social network. The urban settlement area of study is partitioned into subzones, such as, for example, districts or wards of a city. Queries are then performed on the social network that refer to the investigated heatwave period, the subzone, and hashtags connected to keywords related to the heatwave and the pandemic/endemic crisis phenomena. The FREDoC framework is used to build, starting from the acquired flows, the corpus of documents, where each document is made up of the set of posts published in the investigation period and referring to a specific subzone. Using a dictionary of emotional categories, FREDoC classifies the documents by measuring the relevance of pleasant and unpleasant emotions in each document. We measure an index of discomfort of the citizens by aggregating the relevance of unpleasant emotions. Formally, let \(\{c_{\text{p1}}\), \(c_{\text{p2}}\),...\(c_{\text{pNp}}\}\) be the set of \(\text{N}_{\text{p}}\) pleasant emotional categories with fuzzy relevance greater than or equal to a fixed threshold, and let \(\{c_{\text{u1}}\), \(c_{\text{u2}}\),...\(c_{\text{uNul}}\}\) be the set of \(\text{N}_{\text{u}}\) unpleasant emotional categories with fuzzy relevance greater than or equal to this threshold. If \(\tau(c_{\text{pj}},\text{d}_{\text{i}})\) (\(\tau(c_{\text{uj}},\text{d}_{\text{i}})\) is the relevance of the jth pleasant (unpleasant) emotional category detected in the ith subzone), we define an index of discomfort of the citizens in the ith subzone given using the following equation:  
\[\text{ds}_{\text{i}}=\sum_{\text{j=1}}^{\text{N}\text{u}}\tau(c_{\text{uj}}, \text{d}_{\text{i}})-\sum_{\text{j=1}}^{\text{Np}}\tau(c_{\text{pj}},\text{d} _{\text{i}}) \tag{3}\]  
This value is between \(-1\) and \(1\), and it is positive if there is a prevalence of relevant unpleasant emotions. It is negative if, instead, pleasant emotions are more relevant. Let \(\text{e}_{\text{i}}\) be the exposure value determined for the kth subzone, normalized in the range of \([0,1]\). The new exposure value will be given by  
\[\text{e}^{\prime}_{\text{i}}=\max(0,\min(\text{e}_{\text{i}}+\text{ds}_{\text {i}},1)) \tag{4}\]  
where the new exposure \(\text{e}^{\prime}_{\text{i}}\) adds to the exposure the discomfort perceived by citizens if unpleasant emotions prevail, while it subtracts the discomfort index from the exposure if pleasant emotions prevail. The max and min operators are used to obtain an exposure value between 0 and 1. The stressor can represent an aggravating factor for the exposure if unpleasant emotions prevail in the subzone; on the contrary, it can contribute to reducing the exposure if pleasant emotions prevail in the subzone. In the first case, the discomfort index will be a positive value between 0 and 1, in the second case it will be a negative value between \(-1\) and 0. In Figure 2, the proposed method is schematized. After having partitioned the urban area of study into subzones, the two processes of exposure evaluation are started, starting from the available institutional data and the discomfort index obtained by determining the relevance of unpleasant emotions detected in posts published on the social network. The Calculate exposure index function calculates the exposure using census data on the resident population and aggregates the measure by subzone. The Normalize function is then executed to normalize the exposure value in the interval [0, 1], obtaining the normalized exposure for each subzone.