Mathematical Analysis for the Optimization of a Design in a Facultative Pond: Indicator Organism and Organic Matter

1 Faculty of Engineering, Science and Architecture of the Juarez University of the State of Durango, 35120 Gómez Palacio, DGO, Mexico 2 Physical-Mathematical Sciences Research Centre, Faculty of Physical-Mathematical Sciences, Autonomous University of Nuevo León, 66451 Monterrey, NL, Mexico 3 Department of Systems and Industrial Engineering, Monterrey Institute of Technology and Higher Education, 66451 Monterrey, NL, Mexico


Introduction
The inadequate wastewater management and discharge to receptors bodies lead to problems, for example, health risks due to contamination by pathogens, odors, and loss of biodiversity.The purpose of the pond systems is to store and treat wastewater with a retention time determined according to Abbas et al. [1] and Naddafi et al. [2].
Stabilization ponds are classified according to their content of oxygen in anaerobic, facultative, and maturation or polishing.And in relation to the sequence of units, they may also be classified as gaps in series or parallel.Usually lagoon systems are composed of these 3 types, although they can be designed only with 2 ponds (facultative and maturation), it is also possible to consider in the design a single lagoon: facultative.The construction of these systems is inexpensive, easy to operate, and easy to maintain.Stabilization ponds can function independently or in combination with other treatment systems, Shilton and Mara [3].
The lagoon systems aim at the removal of organic matter, also called biochemical oxygen demand (BOD mg/L), elimination of fecal coliform, and nutrients as phosphorus and nitrogen with unit of most probable number for each 100 mL (MPN/100 mL), CNA and IMTA [4].
According to Senzia et al. [5], Agunwamba et al. [6], Mara [7], Abbas et al. [1], Hamzeh and Ponce [8], and Naddafi et al. [2] the lagoon systems are recommended for developing countries with tropical and subtropical climates, where the temperature and the intensity of the sunlight favor the efficiency of the treatment process.
The main disadvantage of stabilization ponds is the land requirement.Therefore, it is advisable to perform a detailed analysis of the design of these systems, with the purpose of establishing the smallest possible area to implement the project.
1.1.Anaerobic Lagoons.When considering anaerobic lagoons in the treatment system, it is recommended to be built in conjunction with facultative lagoons.The treatment is performed in the absence of oxygen.The primary mechanism for removal of microorganisms is the sedimentation: helminth ova settle under its own weight, while the bacteria and virus also decanted because they adhere to the settleable solids.Already in the mud, the microorganisms die due to decomposition of organic matter and predators.A condition for anaerobic lagoons to work properly is that bacterial populations must be balanced: the forming bacteria and methane organic acids.To achieve the above, the temperature must be over 15 ∘ C and the potential of hydrogen (pH) should be located between 6.8 and 7.4 according to Mara et al. [9] and Rolim [10].

Facultative Ponds.
It is the second treatment step and the depths recommended in the design vary from 1.5 to 2.5 meters.The treatment is performed by means of aerobic bacteria present in the superior zone and anaerobic in the lower zone [7].There is a mutually beneficial relationship between algae and bacteria; the result of this link is the reduction of organic matter.The bacteria use the oxygen, that is, produced by the algae through photosynthesis (organic compounds are metabolized aerobically).This process releases large amounts of carbon dioxide that in turn is used by algae.The oxygen supply is performed by the photosynthesis and the stir produced by the wind.As already indicated, oxygen supply is due to the photosynthetic algae and the process of reaeration naturally through the mirror of water, that is, in contact with the atmosphere.Oxygen transfer is due to some parameters, for example: (a) temperature of the pond, (b) wind speed, that is, the turbulence of the contact surface, (c) the mix of liquids in the pond favoring the incorporation of oxygen, and (d) physicochemical characteristics of the wastewater in the pond: salinity and concentration of solids, among others according to Rolim [10].

Maturation Ponds or Polish.
The aerobic conditions are maintained throughout the depth of the pond.The purpose is to improve the quality of the effluent from the lagoon; and depth considered, according to the CNA and the climatic conditions of Mexico, must be between 0.60 and 1.5 meters.These ponds are the final stage of treatment.The number and size are defined by the necessary retention time for the removal of fecal coliform [11]; notwithstanding, the above also performed the oxidation of a small amount of BOD5 [12].According to von Sperling [13] and Shilton [14], fecal coliform removal is due to the interaction between different factors, for example: high potential of hydrogen (pH), dissolved oxygen, and solar radiation.The removal of BOD and nutrients is carried out by aerobic bacteria.Other factors that affect the performance are the environmental conditions prevailing in the region under study: precipitation, wind, temperature, and evaporation, among others.
1.4.Baffles.Oakley [12] and Shilton and Harrison [15] recommend the use of channels or baffles, with the intention of modeling the piston type flow and reduce dead zones.
Up to today numerous scientific articles have been published, where the use of baffles has been included in stabilization ponds, for example: Watters et al. [16], Kilani and Ogunrombi [17], Pedahzur et al. [18], Muttamara and Puetpaiboon [19], Muttamara, and Puetpaiboon [20], von Sperling et al. [21], Zanotelli et al. [22], Shilton and Harrison [15,23], von Sperling et al. [24], Shilton and Mara [3], Abbas et al. [1], and Banda [25].These researchers testing different lengths of baffles concluded that the use of channels or baffles to 70 percent of the length gives better results, both in the hydraulic system of the pond and in the wastewater treatment.Then Bracho et al. [26] and Winfrey et al. [27] conducted other studies of lagoons with baffles, and they concluded that with a greater number of baffles, the hydraulic efficiency is increased, but it was necessary to conduct a cost-effectiveness study considering an increasing number of baffles, as well as verification of the efficiency of the treatment.Furthermore, Persson [28], Crites and Tchobanoglouus [29], Metcalf and Eddy [30], Abbas et al. [1], Shilton and Harrison [15], and Oakley [12] found that the length-width ratio, entrances, location, and exits in the ponds have a significant effect on the treatment efficiency.Some model systems include different properties; for example, Salter et al. [31] considered the influence of the baffles in the hydraulic flow conditions; time after Sweeney et al. [32] analyzed the effect of wind particularly in the hydraulic profile; later Manga et al. [33] focused his studies on the length and location of entry and exit in the flow regime of the lagoon systems.Later some studies were made that included the combined effects of wind, the impact of the baffles, and the position of inputs and outputs: Shilton and Harrison [15] Shilton and Mara [3], Sweeney et al. [32], and Aldana et al. [34].Then Sah et al. [35] conducted a comparison of the different models focusing on well-defined characteristics as water quality, nutrient removal, hydraulic of the ponds, and carbon, among others.They concluded that it was necessary to develop a comprehensive and calibrated model as a support tool for optimization of stabilization lagoons.
About the cost and design of pond systems, Kilani and Ogunrombi [17] recommend optimization for stabilization ponds in order to get the design at minimal cost.Other researchers conducted studies including linear programming, in order to obtain an optimal design of lagoon systems.They concluded that it is possible to determine an improved design, through optimization programs that are based on minimizing costs and maximizing efficiency of treatment according to Nelder and Mead [36], Fonseca and Fleming [37,38], Oke and Otun [39], Bracho et al. [26], Winfrey et al. [27] and Olukanni and Ducoste [40].
The contribution of this paper is to determine a mathematical analysis of the traditional methodology and to define constraints (biochemical oxygen demand and the number of fecal coliform in the effluent) of the mathematical optimization model.As well as programming the objective function in Matlab.
The goal of this paper is to create an optimization model in order to minimize the construction cost of a facultative pond, as already mentioned, considering the biochemical oxygen demand and the number of fecal coliform in the effluent as restrictions of the model.The variables of the model are the retention time and the number of baffles.In this work, the objective of the mathematical model is the minimization of cost using the  mincon (function in Matlab) and the interior-point algorithm.
The present work is an extension of the study by Olukanni and Ducoste [40].The optimization criteria, considered by authors cited, consist in the application of a multiobjective optimization model, where costs are minimized and the efficiency is maximized.
As already indicated the model is subject to the restrictions of the BOD and the number of fecal coliforms, which forces the model to always comply with water quality standards.Another important difference is that in the present study is included the organic matter as a constraint, while the study of Olukanni and Ducoste only considered the fecal coliforms.
In México, the studies of lagoon systems optimization are few.Then the purpose of this work is focused in three objectives: (a) design a facultative pond with the traditional method including baffles and system cost, (b) apply the nonlinear programming tool to design and obtain the cost of the facultative pond, and (c) compare the results between the two analyses and identify cost savings and advantages.
This work is organized as follows: in Section 1 the nomenclature for the design of the facultative lagoon, and the methodology to be applied and preliminary mathematical model are established.Section 2 includes the mathematical relations that intervene in the objective function, the mathematical model, variables of decision, and mathematical analysis to define the right side of the constraints.Section 3 shows an example of application, applying both methodologies, the traditional method of design, and mathematical model for the optimization.There is included in addition a comparative analysis of results and a model sensitivity analysis.In Section 4 conclusions are given.

Materials and Methods
For the design of the facultative pond was considered the methodology adopted for Mexico by the National Water Commission and the Mexican Institute of Water Technology.The consulted text was Technological Packages for the Treatment of Wastewater and Excreta in Rural Communities of the National Water Commission [4].(2) (c) Facultative pond area

Nomenclature for the Design of the Facultative Pond
(d) Volume of the lagoon (e) Hydraulic retention time (f) Sizing length-width ratio equals 3 (g) For the width and length (h) Calculation of surface area (j) According to CNA and IMTA [4], the length-width ratio considering bafflesat 70% of the lagoon length is given by Expression ( 13) was defined by Yánez [41]  =  −0.26118 + 0.25392 () + 1.0136() 2 . ( Equation ( 14) was proposed by Yánez [42] (l) Constant "" is determined by the formula According to Rolim [10] this factor was determined by Wehner and Wilhelm [43].
(m) Fecal coliforms in the effluent of the facultative pond According to Rolim [10] (16) was simplified by Thirumurthi [44] from the equation initially proposed by Wehner and Wilhelm [43].
(n) Fecal coliforms corrected by evaporation (o) Concentration of BOD in the lagoon effluent, kinetic coefficient, (p) Concentration of BOD in the lagoon effluent (q) BOD corrected by evaporation In order to establish a criterion for optimizing the facultative pond, the operative route is proposed, as seen in Figure 1.

Objective Function
To define, the objective function is considered as follows: cost of land: $750.00 per square meter, cost of embankment: $1,200.00per lineal meter, and cost of baffles: $500.00 per lineal meter.Figure 2 shows a transverse cut of the facultative lagoon.
In order to determine the area of the pond, it was considered the upper width ( Sup ) plus 6 meter from each side as shown in Figure 2. Following the same criterion for the length, it is obtained: ( sup + 12)( Sup + 12).For the perimeter of the embankment was considered the axis distance, thus obtained 2( Sup + 3) + 2( Sup + 3).The baffle length was considered as the 70 percent of the total length of the facultative pond, it is obtained: (0.7) Mamp  Sup .The slope of embankment is 2 : 1; the depth of the lagoon is 1.5 meters. where The above expression represents the upper width of the facultative pond plus 3 meters depth slope ratio on the embankment CNA and IMTA [11].
The next term defines the upper length of the pond, considering the length width ratio of 3.
According to [46] to define the expression of average width of the facultative pond, the volume of the expression ( 5) is cleared; then, it is replaced in (4).The resulting from the above process is replaced in the formula (6), and the top width of the lagoon is obtained: In similar form, upper length of the facultative lagoon was obtained: Substituting ( 25) and ( 26) into (22) 3.1.Decision Variables.According to Eppen et al. [47], the control variables are the amounts to be determined considering the constraints.In this case, they are retention time and number of baffles.Their expressions are given by    Mamp .

Constraints.
It is advisable to realize a mathematical analysis with the intention of determining in a single expression all the equations that intervene to predict the fecal coliforms in the effluent.Then applying the traditional methodology, the equations are given by ( 11), ( 12), ( 13), ( 14), ( 15), (16), and (17).
The criteria used to define the right side of the constraints were (a) the quality of the treated water in the effluent which indicates the norm: fecal coliform must be less or equal than 1000 MPN/100 mL and (b) BOD is less than or equal to 75 mg/L [47].Now the mathematical criterion for determining the indicator organism is described.
From ( 12) removal of fecal coliforms including baffles to 70 percent of the length, we have Then, substituting "" into (13) (factor of nondimension dispersion): Substituting last expression in (15) nondimensional ", " the following equation is obtained: )) To calculate the number of fecal coliform corrected by evaporation in the effluent from the lagoon, consider the following analysis: (a) we substitute ( 29) and ( 30) into ( 16) of the traditional methodology; (b) then, we correct the number of fecal coliform by evaporation (  /  ).The result of the above analysis can be replaced in (17); (c) then, in the result expression from of the above process, the flow in the effluent (  ) by formula (11) and the surface area is replaced (Asup) by formulas (25) and (26).Finally, ( 16) with 4 terms is indicated.
The 4 terms are given by ) , In this form the fecal coliforms corrected by evaporation in the effluent of the facultative lagoon are computed.

BOD Constraints.
For the organic load we replace the expression (18), which stands for the concentration of BOD in the lagoon effluent, in formula (19).What results from the above expression is multiplied by the ratio of concentration by evaporation (  /  ).Following the approach used for the correction due to evaporation of the indicator organism we have For decision variables ( Mamp ,   ) the no negativity constraint is considered.Finally the constraints of the model are given by BOD  ≤ 75,   ≤ 1000,  Mamp ,   ≥ 0.

Application Example
It is needed to design a facultative pond for a rural community with a reach of 2,000 inhabitants; a contribution of 154 L/inhabitants/day is considered [4].The design flow is 308 m 3 /day.The average temperature of the coldest month is 11.8 ∘ C [11].The number of fecal coliforms in the influent is 10,000,000 MNP/100 mL and BOD  = 220 mg/L [30].The evaporation is considered as 5 mm/day.To determine the quality of treated wastewater, NOM-001-ECOL-96 was considered [48].

Results and Discussion.
In Table 1 and Figure 3 results and dimensions of the facultative lagoon obtained by applying the traditional method are illustrated.It is noted that with 3 baffles fecal coliform were under 1000 MPN/100 mL, and BOD was lower than 75 mg/L.

Application of the Mathematical Model with Matlab.
We made two files in format ", " in the first we developed objective function according to expression (27), and in a second file we wrote the constraints.Consider the following.where  = total Cost.  = flow in the influent (m 3 /day).(1) = retention time (days).(2) = number of baffles in the facultative pond.Table 2 indicates the optimized decision variables (retention time and number of baffles, resp.) and the final value of the objective function (total cost).
Note that the number of baffles calculated with Matlab is not real because the number of partitions must be an integer.Therefore, it is rounded to the nearest integer to obtain an improved real solution.The values shown in Table 2 are replaced in the formulas of the traditional methodology; we review the number of fecal coliforms in the effluent and the BOD (must be equal or lower than those indicated by the regulations).The optimized dimensions are calculated for the facultative pond.
About the number of baffles, the toolbox of Matlab determined the optimal, which was rounded to 9, instead of 3 originally proposed in Table 1.According to Kilani and Ogunrombi [17], Muttamara and Puetpaiboon [19,20], von Sperling et al. [21], Shilton and Harrison [15], Shilton and Mara [3], and Abbas et al. [1] adding baffles favors the elimination of fecal coliform as it improves the hydraulic flow in the lagoon.The results of the present study coincide with the affirmations of the mentioned researches.
In agreement with Table 4, the time of hydraulic retention was reduced from 25.77 (applying the traditional methodology) to 20.95 days, 4.82 days less, which represents 18.70%.The last is an important percentage since this condition influences the dimensions of the lagoon and as consequence the requirement of the area [11].
Although the retention time was reduced by applying optimization, fecal coliforms resulted below 1000 MPN/ 100 mL.The organic matter was increased from 43 to 50 mg/L (Tables 1 and 3).However it is still below norm NOM-001-ECOL-96 [48].
As it is noted, the decision variables calculated by Matlab optimization toolbox are in accordance with the norm and the constraints, since they were checked again by the traditional methodology.
Table 4 shows the area needed for each of the analyses.A minor area of 1,039 square meters was obtained which represent 17.90 percent.The previous observation is an important percentage in terms of acquisition of area and infrastructure.As already mentioned the principal disadvantage of those systems is the great requirement of the area.Table 1 shows original values calculated with the traditional design method and Table 3 shows the value of improved solution.
The cost difference is $753,757.22which represents the 11.43 percent.According to Olukanni and Ducoste [40] it is possible to reduce the costs of building a lagoons system when defining properly constraints (e.g., the mathematical analysis for computing the right side of the limits), such that when the optimization system is applied the maximum permitted levels of wastewater discharge to receiving bodies is obtained.The results of this work coincide with the cited author.
According to Oke and Otun [39], Shilton and Harrison [23], Bracho et al. [26] and Winfrey et al. [27], including a greater number of baffles significantly improves hydraulic efficiency of the ponds; however, it is important to consider the costs of construction; this is necessary to conduct a costeffectiveness study.The results of this study (Table 4) indicate greater number of baffles using optimization; notwithstanding the foregoing, the cost was reduced to 11.43 percent.The obtained results agree with the statements of these authors, since by increasing the number of baffles the removal efficiency of the indicator organism was higher; despite the above, it was obtained less area and cost.
The novelty of the contribution provided herein, regarding previous works of the authors (references 45 and 46),is (a) the model is simplified, that is, constraints are removed and the model is defined more generally and it can be adjusted to different conditions, (b) the feasible area of the model is increased, and this makes possible to find cheaper solutions, (c) an operational path to the optimal solution of problem is proposed considering the number of integer baffles, and (d) the Matlab program is used the Matlab "fmncon" function and interior point algorithm were used.

Sensitivity Analysis.
As is shown in Figure 4, this model is nonlinear.This figure shows the controllable variables that considers the objective function.According to Anderson et al. [49] demonstrated that the function is sensitive to changing variables.
The highest value of BOD displayed in Figure 5 indicates the concentration of organic matter considered in the design data.It is observed that the decay of organic matter in the course of the days until reaching the retention time is calculated by the optimization tool.The BOD is below the maximum allowable limit indicated by regulations.
Figure 6 shows the decay of the indicator organism in the course of the days.It also indicates that when increasing the number of baffles, the efficiency in removing fecal coliforms increases.According to Sah et al. [35], sensitivity analysis is the response of the model to changes in some values of the   parameters.As shown, the proposed model is sensitive to modification of the decision variables.
In Figure 7 are illustrated the dimensions computed by optimization tool of Matlab.

Conclusions
The mathematical model for optimizing the design and cost of a facultative lagoon was applied, considering the mathematical analysis to determine the constraints: fecal coliform and biochemical oxygen demand.The mathematical model was determined as a function of hydraulic retention time and the number of screens.And still, these variables were considered open, that is, were determined according to the optimal included constraints.The results show a significant  decrease in hydraulic retention time and cost compared to the results of the traditional system.The climatic conditions prevailing in the Comarca Lagunera were considered in this paper.
Although this paper is a study case, the approach and the proposed model can be applied to various design conditions.But it is necessary to carry out the appropriate modifications: influent flow rate, temperature, embankment costs, land costs, screens, slopes, and evaporation.Then, perform the optimization considering the proposed route.
It is important to indicate that the mathematical reasoning and equations determined in the restrictions were verified using the variables of decision calculated by the tool of optimization in the traditional methodology.In addition the present proposed mathematical model can be solved using other algorithms as GRG (generalized reduced gradient) and genetic.

Future Studies
It is prudent to conduct future experiments to verify the degree of dispersion that throws this mathematical model, and consider this as a constraint of the model.
= Area in facultative pond (m 2 )  = Dimensionless constant  Sup = Superficial area of the lagoon (m 2 ) BOD  = Concentration of BOD5 in the lagoon effluent corrected by evaporation (mg/L) BOD  = Concentration of BOD5 in the effluent (mg/L) BOD  = Concentration of the biochemical oxygen demand in the influent of thelagoon (mg/L)  Prom = Average width of the lagoon (m)  Sup = Upper lagoon width (m) C.O. = Organic load  = Dimensionless dispersion factor  = Evaporation (mm/day)   = Bacterial reduction coefficient (day −1 )   = Decay constant at any temperature (day −1 ) ] = Organic surface load (Kg/ha-day)  Prom = Average length of the lagoon (m)  Sup = Upper lagoon Length (m)   = BOD5 concentration in the lagoon influent (mg/L) 1000 = Conversion factor   = Fecal Coliforms corrected by evaporation in the influent of the lagoon (MPN/100 mL)   /  = Number of fecal coliforms in the effluent (MPN/100 mL)   = Fecal coliforms in the lagoon influent (MPN/ 100 mL)  Mamp = Number of baffles in the facultative pond   = Average hydraulic retention time (days)   = Flow in the lagoon effluent (m 3 /day)   = Flow in the lagoon influent (m 3 /day)  med = Influent flow (m 3 /day)  alud = Levee slope = 2 : 1 ratio  = Monthly average lower temperature of air ( ∘ C)  = Volume of the lagoon (m 3 )  = Ratio between length and width, considering baffles  = Depth of the lagoon (m).

( 34 )
Retention time and number of baffles are considered open; it is to say, the toolbox of Matlab's optimization will determine the ideal number of agreement with the one already indicated in restrictions.

Figure 3 :
Figure 3: Dimensions of the facultative pond applying traditional method.
n ti o n ti m e (d a y s ) Objective function N u m b e r o f b a ffl e s Total cost ×10 6

Table 1 :
Results of the facultative pond design with the traditional method.

Table 2 :
Optimization results with Matlab.

Table 3 :
Results of replacing Matlab results in formulas of traditional methodology.

Table 4 :
Comparison of results between traditional method and optimization model.