# Burst Detection in Water Distribution Systems:
## 2 Methodology
### Water Request Stochastic Modeling  
The first phase of the SHtsG deals with the modeling of the water request through a superimposition approach of different trends, as follows:  
\[D_{ut}=\overline{D}_{uy}\alpha_{d,ut}\alpha_{w,ut}\alpha_{y,ut}+\epsilon_{ut} \quad\text{with }D_{ut}\in\mathbb{R}^{+}, \tag{1}\]  
where the subscript \(u\) and \(t\), respectively, represent the users' group/district and the time coordinate of the water request, while \(D_{ut}\) denotes the water request at the time \(t\) of the group of users \(u\), and \(\overline{D}_{uy}\) is the annual average water request of group \(u\). The daily water request pattern is \(\alpha_{d,ut}=\overline{D}_{uh}/\overline{D}_{ud}\), which represents the dimensionless daily behavior of the water request with an hourly time interval expressed by hourly average request (\(\overline{D}_{uh}\)) over daily average request (\(\overline{D}_{ud}\)). Besides, the weekly and yearly dimensionless pattern are the ratio between daily average request and monthly average request (\(\alpha_{w,ut}=\overline{D}_{ud}/\overline{D}_{lum}\)), and between monthly average request and yearly average request (\(\alpha_{y,ut}=\overline{D}_{um}/\overline{D}_{uy}\)), respectively. On the other hand, \(\epsilon_{ut}\) represents the random component of the water request of the group of users \(u\) at the time \(t\). Although \(\epsilon_{ut}\) could be a negative number, the water request \(D_{ut}\) in Equation (1) (\(D_{ut}\) is the sum of one real non-negative term and another real term) has to belong to the real positive numbers due to the definition itself of water request that can not results negative. The water request in Equation (1) consists of two parts: the first addend regards the deterministic terms and the second one the random term. This formula allows for properly modeling the water request of different users aggregation due to the different deterministic temporal trends and to the random component. On one hand, the deterministic component uniquely defines the water request by merging the different dimensionless trends, e.g., \(\alpha_{d,ut}\), \(\alpha_{w,ut}\) and \(\alpha_{y,ut}\) together with the yearly average request for each analyzed group of users. On the other one, the random component adds a variability effect at the deterministic request making the resulting time series more realistic. This component is calculated on the basis of the number of users aggregated and the first and second order moments of the water request itself. Given that the number of users aggregated and the water request mean are given (deterministic part of Equation (1)), the second order moment is defined through the [PERSON] et al. (2019, 2020) approach, as follows:  
\[CV_{ut}=0.1+\frac{6}{\left(0.25\overline{D}_{ut}\ N_{u}\right)^{3/4}}, \tag{2}\]  
where \(CV\) is the coefficient of variation, which is defined as the ratio of the standard deviation to the mean (\(\sigma/\mu\)), and \(N_{u}\) is the number of users aggregated. Equation (2) is valid for \(N_{u}\) ranges between 200 and 1250 users. Since the water request variation is defined, the random component of each time step for each group of users (\(\epsilon_{ut}\)) is determined by a random generation of the normal distribution  
Figure 1: Flow chart of the proposed SHtsG for developing bursts detection models. \(\mathcal{N}(\mu,\sigma^{2})\). The \(\mu\) and \(\sigma^{2}\) represent the time step average request \(\overline{D}_{ut}\) and its variance, respectively. The variance is derived by Equation (2) as follows: \(\sigma^{2}=(CV_{ut}\ \overline{D}_{ut})^{2}\). The water requests of the different district/groups of users \(u\) are implemented in the hydraulic model by distributing them uniformly along the pipes [31] belonging to the corresponding district area. The uniformly distributed requests are defined as the water request per unit length:  
\[d_{ut}=\frac{D_{ut}}{\sum_{j\in u}L_{ij}}, \tag{3}\]  
where \(L_{ij}\) denotes the length of the _ij-th_ pipe belonging to group \(u\).