Optimizing a typical water resources allocation problem using the Harmony Search Algorithm N. Theodossiou1*, D. Karakatsanis1, I. Kougias2, L. Katsifarakis1 1
Division of Hydraulics and Environmental Engineering, Department of Civil Engineering, Aristotle University of Thessaloniki, 54124 Thessaloniki, Greece 2 Renewable Energies Unit, Institute for Energy and Transport, European Commission, Joint Research Centre, 21027 Ispra, Italy *Corresponding author: E-mail:
[email protected], Tel +30 2310995660
Abstract The need to develop and apply new optimization techniques in order to achieve more efficient and effective solutions in complex management problems, has led to the introduction of a series of interesting new methods. The meta-heuristic method of music-based Harmony Search Algorithm (HSA) is one of the leading optimization techniques nowadays with applications covering a wide range of scientific fields, including of course, water resources management. In this paper, a classical water allocation problem, the one introduced by Louks et al in 1981, is being solved with HSA. For this application a specially designed computer software programmed in MATLAB environment is used. The created software includes a friendly GUI (Graphical User Interface) that allows the user to easily interact with the optimization tool. Keywords: water resources management, water allocation, harmony search algorithm, optimization
1. INTRODUCTION Although numerical analysis and optimization have been used and developed long time ago, it was only in the late 20th century when stochastic metaheuristic algorithms launched a new era in the field. These methods introduced sophisticated randomness in order to spot optimum solutions inside the search-space. They have shown an exceptional ability to solve demanding optimization problems in short time and with relatively low programming complexity. As a result, after their initial appearance, their development and implementations in almost every scientific field has been extensive. Most of the metaheuristic algorithms imitate natural or artificial procedures in order to carry out their internal search process. Genetic Algorithm is probably the most wide-spread optimization technique and imitates the natural evolution process. Other common metaheuristics include Ant Colony Optimization, Particle Swarm Optimization and Bee Algorithms, which were also inspired by natural phenomena. Simulated Annealing is the most common metaheuristic that was inspired by an artificial process such as the heat treatment in metallurgy. Geem et al. (2001) introduced Harmony Search Algorithm (HSA), a modern metaheuristic Algorithm inspired from the music creation process. Initially HSA was designed for the optimum design of water distribution networks. Since then, there has been sustained and increasing interest in HSA applications. In the current literature, except from water engineering optimization problems, one can find a vast variety of implementations (Kougias and Theodossiou, 2013, Kougias et al. 2013). HS Algorithm is a powerful and efficient tool, with the extra advantage of having a simple structure. These characteristics attracted the interest of those involved in the optimization field. Harmony Search Algorithm uses three main mechanisms in order to sweep the search-space. These mechanisms serve as global/local engines towards the detection of optimum solutions. They imitate Proceedings of the 12th International Conference on Protection and Restoration of the Environment Editors: A. Liakopoulos, A. Kungolos, C. Christodoulatos, A. Koutsopsyros ISBN 978-960-88490-6-8
920
a musician’s behaviour during a music performance and in the same way musicians try to create pleasant melodies through iterating rehearsals, HSA is approaching the best solutions for optimization problems. Detailed description of HSA's mechanisms can be found in Kougias and Theodossiou (2010). 2. OPTIMIZATION SOFTWARE 2.1 Purpose As metaheuristic algorithms have become an efficient and common tool for scientists of various fields, there has been an increasing need to simplify their implementation. Metaheuristics usually use simple mathematics, compared to the differential calculus that "classic" numerical methods adopt. However, they often have a composite structure and demand delicate programming skills. In order to facilitate the use of metaheuristics from users with limited programming background, various generic optimization programs have been designed. Such programs can either be commercial or open-source software. Often, the created tools answer academic and research needs. Their aim is to provide a user-friendly environment, where the optimization process will only require fundamental computing skills. In that way the user avoids the most time-consuming part of every optimization process, i.e. the design and creation of a unique program that optimizes a specific application. Using generic optimization software requires just few simple steps. After the formation of the representative model, the user needs to input the objective function (to be optimized) and the problem's constraints. Consequently, the program runs and provides numerical, graphical and other results. This formation has been proven very handy since it only requires fundamental computing skills and no special training. Even in cases that programming skills are not an issue, generic optimization software can be very effective. In most cases their implementation is way easier and faster compared to the design and creation of ad-hoc programs. There is a variety on the algorithms that these programs might use. In those programs that incorporate a more sophisticated structure, the user has the opportunity to select the optimization techniques among a list of available algorithms. 2.2. Harmony Search algorithm optimization toolbox (HS Toolbox) In the present article, the authors present the design and creation of a HSA–based optimization software. This program, given the name HS Toolbox, was designed and created in Matlab environment and its Graphical User Interface (GUI) is illustrated in Fig. 1 (Karakatsanis, 2013). The main purpose of HS Toolbox is to provide a user-friendly interface, where the user will be able to input the objective function and the constraints in normal mathematical formula. Moreover, it is important that it can cope with complex problems that include numerous variables and constraints. 2.2.1. Characteristics HS Toolbox consists from a main object of 4000 code line that executes the Harmony Search algorithm. There are extra objects that control the constraints (1000 code lines) and the GUI that includes 2000 code lines. In its original version it includes a limit to the number of constraints (10). This number is adequate for most problems and can be increased, if needed with proper alterations. However, the set limit helps to keep the program simple and its performance fast. 921
Figure 1 The Graphical User Interface of the HSA optimization software 2.2.2. Description of HS Toolbox In Figure 1 the HS Toolbox is illustrated. In this friendly GUI environment, the User simply writes the mathematical expressions that define the objective function and the constraints (equalities or inequalities). A special code reads the contents of the text boxes and identifies the equations. HS Toolbox incorporates another unique characteristic that boosts the convergence i.e. the Size Class of the decision variables. This specification allows the user to input typical size class of each variable (decimal, tens, hundreds, thousands etc.), which results to a prioritization of the search process. In the left part of the GUI the User needs to insert the values of HS parameters: x HMS: Harmony Memory Size x HMCR: Harmony Memory Consideration Rate x PAR: Pitch Adjusting Rate x IN: Iteration Number In the same part the User can also define whether the examined problem is a maximization or minimization problem. The Method menu offers the opportunity to alter the Selection process of the algorithm. In that way it is either possible to add a penalty to no-feasible solutions or discard them. Solve button executes the algorithm and the Results frame includes the optimum values obtained. 922
3. A WATER ALLOCATION PROBLEM To demonstrate the potential of the HS Toolbox, a classical water allocation optimization problem was chosen as a benchmark application. This is a problem introduced by Louks et al in 1981. For three users (n=3) the problem is graphically presented as in Figure 2.
Figure 2 The water allocation problem of Louks et al (1981) The problem comprises of the outflow R of a reservoir, a number of n aligned users Bi and the requirement of a surplus flow S (e.g. ecological flow). The problem aims at identifying the optimal allocation of R amongst the potential users (including surplus S) with the maximum distribution banefits. The total benefits from the distribution of water to each user i is defined by: Vi = ai xi + bi xi2
(1)
where, a and b are constant coefficients depending on the characteristics of the distribution network for each user (McKinnet and Savitsky, 2003). Benefit analysis for the three users, are presented in Figure 3, considering that the values of the respective coefficients of equation 1, are: a1=6, b1=-1, a2=7, b2=-1.5, a3=8 and b3=-0.5 According to the problem formulation, the objective function and the constrains of the optimization problem are identified as: Objective function: (6x1 – x12) + (7x2 – 1.5x22) + (8x3 - 0.5x32) Æ max
(2)
Constrains: x1 + x2 + x3 R - S x1 + x2 + x3 0
(3)
where, R is the outflow from the reservoir, xi is the water allocated to each user and S is the surplus flow.
923
Figure 3 Distribution of benefit analysis for the three water allocation users (benefit vs water allocated to each user) 3. RESULTS AND DISCUSSION Assuming that the outflow from the reservoir is R=10 m3/h and the water surplus is S=2 m3/h, the solution of the problem using the HS Toolbox resulted to the following water distribution: X1=1.55 m3/h, X2=1.36 m3/h and X3=5.09 m3/h The objective function, representing the total distribution cost is F=41.3452. This value is extremely close to the one presented by Loucks (F=41.41). The algorithm results to a value for the objective function above 41 with a possibility of 7%. The results of the convergence procedure are presented in figure 4. 42 41 40 39 38 37 36 35 34
Figure 4 Convergence of the water allocation problem (iterations vs total benefit) 924
The problem was solved using the following values for the HS parameters (see paragraph 2.2.2): HMCR=0.7, PAR = 0.05, HM=10 and IN=10000 For different values of the outflow R from the reservoir, the water allocated to the three users is presented in figure 5.
water allocated to each user
7 x1 6
x2
5
x3
4 3 2 1 0 0
2
4
6
8
outflow R from reservoir
10
12
Figure 5 Water allocated to the three users according to the total water outflowing the reservoir It is obvious from the analysis presented in this paper that the new optimization tool based on Harmony Search is very effective and can be easily used, as presented in figure 1, for the introduction of the mathematical description and the solution of complex problems. The fast convergence of the algorithm is also a very important characteristic. The more complex the problems to be optimized, the more intense the necessity to use user-friendly efficient software like the HS Toolbox. References 1. 2.
3.
4.
5.
6. 7.
Geem, Z.W., Kim, J.H., Loganathan, G.V. (2001). A New Heuristic Optimization Algorithm: Harmony Search. Simulation. Vol. 76:2, pp. 60 – 68. Karakatsanis, D. (2013), Optimization software with Harmony Search Algorithm, graduate thesis, Department of Civil Engineering, Aristotle University of Thessaloniki, Greece (in Greek) Kougias, I. and Theodossiou, N. (2010), A new music-inspired harmony based optimization algorithm. Application in water resources management problems, In: Proceedings of International Conference on Protection and Restoration of the Environment X, Corfu 2010. Kougias, I., and N. Theodossiou (2013), Multiobjective pump scheduling optimization using Harmony Search Algorithm (HAS) and polyphonic HSA, Water Resources Management, vol 27 (5), pp. 1249-1261. Kougias, I., T. Patsialis, N. Theodossiou, and J. Ganoulis (2013), Hydropower projects within a municipal water supply system. Optimum allocation and management using harmony search, Exploring Innovative and Successful Applications of Soft Computing, book chapter. Loucks, D.P., Stedinger, J.R., and Haith, D.A. (1981), Water resources systems planning and analysis, Prentice-Hall, Englewood Cliffs, N.J. McKinney D.C. and Savitsky, A. (2003), Basic optimization models for water and energy management, The University of Texas at Austin, Technical report. 925