A Distributed Optimization Method for Energy Saving of Parallel-Connected Pumps in HVAC Systems

: The energy saving problem of parallel-connected pumps in heating, ventilation, and air-conditioning (HVAC) systems has received an increasing attention in recent years. While many pump optimization methods are proposed and show great performance, pumps are not always energy saving and lack ﬂexibility. In this paper, we propose a distributed control algorithm for parallel-connected pumps in HVAC systems. Based on a spanning tree of the intelligent nodes and a population of potential solutions, the algorithm makes the optimal control decision for pumps to minimize the energy consumption and meet the system demand. The theoretical analysis on convergence of the algorithm is established. Unlike traditional control structure, the whole system is fully distributed and each pump is controlled by an intelligent node that runs the identical control code and coordinates with other nodes through direct data exchange. Simulation experiments on 6 parallel-connected pumps are provided for different working cases to demonstrate the effectiveness of the proposed algorithm and compare with other four methods. The results show that our algorithm strictly satisﬁes the demand constraint and presents good energy saving potential, the convergence guarantee, the ﬂexibility. The maximum energy saving can be up to 29.92%. Besides, the hardware test clearly presents that our algorithm can perform on low-cost Raspberry Pi3 and reduce the system cost.


Introduction
The heating, ventilating, and air-conditioning(HVAC) system makes up approximately 50% of building energy consumption and 20% of total energy consumption [1]. Parallel-connected pumps, which provide as wide flow range as possible, are the main power consumer devices in HVAC systems. The report of European Commission shows that pump systems account for nearly 22% of the energy consumed by electric motors in the world [2]. The energy consumption of pumps to transport energy into rooms is responsible for a significant portion of HVAC energy consumption [3]. It accounts for about 40% of the total HVAC energy use [4]. These numbers demonstrate that the system with parallel-connected pumps has great potential for energy saving and there is an increased attention associated with the operation of pumps. Many advanced computer control systems have been implemented in HVAC systems [5]. How to optimally control the number of running pumps and corresponding speeds is important to reduce the total energy consumption and exactly meet the demand.
Researchers have proposed various pump optimization strategies to reduce the energy consumption [8]- [23]. These methods play important roles and help human operators to save much algorithm. To demonstrate the advantages of the new algorithm, in Section 6, we show numerical results of the algorithm and compare it with the state of art algorithms. We also study the flexibility of the algorithm and test the algorithm on hardware platform. In Section 7, we conclude the paper.

Literature review
There are plenty of studies on pump energy saving control and optimization. By investigating the existing papers, we summarize them into four groups including rule based methods, mathematical programming, heuristic methods and distributed methods as shown in Table 1. The first three groups are based on the centralized control framework which replace the group of controllers as shown in Figure 1 with a single controller. The last group is based on the distributed control framework as presented in Figure 1. Table 1. Optimization methods for the system with parallel-connected pumps.

Control framework
Groups Methods

Rule based methods
In the pump system, the operation still depends on human operators to manage pumps. To tackle this problem, some methods have been conducted on adjusting pump working, including on-line adaptive control [8] and group control strategy [9]. Zhao et al. [10] defined the most unfavorable thermodynamic loop and used the variable differential pressure set point control strategy of pumps. The test results saved 47-58% water pump power consumption. Ma et al. [11] developed the pressure drop models for water networks and formulated an optimal pump sequence control strategy. The number of pumps in operation was set according to their power consumption and maintenance costs. In addition, Gao et al. [12] proposed a fault-tolerant and energy efficient sequence control strategy (SC) for chilled water pump systems with a differential pressure set-point. The strategy ensured that the water flow of secondary loop met the primary loop. There was a series of operational problems for the terminal air-handling units and chillers due to the ungratified flow rate demand. Rule based methods are simple and show great performance to meet the demand. The accurate model of pumps is not needed in [10] [12]. These methods are widely used in practical engineering. Sometimes pumps cannot work in the most energy efficient way because of the non-optimal working point.

Mathematical programming methods
Currently, many experts have made great efforts on developing and applying methods for pumps working in parallel to improve their energy efficiencies. Many typical research papers were reported by focusing on mathematical programming methods. Bonvin et al. [13] introduced a convex mathematical program for pump scheduling in water networks. It realized average 3.0% optimality gap and significant saving according to operation costs and energy consumption. Horváth et al. [14] proposed a convex pump model based on pump curves and developed a mixed-integer optimization method. The applicability and results showed that the method was more energy efficient compared with current methods. The errors of the solution and the computation time were influenced by the help variables. In order to keep pumps running closely to the best efficiency point, Koor et al. [15] applied the customized optimization software which adopted the Levenberg-Marquardt algorithm to solve the complex optimization task. By analyzing three different theoretical scenarios, the optimal number of working pumps was estimated. The author in [16] studied the problem of energy consumption minimization for variable speed drive pumps and proposed a simplified convex relaxation of pump characteristics. Two small benchmark networks showed that the method was suitable for pump operations with lower energy costs. To develop an energy-oriented optimal control solution, Jepsen et al. [17] recommended a method to minimize the energy consumption of pump stations by two steps: First, the energy consumption for a pre-selected set of active pumps were formulated as a convex optimization problem, then the problem of choosing the number of active pumps was solved by a convex solver. The proposed solution presumed the performance curves remaining constant over time. Inspired by [17], we adopt the sequential least squares programming algorithm (SLSQP) to compare with our method. The sequential least squares programming algorithm has better computing efficiency [25]. These mentioned mathematical programming algorithms increase the ability to obtain the near-optimal solutions. Due to the equality constraints, there are some deviations to meet the demand. These methods are suitable only for specific systems and lack flexibility.

Heuristic methods
Considering the complexity of the problem, some researchers have turned their attention to heuristic optimization methods. By adopting the genetic algorithm, Wang et al. [18] proposed a bi-objective pump scheduling approach. Rong et al. [19] presented a crowding genetic algorithm to decide optimal pump configuration. Cimorelli et al. [20] studied the optimal regulation of pump systems by the genetic algorithm. In addition, Barán et al. [21] introduced a multi-objective evolutionary algorithm to solve the optimal pump scheduling problem with four objectives. Hashemi et al. [22] introduced an ant-colony optimization method to improve the optimization process and reduced the feasible solutions in the search space. The optimization process was repeated many times leading to different costs and the lowest cost was selected. In order to enhance energy conservation and analyze control strategies, Olszewski et al. [23] studied three different strategies for complex pumping stations with genetic algorithm (GA) and pointed that minimizing power consumption was the most energy efficient. The ungratified flow rate was affected by the population size. The heuristic optimization methods are powerful tools to solve the optimization problem without any derivatives and continuities assumption. The above methods adopt the advantage of population sampling to solve these combination problems. However, these methods lack convergence guarantee and cannot be used to assess the minimum energy. Under equality constraints, these methods are hard to find a feasible solution. If the system with parallel-connected pumps changes, they need to do the algorithm again.

Distributed methods
Recently, we proposed a new building control architecture Insect Intelligent Building (I 2 B) [7]. This new distributed control framework is convenient for pump units. It is open, flexible and has a low configuration cost. There are some early attempts to carry out the distributed control in HVAC systems. Liu et al. [24] developed a decentralized optimization algorithm for optimal set point control for HVAC systems. Dai et al. [26] introduced a novel decentralized transfer algorithm (TA) as a solution to a typical control problem for parallel-connected pumps in HVAC systems. In fact, the idea of distributed control or optimization has been applied widely in other large engineering systems such as the distributed multi-area economic dispatch for active distribution networks [28], or multi-agent traffic light control systems [29].
The above literature review shows that there is great potential in reducing pump energy consumption. Advanced control strategies are effective ways to achieve high energy efficiency. There are three types of methods based on centralized control structures: rule based methods, mathematical programming and heuristic methods. There are also some distributed methods in recent years and show better flexibility. Dai et al.'s work [26] is an initial attempt to solve the optimization problem for parallel-connected pumps in distributed manner. We observe that existing studies can be further improved. First, there are some violations of demand constraints. So strictly speaking, the solutions are not feasible. Second, existing algorithms have no guarantee of convergence. The solution may not be optimal and extra energy is consumed. To our best knowledge, the algorithm introduced in this paper is the first effort to address above challenges at the same time.

Problem formulation
Consider the control of parallel-connected pumps in an HAVC system as shown in Figure 1. We assume that there are m centrifugal variable-speed pumps connected in parallel and the size of pumps may be different. The demand is a stable value during a period of time (for example one hour as given in paper [11]). Our problem is to optimize the number of running pumps and their speed set-points to meet the demand with minimum energy consumption. We also assume that underlying controllers such as those given in [2] can regulate pump speed to the new set-points in real time.

Pump models
Let us first formulate the relationship between pump speed and pump energy consumption. There are various methods to establish pump model in application, such as dynamic pump model [30], pump approximation model [23]. In order to obtain better precision and convenient calculation, we choose polynomial functions to reflect pump characteristics. It is vital to know pump characteristics to implement optimal pump control. To describe a pump, we need to consider relationships between pump head, flow rate, and efficiency. When pumps work at their rated speeds, the relationships can be indicated by the equations as below.
We use H i to denote the head of pump i, i = 1, 2, . . . , m where m is the total number of pumps. Q i is the flow rate of pump i. η i is the mechanical efficiency, P i is the power consumption of pump i. P i depends on three sub-efficiency variables, including the mechanical efficiency η i , the motor efficiency η M,i , the variable frequency efficiency η VFD,i . The a P1,i , a P2,i , a P3,i , b P1,i , b P2,i , b P3,i are pump performance parameters. These parameters in the equations may be accessed by the pump performance curves or actual measurement data. The data is measured when pumps work at the rated speed. If we obtain the data, it is possible to utilize the least square method to fit the polynomial functions.
We use n i to denote the actual speed of pump i. n 0,i is the rated speed of pump i. We define speed ratio ω i to depict the ratio between the actual speed and the rated speed.
In general, the pump performance parameters are related to the speed and the operating conditions. When pump works in variable speed status and the operating conditions do not change, we can attain a series of pump characteristic curves through the pump affinity laws [31], as presented in Equation (5).
Preprints (www.preprints.org) | NOT PEER-REVIEWED | Posted: 7 July 2020 Peer-reviewed version available at Energies 2020, 13, 3927; doi:10.3390/en13153927 Where Q i (n 0,i ) is the rated flow rate at rated speed n 0 , Q i (n i ) is the actual flow rate at actual speed n i . H i (n 0,i ) is the rated head at rated speed n 0 . H i (n i ) is the actual head at actual speed n i . η i (n 0,i ) is the rated mechanical efficiency at rated speed n 0 . Using the pump affinity laws and Equations (1)(2), we can reach the equations of pump head and flow rate, efficiency and flow rate at a speed n i including rated and non-rated, which are as below.
Although paper [32] indicated that η M,i , η VFD,i depended on ω i , when the speed ratios meet 0.4 ≤ ω i ≤ 1, η M,i , η VFD,i could suppose to be constants. The reason is that ω i has little influence on them. Therefore, we can dispense with the impact of η M,i , η VFD,i and only consider the mechanical efficiency η i . As a result, the pump power consumption equation can be rewritten as below.

Optimization problem formulation
Now let us formulate the pump speed ratio optimization problem (PSROP).

[Problem 1. Pump Speed Ratio Optimization Problem (PSROP)]
The objective function presents that the optimization objective of this paper is to minimize the total power consumption of pumps in parallel. The objective function indicates that we should try to find a combination of ω i to content the corresponding constraints at the lowest energy consumption. Constraint (10) is the equality relationship between the head of pump and the total pressure difference H 0 . Constraint (11) is to guarantee that the amount of flow rate is equal to the total flow rate demand Q 0 on the main pipe. Constraint (12) is the range of speed ratio. ω − is the lower limitation of speed ratio. If the speed ratio is equal to 0, it means that the pump i is shut down.

Proposed algorithm
In this section, we propose a novel algorithm, Breadth first search Random Sampling (BRS for short), to solve the optimization problem PSROP. Our algorithm includes two steps.
First, in order to process the network information, we apply the breadth first search algorithm (BFS) [33] to construct a spanning tree that supporting the communication in the pump intelligent node network. For details of BFS algorithm, see Appendix A.1.
Second, based on the tree, we randomly sample the speed ratios. All the nodes coordinate with each other, carry out parallel calculations to optimize the speed ratio of each node so that the total energy consumption is minimized. Before introducing the algorithm in detail, we make an assumption as follows: Assumption 1. In our distributed pump control system, every pump is an intelligent node equipped with a controller. The pump model and an identical computing program have been stored in the node (controller) for the pump. The node can communicate with neighbors and do calculation. The network of the pump intelligent nodes forms a connected graph.
With this assumption, if node i and node j are not neighbors, there is at least one path between them.  Figure 3. The message processing of the variables among intelligent nodes. Figure 2 gives an example of constructing a BFS tree for a network with 6 nodes (controllers for 6 pumps connected in parallel). From the root node 1, the search message indicated by red links gradually spreads to leaf nodes. Based on the BFS tree, every node performs an algorithm enabling coordinations with its neighbors.
Our algorithm is formally defined as Algorithm 1. Algorithm 1 uses the BFS tree generated by BFS algorithm defined in A.1 as input and calls the Algorithm defined in A.2 to do the message processing. A message processing example is shown in Figure 3 based on the BFS tree given in Figure 2. The messaging mechanism between nodes can be described as follows. Every node has six input message queues. Each message queue records the message. Once the message is read, it will be deleted from the queue. The communication between nodes is synchronous. During the k-th round, each node sends messages to its neighors and read from its input message queues. As a result, the messages of all child nodes are collected.

Preprints (www.preprints.org) | NOT PEER-REVIEWED | Posted: 7 July 2020
Peer-reviewed version available at Energies 2020, 13, 3927; doi:10.3390/en13153927 Below is a description of the main procedure in Algorithm 1. Every node obtains its node type in the BFS tree (as root node, intermediate node, or leaf node). Then every node initializes its pump performance parameters, the range of speed ratio, the sample adjustment parameter τ, the child nodes set N i and the total iteration parameter K.
Every leaf node generates independently speed ratio samples following the uniform distribution Algorithm 1: Breadth first search Random Sampling algorithm (BRS) ,i , the total flow rate Q 0 , the head H 0 , sample adjustment parameter τ, the child nodes set N i , the range of speed ratio ω − and K ; Output: every intelligent node's optimal estimation of speed ratio ω * i ; 1 if node is leaf node or intermediate node then 2 Initialize 6 Use Equations (6)(7)(8) and H 0 to compute Q i,k , P i,k ; Send end instruction and ω * k to child nodes ; 14 Goto final ; 15 if node is root node then 16 Initialize Use Equations (6)(7) (8) and Send end instruction and ω * k to child nodes ; 26 Goto final ; 27 final ; 28 return its speed ratio ω * i ; over the interval [ω − − τ, 1] with ω i,k as the k-th sample of node i. If the speed ratio sample ω i,k ≥ ω − , it will evaluate corresponding Q i,k , P i,k . If not, the node will set the sample to 0, which means the pump will be shut down. Then the node will transmit the Q T,i,k , P T,i,k , ω T,i,k to its parent node. If it does not receive end instruction, the leaf node will continue to do the above operation. When the leaf node receives end instruction from the parent, it will stop generating samples, and acquire its optimal speed ratio. The intermediate node performs the same operation that generates samples. The difference is that the intermediate node will calculate the partial summation flow rate Q T,i,k and the partial summation power consumption P T,i,k over the subtree of node i basing on the Q T,j,k j , P T,j,k j provided by its child nodes N i . The Q T,j,k j , P T,j,k j is read from the input message queue. Next, if the partial summation flow rate Q T,i,k ≤ Q 0 , the intermediate node will transmit Q T,i,k , P T,i,k , ω T,i,k to its parent node. If not, the node will delete the Q T,i,k , P T,i,k , ω T,i,k . As for the root node, it will compute its Q i,k through the total flow rate Q 0 and the Q T,j,k j provided by its child nodes. This operation makes sure that the constraint is satisfied. In view of the Q i , the root node utilizes the Equations (6)(7)(8) and H 0 to compute ω i,k . When ω i,k satisfies the speed ratio range constraint, it will calculate the total energy consumption P T,i,k . P * k is the currently optimal total energy consumption after k rounds selection of speed ratio samples. ω * k denotes the optimal estimation combination of speed ratio samples in the k-th round for the root node. In addition, if P T,i,k ≤ P * k , the root node will update P * k and ω * k to save the currently optimal estimation combination of speed ratios for the whole network. By doing so, after K rounds the root node supposes that the best combination of speed ratios is achieved, and therefore ends the entire algorithm and sends the best combination of speed ratios ω * k to child nodes. Once the node receives the end message and ω * k , it will stop calculation and send them to child nodes. From the steps of Algorithm 1, we can observe that BRS algorithm makes sure the solution exactly meets the demand (the total flow rate constraint). Every node maintains its own speed ratio ω * i . The whole adjustment is an iterative optimization process with the cooperation of each node. Constraints are satisfied in the entire iteration process. Besides, it has the flexibility due to the distributed control structure. We will prove that the total energy consumption can be minimized.

Theoretical analysis of the proposed algorithm
We carry out a theoretical analysis of the convergence for the proposed BRS algorithm. According to the definition of the algorithm, the sample process at node i (for pump i) of speed ratio can be viewed as an i.i.d. stochastic process {ω i,k , k = 1, 2, ...} where ω i,k is the k-th sample of the speed ratio of pump i. The speed ratio sample of pump i follows the uniform distribution with τ > 0 as a given parameter such that ω − > τ.
It is trivial that the optimal value of PSROP' is the same as that of PSROP since both objective functions and constraints are the same when we re-order the speed ratios. Below, in order to present our analysis, we define the optimal pump speed ratios according to node types of the spanning tree T as follows Similarly, we denote as the combination list of decision variables for PSROP' problem and as the speed ratios of the m pumps output by our BRS algorithm after K rounds to emphasis the role of node type on the tree T. We note that due to the equality constraint Equation (16), the optimal speed ratio ω * r of the root node r can be written as a function of speed ratios of other nodes. In fact, we have (due to the monotone property of flow rate function by Assumption 2) Similarly, we have according to the step in Line 20 of Algorithm 1 running at the root node.
where ω * T,K = [ ω * i,K , i ∈ L ∪ I ∪ {r}] are speed ratios output by the algorithm after K rounds.
Since the optimal solution is feasible, we have For a given ε 1 > 0 and corresponding δ r (ε 1 ), we choose ε 2 in Equations (28) and (29) such that or equivalently For (ω i , i ∈ L ∪ I) satisfying ∩ i∈L∪I B i , we have From the monotone property of Q −1 r (based on the monotone property of flow rate function by Assumption 2), we also have From Equation (29) and Due to Equation (27), for ω r in Equation (33) we have In sum, we have For given ε > 0, we can choose ε 1 such that For nodes i ∈ L ∪ I, define A i,k as the event that the kth sample ω i,k generated at node i belongs to the interval B i defined in Equation (27) with the understanding that B i = {0} if ω i,k = 0 (corresponding to the case u i,k ∈ [ω − − τ, ω − ). According to the algorithm design, we have if Q i (ω * i ) = 0, it means the pump will be shut down. Since the samples generated at different nodes in L ∪ I are independent, we have Preprints (www.preprints.org) | NOT PEER-REVIEWED | Posted: 7 July 2020 where d is a constant no large than τ and (ω + i − ω * i ) for nodes i ∈ L ∪ I such that Q i (ω * i ) > 0. From Equation (32), we know that if ω i,k ∈ B i , ∀i ∈ L ∪ I, it is true that forms a feasible solution with total energy consumption as From the selection of ω * T,k as the feasible solution with the lowest total energy consumption for the first k-th rounds, we have From the optimality of ω * and Equation (40), we have The theorem is proved.
As a result, BRS algorithm can not only exactly meet the constraints and have great flexibility but also has the guarantee of convergence. By applying BRS algorithm, the solution ω * T,k converges to the optimal speed ratio ω * in probability. Hence, under Assumption 1, BRS algorithm is easy to realize and can converge to the optimal solution. Remark: In reality, we cannot judge whether Assumption 3 holds in advance. To make sure the convergence to the global true optimal solution, we can run the algorithm with each node as the root node in turn and compare the final results.

Results and discussion
In this section, we will verify the properties of the proposed BRS algorithm including the demand satisfaction, minimum energy consumption, the flexibility in adapting to changing topology of pump systems and low-cost hardware test. We compare BRS with other methods in demand satisfaction and energy consumption. This section is organized as follows: First, we introduce the study cases, the simulation environment and compared algorithms. Second, we study the violation of constraint satisfaction among BRS and the compared algorithms. Third, we compare the performance among BRS and other algorithms. Then, we study the flexibility of BRS under a different number of intelligent nodes. Finally, we test BRS based on low-cost hardware.

Set up of study cases
We adopt the performance parameters of pumps which are introduced in paper [34]. Table 2 shows the specific parameters and performance curves of these pumps are presented in Figure 4. The parameters are collected from the RXL type pumps.

Preprints (www.preprints.org) | NOT PEER-REVIEWED | Posted: 7 July 2020
Peer-reviewed version available at Energies 2020, 13, 3927; doi:10.3390/en13153927   Here, we establish an HVAC system including 6 pumps in parallel. 4 of pumps are PUMP-A (big pump) and 2 of pumps are PUMP-B (small pump). We adopt four different total flow rate and head demand cases in an HVAC system which represent the typical stable working conditions during a period of time as shown in Table 3. These cases are from light to heavy. In order to investigate a method in depth, the optimal working positions for parallel pumps are different under these four cases.

Software simulation environment
The software simulation environment is as follows: The centralized algorithms SC, SLSQP and GA are built with Python to carry out the simulation. We employ the distributed simulation platform (DSP) 1 to investigate the performance of both BRS and TA. The operating environment is Win10x64, Intel (R) Core (TM) i7-7700 @3.60GHz, DSP1.0, and computer memory is 8 GB. Based on the DSP, we can simulate a distributed pump system to test BRS and TA algorithms under different HVAC system demand. DSP can generate different kinds of topologies for intelligent nodes. TA is designed under controllers connected in the chain topology and relaxes the constraint. If the topology changes, TA cannot obtain the violation of constraints. All nodes are connected one by one for distributed methods 1 DSP is a simulation engine written in python that can simulate distributed algorithms synchronous all nodes through UDP communication.
in Section 6.4. In Section 6.6, we adopt a tree topology. The population size and iterations are the same for GA and BRS.

Algorithms to compare
The compared algorithms include centralized algorithms and distributed algorithm. We pick up three typical centralized algorithms including sequence control strategy (SC) [12], sequential least squares programming algorithm (SLSQP) [25] and genetic algorithm (GA) [23]. The distributed transfer algorithm (TA) was proposed in [26]. These algorithms are selected based on previous literature review. They are well represented characteristics of four class methods and show good performance. The details of these algorithms can refer to the related literatures. Table 4 presents the calculation results for five algorithms listed in Section 6.3 and for four cases listed in Section 6.1. ∆ represents the violation of constraint (11), which means that ∆ = ∑ Q i − Q 0 . The total flow rate exceeds the actual demand if ∆ is positive. The total flow rate is less than the actual demand if ∆ is negative. From Table 4, ∆ related to BRS and SC are all 0 in the four cases and there are no violations to meet the constraint. As can be seen, ∆ for other three algorithms are positive or negative.

The violation of constraint satisfaction
The reason for the performance difference among algorithms in constraint satisfaction for pump systems is that their principles are different. Our BRS algorithm and SC deal with the equality constraint directly. BRS algorithm uses the advantage of population sampling and the equality constraint to find feasible solutions. SC adopts the PID feedback control to eliminate the deviation and meet the constraint. The other three methods relax the equality constraint and adopt the penalty function. They cannot meet the constraint. Regardless of cases, ∆ is distributed randomly.
Experimental results prove that most methods have some violations to meet the demand. Furthermore, data comparison of ∆ confirms that our BRS algorithm can exactly satisfy the demand constraints, which is difficult to most methods.   Table 4 summarizes the total energy consumption P * for five algorithms listed in Section 6.3 and for four cases listed in Section 6.1. The bold value of P * in each cases is the minimum energy consumption. When comparing P * of BRS to that of SC in the four cases, it is clear that the energy consumption of BRS is the minimum to exactly meet the demand constraint. Comparing P * among BRS and other three algorithms in the four cases, the energy consumption of BRS is the minimum in Case 2 and Case 4. The energy consumption of SLSQP is slightly lower than BRS in Case 1 and Case 3. The reason is that the solutions of SLSQP are not feasible and the total flow rate is less than the actual demand. Due to providing less flow rate, the energy consumption of SLSQP is minimum. The differences of P * between SLSQP and BRS are 0.001 and 0.005 in Case 1 and Case 3. Table 4 shows that SC can satisfy the demand constraint. But SC does not optimize the energy consumption and pumps work in the non-optimal points. As a result, SC consumes much more energy.
According to these findings, due to lacking the guarantee of convergence, these methods cannot work optimally in most cases. Our BRS algorithm makes sure to satisfy the demand and minimize the energy consumption of pumps. It consumes less energy in the four cases and verifies the guarantee of convergence.
From Table 4, it can be observed that there are different combinations of pumps for type PUMP-A and type PUMP-B in the four proposed cases. In Case 1, we can choose the first option to open two PUMP-A, the second option to open one PUMP-A and two PUMP-B or the third option to open one PUMP-A and one PUMP-B. BRS algorithm makes sure to satisfy the demand and have a minimum energy consumption. The combination of pumps with BRS is supposed to be optimal. Table 4 shows that only BRS and SC can exactly meet the demand constraints. SC is wildly used in practical engineering. In order to show the energy saving potential between two algorithms, we define the energy saving rate ξ P as follows. Where P SC i is the energy consumption of pump i under SC. P BRS i is the energy consumption of pump i under BRS.  Table 5 summarizes the energy save rate of pumps in the four cases under different algorithms, clearly showing that BRS is more energy efficient than SC. During the four work cases, the maximum energy saving of BRS is about 29.92%, which indicates that BRS can save more energy in practical engineering. This energy saving ability reflects that BRS has a great ability to find good enough solutions.
The theoretical analysis shows that the speed of convergence for BRS algorithm is exponential with the K increasing. The iteration process of P * in Figure 5 shows that BRS algorithm may obtain a good enough solution in the first 20 iterations. While the demand changes, it almost has little influence on the speed to find a solution. Besides, the running time of BRS under the four cases is within 3 seconds. Compared with the period of demand changing, BRS running time is quite small. These analysis further presents that BRS algorithm has the guarantee of convergence and is more fit to practical engineering.

Test of flexibility
The testing scenario is as follows: First, all nodes work well as shown in Figure 6 (a). Then, Node 4 PUMP-A breaks down or is in maintenance as shown in Figure 6 (b). Next, Node 4 is repaired as shown in Figure 6 (c). The total flow rate and head demand on the main pipe is Case 3 listed in Section 6.1.  Figure 7 shows the iteration process of BRS under different number of nodes corresponding to the ones in Figure 6. From Figure 7, P * tends to converge to the optimal points. When all pumps work well as shown in Figure 6 (a)(c), P * converges to the same optimal point. As expected, the number of nodes changing does not hinder the capacity of our algorithm to cooperate with neighbors and perform the on-line optimization. BRS algorithm does not need to stop the whole pump system and the pump is plug-and-play. In contrast, the centralized control methods need to explicitly reformulate the problem to be solved manually and hard to automate in practice.
These experiments validate that our BRS algorithm can adapt to the system dynamic changing by reallocating the flow rates in an on-line fashion.

Hardware test of BRS
Furthermore, we developed a distributed low-cost hardware platform to test the algorithm performance. The hardware platform is based on Raspberry Pi3, Model B, 1GB RAM. Every Raspberry Pi3 represents an intelligent node and has the wireless and Ethernet communication interface. It can connect with neighbor nodes through wireless communication interface. Every node stores the pump model and simulates a smart pump. Figure 8 presents the topology of the pump nodes. The total flow rate and head demand on the main pipe is Case 3 listed in Section 6.1.   Figure 9 shows the iteration process of BRS algorithm on the hardware platform. BRS algorithm can converge to the optimal point in the first few iterations, which clearly shows that BRS algorithm can perform on Raspberry Pi3-based low-cost hardware platform. The whole hardware system is fully distributed and there are not any central monitoring hosts. When the number of pumps increases, traditional centralized methods need a high-cost computing platform to perform the centralized optimization. As a result, BRS algorithm can reduce the system cost.

Conclusions
The distributed optimization problem with parallel-connected pumps is studied in this paper. We propose a distributed optimal control algorithm BRS for on-off status and flow rates of parallel-connected pumps in HVAC systems. The proposed BRS algorithm consists of two parts: First, in order to process the network information, we apply the breadth first search algorithm to construct a tree for exchanging messages. Second, all nodes coordinate with each other and randomly sample the speed ratios. The intelligent nodes communicate with their neighboring nodes and run collaboratively to perform the proposed distributed approach. Compared with existing methods, the solutions of our BRS algorithm meet the total flow rate demand without any deviations and achieve the minimum pump energy consumption. BRS algorithm has the convergence guarantee and shows the great flexibility in adapting to the system dynamic changing.
The methodology and its advantages are demonstrated through a numerical example. Besides, we show that the BRS algorithm works on low-cost hardware. As a future work, we will try to extend the algorithm to asynchronous networks. If the condition is allowed, we will test BRS algorithm in practical systems. a P1,i , a P2,i , a P3,i , b P1,i , b P2,i , b P3,i pump performance parameters H i head of pump i (m) H 0 total head demand (m) m total number of pumps n i actual speed of pump i n 0,i rated speed of pump i N i set of child nodes of node i P * k optimal estimation of total power consumption after the k-th sample P i power consumption of pump i P T,i,k partial summation power consumption over subtree of node i Q T,i,k partial summation flow rate over subtree of node i Q i flow rate of pump i (L/s) Q 0 total flow rate demand (L/s) R T,i,δ combination of node's optimal speed ratio neighborhood over the subtree of node i Greek letters