Optimal water allocation based on agricultural and environmental water value

Despite the significant role of wetlands in maintaining a healthy ecosystem and providing various ecosystem services, they are under threat due to human activities and agriculture use. The fact that the economic value of ecosystem services is not considered in hydro-economic models and integrated water resources management is a key issue that affects the ecosystem and its degradation. the economic value of ecosystem services provides a quantitative and important basis for the reasonable management of water resources. Given that supplying the agriculture and environmental demands conflict with each other, achieving a balance between these goals is very important. So, in this study, a simulation-optimization (WEAP-PSO) approach is employed for optimal planning at the basin and designing environmental flow based on wetland ecosystem services. The objective function of the problem is considered to be the total economic value of the river, which includes the economic value of the agricultural sector and the economic value of the wetland ecosystem services. The decision variables of the problem are considered as, the cultivation area of agricultural units and environmental flow of Kani Barazan wetland. The results show that considering these two objectives together, in addition to sustainable development, causes the highest economic efficiency in the basin.


Introduction
Countries such as Iran, with an arid and semi-arid climate, face water shortage problems due to inadequate temporal and spatial distribution of water, as well as population growth, urbanization, and the development of agriculture and industry. Increasing water demand and its continuity have widened the gap between water supply and demand. Therefore, optimal and sustainable management and utilization of available water resources are essential to prevent water crisis.
Hydro-economic models are often used to evaluate water resources management options, commonly with a goal of understanding how to maximize water use value and reduce conflicts among competing uses.
In recent years, many hydro-economic models have addressed the issue of integrated management and planning of water resources for various goals. Some researchers have focused on only one economic sector like agriculture (Sherafatpour et  By reviewing studies on the optimal allocation of water resources, it's clear in most studies, environmental needs have either been ignored altogether or have been considered as a constraint in the mathematical planning model (Momblanch et al. 2016). In hydro-economic models, agricultural economics, industry and urban demands are usually considered, and environmental economics is not considered as an important part of the basin that guarantees sustainable development. Our natural environment provides us with a variety of services that contribute to our economic well-being. The fact that the economic value of these services is not considered in decision-making is a key issue that affects the ecosystem and its degradation. Thus, the valuation of ecosystem services provides an opportunity to price previously unpaid ecosystem services, such as improving climate conditions, regulating water quality, and providing plant and animal habitat, so that these services can enter into economic relations. Understanding the quantity and spatial distribution of ecosystem services, along with their associated economic value, is a fundamental Wetlands in Iran are increasingly under pressure due to human activity. Undoubtedly the most serious threats to wetlands have been their drainage and reclamation for agriculture and the diversion of water supplies for irrigation (World Bank 2005). On the other hand, agriculture has special importance in many parts of Iran and in addition to providing food security, the livelihood of many people depends on it.
Designing environmental flows is a challenge for researchers and managers, given their complexity and their importance, both for nature conservation and economy. However, the rapid growth of the human population has put these areas under increasing pressure that threatens their ecological integrity and economic value ). In general, methods for designing Therefore, when planning water resources in the catchment, both of these cases should be considered in the hydro-economic model to achieve sustainable and efficient development.
Therefore, the optimal allocation and development of water resources between the environment and agriculture sectors (which are extremely competitive in Iran) are very important. For this purpose, the optimization-simulation approach has been employed in this study. First, the waterrelated ecosystem services of wetland are evaluated. Then, using the optimization-simulation model and the relationship and interaction between the economic value of the wetland and agriculture, the optimal planning of water resources in the basin and the design of e-flow is investigated. WEAP (Water Evaluation And Planning) software is used to simulate the water resources system and PSO (particle swarm optimization) is used as an optimization algorithm. The developed model is employed for Mahabad catchment and Kani Barazan wetland in northeastern Iran.

Value Method of E-flow
The relationship between the economic and ecological services functions is contradictory (Gopal, 2016), i.e., the greater the water resource used for the economic sectors, the smaller the water resources used for the ecological base flow of rivers. Therefore, suppose the inflow of rivers is constant, the change in the amount of water in any water use sectors (economic water use or ecological water use) would lead to the change in the amount of water in other water use sectors, which would further cause the change in the total economic value functions of rivers.
When the water requirement of economic services functions or ecological services functions of rivers reached a certain value, the total economic value produced by ecosystem services functions of rivers would achieve the maximum value (indicated by P point in Fig. 1). At this time, the water demand of the ecological service functions of rivers would be the recommended ecological base flow of rivers (see Fig. 1).
In recent years, water interception by dams upstream of the wetland and excessive water use by the inhabitants of the watershed has resulted in decreasing water depth in the Baiyangdian Wetland

Water-related ecosystem services of wetland
Wetlands are versatile ecosystems that provide ecosystem services necessary for the social and In Table 1, the most important services of Kani Barazan wetland are briefly discussed and the method of calculating each one is shown. Wi * Pi Si is the harvested area; Yi is the per unit yield; Pi is the market value; i stands for some product.

Economic Value of Agriculture sector
For decades, agriculture has been associated with the production of essential food crops. Most people's main source of livelihood is farming. About 70% of people rely directly on agriculture as a livelihood (Fao 2016). Agriculture is the main source of national income for most developing countries. Therefore, planning for the development of agricultural sectors and allocating suitable water for irrigation is an important issue that should be given special attention. Therefore, in this research, we have tried to achieve the highest economic efficiency by determining the area under cultivation and the appropriate cultivation pattern downstream of Mahabad Dam. The most important crops grown in the area are wheat, alfalfa and sugar beet. The specifications of these products are given in Table 2. The amount of economic value obtained from the agricultural sector is calculated using Equation 1.
In the above equation

Simulation-optimization approach
Given the complexities of efficient water allocation planning, mathematical models provide the opportunity to model the hydrological processes associated with the water resources system and the relationships between supply and demand points. In general, water resources management models are divided into three types: simulation, optimization and simulation-optimization.
Simulation models use a set of relationships and parameters to predict system behavior and reconstruct the behavior of a water resources system according to set of (real or hypothetical) rules.
Optimization models are based on maximizing or minimizing an objective function, which is based on a number of predetermined decision variables and constraints. The strength of simulation models is their ability to account for water resources systems with all the components and details possible, but solving many water resources problems requires the use of optimization models.
In this research, WEAP model is used for simulation and PSO algorithm is employed for optimization. Figure 2 shows the process of the optimization-simulation model.  In equation 1, the first objective is defined as the total economic value of the basin which is the sum of economic value of agriculture sector and economic value of wetland ecosystem services. Equation 2 is the amount of the penalty, which is applied in case of a reliability violation. that the amount of agricultural crop areas is determined according to the reliability of supplying their demands. So, the reliability of supplying demands could not be less than 80% (Hatamkhani and Moridi 2019). The penalty coefficient (PC) is found by trial and error and is set to 0.01.
Equation (3) is related to the monthly water balance of each reservoir. In Equation (4), the monthly reservoir storage volume is limited to the minimum operation volume and normal water volume.
Equation (5) is associated with the monthly operation policy of reservoirs as a function of storage volume and inflow. Equation (7) emphasizes that the volume of water that is actually allocated to a demand site at a time period should be less than or equal to the volume of water demand of the site. The time reliability of demand nodes of the system is controlled by equations (8) and (9).

WEAP
WEAP model is a tool for integrated planning of water resources, which has provided a comprehensive, flexible, and user-friendly framework for planning and analyzing policies (Sieber and Purkey, 2011). The WEAP model uses linear programming to solve water allocation problems at any time step and its objective function is to maximize the percentage of supplying demands, concerning supply and demand priority, mass balance, and other constraints. This software is widely used for integrated management and planning of water resources and has the river, economic, and agricultural demand management submodels.

PSO Algorithm
Particle swarm optimization (PSO) is a swarm intelligence algorithm based on the social behavior of birds. In this algorithm, a particle chooses a direction using the current position and its best position in the previous iterations (pbest) and also the best position in the whole swarm (gbest).
The particles move to new positions, and the objective function values are calculated bsased on pbest and gbest in each iteration. This process is repeated until stopping criteria is met. In the PSO algorithm, each particle is a candidate solution equivalent to a point in a D-dimensional space, so the ith particle can be represented as X i = (x i1 , x i2 , … x iD ) D ). The rate of the ith particle's position change is given by its velocity V i = (v i1 , v i2 , … v iD ) D . Equation (10) updates the velocity for each particle in the next iteration, whereas Equation (11) updates each particle's position in the search space: 10 v id n+1 = χ[Wv id n + C 1 r 1 n (P id n − x id n ) + C 2 r 2 n (P gd n − x id n )] In these equations d= 1,2,... ,D ;i = 1,2,..., N, and N is the size of the swarm; x is called the constriction factor which is used in constrained optimization problems to control the magnitude of the velocity. W is called inertia weight; C 1 , C 2 are two positive constants, called cognitive and social parameters, respectively; r 1 , r 2 are random numbers uniformly distributed in [0,1]; and n = 1, 2,..., n max , shows the iteration number.

Case study
The study area includes the Mahabad River catchment area in northwestern Iran and the province of West Azerbaijan. Mahabad river flows into the reservoir of Mahabad dam after originating from the heights. Downstream of this reservoir is the irrigated lands of Mahabad plain that are fed to irrigate the water of this reservoir. In addition, there is a need for drinking and industry in the city of Mahabad, which must be met from this reservoir. The location of the Mahabad catchment is shown in Figure 3.  Table 3 identified the most important functions and services of Kani Barazan wetland and the valuation method of each. The ecosystem services can be devided into four categories: (1) provisioning, (2) regulating, (3) cultural, and (4) supporting services. Among the seven ecosystem services, five (raw materials, water quality improvement, water balance, and climate regulation)

Economic Value of Kani Barazan Wetland
were estimated in two steps. The first step was to estimate the physical dimension of each ecosystem service. The physical dimensions of the water balance were calculated based on DEM and land use data. These included N and P removal rates and water surface evaporation in summer.
The second step was to calculate the value of each ecosystem service based on the physical dimension by the evaluation method. The market price method was used to assess the value of raw materials. The avoided cost method was used to estimate the water quality improvement, climate regulation, and water balance value.
The value of tourism activities can be based on income generated from tourists. This study incorporated tourism activities to estimate recreational value. We followed the travel cost method

Simulation-Optimization Results
As explained, the purpose of this study is to determine the optimal planning in the catchment to achieve an optimal trade-off between water allocation between agriculture and the environment.
The purpose of the research is to maximize the total economic value of river functions which is the sum of economic value of agriculture sector and the economic value of wetland ecosystem services. According to Figure 4, the total economic value reaches a maximum value and then follows a decreasing trend. Therefore, simultaneously consideration of the cultivation pattern in the region and the water requirements of the wetland with regard to its ecosystem services for determining optimal planning and management of water resources is essential. The problem decision variables are area under cultivation of crops and e-flow of wetland. minimum and maximum limits of the decision variables are described in Table 4. It should be noted that the area under cultivations is calculated so that the constraint on the reliability level (80) is satisfied. The penalty function causes that the objective function tends to desirable reliability. As mentioned, WEAP software has been used to simulate the water allocation in the catchment area. In water allocation, the domestic and industry demands are considered as the first priority.
Then there are the needs of agriculture and the environment, which are included in the model with equal priority.
The PSO algorithm is employed to maximization the objective function. Given that the number of decision variables is problem 4, the number of particles in the PSO algorithm is considered 12. Figure 4 shows how the objective function converges to the best value.  Table 6 shows the optimal values of the decision variables and the objective function.  Table 7 shows the sensitivity analysis of the decision variables and their effect on the objective function.

Conclusion
In this study, a water allocation model is presented that in an integrated framework, considers the interaction of water supply and demand with respect to economic factors. In the water allocation process, the water supplier decides to allocate water under the influence of limited access to water resources and maximizing water supply revenue for different sectors. The construction of a model On the one hand, it protects the e-flow and determines its appropriate amount, and on the other hand, its effect on the increase of the economic value of the river is evident.