Irrigation Canal System Delivery Scheduling Based on a Particle Swarm Optimization Algorithm

Reasonable planning of water delivery schedules for canal systems can reduce losses caused by water seepage and improve the utilization efficiency of irrigation water. Empirical methods of water delivery scheduling for canal systems usually cause problems such as insufficient discharge, excessively delayed water delivery, and large losses under given water requirements. In this study, a canal water delivery scheduling model was set up, and a customized algorithm based on particle swarm optimization was proposed. Typical heuristic algorithms often become trapped in local optima and often search inefficiently under numerous constraints; however, the proposed algorithm can overcome these typical problems. The proposed method was evaluated for two typical canal irrigation systems, and the results showed that the algorithm is robust and efficient and can quickly meet the water delivery optimization schedules for canal irrigation systems. Compared with empirical methods, the algorithm reduced the leakage loss of delivered water from 7.29% to 5.40%, and 8.97% to 7.46% for the two tested canal systems. The discharge of the main canal is relatively stable, which can reduce the difficulty of head gate adjustment. The proposed optimization algorithm can provide practical and efficient water delivery schedules for irrigation canal systems.


Introduction
The global population is expected to reach 9.7 billion in 2050 and 11.2 billion by 2100 [1], thus water resource efficiency urgently needs to be solved [2].Considering the perspective of water sustainable development, "Water Footprint" and "Virtual Water" have become core concepts and fundamental issues in recent years [3,4].Reasonable water resources allocation is essential to produce greater benefits to meet the food requirements of humankind [5].The efficient utilization of irrigation water is paramount for food security [6,7] and it will remain important as its share in world food production will rise from the current level of 40% to more than 45% by 2030 [8].Scientific management of irrigation systems is necessary for maximal water usage efficiency.Since 1999, numerous field studies have investigated irrigation system optimization operations.Barnes and Wardlaw [9] evaluated the potential of a quadratic programming (QP) optimization approach for improving real-time irrigation water management in systems with complex distribution networks.Li et al. [10] developed a robust multistage interval-stochastic programming (RISP) method and applied it to the planning of regional water management systems.Various two-stage decomposition approaches based on stochastic dynamic programming (SDP) were used for seasonal multi-crop irrigation water allocation and optimal stochastic intra-seasonal irrigation scheduling [11][12][13][14][15][16].Yang et al. [17] developed and used optimization models for the management of water resources for sustainable irrigated agriculture.Reca et al. [18] proposed an optimization model based on an economic efficiency criterion to plan water allocation in agricultural systems with complex water deficits.A linear programming model was developed for allocating land and water resources to maximize net annual returns from a command area located in the Jhajjar district of Haryana, India [19].These models were able to provide scientific guidance for irrigation system management strategies.However, these models usually require precise values for various parameters that are difficult to measure precisely in actual irrigation system management; furthermore, these models seldom consider farmers' autonomy [20].Therefore, some gaps still exist in actual irrigation applications.
Practical irrigation system management requires highly simple and robust models; thus, numerous studies of canal water delivery have proposed simplified optimization models and algorithms.Suryavanshi and Reddy [21] applied integer linear programming to propose possibilities for water delivery scheduling for small canal systems in which eight sub-canals discharged equal quantities of water.Wang et al. [22] improved that integer linear programming method to provide a constant flow rate in a small canal system, with 13 sub-canals and an irrigated area of more than 700 ha; the method reduced the frequency of the head gate operation.Anwar and Clarke [23] adopted a flexible mixed-integer program that allowed users to specify start times in irrigation periods for a canal irrigation system with equal sub-canal discharge.Monem and Namdarian [24] proposed a simulated annealing (SA) method for water distribution in irrigation canals, and the result proved that SA could optimize several objectives, such as maintaining a main canal delivery near its capacity, reducing adjustments to a main canal, and maintaining branch canal delivery close to a required limit.
All of the aforementioned studies assumed equal canal discharge designs, which are difficult to adapt to the management of most canal systems.Reddy et al. [25] developed an interactive computer program named ZERO1 to derive an optimal rotational schedule for systems with unequal sub-canal discharge levels.The objective was to maintain the main canal water discharge close to the branch canal discharge.During the optimization process, sub-canal delivery water is set to its designed level of discharge.This was tested for the Xile Submain canal system of the Hetao irrigation district, successfully improving the operational efficiency of that water distribution system.Wardlaw and Bhaktikul [26] improved the model by Reddy et al. [25] with a genetic algorithm (GA) and proved that this GA was efficient relative to linear programming approaches.Mathur et al. [27] further improved on the studies of Reddy et al. [25] and Wardlaw and Bhaktikul [26] by adopting the condition that the sub-canals require different time intervals.However, existing studies have not considered the water losses of canals, the delivery discharges of branch canals relative to designed discharges, and the robustness and reliability of algorithms for long water delivery periods.
A number of heuristic algorithm methods, such as the genetic algorithm (GA) [26,28], simulated annealing (SA) [24,29], ant colony optimization (ACO) [30], etc., provide advantageous solutions to solve the complex optimization problems of irrigation management.PSO is an efficient method with few parameters to adjust for solving large, complex nonlinear global optimization problems [31,32].In some cases, PSO performs more efficiently than other heuristic computation techniques [33].PSO has been successfully applied to various pure and applied research areas [34][35][36][37][38].However, few researches about PSO have been utilized in water management or irrigation systems [39].Reddy and Kumar [40] applied elitist-mutation PSO (EMPSO) to optimize an operational model for a short-term reservoir operation for the irrigation of multiple crops.Rezaei et al. [41] presented fuzzy Multi-Objective Particle Swarm Optimization (f-MOPSO) to improve conjunctive surface water and groundwater management.Although they proposed some novel PSO algorithms to improve the accuracy of optimization results, the robustness and stability of PSO in an actual irrigation system and water management were not addressed.
The present research explains how to configure an optimal canal water delivery scheduling model with PSO to overcome the drawbacks that plague most current heuristic algorithms.Notably, the proposed PSO does not fall into local optima solutions; the proposed PSO does not perform with a low search efficiency under typical constraints.Two typical canal irrigation systems were used to assess the efficiency and robustness of the model and the algorithm.This study provides a new practical tool for the optimization of irrigation canal water delivery scheduling.

Mathematical Model of Canal System Operation Scheduling Optimization
Under general conditions, most irrigation canal systems can be simplified into the layout chart depicted in Figure 1.The water flows from the headwork to N branch canals (the second level canals) through the main canal (the first level canal).
Water 2018, 10, x FOR PEER REVIEW 3 of 13 the proposed PSO does not fall into local optima solutions; the proposed PSO does not perform with a low search efficiency under typical constraints.Two typical canal irrigation systems were used to assess the efficiency and robustness of the model and the algorithm.This study provides a new practical tool for the optimization of irrigation canal water delivery scheduling.

Mathematical Model of Canal System Operation Scheduling Optimization
Under general conditions, most irrigation canal systems can be simplified into the layout chart depicted in Figure 1.The water flows from the headwork to N branch canals (the second level canals) through the main canal (the first level canal).The second level canals (regard as branch canals) The second level canals (regard as branch canals) The water distribution process requires that all branch canals should meet the following requirements: the actual water delivery must meet the requirements of different branch canals; the water delivery time may change within the specified delivery period T; and the main and branch canal water must discharge between 0.6 and 1.0 times the designed discharge.These three requirements guarantee that the water distribution requirements can be met and that flooding of the canal can be prevented.When the actual delivery discharge is close to the water delivery capacity of the canal, the amount of water lost is small.
The objective function is to minimize the total amount of water loss in the main and branch canals in all water delivery periods (T).
( , , , , ) where Wl is the total amount of water loss (m 3 ) of the main canal Wml and the branch canal Wbl in the entire irrigation process; qm and qj are the discharges (m 3 /s) of the main and branch canals, respectively; Am and Abj are water permeability coefficients and mm and mbj are indexes of the main and branch canals, respectively; and lm and lbj are the valid water delivery lengths (km) and tm and tbj are water delivery times (s) of the main and branch canals, respectively.The water distribution process requires that all branch canals should meet the following requirements: the actual water delivery must meet the requirements of different branch canals; the water delivery time may change within the specified delivery period T; and the main and branch canal water must discharge between 0.6 and 1.0 times the designed discharge.These three requirements guarantee that the water distribution requirements can be met and that flooding of the canal can be prevented.When the actual delivery discharge is close to the water delivery capacity of the canal, the amount of water lost is small.
The objective function is to minimize the total amount of water loss in the main and branch canals in all water delivery periods (T). min where W l is the total amount of water loss (m 3 ) of the main canal W ml and the branch canal W bl in the entire irrigation process; q m and q j are the discharges (m 3 /s) of the main and branch canals, respectively; A m and A bj are water permeability coefficients and m m and m bj are indexes of the main and branch canals, respectively; and l m and l bj are the valid water delivery lengths (km) and t m and t bj are water delivery times (s) of the main and branch canals, respectively.The theoretical equations of calculating the canal leakage are typically difficult in practical applications due to incomplete required data.Some empirical formulas could calculate leakage conveniently via the main influencing factors.The Kostiakov formula [42], which has been popularly used in the calculation of canal water loss in the process of water delivery, was selected in this study (shown by Equation ( 4)).The whole leakage loss in different canals can be calculated by Equation (5).
where S is the leakage loss in unit length and unit time (m 3 /s/km); A and m are the water permeability coefficient and index of main or branch canals, respectively, which depend on the soil of the canal bed, canal lining, depth of groundwater, and other factors; q is the discharge (m 3 /s); l is the valid length of canals (km); and t is the duration of water delivery (s).
The constraint conditions of the model mainly include the following: Branch canal discharge constraint: the discharge of any branch canal (q j ) is α times its designed discharge, where α ranges from 0.6 to 1.0.
Water delivery time constraint: the start time (t js ) and end time (t je ) of water delivery in the branch canal j must be within the delivery period (T).
t j = t je − t js (10) where t j is the duration of water delivery of the branch canal j and T is the whole water delivery time.
Water requirement constraint: the water delivery amount of any branch canal must be equal to its requirement: where W j is the water requirement amount of the branch canal j.
Water balance constraint: For simplicity of analysis, the whole water delivery time T is divided by a fixed time interval i, such as 6 or 12 h.The discharge of the main canal in any time interval i must be equal to the sum of the delivery discharges of the branch canals in that time interval, which is expressed as follows: where q mi is the delivery discharge of the main canal at time interval i; i is the time interval number; j is the branch canal number; N is the number of branch canals.x ij is defined by Equation ( 13): when the jth branch canal delivers water in the ith time interval, x ij = 1; and otherwise, x ij = 0. t i is the time corresponding to the ith interval.
Main canal discharge constraint: at any time, the delivery discharge of the main canal must be close to its designed discharge and less than or equal to its maximum allowable discharge (generally 1.0 times the designed discharge).Additionally, the delivery discharge of the main canal should be more than 0.6 times the designed discharge to ensure the stability of delivery discharge throughout the whole irrigation period.
where q md is the designed discharge of the main canal.

The PSO Algorithm
Particle swarm optimization (PSO) is a heuristic algorithm derived from the study of bird foraging behavior [33].Each particle, which represents a candidate solution within a multidimensional search space, adjusted its position based on its own flying experience and the flying experiences of all companions.PSO searches for the best solution for each individual and for the global population during each iteration, so that each particle can update its information in the context of its own previous best position and of the best global position.PSO has been widely used in many fields, including engineering optimization and image processing, due to its advantages of a simpler structure and faster convergence.
In PSO, each particle, P i , has two features: position X i (decision variables) and velocity V i .Each particle updates itself during the iteration by tracking two extremes: the current optimal position found by the particle (P best ) and the current best position found by the global population (G best ).The conditions for terminating the loop are either reaching the maximum allowed generation or achieving a designated fitness level.The PSO can be updated by: where w < 1 is the inertial weight; c 1 and c 2 are learning factors; and r 1 and r 2 are random numbers uniformly distributed in [0, 1].

Coding Design
It is difficult to solve a canal system model by conventional methods.To obtain the globally optimal solution of this mathematical problem, PSO was used in this study.For a certain irrigation canal system, the length (L m , L b ), designed discharge (q md , q bd ), and leakage loss parameters (A, m) of the main and branch canals have been determined.The constraints include specific water delivery requirements for each branch canal.The problem of optimization of delivery scheduling for irrigation canal water systems is to determine the decision variables, namely start time, water delivery duration, end time, and delivery discharge of each branch canal.
Because multiple relationships exist between these decision variables, this study used α j , the ratio of the water delivery discharge of the branch canal to its designed discharge, and t je , the end time of water delivery, as decision variables for coding.The duration of water delivery of branch canals j (t j ) can be obtained by dividing its demanded water amount by the water delivery discharge, and then t js can be deduced from Equation (10).Optimization of α j can be used to satisfy the constraints of Equations ( 6) and (7).Optimization of t je can satisfy the constraints of Equations ( 9) and (10).Using the aforementioned methods to satisfy the constraints can greatly improve the probability, as well as the efficiency, of finding feasible solutions.

Fitness Function Design
The constraints described in Equations ( 14) and ( 15) are very complicated, especially when the irrigation time is long and when the feasible domain of the problem is small.The key to the problem is how to reflect these constraints in the fitness function.If the fitness function reflects the constraints, the algorithm automatically converges from the infeasible domain to the feasible domain.After analyzing Equations ( 14) and (15), in the context of the objective function and dimensional uniformity, the fitness function was designed as follows: where F fit is the fitness function; W ml is the amount of main canal water loss (m 3 ); W bl is the amount of branch canal water loss (m 3 ); W is the total amount of water delivery (m 3 ) within the whole irrigation time T; and p i is the penalty function.
The part (W ml + W bl )/W in Equation ( 18) mainly reflect the requirements of the objective function; the sub-formula q md ] reflects Equation ( 14), the constraint regarding main canal discharge, which means the discharge of the main canal must be close to its designed discharge at any time; and p i reflects Equation (15), which means the delivery discharge of the main canal must be as close as possible to its designed discharge at any time.To guarantee unified dimensions with p i , the part (q md − N ∑ j=1 q j • x ij ) 2 /q md are designed to reflect Equation ( 18).
In the context of realistic physical mechanisms, Equation ( 8) is a rigid constraint and must be satisfied.
F f it = 0, if t je < 0 (j = 1, 2, . . ., N) Equation ( 18) was used as a fitness function to manage the main canal discharge constraint condition in all irrigation times.This fitness function can significantly reduce the probability of the algorithm's optimization solution entering an infeasible region, can cause the algorithm to converge to the minimally feasible region at the initial stage of optimization, can improve the algorithm's solution speed, and can ensure the stability of the calculation results.The flowchart of the program is depicted in Figure 2.

Project Cases
Two typical canal irrigation systems were used to evaluate the performance of the model.The first system is branch canal No. 11 of the north canal in the Fengjiashan irrigation district, Shaanxi Province, China.Branch canal No. 11 can be regarded as the main canal with a designed discharge of 1.2 m 3 /s; it delivers water to 24 lateral canals that can be regarded as second-level canals with designed discharge values ranging from 0.03 to 0.18 m 3 /s.The soil texture in the canal beds is silt loam; the canals are lined with concrete; and the permeability parameters A and m are 0.86 and 0.4, respectively.The length and discharge values of different canals are listed in Table 1.Data regarding the practical process of water delivery in one irrigation period in the spring of 2015 were collected and are presented in Table 1 and Figure 3 (a1,a2).
The second canal system is the west main canal in the Shitouhe river irrigation district, Shaanxi Province, China.The west main canal can be regarded as the main canal, and its designed discharge is 2.5 m 3 /s.It delivers water to 14 branch or lateral canals that can be regarded as second-level canals with designed discharge values ranging from 0.15 to 1.04 m 3 /s.The soil texture in the canal beds is sandy loam; the canals are lined with concrete; and the permeability parameters A and m are 1.19 and 0.45, respectively.The length and discharge values of different canals are listed in Table 1.Data regarding the practical process of water delivery in one irrigation period in the spring of 2015 were collected and are presented in Table 1 and Figure 3 (a3,a4).

Project Cases
Two typical canal irrigation systems were used to evaluate the performance of the model.The first system is branch canal No. 11 of the north canal in the Fengjiashan irrigation district, Shaanxi Province, China.Branch canal No. 11 can be regarded as the main canal with a designed discharge of 1.2 m 3 /s; it delivers water to 24 lateral canals that can be regarded as second-level canals with designed discharge values ranging from 0.03 to 0.18 m 3 /s.The soil texture in the canal beds is silt loam; the canals are lined with concrete; and the permeability parameters A and m are 0.86 and 0.4, respectively.The length and discharge values of different canals are listed in Table 1.Data regarding the practical process of water delivery in one irrigation period in the spring of 2015 were collected and are presented in Table 1 and Figure 3(a1,a2).
The second canal system is the west main canal in the Shitouhe river irrigation district, Shaanxi Province, China.The west main canal can be regarded as the main canal, and its designed discharge is 2.5 m 3 /s.It delivers water to 14 branch or lateral canals that can be regarded as second-level canals with designed discharge values ranging from 0.15 to 1.04 m 3 /s.The soil texture in the canal beds is sandy loam; the canals are lined with concrete; and the permeability parameters A and m are 1.19 and 0.45, respectively.The length and discharge values of different canals are listed in Table 1.Data regarding the practical process of water delivery in one irrigation period in the spring of 2015 were collected and are presented in Table 1 and Figure 3(a3,a4).Note: j is the number of second-level canals, j = 1, 2, . . ., N (in the Fengjiashan irrigation canal system, N = 24, in the Shitouhe irrigation canal system, N = 14); q b is the designed discharge; L m is the distance between the second-level canal j and the headwork; L j is the length of the second-level canal j; W j is the amount of required water.

Results from the PSO Algorithm and Comparison
A method based on the PSO algorithm was used to repeatedly perform 15 calculations on actual irrigation processes of the two irrigation canal systems.The PSO population size (PopSize) was 500; the maximum number of iterations was 200; w was 0.7; and c 1 and c 2 were both 2.0.The approximate operation time for one iteration was 20 s on an Intel ® core i5 CPU.To reflect actual water delivery needs, the water delivery interval was set to 12 h for the Fengjiashan irrigation system and was set to 6 h for the Shitouhe irrigation system.The optimization results and the actual delivery processes are displayed in Table 2 and Figure 3 (for brevity, Figure 3 reveals the actual and typical optimization and delivery schedule).
Table 2 proves that the optimization results of water delivery processes in canal systems are not always the same due to the random search mechanism of the PSO algorithm.When the conventional method was replaced with PSO, the water delivery time interval (T max ) was reduced from 33 to 22 in the first system and from 38 to 24 in the second system; the water delivery time was reduced from 396 to 264 h and from 228 to 144 h; and the PSO-planned leakage losses relative to the canal water requirements were close to 5.40% and 7.46% for the two systems.By contrast, the conventional plan had losses of 7.29% and 8.97% of actual delivered water (see row "R 1 " in Table 2).This proved that the optimal delivery schedule can improve the water efficiency of canal irrigation systems.
A total of 15 repetitions data results simulated by PSO, applied for branch canal No. 11 of the north canal in the Fengjiashan irrigation district, were further analyzed.The mean discharge ratios to the designed discharge in the branch canal system (α) ranged from 0.878 to 1.000, whereas the actual delivery was 0.595, which means the optimized delivery discharge was close to the designed discharge.The PSO schedule was appropriate to the branch canal capacity for the main canal system.Most of the ratios of delivery discharge to designed discharge (R 3 ) were smaller than 1.Ratios in individual delivery intervals (n ex ) were seldom larger than 1; the largest ratio value was 1.079, which is acceptable for the main canal capacity and safe for canal water delivery [43].The mean ratio values of the main canal delivery discharge to the designed discharge at all irrigation times (R 2 ) ranged from 0.833 to 0.952, which means the delivery discharge was close to capacity.Note: T max is the maximum water delivery interval; R 1 is the ratio of leakage loss to the water requirement in the whole canal system (%); α is the percent of the average value of the second-level canal delivery discharge to its designed discharge; R 2 is the ratio of the first-level canal delivery discharge to its designed discharge in all irrigation periods; n ex is the number of time intervals when the delivery discharge of the first-level canal exceeds its designed discharge in all irrigation periods; R 3 is the ratio of the maximum delivery discharge of the first-level canal to its designed discharge in all irrigation periods; Considering the actual water delivery needs, 12 h was considered as the water delivery interval for the Fengjiashan irrigation system and 6 h for the Shitouhe irrigation system.Figure 3 compares a typical optimized delivery process with actual processes for two irrigation canal systems.The water discharges of the main canals in the actual delivery process are usually somewhat smaller than the designed discharges; the discharge fluctuations are larger; and canal water delivery times are long, which causes difficulties for canal management.Water discharges of main canals in optimization delivery processes are usually close to the designed discharges; the water discharge process is relatively even at all irrigation times; water delivery times are relatively short, which can facilitate canal management.The system of the west main canal in the Shitouhe river irrigation district also exhibits similar results.All these results prove that the proposed optimization algorithm can provide practical and efficient water delivery schedules for irrigation canal systems.

Conclusions
A mathematical model of delivery scheduling for canal water systems was proposed; this model has numerous constraints.Because it is very difficult to solve this model by a traditional optimization algorithm, an optimization algorithm based on PSO was proposed and evaluated with two typical canal irrigation systems in China.The results prove that the proposed algorithm can overcome the shortcomings of typical heuristic algorithms, such as entrapment by local optima and a low search efficiency.The proposed algorithm rapidly obtains the global optimal solution of the model and delivers optimized irrigation canal water delivery plans.The results for the two studied irrigation systems prove that the discharge of the main canal is even, and the flows of the branch canals are close to the designed flows.The PSO solutions reduced canal leakage from 7.29% to 5.40% and from 8.97% to 7.46% for the two studied systems.The water delivery time and the gate adjustment times were both reduced, saving the farmers' time and making their irrigation management more efficient and convenient.Although the water delivery schedules derived by the PSO algorithm have certain inconsistencies due to the random search mechanism, the schedules can meet the constraints of canal water delivery capacity and the losses of water due to leakage are smaller with PSO than with conventional planning methods.Therefore, the proposed algorithm is robust and efficient and can provide a new method for optimal water delivery in irrigation districts.It is an important measure for farmers to improve the management level of irrigation water and to maximize the benefits of farmland water conservancy projects, and is conducive to promoting the development of agriculture and animal husbandry and rural economy in the areas where irrigation districts are located.

Figure 1 .
Figure 1.Schematic of a secondary irrigation canal system.

Figure 1 .
Figure 1.Schematic of a secondary irrigation canal system.

(Figure 3 .
Figure 3. Comparisons of water delivery through irrigation canal systems for traditional and optimized schedules.Note: (a1,a2,b1,b2) represents the irrigation scheduling of branch canal No.11 of the north canal of the Fengjiashan irrigation district; (a3,a4,b3,b4) represents the irrigation scheduling of the west main canal in the Shitouhe river irrigation district.In (a2,b2), from bottom to top, each rectangle successively represents the water delivery discharge and duration from the second-level canal numbered 1 to 24; (a4,b4) are numbered 1 to 14; the height of each rectangle represents the value of discharge and the length represents the duration of water delivery; the scale of the vertical axis is 0.2 m 3 /s in (a2,b2) and 0.4 m 3 /s in (a4,b4).

Figure 3 .
Figure 3. Comparisons of water delivery through irrigation canal systems for traditional and optimized schedules.Note: (a1,a2,b1,b2) represents the irrigation scheduling of branch canal No. 11 of the north canal of the Fengjiashan irrigation district; (a3,a4,b3,b4) represents the irrigation scheduling of the west main canal in the Shitouhe river irrigation district.In (a2,b2), from bottom to top, each rectangle successively represents the water delivery discharge and duration from the second-level canal numbered 1 to 24; (a4,b4) are numbered 1 to 14; the height of each rectangle represents the value of discharge and the length represents the duration of water delivery; the scale of the vertical axis is 0.2 m 3 /s in (a2,b2) and 0.4 m 3 /s in (a4,b4).

Table 1 .
Parameters and water requirements of two canal systems.

Table 1 .
Parameters and water requirements of two canal systems.

Table 2 .
Water delivery scheduling results of 15 repeated optimizations compared with the traditional schedules.