## 2 Reliability Model of the Components in the WS
### Multi-State Markov Modeling of Water Supply Pipes  
The reliable operation of the WS is essential to ensure an uninterrupted supply of clean water. Pipeline leakage is a significant factor affecting the proper operation of the WS. Figure 3: Multi-state Markov model of RO seawater desalination plant. Studies have shown that pipeline leakage is caused by a complex interaction of physical, environmental, and operational factors that affect the rate of deterioration, degree of displacement deformation, and rupture, and water supply pipes fail in various forms, including pinholes, holes, and ruptures, all of which can lead to water loss [18,19]. A schematic diagram of water supply pipe leakage is shown in Figure 4.  
Typically, the nodal balance of the WS under normal operating conditions is shown as follows (5):  
\[\mathbf{AQ_{P}}=\mathbf{Q_{N}} \tag{5}\]  
where \(\mathbf{Q_{P}}=[q_{Pj}]\) (m\({}^{3}\)/s) is a vector, each element of which represents the amount of water transported in the pipe; \(\mathbf{Q_{N}}=[q_{Nj}]\) (m\({}^{3}\)/s) is a \(n\times 1\) vector, each element of which represents the node water demand; and \(A\) is the connection matrix of pipes and nodes. When a fault in a water supply pipe results in a leak, assuming that after the leakage occurs it takes only a relatively short period to reach a steady-state leakage, (5) will be modified to (6), as follows:  
\[\mathbf{AQ_{P}}=\mathbf{Q_{N}}+\mathbf{Q_{L}} \tag{6}\]  
where \(\mathbf{Q_{L}}=[q_{Lj}]\) (m\({}^{3}\)/s) is a \(n\times 1\) vector and each element represents the leakage flow rate of the node. The following point leakage model is proposed based on the theory of leakage flow in the WS as follows [20]:  
\[q_{Lj}=\alpha\mu A_{Lj}\sqrt{2 gH_{Lj}} \tag{7}\]  
where \(H_{Lj}\) (m) is the leakage point hydrostatic head; \(\mu\) is the flow coefficient; \(\alpha\) is the leakage coefficient related to the obstruction of the soil and filler, usually 0.1-0.3; \(q_{Lj}\) is the leakage flow; and \(A_{Lj}\) (m\({}^{2}\)) is the leakage area, which is calculated as follows. \[A_{Lj}=\left\{ \begin{array}{l}0,S<R\\ \pi D(S-R),R\leq S\leq R+\frac{A}{\pi D}\\ A,S>R+\frac{A}{\pi D}\end{array} \right. \tag{8}\]  
where \(R\) (m) is the joint leakage displacement, i.e., the joint begins to leak when the joint displacement arrives at \(R\). Here, displacement refers to the size of the damage point of the pipeline. \(D\) (m) is the diameter of the pipeline. \(A\) (m\({}^{2}\)) is the cross-sectional area of the pipeline, \(S\) (m) is the displacement of the pipeline after its failure, which is mainly related to the degree of deformation or rupture of the pipeline. The leakage volume calculation can use the virtual node method [18], but the method is complex and difficult to calculate. In order to simplify the calculation, reference [19] assumes that the leakage of the pipe comes from its two endpoints, which significantly improves the efficiency of the calculation, and the leakage results are close to other methods. The leakage flow rate of the pipe is as follows:  
\[q_{Lj}=\alpha\mu A_{Lj}\sqrt{g(H_{1}+H_{2})} \tag{9}\]  
Figure 4: Structural diagram of a leaking water supply pipe. where \(H_{1}\) and \(H_{2}\) are the hydrostatic heads at the two end points of the leaking pipe, and the hydrostatic heads are calculated according to Equation (17) using the pressure of the pipe nodes. Due to the randomness of pipeline leakage, the Monte Carlo sampling method is used to extract the leakage aperture of the pipeline, the leakage area is calculated according to Equation (8), and the leakage flow rate is calculated according to Equation (9). In existing studies, two-state reliability evaluation models are generally used for water supply pipes containing normal operating states and fault states [11; 21]. However, the size of leak displacements is random, including normal, small hole leakage, hole leakage, and rupture. The normal and other operation states can be transformed into each other.