Employing Tank Constraints to Present Total Cost and Water Age Trade-Offs in Optimal Operation of Water Distribution Systems

: Water distribution systems (WDSs) are massive infrastructure systems designed to supply water from sources to consumers. The optimal operation problem of WDSs is the problem of determining pump and tank operation to meet the consumers’ demands with minimal operating cost, under different constraints, which often include hydraulic feasibility, pressure boundaries, and water quality standards. The water quality aspect of WDSs’ operation poses significant challenges due to its complex mathematical nature. Determined by mixing in the systems’ nodes, it is affected by flow directions, which are subject to change based on the hydraulic state of the system and are therefore difficult to either predict, control, or be included in an analytical model used for optimization. Water age, which is defined as the time water travels in the system until reaching the consumer, is often used as a general water quality indicator—high values of water age imply low water quality, whereas low values of water age usually mean fresher, cleaner, and safer water. In this work, we present the effects that tank operation has on water age. As tanks contain large amounts of water for long periods of time, water tends to age there significantly, which translates into older water being supplied to consumers. By constraining the tank operation, we aim to present the trade-off between water age, tank operation, and operational cost in the WDS optimal operation problem and provide an operational tool that could assist system operators to decide how to operate their system, based on their budget and desired water age boundary. The analysis is applied to three case studies that vary in size and complexity, using MATLAB version R2021b and EPANET 2.2. The presented results show an ability to mitigate high water age in water networks through tank constraints, which varies in accordance with the system’s complexity and tank dominance in supply. The importance of a visual tool that serves as a guide for operators to tackle the complex problem of controlling water age is demonstrated as well.


Introduction
Modeling water quality in water distribution systems (WDSs) poses numerous challenges due to the complex and variable nature of hydraulic and contaminant transport processes within these networks [1].Firstly, the spatial and temporal dynamics of water flow and mixing present significant hurdles to accurate modeling [2].WDSs consist of a vast network of pipes, pumps, valves, and storage tanks, with intricate hydraulic behaviors influenced by factors such as pipe material, diameter, topology, and operational conditions.Capturing the transient flow patterns and residence times of water parcels as they move through this labyrinthine infrastructure requires sophisticated modeling techniques capable of simulating both steady-state and transient flow regimes accurately.Moreover, the heterogeneous nature of water quality parameters, including chemical constituents, disinfection byproducts [3], and microbial contaminants [4], further complicates the modeling task, necessitating the comprehensive consideration of reaction kinetics, mass transfer phenomena, and compliance with water quality standards.
Water 2024, 16, 1637 2 of 14 Water quality modeling represents a major challenge for both researchers and practitioners in the field of water resource system engineering.The field of modeling water quality in water distribution systems has been studied quite extensively [5], with several studies addressing the inclusion of water quality considerations in optimization processes.Ref. [6] developed a multi-objective methodology to optimize water distribution system design, incorporating objectives of chlorine disinfectant concentrations and water age alongside the traditional minimal cost objective.However, their solution approach involved the employment of an evolutionary solver, rather than an analytical one.Similarly, ref. [7] proposed a multi-objective optimal design problem, rather than focusing on operation, based on water quality, utilizing a water quality reliability index that integrates the chlorine residual and water age.Ref. [8] tackled the optimization of regional water supply system distribution and quality, which relies on several different water sources of varying qualities.Their approach involved using a genetic algorithm for determining flow directions and applying a generalized reduced gradient to optimize the objective function afterward.Although employing a reduced gradient method, their solution also relies heavily on a heuristic.They applied their method to a single case study and did not examine the influence of the network's complexity and size.Ref. [9] presented an optimization of water distribution system operation under blending constraints.Their work considers water quality as the only objective, without taking into consideration operation cost.Ref. [10] presented a solution for optimal pump operation under water quality constraints, employing an optimization-simulation technique on a single hypothetical case study with one pump and one tank.Ref. [11] proposed a water quality index approach for optimizing chlorine boosters, but did not consider total cost as an objective.Ref. [12] solved an optimal scheduling problem for both pumps and chlorine boosters with the objective of minimal operation cost using a genetic algorithm engine.Ref. [13] presented a multi-objective optimization of a water distribution network, considering pumping costs and chlorine loss, as well as the deviation of the tank level, rather than including it as a part of the constraints.
In this work, we present an analysis of the effect that tank operation has on the system's water age, which results in a system's operational scheme that ties between the tank operation, the operational cost, and the maximal water age that is obtained in consumer nodes.The scheme could assist operators when making decisions regarding the operation policy.It is obtained using a deterministic, analytical optimization model and EPANET 2.2 hydraulic simulations [14].

Methodology
In this study, we chose to use water age as the measure of water quality in the system.Water age refers to the time it takes for water to travel through the system until it reaches consumers.Typically, lower water age values are preferred, as they indicate fresher water that is safer for consumption.In contrast, older water often leads to poor water quality and issues such as a strange taste or odor, microbial growth, and reduced corrosion control [15].

Water Distribution System Optimal Operation Problem Formulation
For context, common mathematical hydraulic symbols can be found in [16].The decision variables of the WDS optimal operation problem are the following: Q is the water flow in all pipes of the WDS [m 3 /h]; H is the hydraulic head in all nodes of the WDS [m]; H p is the pump head gain for all pumps in the WDS [m]; Q p is the pump flow for all pumps in the WDS [m 3 /h]; and n p is the pump rotation speed for all pumps in the WDS (which are all variable speed pumps) [rpm].All decision variables are to be determined for every timestep of the simulation.In practice, pump rotation speed and flow are defined as the independent decision variables of the problem, whose values then allow the calculation of all the rest of the decision variables (i.e., the dependent decision variables).
Equations ( 1)-( 9) define the WDS optimal operation model to be solved, which includes the nodal mass balance, link energy balance, pump curve (relationship between pump flow and pump head gain), tank continuity (relationship between flow into/out of the tank and water volume in it, tying together consecutive simulation timesteps), tank periodic operation (ensuring that both initial and final level are equal), nodal head bounds, and non-negative pump flow and head and pump rotation speed bounds, respectively.
where A T is the network's incidence matrix, describing which nodes are connected by which links; d is the vector of nodal water demands; t is the timestep; T is the set of simulation timesteps; R is a column vector of pipe resistances, calculated according to the Hazen-Williams formula; |Q| 0.852 is the elementwise absolute value of the pipe flow vector raised to the power of 0.852, to allow the correct modelling of changing flow direction in network pipes; A 0 is a matrix with elements {0, 1}, which defines the location of sources in the incidence matrix A; H 0 is a column vector containing the values of constant heads at the sources [m]; A pumps is a matrix that defines pump links' locations inside the WDS, used to adjust the dimensions of matrix H t p ; H t p is a matrix of pump head gains; a pumps,l and b pumps,l are the curve coefficients of pump l; n t p,l is the rotation speed of pump l; L is the set of the system's pumps; H tank,s is the elevation of water in tank s [m]; Q tank,s is the flow of water in the pipe connected to tank s [ m 3  h ]; ∆t is the length of a timestep [h]; α tank,s is the cross-section area of tank s [m 2 ]; S is the set of the system's tanks; H 0 tank,s is a given initial condition for the elevation of tank s; H 24 tank,s is the elevation of tank s at the end of the simulation period [m]; H min and H max are vectors of the upper and lower head bounds at the nodes [m]; and n min and n max are the minimum and maximum pump rotation speeds, respectively.
The objective function was set as the minimization of pump power costs.Pump power cost is traditionally described by the expression shown in Equation (10 The optimization problem to be solved is given by (11).

Modification of Tank Operation Constraint
As part of (6) in the problem formulation, the constraint of the tank head is given in (12): By modifying the minimal tank level bound to many different values, we can solve different optimization problems and create a field of solutions, each with a certain optimal cost and maximal water age value, out of which a system operator could choose the best strategy that is in accordance with the desired outcome of the operation.By dividing the range of feasible tank heads to increments, we repeatedly solve the optimal operation problem, modifying the lower bound of the tank head constraints each time.Each of the solutions is then simulated using EPANET 2.2 to determine the maximal observed water age in the system's demand nodes.The values of total cost are then plotted against the corresponding minimal tank constraint and maximal observed water age, to create the field of solutions that will serve the operator in the decision-making process.

Conceptual Definition of Water Age
Water age is defined as the time water travels inside the distribution system until reaching the consumer.This definition takes into account the initial water age at each of the sources, and the travel distances and flow velocities in pipes.As water mixes in network nodes, the calculation of water age includes a weighted average of all ages of water entering a particular node, in which the weights are the volumetric flow.
In this work, EPANET 2.2 is used for hydraulic simulations.It allows us to obtain water age values throughout a distribution network.It assumes no mixing inside a pipe, which means a unified water age front for pipe flow, and complete mixing in nodes, meaning that all parcels of water interact and mix when arriving at a node or a tank [17].

Results
The model presented above was coded using MATLAB version R2021b [18] and the YALMIP optimization package [19].It was solved using an IPOPT optimizer with a 64-bit Intel i7 4-core CPU at 2.00 GHz and 8 GB RAM.The analysis was applied to three case studies varying in complexity and scale.
The energy tariffs and water demand pattern were identical in all examined case studies, and they are presented in Figure 1.Energy tariffs were taken from [20], and the water demand pattern was taken from [15].

Results
The model presented above was coded using MATLAB version R2021b [18] and the YALMIP optimization package [19].It was solved using an IPOPT optimizer with a 64-bit Intel i7 4-core CPU at 2.00 GHz and 8 GB RAM.The analysis was applied to three case studies varying in complexity and scale.
The energy tariffs and water demand pattern were identical in all examined case studies, and they are presented in Figure 1.Energy tariffs were taken from [20], and the water demand pattern was taken from [15].

Case Study 1
Case study 1 is a very simple network, comprising three demand nodes that form a single loop, a tank, and a pump, as observed in Figure 2. The system's attributes are detailed in Table 1.

Case Study 1
Case study 1 is a very simple network, comprising three demand nodes that form a single loop, a tank, and a pump, as observed in Figure 2. The system's attributes are detailed in Table 1.

Results
The model presented above was coded using MATLAB version R2021b [18] and the YALMIP optimization package [19].It was solved using an IPOPT optimizer with a 64-bit Intel i7 4-core CPU at 2.00 GHz and 8 GB RAM.The analysis was applied to three case studies varying in complexity and scale.
The energy tariffs and water demand pattern were identical in all examined case studies, and they are presented in Figure 1.Energy tariffs were taken from [20], and the water demand pattern was taken from [15].

Case Study 1
Case study 1 is a very simple network, comprising three demand nodes that form a single loop, a tank, and a pump, as observed in Figure 2. The system's attributes are detailed in Table 1.Here, the tank level constraint was changed using increments of 0.1 [m] to form 71 optimization problems to be solved.Figure 3 presents the results of those problems, obtained by applying the analysis on case study 1.Here, the tank level constraint was changed using increments of 0.1 [m] to form 71 optimization problems to be solved.Figure 3 presents the results of those problems, obtained by applying the analysis on case study 1.The result presents the trade-off between the two objectives of the operation in a very clear way.In this simple example, there are two opposite monotonic trends of water age and total operation cost, as the constraint on tank operation is raised.When the operation of the tank is not constrained at all, water age is at its maximal value of 13.89 [h], and the tank is emptied entirely in order to reduce the strain on the pump.As the tank minimal level constraint is raised, the pump is forced to work harder, pumping larger amounts of fresher water to the system, thus reducing the maximal water age in the system.When the tank is forced to stay full for the entire simulation, water age is reduced to the minimal possible value of 3.28 [h].It should be noted that throughout this work, only water demand nodes were observed to find the maximal water age in the system.

Tank
To complete the picture and support the claims above, tank operation curves were matched to water age curves for node 3, in which the maximal water age is obtained.Those curves are presented in Figure 4.The result presents the trade-off between the two objectives of the operation in a very clear way.In this simple example, there are two opposite monotonic trends of water age and total operation cost, as the constraint on tank operation is raised.When the operation of the tank is not constrained at all, water age is at its maximal value of 13.89 [h], and the tank is emptied entirely in order to reduce the strain on the pump.As the tank minimal level constraint is raised, the pump is forced to work harder, pumping larger amounts of fresher water to the system, thus reducing the maximal water age in the system.When the tank is forced to stay full for the entire simulation, water age is reduced to the minimal possible value of 3.28 [h].It should be noted that throughout this work, only water demand nodes were observed to find the maximal water age in the system.
To complete the picture and support the claims above, tank operation curves were matched to water age curves for node 3, in which the maximal water age is obtained.Those curves are presented in Figure 4.A distinctive pattern emerges for the two curves, and a clear link is observed between the tank operation between 12:00-18:00 and the water age at node 3.As we constrain the minimal level, we also cut the sharp water age rise and maintain better water quality in the system.The large amount of water contained in the tank ages dramatically throughout the simulation and supplying it to the system damages water age.Constraining the minimal tank level, which in turn constrains the amount of water supplied from the tank, helps in mitigating the damage old water in the tank imposes.When the tank is not used at all, all nodes are supplied with water through the pump, and the best possible water age con- A distinctive pattern emerges for the two curves, and a clear link is observed between the tank operation between 12:00-18:00 and the water age at node 3.As we constrain the minimal level, we also cut the sharp water age rise and maintain better water quality in the system.The large amount of water contained in the tank ages dramatically throughout the Water 2024, 16, 1637 7 of 14 simulation and supplying it to the system damages water age.Constraining the minimal tank level, which in turn constrains the amount of water supplied from the tank, helps in mitigating the damage old water in the tank imposes.When the tank is not used at all, all nodes are supplied with water through the pump, and the best possible water age conditions are achieved.

Case Study 2
Case study 2 is slightly more complex, and includes seven nodes, two tanks, and two pumps.The system's layout is presented in Figure 5, and its attributes are presented in Table 2.A distinctive pattern emerges for the two curves, and a clear link is observed between the tank operation between 12:00-18:00 and the water age at node 3.As we constrain the minimal level, we also cut the sharp water age rise and maintain better water quality in the system.The large amount of water contained in the tank ages dramatically throughout the simulation and supplying it to the system damages water age.Constraining the minimal tank level, which in turn constrains the amount of water supplied from the tank, helps in mitigating the damage old water in the tank imposes.When the tank is not used at all, all nodes are supplied with water through the pump, and the best possible water age conditions are achieved.

Case Study 2
Case study 2 is slightly more complex, and includes seven nodes, two tanks, and two pumps.The system's layout is presented in Figure 5, and its attributes are presented in Table 2.As this case study includes two tanks, minimal level constraints of both had to be modified, and all combinations had to be examined to complete the analysis.Since the system here is more complex, the increment size was defined as 0.5 [m] to form 441 optimization problems.The results are presented in Figure 6.As this case study includes two tanks, minimal level constraints of both had to be modified, and all combinations had to be examined to complete the analysis.Since the system here is more complex, the increment size was defined as 0.5 [m] to form 441 optimization problems.The results are presented in Figure 6.A monotonic rise in cost is observed with the raising of the minimal tank level constraint, similarly to the previous case study.This result was expected, as higher tank levels lead to higher pumping power and force pumps to supply larger fractions of water demand.However, water age behavior is a bit more complicated, and does not present a smooth and monotonic pattern.Nevertheless, a general reduction can be observed.The maximal water age in the system without constraining the tanks is 16 [h], and the minimal water age is 8.72 [h], which is in fact obtained when both tanks are constrained to be full for the entire length of the simulation.The most significant improvements can be observed on the edges, when one of the tanks is left entirely untouched throughout the operation.In those cases, the amount of water that is aging drastically in the tanks and used for supply is cut in half, and therefore leads to the observed improvement.It can be noticed that when tank 9 is constrained to operate near its maximal level, water age in the system A monotonic rise in cost is observed with the raising of the minimal tank level constraint, similarly to the previous case study.This result was expected, as higher tank levels lead to higher pumping power and force pumps to supply larger fractions of water demand.However, water age behavior is a bit more complicated, and does not present a smooth and monotonic pattern.Nevertheless, a general reduction can be observed.The maximal water age in the system without constraining the tanks is 16 [h], and the minimal water age is 8.72 [h], which is in fact obtained when both tanks are constrained to be full for the entire length of the simulation.The most significant improvements can be observed on the edges, when one of the tanks is left entirely untouched throughout the operation.In those cases, the amount of water that is aging drastically in the tanks and used for supply is cut in half, and therefore leads to the observed improvement.It can be noticed that when tank 9 is constrained to operate near its maximal level, water age in the system spikes.In those cases, the pressure in the system is forced to stay relatively high, which results in frequent flow direction change in the links connecting the tanks to the system.This leads to supply of old water late in the operation period by tank 8 to nodes 1 and 7.As the constraint on tank 8 rises, such a spike in water age is not observed, which can lead to the conclusion that the operation of tank 8 is linked more closely to water age in the system, and operational decisions should be focused on it, rather than on tank 9, in order to improve water age.
As mentioned, the two tanks in the system force the examination of all possible combinations of tank constraints, and the results are presented in the form of three-dimensional graphs.The 'holes' observed on the edges of the graphs describe problems that did not converge to a feasible solution.This could mean that the system could not function hydraulically under certain constraints.This phenomenon happened only on the edges, suggesting that for certain combinations of minimal tank constraints, one tank could not be operated while the other is not used.As tanks help govern the hydraulic head in the system, they should be operated in a certain synchronization to satisfy energy balance throughout the system, which evidently could not be achieved in those points.This required synchronization between the tanks, especially in this relatively small system, results in the largest minimal tank constraint to dictate the level in the proximity of which the other tanks will operate.This realization justifies the examination of the 'diagonal'-all scenarios where the two constraints are equal.The results are shown in Figure 7.
system, they should be operated in a certain synchronization to satisfy energy balance throughout the system, which evidently could not be achieved in those points.This required synchronization between the tanks, especially in this relatively small system, results in the largest minimal tank constraint to dictate the level in the proximity of which the other tanks will operate.This realization justifies the examination of the 'diagonal'all scenarios where the two constraints are equal.The results are shown in Figure 7.Although not monotonic, a more prominent trend of maximal water age behavior is observed, as it rises as much as 2 h at the beginning, and then decreases sharply to below 10 h.These results resemble those observed in case study 1 and emphasize the link between the two tanks throughout the operation.As expected, total cost rises here as well, consistently with the increase in minimal tank level constraints.

Case Study 3
Case study 3 is a modification of the Fossolo network, which is a well-known case study.The network originally consisted of 36 nodes with no pumps or tanks.Here, we add two pumps and two tanks, to obtain the network shown in Figure 8.The system attributes are detailed in Tables 3-5.Although not monotonic, a more prominent trend of maximal water age behavior is observed, as it rises as much as 2 h at the beginning, and then decreases sharply to below 10 h.These results resemble those observed in case study 1 and emphasize the link between the two tanks throughout the operation.As expected, total cost rises here as well, consistently with the increase in minimal tank level constraints.

Case Study 3
Case study 3 is a modification of the Fossolo network, which is a well-known case study.The network originally consisted of 36 nodes with no pumps or tanks.Here, we add two pumps and two tanks, to obtain the network shown in Figure 8.The system attributes are detailed in Tables 3-5.As this system includes two tanks as well, all possible combinations of constraints were considered with an increment size of 1 [m], resulting in 121 optimization problems.The results of the analysis are shown in Figure 9. Similarly to case study 2, the trend in cost is more prominent and consistent, whereas the maximal water age seems to fluctuate throughout the plain, with the lowest values obtained on the edges.The lowest water age value is 3.77 [h], which is an improvement from the 6.39 [h] value for the scenario where the tanks are not constrained at all.The complex nature of this case study makes it very difficult to analyze the different peaks and low water age points, and neither one of the tanks seems to have a stronger effect on water age than the other.
Interestingly, the general trend for water age here is to rise as tank constraints are Similarly to case study 2, the trend in cost is more prominent and consistent, whereas the maximal water age seems to fluctuate throughout the plain, with the lowest values obtained on the edges.The lowest water age value is 3.77 [h], which is an improvement from the 6.39 [h] value for the scenario where the tanks are not constrained at all.The complex nature of this case study makes it very difficult to analyze the different peaks and low water age points, and neither one of the tanks seems to have a stronger effect on water age than the other.
Interestingly, the general trend for water age here is to rise as tank constraints are raised to larger values.To see this trend better, the diagonals of the two graphs above were extracted and are plotted against each other in Figure 10.Similarly to case study 2, the trend in cost is more prominent and consistent, whereas the maximal water age seems to fluctuate throughout the plain, with the lowest values obtained on the edges.The lowest water age value is 3.77 [h], which is an improvement from the 6.39 [h] value for the scenario where the tanks are not constrained at all.The complex nature of this case study makes it very difficult to analyze the different peaks and low water age points, and neither one of the tanks seems to have a stronger effect on water age than the other.
Interestingly, the general trend for water age here is to rise as tank constraints are raised to larger values.To see this trend better, the diagonals of the two graphs above were extracted and are plotted against each other in Figure 10.Note that the solution for the scenario where both tanks remain completely full for the entire operation period is missing from this figure, as it did not converge to a feasible solution.These results present an opposite trend compared to those obtained for case studies 1 and 2. As can be observed in Figure 10, both water age and cost seem to rise together as the minimal level constraint on the tanks rises, and we end up with a more expensive solution, which does not improve water age but rather damages it.This result can lead to the conclusion that the volume of the tank, compared to the scale of the network and its complexity, will dictate the dominance of the tank in both energy efficiency (which will translate into saving of capital) and water age influence.For a network of this Note that the solution for the scenario where both tanks remain completely full for the entire operation period is missing from this figure, as it did not converge to a feasible solution.These results present an opposite trend compared to those obtained for case studies 1 and 2. As can be observed in Figure 10, both water age and cost seem to rise together as the minimal level constraint on the tanks rises, and we end up with a more expensive solution, which does not improve water age but rather damages it.This result can lead to the conclusion that the volume of the tank, compared to the scale of the network and its complexity, will dictate the dominance of the tank in both energy efficiency (which will translate into saving of capital) and water age influence.For a network of this scale, evidently, the efficiency of the tank for saving energy is much more significant than its effect on water age.
In this case study, node 3 is the node where maximal water age is obtained for most tank constraint combinations.Node 3 is located right next to tank 39 and is connected to it.The cases in which the maximal water age is obtained in different nodes are those where one of the tanks is constrained to remain completely full.When tank 39 remains full, maximal water age is obtained in node 36, and when tank 40 remains full, it is node 13 that consumes the oldest water in the system.Since this system is larger and more complex compared to case studies 1 and 2, tanks have less of an effect on water age as long as they are still in use.It is only when tanks are removed completely from the operation that a dramatic improvement can be observed, shifting supply to rely more heavily on pumped water, which is of a younger age.Since the improvement in water age is not significant along the edges (that is, when one of the tanks is out of use while the other still operates), and the rise in cost is not too drastic in those areas, it would be most preferred to operate inside those areas.

Conclusions
This work deals with water age in water distribution systems and aims to present an analysis of water age behavior through tank operation constraint modifications to emphasize the trade-off between water age and operational cost in the WDS optimal operation problem.As water quality behavior in distribution systems is very complex and difficult to model, surrogate methods are needed to examine and control it.
The analysis presented in this work focuses on the minimal allowed tank level and demonstrates its effect on water age.By modifying the minimal tank level constraint and solving the optimal operation problem repeatedly, water age and operation cost can be plotted against each other to reveal and characterize the system's behavior.Such a visual aid could help be of use for water system operators when deciding how to best operate the system under hydraulic, pressure, and water age constraints with a limited operation budget.
The analysis in this work was applied to three case studies, varying in complexity and scale.The results clearly show that as the network becomes more complex, the influence of tank operation on water age weakens, both because of the dominance of the tank in water supply and the growing effects of the network's topology and pipeline lengths.
In case study 1, tank operation allows us to control water age quite well, and two clear and opposite monotonic trends of water age and operation cost are observed.Case study 2, being a bit more complex, presents a more complicated relationship between tank operation and water age, but does demonstrate the link between the two.It also gives an insight into the operation of a network with multiple storage facilities, shows the difficulty of keeping them in synchronization (through the difficulty of obtaining solutions for all constraint combinations), and floats the idea of identifying the most 'damaging' tank out of the several that are serving the network.Case study 3 is the most complex in this study, and although it presents a different and less prominent link between water age and tank operation, it gives an insight on tank effects on water age in large-scale distribution systems and shows that operators may benefit from disregarding certain tanks in the system, which would lead to reduced water age for a relatively small rise in total operation cost.
This work demonstrates the complexity of the optimal operation problem and the difficulty of controlling water age as a part of it.Nevertheless, analyses that create visual tools such as the graphs that are presented throughout this paper can be of great assistance when trying to determine the system's operation and take into consideration water age constraints in addition to pressure and cost.
Future work should focus on fully incorporating the control of water age into the optimization model of WDS operation, so it could be taken into consideration analytically.This could be carried out by developing surrogate models, typically data-driven, which can predict water quality based on hydraulic states of the system.Such a development will be regarded as a significant contribution to this field.

Water 2024 , 15 Figure 4 .
Figure 4. Node 3 water age (a) and tank operation (b) curves for different solutions of case study 1.

Figure 4 .
Figure 4. Node 3 water age (a) and tank operation (b) curves for different solutions of case study 1.

Figure 4 .
Figure 4. Node 3 water age (a) and tank operation (b) curves for different solutions of case study 1.

Figure 6 .
Figure 6.Results of case study 2-minimal water age (a) and total cost (b).

Figure 6 .
Figure 6.Results of case study 2-minimal water age (a) and total cost (b).

Figure 7 .
Figure 7. Maximal water age and total cost of same-value tank constraints for case study 2.

Figure 7 .
Figure 7. Maximal water age and total cost of same-value tank constraints for case study 2.

Figure 8 .
Figure 8.The layout of case study 3-the Fossolo network.

Figure 9 .
Figure 9. Results for case study 3-maximal water age (a) and total cost (b).

Figure 9 .
Figure 9. Results for case study 3-maximal water age (a) and total cost (b).

Figure 9 .
Figure 9. Results for case study 3-maximal water age (a) and total cost (b).

Figure 10 .
Figure 10.Maximal water age and total cost of same-value tank constraints for case study 3.

Figure 10 .
Figure 10.Maximal water age and total cost of same-value tank constraints for case study 3.

Table 1 .
Properties of Case study 1.

Table 1 .
Properties of Case study 1.

Table 1 .
Properties of Case study 1.

Table 2 .
Properties of Case study 2.

Table 2 .
Properties of Case study 2.

Table 3 .
Link properties for case study 3.
Link ID Diameter [mm] Length [m] Link ID Diameter [mm] Length [m]

Table 3 .
Link properties for case study 3.

Table 4 .
Node base demands for case study 3.

Table 5 .
Properties of Case study 3.