# Burst Detection in Water Distribution Systems:
## 2 Methodology
### Water Consumption Hydraulic Simulation  
The second phase of the SHtsG aims to provide a synthetic consumption time series close to real ones due to both a suitable calculation of the satisfied water request, called demand, and a proper modeling of the water losses with the DFPDM. The water consumption for each group of users reads as:  
\[Wt_{ut}=Wd_{ut}+Wl_{ut}+Wb_{ut}, \tag{4}\]  
where the \(Wt_{ut}\) defines the water consumption for the group \(u\); \(Wd_{ut}\), \(Wl_{ut}\), \(Wb_{ut}\) are instead the water demand, the background losses, and the water bursts, respectively. The water consumption is represented by the distributed along pipe consumption scheme and the concentrated at the nodes demand scheme (for details, see [32]). The first is used for implementing water demand and background leakages, as follows:  
\[p_{ij}=pd_{ij}+pl_{ij}, \tag{5}\]  
where _ij_ is the pipe index on which the withdrawals are spread, while \(p_{ij}\) denotes the part of the consumption assumed distributed along the _ij-th_ pipe, \(pd_{ij}\), and \(pl_{ij}\) are instead the distributed water demand and background leakages of the _ij-th_ pipe. These variables are expressed as flow rate per unit length and are characteristic related to the pipes. On the contrary, the second component is the focus of lumped withdrawals at the _i-th_ node, and reads as:  
\[q_{i}=qb_{i}, \tag{6}\]  
where \(q_{i}\) is the component of the water consumption concentrated at nodes which consists only of the water bursts \(qb_{i}\). They are measured as flow rate drawn at the nodes of the network. The mathematical equations on the base of the DFPDM are the mass balance at the node \(\hat{i}\):  
\[\sum_{i}\left(Q_{i\hat{i}}-\int_{0}^{L_{i\hat{i}}}p_{i\hat{i}}(h(x))\ dx\right)- \sum_{j}Q_{i\hat{j}}-q_{i}(h_{i\hat{j}})=0, \tag{7}\]  
where \(i\) and \(j\) are the ending pipe nodes, \(x\) is the pipe longitudinal coordinate, \(\hat{i}\) is the considered node for the mass balance, \(h\) is the hydraulic head, and \(Q_{i\hat{j}}\) is the flow rate at the node \(i\). \(p_{ij}\) and \(q_{i}\), which are defined above, denote the water consumption assumed as distributed and concentrated, respectively. The head loss equation, which is expressed according to the Darcy-Weisbach formula, for the _ij-th_ pipe reads as follows:  
\[h_{i}-h_{j}=r_{ij}\int_{0}^{L_{ij}}\left(Q_{ij}-\int_{0}^{x}p_{ij}(h(x))\ d \xi\right)\left|Q_{ij}-\int_{0}^{x}p_{ij}(h(x))\ d\xi\right|\ dx, \tag{8}\]  
where \(h_{i}\) and \(h_{j}\) is the hydraulic head at node \(i\) and \(j\), and \(r_{ij}\) denotes the hydraulic resistance per unit length of the _ij-th_ pipe. Equation (8) is the generic formulation of the head loss drop of the pipesthat embraces all the possible cases. For example, Equation (8) in the case of null distributed water consumption along pipes assumes the following form:  
\[h_{i}-h_{j}=r_{ij}L_{ij}\left|Q_{ij}\right|Q_{ij}\quad\text{if $p_{ij}=0$}, \tag{9}\]  
while the case of pipe water consumption different form zero in demand driven hydraulic conditions results as follows:  
\[h_{i}-h_{j}=\frac{r_{ij}}{3p_{ij}}\left(\left|Q_{ij}\right|^{3}-\left|Q_{ij}-p_ {ij}L_{ij}\right|^{3}\right)\quad\text{if $p_{ij}=c$ }\{c\in\mathbb{R}^{+}\}. \tag{10}\]  
In this case, the final water demand is equal to the water request (\(p_{ij}=d_{ij}\)) given the required pressure for regular working. The last possible case regards pipes working in a pressure driven condition with distributed water consumption. The distributed request \(p_{ij}\) is therefore function of the hydraulic head along the _ij-th_ pipe and can be assumed as a second order polynomial function:  
\[p_{ij}=w_{ij,1}x^{2}+w_{ij,2}x+w_{ij,3}, \tag{11}\]  
where \(w_{ij,1}\), \(w_{ij,2}\), and \(w_{ij,3}\) are the three coefficients defined by means of the punctual pressure-consumption relationship evaluated at the top, middle, and end points of pipe. In this work, both the three coefficients of \(p_{ij}(h(x))\) and the nodal \(q_{ij}(h(x))\) consumption are evaluated by [PERSON] and [PERSON] [33].