Decision support system for optimization of permits for wastewater discharge

This paper presents a Decision Support System (DSS) to assist in the issuing of wastewater discharge and water abstraction rights, including the evaluation of alternative pollution control strategies used to facilitate the analysis and implementation of the instrument. The DSS substantiates its analysis with the use of evolutionary algorithms for the optimization of water demand and wastewater discharge allocation. It intends to maximize the uses and minimize the costs of wastewater treatment measures, according to the limits imposed by the water quality standards. Among the strategies considered for the issuing of permits were the compliance with environmental legislation for wastewater discharge, the equality between water users, the water quality standards set by the water bodies’ classification, and the restrictions imposed by the responsible controlling water agency. The DSS’s results were satisfactory to the strategies analyzed, as they complied with the restrictions and penalties imposed to the objective function. The main objective of the proposed strategies is to evaluate the performance of the DSS in getting the results, as well as to analyze the flexibility of the algorithms when new restrictions and penalties are introduced in the decision making process.


INTRODUCTION
The management of effluents in river basins is a common problem in many regions of the world.There are several factors that interfere in the analysis of the sustainability of the watershed, among them the dynamics of the environment and the use and occupation of the soil that cause changes in the environmental conditions resulting in the imbalance of water resources.
In many situations the discharge of effluents is not evaluated, effluent discharges are analyzed only by the environmental agency, where the control is carried out based on the emission standard, entirely unrelated to the quantitative process of authorizing the emission.When evaluating only the emission standards, the analysis is restricted to a point, when in reality all the loads should be analyzed in a collective way, that is, the river basin in an integrated approach or as a unit of management, according to the fundamentals of the National Policy on Water Resources (Law 9.433/97 -BRASIL, 1997).Therefore, the pollution control measures can be optimized, giving greater economic efficiency in the analysis, concerning the removal of cargo and without neglecting the environmental control.
The integrated analysis of the quantitative and qualitative aspects necessary for the authorization of discharge of effluents or the dilution is one of the significant challenges to be overcome by the management bodies.According to Mutiga et al. (2010) lack of knowledge about available water resources and lack of coordination in the management of water resources in the basin generally, result in water deficits that have hampered the development of a river basin.Silva and Monteiro (2004) argue that, in the process of granting effluent discharges, the environmental and water management bodies should work in a fully articulated manner.The need for articulation is due to the interdependence of decision-makers and stakeholders since effluent treatment efficiencies are defined for the environmental installation license and the corresponding remaining pollutant loads should be in perfect harmony with the flow rates be allocated for the dilution of these pollutants, and vice versa.Silva et al. (2017) emphasize the importance of implementing the management tools of the State Water Resources Policy in an integrated way so that quantitative and qualitative balance analyzes can be effectively implemented.This reinforces Porto's (2009) statement by emphasizing that the integration of environmental licensing and licensing requires everyday decisions and information base.
The advance in information systems and Decision Support to aid in the integrated management of water resources systems is evident.Authors such as Rodrigues (2005), Wang, Fang and Hipel (2007), Collischonn and Lopes (2009), Pessoa, Kayser and Collischonn (2012), Han et al. (2013) present methodologies and tools that seek to satisfy the needs of the water management process.
In the same vein, it is possible to mention some models with an emphasis on the management of water resources such as AquaNet DSS (PORTO et al., 2003(PORTO et al., , 2005)), ModSim (LABADIE, 2005;LABADIE;LARSON, 2006), Mike Hidro Basin (DHI WATER AND ENVIRONMENT, 2018), WRAP -Water Rights Analysis Package Modeling System (WURBS, 2012), RIBASIM -River Basin Planning and Management (DELFT HYDRAULICS, 2006), IRAS-2010 -Interactive River andAquifer Simulation -Matrosov, Harou andLoucks (2011) (LOUCKS, TAYLOR;FRENCH, 1995), WEAP-Water Evaluation and Planning (YATES et al., 2005) and RIVERWARE: a generalized tool for complex reservoir system modeling (ZAGONA et al., 2001).These models are tools that allow the integrated and multipurpose analysis in the planning and management of hydrographic basins considering the allocation of water rivers and reservoirs under various hydrological conditions contributing to the analyzes of the management of Water Resources.
In the Water Resources management process, decision making becomes complex when there is conflict over the use of this resource, and this conflict is quantitative or qualitative.Although several models propose to subsidize the decision-making process in the management of water resources, the difficulties in choosing the analysis model or methodology focus on the need to integrate quantity and quality aspects in an optimized approach.The system should be able to identify for the decision-maker, not only the critical points, whether determined by quantitative or qualitative factors, but also the location and magnitude of the measures to be taken to address the water security of the watershed as a whole.
Zandonadi, Mendonça and Reis (2015) compare estimated dilution flow values through several methodologies and how they can result in very different values of dilution flows.The authors argue that the assessments of permits applications that they consider the real quality of the watercourse make the analysis process closer to reality.
The challenge of the management bodies is to analyze critical basins, where there are deficits and the volume available in the watercourse do not meet the needs of users.The deficits can paralyze the permits granting system, and it is necessary to increase the water availability, reducing the dilution flow rates -Q dil .For this, it is necessary to optimize the allocation of pollutant load along the receiving body, imposing treatment to the effluent loads, so that the limit of the class of watercourse established by the framework is not exceeded.Fantin, Reis and Mendonça (2017) present a methodology for the pre-selection of alternatives for sewage treatment in the watershed context, considering water quality model and optimization technique and a set of criteria of a technical and economic nature.
This manuscript presents a methodology to assist in the application of permits for wastewater discharge into rivers, through the optimization of the permits aiming at maximizing water uses, withdrawals and loads, and minimizing the costs of implementing the decontamination measures, by maximizing dilution flow rates.
To reach the proposed objective, a simulation model was created for the quantity and quality of water integrated into an optimization model.This set of models was integrated into a graphical interface and a database in the form of a Decision Support System (DSS).This DSS has the function of assisting in the analysis of the permit process, allowing the determination of scenarios of quantity and quality of water from the uses existing in the basin, the limits of use established and the cost of implementing the measures of decontamination.
The proposal presented in this article aims to optimize in an integrated way the attendance to the demands of consultative use and the levels of treatment of the optimal effluent releases, pointing at a higher efficiency of the system.The system seeks to identify the most suitable places to invest in treatment to minimize their costs and maximize the quantitative uses without violating the limits of water quality established by the framing of bodies of water.In this article, the Genetic Algorithm was chosen for the optimization process, due to its characteristics that allow the introduction of complex and highly nonlinear objective functions, as well as to evaluate constraints imposed on them.These characteristics are essential for the analysis proposed here that integrates the demands and effluent releases in a Decision Support System, where the different water resources management strategies are evaluated, guaranteeing greater agility in decision making.
Garcia et al.

METHODOLOGY Decision Support System (DSS) description
The possible analysis strategies included in the developed DSS are: i) prioritization between meeting the quantitative needs and compliance with the quality limits established by law for the water bodies; ii) an equality among users; iii) and compliance with environmental legislation for the discharge of effluents.
Among the strategies for permits concession, the most common are those that impose service priority for demands, either through type of use or another rule that imposes some hierarchy among users.
The second strategy imposes isonomy among the users within the watershed.The proposed DSS solves this problem restricting the algorithm, which considers that the uses of the same type of use, must meet the same levels of treatment of its effluents.This type of constraint limits the solution space of the optimizer since the treatment efficiencies must be set for groups of users of the same type of use.
When considering isonomy, users of the same productive sector should have the same environmental restrictions, regardless of their location in the watershed and the environmental quality of the watercourse.This type of analysis imposes on the global cost of the decontamination measures since it forces the users located in reaches of the river with more favorable environmental conditions to apply the same standard of pollution control of the user located in an environmentally degraded reach, where the capacity of assimilation of the polluting load it's smaller.The positive aspect of this alternative is the improvement of the final water quality profile in the stream.On the other hand, the overall cost of pollution control measures becomes higher, which can limit their implementation.
There is a great deal of discussion about the application of isonomy among type of uses, since users located in more degraded areas should not be penalized by the condition of degradation of the watercourse caused by the collective, nor should generate a higher cost to a user with the same type of use located in the same watershed.
Among the possible licensing strategies to be simulated in the DSS are the analysis of environmental legislation (usually defined by each regulatory agency) and the issue of isonomy among users.Regardless of the alternatives selected, the optimization algorithm of the DSS must respect the limits imposed for the release of effluents by the Environmental Legislation, for example, for the State of Sao Paulo, Brazil, the discharge of an effluents must have a maximum concentration of 60 mg/L of BOD, or treatment larger than 80% of pollutants removal.These limits constitute the input data of the DSS, allowing it to be applied in watersheds with different discharge restrictions.
The proposed Decision Support System in this study allows flexibility in establishing minimum and maximum limits for effluent treatment efficiencies for each user in the watershed, in this way the watershed managers have higher control over polluting users.Figure 1 presents the flowchart with the strategies makes available in the DSS for decision making.
Figure 1.Strategies for the analysis of effluent permits in the proposed DSS.
Decision support system for optimization of permits for wastewater discharge

4/14
The decision maker should define which strategy will be used in the analysis process, such as prioritizing abstractions, using isonomy among users, or considering environmental by-law restrictions.The DSS is flexible because it allows introducing restrictions in localized points of the basin, for example, to restrict for a specific type of use, different limits for the treatment efficiencies, as well as to regulate the individual users.

The simulation model
The equation of the simulation model attempts to represent the aspects that occur in the watercourse.For the model, the steady flow regime allowing to simulate reference flows, such as Q95% (95% probability of occurrence) or Q7,10 (minimum flow of 10 years of recurrence and duration of 7 days), adopted by most of the water resources management authorities in Brazil.The quantitative balance (mass balance) is calculated through Equation 1.For the qualitative balance, a complete mixture was considered at the points of point loading as shown in Equation 2.
Where: Q Eff and C Eff represent the flow and concentration of the effluent, respectively; Q Nat and C Nat represent the stream infloflow and concentration of the inflow, respectively; Q River and C River represent the flow and concentration of the river, respectively; and Q Demand represents the flow of consumptive use in the river section (flow granted) For the simulation of water quality, two parameters, the biochemical oxygen demand (BOD) and dissolved oxygen (DO) were selected.
The BOD was included in the DSS because it is an indicator of the presence of organic matter in the watercourse and it is listed the Brazilian environmental legislation as one of the parameters used for the licensing process.Therefore, its analysis of the process of granting effluents meets the environmental requirements defined in the legislation.
The DO is a parameter that indicates the environmental conditions of the watercourse.The analysis of this parameter is fundamental especially when the watercourse is classified as class 4, for which the environmental legislation does not establish the maximum limit of concentration for the BOD.
The decay BOD in the river stretch is determined by Equation 3, the total removal rate presented in Equation 4 and the dissolved oxygen behavior in each section is calculated by Equation 5, as in Chapra (1997).
Where: k r -the total removal rate (day -1 ); k d -the removal rate of the BOD (day -1 ); k s -the removal rate for sedimentation (day -1 ); k a -reaeration rate (day -1 ); L 0 -the initial carbonic BOD concentration (mg/L); U -velocity (m/s); x -distance (m); and SL -rate of the BOD distributed source (g/m 3 day).D -is the initial oxygen deficit (mg/L); D 0 -is the initial oxygen deficit (mg/L); For the simulation model correctly reproduce the analyzed parameter profile, appropriate values must be adopted for the coefficients ka, kd and ks.The determination of these values can be an exhaustive process due to a large number of possible combinations.This process is called model calibration, and, in this study, the values were optimized to minimize the sum of the least square errors between the values observed and calculated for the river stretches that have observed data series.
Another important variable in the decision process is the dilution flow, which represents the volume of water in the river necessary to dilute the concentration of a pollutant to maintaining the limits of the parameter considered in the analysis, within the classification of the watercourse receiving the effluents.Several authors such as Hora (2001), Kelman (1997) and Brasil (2000) proposed equations to find the value of the dilution flow rate.In the case of the analysis of permits, it is essential to evaluate the users jointly and, thus, prioritize the limits imposed by the environmental law.
The equation proposed by Hora (2001), Equation 6, considers the concentration of water quality in the river at the effluent point.Thus, for the determination of the dilution flow, all existing effluents with their respective loads are considered, which allows a more realistic analysis of the quality profile, when compared with the methodology that considers only the natural contribution.When accounting for all users in the water quality to determine the dilution flow rate, the final solution becomes more restrictive because a larger volume of water will be required to dilute the same effluent load than when considering only the concentration of the river.
In assessing the dilution volume permits in this way, the optimization algorithm can obtain as a solution, the level of treatments in places where there is water availability for dilution, to ensure volume to dilute effluents in more critical stretches of the watercourse, to reduce the global costs of the pollution control Garcia et al.
5/14 measures.For the cost analysis, it was necessary to implement functions (Equation 7) for the treatment systems and their efficiency of load removal.Table 1 presents cost function parameters. Where: A and Bparameters of the cost function The parameters were calibrated based on the cost information from treatment plant projects, which describe the relationship between efficiency and cost of their implementation and operation.
In the process of optimization of the effluent permits, the scenarios must be carefully evaluated, to maximize the uses and the reduction of the impacts caused by the discharge of effluent in the watercourse, as well as the minimization of costs of the implemented measures.
For the optimization process, the Genetic Algorithm (GA) was used.Genetic Algorithms (GAs) were introduced by John Holland (HOLLAND, 1975) and popularized by one of his students, David Goldberg (1989).The algorithm was implemented to evaluate the solution of the load allocation problem in the process of effluent granting (dilution flow) and minimization of costs of implementation of the decontamination measures.In AG there are three operators: selection, crossing and mutation, to generate the new population of descendant individuals from the parents' population.The selection operator is used to select the chromosomes to which the crossover operators will be applied.There are different selection operators (DEB, 1999), and in general, chromosomes with higher objective function values are more likely to be selected and survive.A widely used crossover operator in real-coded AG is the Simulated Binary Crossover -SBX (DEB et al., 2002;DEB;BEYER, 2001;DEB, 2009) that simulates crossover at one point of binary coding and uses a distribution of probabilities around two parents to create the descending solutions.After selection and crossing the mutation is performed to preserve the diversity of the population.The probability of mutation should be kept low, since high values may compromise good solutions (DEB, 1999).Mutation operators can be uniform, nonuniform or polynomial, and vary with generation number, Deb (2009).Some authors obtained good performance when using Genetic Algorithms for systems optimization analysis involving quantitative and qualitative aspects applied to water resources systems (FANTIN; REIS; MENDONÇA, 2017; SANTORO; REIS; MENDONÇA, 2016; REIS; VALORY; MENDONÇA, 2015;CHO;LEE, 2014;FERNANDES;KONDAGESKI, 2009).
Figure 2 shows the flowchart of the DSS for the solution of the proposed problem for the discharge of effluents.In this flowchart, one can observe the steps selected to obtain the optimized  Decision support system for optimization of permits for wastewater discharge 6/14 results.The number of generations "N" is a parameter of the optimization algorithms and represents the cycles performed by the algorithm to generate new populations, represented by "n".The number of generations "N" required depends on the complexity of the proposed problem and must be determined experimentally.The number of strechs "I" depends on the discretization of the watershed, where for each "i" stretch it is possible to attribute the hydraulic characteristics of the river as well as define incremental flows and the information of the users such as withdraws and discharges.
The objective of the optimization process in the DSS is the optimal effluent load allocatiosn in a watercourse, aiming at the lower overall cost for the installation of effluent treatment plants, maximization of the withdrawals while maintaining the parameters of water quality within the limits of the class defined by the environmental laws.
The model variables are: 1) the effluent treatment efficiencies that are linked to the station's implementation cost functions, and 2) the consumptive demands (withdrawls).
Consumptive demands will only be variables of the model when deficits are allowed if the strategy to prioritize the demands according to their use is selected.Therefore, the demand becomes a variable to be optimized, otherwise the withdrauls will be equal to the value set by the decision maker, if there is available volume in the system.
Equation 8 presents the sum of the cost of implementing the treatment plants that must be built for each effluent discharge. Where: C -implementation cost of the treatment plants; TreatCost i -implementation of of treatemne plant i; i watercourse strech; N number of strechs; Depending on the select analysis scenarios chosen, up to three penalties can be applied to the objective function.
The first penalty applies when the values of the analyzed parameters, BOD and DO, are outside the limits of the class the river.For the classes that do not have a defined value for DO, this is disregarded of the calculation of the penalty, being then evaluated only as function of the BOD.Penalty 1 is written mathematically according to Equation 9.
Where: P 1 -Penalty 1; BOD river i -Biochemical Oxygen Demand concentration of the watercourse for stretch (i); BOD class i -class limit of the Biochemical Oxygen Demand for the watercourse strech (i); DO river -Dissolved Oxygen concentration for the strech (i); DO class -class limit of the Dissolved Oxygen for river strech (i); W q -weight pernalty for the deviation of the watercourse class.
The value for the penalty coefficient (Wq) to guide the optimization algorithm towards maintaining the parameters within limits, must be high, given that violations of the water quality are not desired.The value adopted for Wq was 10 9 for the case study presented next.
The second penalty is applied directly to the effluent discharges over the without optimization process.In this strategy, the penalty is imposed when effluent is over an absolute limit, usually established by the environmental laws in some states in Brazil.Penalty 2 is calculated as presented in Equation 10.

(
) Where: P 2 -Penalty 2; BOD effluent i -concentration of Biochemical Oxygen Demand of the effluent for the stretch (i); BOD EnvRest -maximum limit of concentration of Biochemical Oxygen Demand that can be released to the watercourse according to environmental legislation; W Env -weight applied to environmental restriction penalty.
The value of the environmental restriction penalty weight (W Env ) should be high if violations of the environmental limits for the discharge of effluent are not desired in any parts of the river.The value adopted for W Env was 10 9 for the case study presented below.
The third penalty is added to ensure that the demands (withdraws) required by the users are met with use.Thus, whenever a user is not fully supplied, there is a penalty in the objective function, according to Equation 11.This penalty is applied when demand deficits are allowed in the licensing strategies.
The value of the penalty weight for the demand deficits (W dem ) is an input of the model.The value of the weight does not have to be very high, since the model allows the users to establish the minimum and maximum limit for the demands.The value adopted for W dem in the case study presented was equal to 10 3 .
The treatment efficiencies (Eft) is a decision variable for the effluent discharges are set as the constraint in the optimization.The values should remain in the range of the imposed in the input data of the model (Equation 12).

( ) ( ) ( )
Where: Eft min -minimum efficient treatment for the effluent i; Eft -modeled efficient treatment for effluent i; Eft Max -maximum efficient treatment for the effluent i; i -stretch in the watercourse.By allowing demand deficit, constraints are assumed for the decision-making variable of demand (Dem otim ) that must remain Garcia et al.

7/14
within the limits imposed by the manager as input data of the model, Equation 13.In the case study presented in this paper, Dem otim min was adopted as an average risk, which represents a minimum of 80% of the demand required by the user.
Equation 14 presents the final objective function used by the optimization algorithm in the analysis of the effluent permitting process.P 2 -Penalty due to deviation of Environmental Legislation for the discharge of effluents; P 3 -Penalty due to deficits of the demands required by the user.

CASE STUDY
In order to evaluate the results achieved with the developed DSS, as well as the effluent permitting strategies discussed in this article, a case study was applied in the Atibaia River Basin, in the state of São Paulo.
The Atibaia River is an important tributary of the Piracicaba River, which is part of UGRHI 05 -Piracicaba, Capivari, Jundayí. Figure 3 shows a map with the location of the Atibaia River Basin.
The Atibaia River was chosen for this analysis because of its location and socioeconomic importance in the state of São Paulo.Another point that led to the choice of this case study was the existence of a good database with information regarding existing permits on the watershed, including effluent loads and the type of water use of each permit.
Two parameters of the water quality modelo were evaluated: Biochemical Oxygen Demand BOD and Dissolved Oxygen DO.
In Rio Atibaia, there are eight water quality monitoring stations operated by CETESB, which are listed in Table 2, which were used to calibrate the water quality model.
Equation 15 presents the objective function to be optimized for the calibration of the water quality model.The minimum and maximum limits of the coefficients ka, kd and ks, which represent the limits for the search space of each variable, are input data of the model.These values can vary along the stretches, so that they best represent the characteristics of the water quality model.The values of 6 ranged from 0.1 to 6.0, the values of kd ranged from 0.1 to 1.6 and the values of ks ranged from 0 to 1.0.
The water quality simulation was performed with the mean values of ka, kd and ks obtained from the 50 simulations for each stretch of the Atibaia river.The BOD and DO profiles obtained with the mean values of the parameters presented a good fit when compared to the observed values, represented by Box-Plots, indicating that the automatic calibration can be used to set the quality model parameters.
Figure 4 and Figure 5 present the profiles of BOD and DO, respectively, for the 50 simulations of the Atibaia River using the Genetic Algorithm.In these two figures, we can visualize the Box-plots of the eight monitoring points included in the analysis.
For the analyzed parameters, scenarios were evaluated combining different granting strategies that are part of the DSS.The application refers to the assessment of the permitting of effluent discharges aiming at the lower cost of implementing effluent treatment units to maintain the maximum limits for the quality parameters defined by the environmental law, considering the restrictions and penalties imposed by each permitting strategy.
This analysis was carried out considering three scenarios: 1) prioritizing the attainment of the demands and meeting the water quality limits imposed by the class of the river (Class 2 -maximum of 5 mg/L BOD for Atibaia river); 2) prioritizing the attainment of the demands and meeting the water quality limits imposed by the class of the watercourse.This restriction refers to complying with the maximum limits imposed by environmental legislation (maximum concentration of 60 mg/L of BOD, or treatment superior to 80% of load removal) and 3) prioritizing the attainment of the demands and meeting the water quality limits imposed by the class of the watercourse, while considering the isonomy among users with the same purposes of use.For the 3 scenarios, priority was given to meeting the demands, that is, the abstracted flow equals the flow required for each user.Thus, not considering flow efficiencies for abstractions, one can have greater control over the influence of each strategy in the solution.

RESULTS AND DISCUSSION
Figure 6 shows the water quality profile (DO and BOD) for the three similar grant scenarios.The BOD profile, in Figure 6, indicates that the more restrictive the scenario, limiting the search space of the solution as in the cases of scenarios 2 and 3, that considered the Environmental Law and the isonomy among users, respectively, the higher the treatment efficiencies of effluents will be, modeled by the optimization algorithm optimizer.In view of this, it can be seen in Figure 6 that the BOD profile for scenario 1 was the one that remained closer to the maximum limits allowed by the framing class, which has no restrictions such as those observed in scenarios 2 and 3.
Figure 7, Figure 8 and Figure 9 present the water quality profile, the flow in the stretches of the Atibaia River and the dilution flows necessary to dilute the effluents at their discharge points for the scenarios 1, 2 and 3, respectively.It should be noted that the optimization algorithm respected the limits established by the class (environmental law) for the three proposed scenarios.
Figure 7 presents the results of scenario 1, where it can be observed that the available flow (volume) in the stretch with discharges was used in its totality to dilute the effluents.Figure 7 also indicates that when the water quality reaches the maximum limits the dilution flow rate is equals the available flow rate in the stretch.This behavior can be observed at km 18 and 74.The total dilution flow calcued for scenario 1 was 44.45 m 3 /s and the total load discharge to the river was 12.77 tons of BOD/day.
The results produced by scenario 2 are presented in Figure 8, and, unlike observed in scenario 1, the dilution flow was not used in its entiry capacity to dilute the pollutants, except for kilometer 63, where the dilution flow was equals the flow available in the section.
In establishing the restriction to comply with environmental legislation, the optimization algorithm determined higher treatment    11/14 levels for effluents.In this case, the treatment measures applied were higher than necessary to maintain the water quality parameters within the limits the class.The total dilution flow modeled in scenario 2 was 22.55 m 3 /s and the total load discharge to the river was 9.14 tons BOD/day.
Figure 9 presents the results of scenario 3, where a similar behavior to that achieved for scenario 2 was observed when the dilution flow was examined.
In scenario 3, the dilution flow was lower than the flow available at any effluent discharge point.The water quality profile remained far from the maximum and minimum limits of the BOD and DO parameters, respectively, established by the environmental law.This result reflects the isonomy among users, with the same type of use, the optimization algorithm determines the same degree of treatment regardless of the water quality of the watercourse at the point of the effluent discharge.This imposes a load removal rate higher than necessary to maintain the water quality standards within the established limits.The total dilution flow obtained in scenario 3 was 24.06 m 3 /s and the total effluent load discharger was 8.20 tons BOD/day.
The analysis of the remaining BOD loads modeled in each scenario showed that the load decreases proportionally with the increase of the legislative restrictions.The dilution flow presents a similar behavior, where we can observe the reduction of the volume necessary to dilute the effluents as the treatment plants are implanted, as expected.The location of the discharge point influences the value of the dilution volume since the concentration of the quality parameter of the receiving body is considered in the calculation of the dilution flow rate.
The water quality profiles presented indicate that the more restrictive the scenario, the better the quality of the water in the watercourse, that is, the quality profile departs from the maximum and minimum limits, stipulated for the framework classes, for BOD and DO, respectively.As for the flow rate required for the dilution, it is observed that for the critical points, where the river presents a higher state of degradation, scenario 1 made better use of the available volumes for the dilution of the effluents than the scenarios 2 and 3.
Table 3 shows the number of users (effluent discharges) by type of use and the number of interventions with the implementation of treatment plants.It is observed that all the scenarios prioritized the treatment of domestic waste.
Table 4 indicates the location of the proposed treatment plants for the river stretched with effluent discharges for each of the strategies: scenarios 1, 2 and 3.The load removal efficiency, type of treatment and cost of implementation of the type of treatment plant is also presented on Table 4.
A brief comparison between the different scenarios proposed can be obtained by observing the treatment efficiencies of the effluent discharges in the Atibaia River, wherein scenario 1 the efficiencies modeled by the optimization process ranged between 45, 75 and 90%.For scenario 2, which is more restrictive, since it considers environmental legislation for the discharges, modeled efficiencies range between 75 and 90%, a larger number of treatment stations are also observed.In scenario 3, the isonomy between users is evident, since the level of treatment was the same for the group of users with the same type of use.The treatment efficiency in scenario 3 was modeled as 75% removal of pollutant load for domestic waste.
Scenario 1 presents the results with a greater degree of freedom regarding the constraints imposed to the optimization algorithm.Therefore, to obtain the best result, effluent discharges are evaluated independently, and treatment efficiency is not linked to other types of uses.In this scenario, the water quality profile of the river is tested and should not excced the limits established by the class of the river.The minimum and maximum treatment limits imposed as input data for each user independently or by type of use are also enforced by the optimization algorithm.Scenario 1 presents the lowest overall cost for the implementation of the decontamination measures.
The results obtained with scenario 2 are close to those of scenario 1.The main difference is that scenario 2 evaluates the restrictions imposed by the environmental legislation for effluent discharges, which requires the treatment of waste effluents with high load, regardless of the location of these discharges in the watershed.
Scenario 3 analyzes the isonomy among users, which prevents the implementation of distinct levels of treatments, with different efficiencies, for users of the same type.It should be noted that the lower limits of treatments for each type of use can be modified in the input data of the DSS, which allows imposing minimum treatments for each type of use, and, thus, reduce the disparity in the adoption of measures between different uses.This type of scenario restricts possible solutions, which can lead to a higher overall cost for the decontamination measures adopted.The spatial distribution of the users in the watershed becomes an important factor, because if a user who presents high effluent discharge and large pollutant load is located in a stretch of the river with a low dilution capacity, a treatment with high removal of waste load should be applied, and this, in turn, will be applied equally to all users with the same purpose of use.

CONCLUSION
A general analysis of the three proposed scenarios allows us to conclude that scenario 1 is more economically and environmentally favorable for the watershed since, in addition to complying with the limits established by the environmental law, it presented the lowest overall cost.However, this scenario does not consider violations of the effluent discharges standards set by the environmental legislation as well as the strategy of isonomy among users with the same kind of use.However, for the construction of the scenarios, environmental legislation strategies, and isonomy among users should be considered, to comply with established standards for effluent discharges and the solution of conflicts between users, respectively.
In the scenario that considers isonomy, charge for use could include in the implementation cost, a compensation to users who are required to implement higher levels of treatment because of the low dilution capacity of the receiving body at it discharge site.Thus, instead of imposing the same levels of treatment on all users with the same type of use, the charging framework would have the function of mitigating differences among users.Therefore, users located in parts of the watershed with greater dilution capacity would contribute monetarily to the implementation of treatment measures in other portions of the watershed optimizing for the invested resources.
In this context of strategy selection, the important role of the watershed conservation authorities in defining priorities is highlighted, to achieve the sustainable development of the basin, considering that the criteria discussed, environmental legislation and isonomy, lead to investments for the implementation of treatment measures.
The effluent granting scenarios proposed in the case study is only a small sample of the potential of the DSS presented in this manuscript since several other scenarios are possible to be applied for the evaluation of the grant.The application of DSS introduces a relevant contribution in the process of analysis of the effluent grant, through the enrichment of the decision process by the possibility to evaluate different strategies and impacts of its application for the improvement of the water body quality, effectiveness of the management tool and influences on the capacity of financial resources.
concentration of the effluent (mg/L); Q e -flow of the effluent (m 3 /s); C max -maximum allowed concentration for the river's class (mg/L); Q r -river flow (m 3 /s); and C r -river's concentration (mg/L).
Dem otim min -minimum flow (volume) for withdrawl i This value depends on the following: • Low risk 90% of the minimum demand required • Medium risk and 80% of minimum demand required; • High risk 50% of minimum demand demanded; Dem otim -modeled flow for withdrawl i; Dem otim Max -maximum flow (volume) for withdrawl i (Required demand).
Cost of the implementation of the treatment system; P 1 -Penalty due to deviation of the BOD and DO parameters from the limitis established in the class;

Figure 3 .
Figure 3. Location of the Atibaia River Basin in the Piracicaba River Basin in the state of Sao Paulo.

Figure 4 .
Figure 4. Profile of BOD in the Atibaia river with AG for 50 generated simulations and Box-Plotters obtained with the BOD data of the monitoring stations.

Figure 5 .
Figure 5. Profile of DO in the Atibaia river obtained with AG for 50 simulations and Box-Plots from the observed data at the monitoring stations.

Figure 6 . 14 Figure 7 .
Figure 6.Profile of BOD and DO obtained for each scenario analyzed.

Figure 8 .
Figure 8. Water quality profile, river flow and dilution flow for scenario 2.

Figure 9 .
Figure 9. Water quality profile, river flow dilution flow for scenario 3.

Table 1 .
Parameters for the functions of Costs of implantation of the sewage treatment systems (Source: adaptaed from BRITES, 2010).

Table 2 .
Water treatment stations used in the case study.

Table 3 .
Total number of users by type and number of treatment plants for each scenario and type of use.

Table 4 .
Location of treatment plant types for each scenario.