Quadratic head loss approximations for optimisation problems in water supply networks

This paper presents a novel analysis of the accuracy of quadratic approximations for the Hazen – Williams (HW) head loss formula, which enables the control of constraint violations in optimisation problems for water supply networks. The two smooth polynomial approximations considered here minimise the absolute and relative errors, respectively, from the original non-smooth HW head loss function over a range of ﬂ ows. Since quadratic approximations are used to formulate head loss constraints for different optimisation problems, we are interested in quantifying and controlling their absolute errors, which affect the degree of constraint violations of feasible candidate solutions. We derive new exact analytical formulae for the absolute errors as a function of the approximation domain, pipe roughness and relative error tolerance. We investigate the ef ﬁ cacy of the proposed quadratic approximations in mathematical optimisation problems for advanced pressure control in an operational water supply network. We propose a strategy on how to choose the approximation domain for each pipe such that the optimisation results are suf ﬁ ciently close to the exact hydraulically feasible solution space. By using simulations with multiple parameters, the approximation errors are shown to be consistent with our analytical predictions. the quadratic approximations of the commonly used HW head loss formula. We present a novel error analysis of the different quadratic approximations schemes, and investigate their impact on the solutions of optimisation problems for water supply networks. We propose and analyse an approximation that minimises the integral of square absolute errors, and we also formulate an alternative quadratic approximation to the one described by Eck & Mevissen (  ). We derive


INTRODUCTION
The optimal management of water supply networks requires the satisfaction of multiple objectives, ranging from leakage reduction to improvements in water quality and system resilience. Consequently, various optimisation problems need to be solved including network design problems (Savic & Walters ), pump scheduling problems ( Jung et al. ) and the optimal placement and operation of control valves (Nicolini & Zovatto ; Wright et al. ). Any optimisation problem, which is formulated for the hydraulic management of water supply networks, is constrained by the mass and energy conservation laws.
These hydraulic expressions take into consideration friction head losses that can be represented by either the Hazen-Williams (HW) or Darcy-Weisbach (DW) formulae. The HW formula is semi-empirical (Liou ; Christensen et al. ) and it involves a non-smooth fractional exponential function, whose Hessian is unbounded around the origin. Consequently, the HW formula is difficult to handle as a constraint for nonlinear programming solvers, for which second order derivatives are often needed. In DW models, the relation between friction head loss and flow is defined by an implicit equation, which involves non-smooth terms, and it can be numerically calculated through an iterative process (Larock et al. ,Section 2.2.2). This complicates the use of such models in a smooth mathematical optimisation framework. As a consequence, optimisation problems for water supply networks are often addressed using heuristic approaches that handle the nonlinear nonsmooth hydraulic equations through highly specialised and customised simulation approaches (Maier et al. ).

QUADRATIC APPROXIMATIONS FOR FRICTION HEAD LOSSES
Throughout this paper, the friction head loss across a pipe is represented by the HW formula and it is given by: with n ¼ 1.852 and the positive real number r, which is the resistance coefficient of the pipe, is defined as where L, D, C are length, diameter and HW roughness coefficient of the pipe, respectively. For a given flow velocity v in a pipe, the corresponding flow q is given by q ¼ S Á v, where S is the cross-sectional area of the pipe. In particular, if V max is the maximum expected flow velocity in a pipe, we have Formula (1) is non-smooth due to the rational exponent n ¼ 1.852. In various optimisation problems for water supply networks, the friction head losses appear as constraints. In order to apply standard nonlinear programming techniques it is necessary to use a sufficiently smooth approximation of Equation (1). In particular, given an expected maximum flow Q max , we look for a quadratic polynomial function Various mathematical notions of closeness can be used, each one resulting in approximation with particular characteristics. In this paper, we focus on two different approaches and analyse their goodness for optimisation problems in water supply networks.

A QUADRATIC MODEL THAT MINIMISES ABSOLUTE ERRORS
In the present formulation we consider a smooth quadratic approximation of the friction losses across a pipe, generated by flow q ranging between 0 and some fixed maximum flow Q max . We look for a polynomial function errors defined by In the following, we refer to this approximation as QA 1 . An analytical expression for I(a, b) can be derived as: Therefore, a couple (a Ã 1 , b Ã 1 ) minimises the integral if it satisfies the following equations: The solution of the above linear system yields:

ANALYSIS OF THE APPROXIMATION ERROR
We study the errors introduced by the considered smooth friction loss approximation formula. Given the quadratic polynomial function with coefficients (a Ã 1 , b Ã 1 ) defined by equations in (8), it holds where the function ϕ(x) ¼ k α x 2 þ k β x À x n depends only on n.
In particular, we have The reader is referred to Lemma 1 in Appendix 1 for a technical proof of the above statements.
In the following, we further analyse the impact of Q max on the approximation accuracy and we propose a selection strategy for its value. Recall that in our study n ¼ 1.852. As shown in Figure 2 In particular suggests that to improve accuracy we should avoid large values of Q max .
In addition, from Figure 2(b) we can conclude that the function jϕ(x)j is monotone increasing for x > 1. Therefore, the greater the flow is than Q max , the less accurate the quadratic friction loss approximation is. This is not surprising as the approximation is optimised to minimise errors in In conclusion, we consider an approximation interval large enough to include the majority of expected feasible flows. However, this does not mean that the value of Q max should be unnecessarily large.

A QUADRATIC MODEL THAT MINIMISES RELATIVE ERRORS
We consider the quadratic approximation that is obtained by minimising the integral of relative errors (Eck & Mevissen ). In this approximation scheme, a quadratic where Q 1 > 0 and Q 2 ¼ Q max > Q 1 specify the approximation range. We refer to this approach as QA 2 . Furthermore: We look for (a Ã 2 , b Ã 2 ) which solve the following system of equations: therefore:

ANALYSIS OF THE APPROXIMATION ERROR
It can be shown from (17) that the accuracy of the quadratic approximation depends on Q 1 , Q 2 and the resistance coefficient r. In Eck & Mevissen (), a method for choosing Q 1 was suggested, in order to control the relative error of the proposed approximation. In fact, given that Q 2 is equal to the maximum considered flow value Q max , we choose Q 1 so that the minimum of the relative error function is within a given tolerance ϵ rel (see Figure 3).
Since our aim is to apply the considered approximation scheme to formulate constraints of different optimisation problems for water supply networks, we study the effect of Q 1 , Q 2 and ϵ rel on the absolute errors. In fact, these variables affect the degree of constraints violation for a feasible candidate solution. Therefore, we derive new exact analytical formulae for the absolute error. With the application of these formulae, we provide new insights into the approximation defined in (17). In particular, we show that, as for QA 1 , the absolute error is proportional to the resistance coefficient and it is a nonlinear function of Q max .
Given Q max and ϵ rel , let a Ã 2 and b Ã 2 be the coefficients defined in (17) where Q 1 is chosen according to the method proposed in Eck & Mevissen (). In this case, we have: where function ψ(x) ¼ l α x 2 þ l β x À x n depends only on ϵ rel and n. In particular, it is possible to compute a real number γ ¼ γ(ϵ rel , n) such that: See Lemma 2 (Appendix 1) for a detailed derivation of the above expressions. In addition, there is an implicit nonlinear relation between function ψ and the couple (ϵ rel , n).
From Figure 4, we can see that when q < (Q max =10), the choice of ϵ rel ¼ 0:1 results in jψ(q=Q max )j ≪ 10 À3 . Therefore, if we expect that most flows are significantly smaller than Q max , we can set ϵ rel ¼ 0:1. The accuracy on flows larger than Q max is improved when smaller values of ϵ rel are used. In the remaining part of the paper we consider the case of ϵ rel ¼ 0:1.
From Figure 5(b), the value jψ(q=Q max )j is large for q > Q max . Therefore, in order to have a small approximation error, Q max should be defined so that the majority of expected feasible flows does not exceed this value. On the other hand, Equation (18) In Figure 6, we compare the graphs of jϕ(Á)j and jψ(Á)j. From Figure 6(a), we conclude that when q < (Q max =5), QA 2 results in a smaller absolute error than QA 1 . In the case when the flow q is closer to Q max , the best level of accuracy is achieved with QA 1 . Note that both approximation schemes can result in large errors when q ≫ Q max .
Finally, recall that r ¼ (10:670 Á L=C n D 4:871 ). Therefore, the absolute errors for QA 1 and QA 2 friction head loss approximations can be written as: Even though the quadratic approximation was observed to be more accurate for rough pipes in the case of DW friction models (Eck & Mevissen ), the above formulae demonstrate that this does not hold for HW models. In fact, when L, D and Q max are fixed, both approximation schemes become less accurate for rough pipes. This is shown also in Figure 7, where a pipe with L ¼ 100 m, D ¼ 0.25 m and V max ¼ 3m=s is considered.     We define the mean absolute error on nodal pressure as

NUMERICAL RESULTS AND DISCUSSION
wherep(t) ∈ R nn represents the vector of nodal pressures at loading condition t, computed by the optimisation process using a quadratic approximation for friction losses; on the other hand, p(t) ∈ R nn represents the vector of nodal pressures computed by hydraulic simulation with optimised valve settings and HW friction loss model. Analogously, we define withq(t) ∈ R np and q(t) ∈ R np vectors of flows computed in valve optimisation and simulation, respectively. Finally, we formulate two empirical cumulative distribution functions as to consider velocities up to 10 m/swe refer to this scenario as T1. In this case, the feasible flow q j (t) may be larger than Q max j for most j ∈ {1, . . . , n p } and t ∈ {1, . . . , n l }. Therefore, according to Figure 6, we expect QA 1 to be more precise than QA 2 . As reported in Figure 10(a), this is verified by our experiment, with QA 1 being more accurate than QA 2 .  In the case of V max j ¼ 10m=s, the behaviour of the two quadratic approximation schemes can be described as follows. As shown in the previous section, the inaccuracies due to unnecessary large Q max j on many links can result in high errors of approximations. Note from Figure 12(a) that many feasible flows are much smaller than the expected Q max j . Specifically, we observe that q j ≪ (Q max j =10) for most j ∈ {1, . . . , n p }. This implies that jψ(q j =Q max j )j < 10 À4 for most j ∈ {1, . . . , n p }; see also Figure 12(b). In comparison, the values jϕ(q j =Q max j )j are at least an order bigger for the same links. With reference to Equation (20), we conclude that, in the case of QA 2 , the value of jψ(q j =Q max j )j is small enough to compensate the large (Q max j ) n on most links j ∈ {1, . . . , n p }. This is not valid for QA 1 .
In order to improve the accuracy of both optimisation strategies, we should tailor the value of the maximum expected flow for each particular link j and avoid unnecess- Recall that for each j ∈ {1, . . . , n p }, we have The proposed strategy avoids overestimating values Q max j on small pipes with low velocities. We consider tailored maximum velocities with μ ¼ 1; this is scenario T4.
In this case, we obtain the best pressure accuracy for the two approximations (see Figure 11(c)).
We further analyse the quality of the different solutions provided by the optimisation process with QA 1 and QA 2 friction head loss models, using a tailored maximum expected flow for each link. In this case, many feasible flows are such that q j (t) < (Q max j =5). In the previous section, we have shown that this implies e 2 (q) < e 1 (q) and have confirmed by the experimental results. In fact, as shown in Figure 11(c), the optimal solution corresponding to QA 2 is more accurate than the one related to QA 1 . As observed in Figure 11(d), both quadratic approximations cause large errors (more than 1 l/s) in the computation of a small fraction of network flows (less than 2% for the described case study). In the considered case study, most of the feasible flows q j (t) are smaller than (2Q max j =5). With reference to Figure 15 and Equation (20), we conclude that QA 1 overestimates friction losses on the majority of network flows, while QA 2 underestimates these values. For this reason, pressures computed using QA 1 are lower than corresponding hydraulically feasible pressures. In comparison, the optimisation with QA 2 computes higher pressures than obtained from hydraulic simulation. Nonetheless, by appropriately choosing the ranges for the two quadratic approximations, a good level of accuracy is achieved. Consequently, smooth quadratic approximations for friction  head loss models enable the application of standard nonlinear programming tools for the mathematical optimisation problems arising in the framework of optimal design and operation of water supply networks.
In the present analysis, we study eight different optimisation problems; in fact, for each approximation scheme, four different scenarios are investigated. All the con- In this paper, we have presented two quadratic approximations that minimise the absolute and relative errors, respectively, for the non-smooth HW friction head loss formula over a range of flows for each pipe. We have derived   For each quadratic approximation scheme, four optimisation problems were considered corresponding to different scenarios. In scenario T1, the quadratic approximations of the friction head loss formula is performed over an interval defined by V max ¼ 0:1m=s, while the optimisation allows velocities up to 10 m/s. Scenarios T2, T3 and T4 use maximum velocities of 6 m/s, 10m/s and tailored V max , respectively, both for approximations and optimisation frameworks.
exact analytical formulae for absolute errors for two quadratic approximations that we investigated. In particular, we have shown that the absolute head loss approximation error for each pipe is proportional to the resistance coefficient and it is a nonlinear function of the approximation domain. Based on the derived explicit formulae, we have provided new insights into quadratic approximations of the HW head loss formula for solving optimisation problems for water supply systems. We have also discussed the critical nonlinear relations between errors and the range of flows.
Moreover, in the case of the quadratic approximation that minimises relative errors, our analytical framework allows an efficient strategy for the computation of the quadratic approximation coefficients, which is especially well suited when considering large-scale water supply networks with many pipes.
Friction head loss formulae appear as nonlinear constraints in many optimisation problems for water supply networks. These problems include optimal network design