# Improved Optimization for Wastewater Treatment and Reuse System Using Computational Intelligence

Authors: Zong Woo Geem; Sung Yong Chung; Jin-Hong Kim
Journal: Complexity
 (2018)

---

## Abstract

River water pollution by wastewater can cause significant negative impact on the aquatic sustainability. Hence, accurate modeling of this complicated system and its cost-effective treatment and reuse decision is very important because this optimization process is related to economic expenditure, societal health, and environmental deterioration. In order to optimize this complex system, we may consider three treatment or reuse options such as microscreening filtration, nitrification, and fertilization-oriented irrigation on top of two existing options such as settling and biological oxidation. The objective of this environmental optimization is to minimize the economic expenditure of life cycle costs while satisfying the public health standard in terms of groundwater quality and the environmental standard in terms of river water quality. Particularly, this study improves existing optimization model by pinpointing the critical deficit location of dissolved oxygen sag curve by using analytic differentiation. Also, the proposed formulation considers more practical constraints such as maximal size of irrigation area and minimal amount of filtration treatment process. The results obtained by using an evolutionary algorithm, named a parameter-setting-free harmony search algorithm, show that the proposed model successfully finds optimal solutions while conveniently locating the critical deficit point.


---

## Body

## 1. Introduction

Polluted water dumped into a river causes considerable negative impact on the sustainability of aquatic life. Thus, accurate modeling of this complex system and optimal decision making is therefore very critical since this relates to environmental deterioration, economic expenditure, and human health.In order to optimize this complicated problem, we should first consider various life cycle costs of wastewater treatment and reuse alternatives such as microscreening filtration, nitrification, and diverted fertilization-wise irrigation as well as settling and biological oxidation [1]. Under the optimally minimized budget, all the technical and regulatory constraints such as dissolved oxygen level along the river reach, nitrate-nitrogen level in groundwater, nitrogen amount for crop uptake, irrigation area size, and treatment amount in filtration process should be addressed.To date, various simulation-optimization approaches have been proposed to the wastewater treatment problem [1–7]. However, there is still more room to improve in terms of optimization formulation and simulation calculation for obtaining better solutions. Particularly, this study improves existing simulation calculations by exactly finding the critical deficit point of dissolved oxygen sag curve using analytic calculus. While previous approaches [1–3] approximate the minimal point by roughly discretizing the continuous river reach into eight points (5, 10, 15, 20, 25, 30, 40, and 50 km away from the effluent spot), this study clearly pinpoints the minimal location by analytically performing the differential calculus. In addition, the proposed formulation considers more practical constraints such as maximal size of irrigated area and minimal amount of filtration treatment.Thus, this study intends to improve the optimization structure and the calculation process of the complex wastewater treatment and reuse problem and then to find the optimal solution using an improved evolutionary algorithm, which does not require the boring process of algorithm parameter setting.


## 2. Problem and Modeling

The original wastewater treatment and reuse problem was proposed by Haith [1]. A municipal area, where 100,000 citizens reside, dumps wastewater (40,000 m3/day) into a river after treating it with settling and biological oxidation. However, these processes are not enough to meet the water quality regulation (5 ppm or 5 mg/liter in terms of dissolved oxygen (DO)). Thus, the local government plans to construct an extra treatment system to improve the effluent quality.As seen in Figure1, the extra treatment system can include two treatment options (filtration and nitrification) and one diverted irrigation option for the sake of crop fertilization. In this system, there are five decision variables such as (1) wastewater volume directly dumped into the river (Q1 kilo-m3/day), (2) wastewater volume treated by filtration process (Q2 kilo-m3/day), (3) wastewater volume treated by nitrification process (Q3 kilo-m3/day), (4) wastewater volume treated by nitrification and filtration processes (Q4 kilo-m3/day), and (5) wastewater volume diverted for crop fertilization (Q5 kilo-m3/day).Figure 1
Schematic of wastewater treatment system.For these extra treatment options (doing nothing(Q1), filtration only (Q2), and nitrification only (Q3-Q4) and both nitrification and filtration (Q4)), quantified effects can be assessed as described in Table 1.Table 1
Quantified effect of each treatment.
Type of treatment Effluent quality (in ppm) DO CBOD NBOD Secondary process only(Q1) 2 25 54 Secondary + filtration(Q2) 2 13 50 Secondary + nitrification(Q3-Q4) 2 13 10 Secondary + nitrification + filtration(Q4) 2 7 10If wastewater is fully mixed with river flow at the discharge point, initial effluent qualityC0, B0, and N0 can be calculated using Table 1 and weighted average. If river flow is 110,000 m3/day, DO is 8.0 ppm, carbonaceous biochemical oxygen demand (CBOD) is 2.0 ppm, and nitrogenous biochemical oxygen demand (NBOD) is 5.0 ppm, C0, B0, and N0 become as in (1)C0=8110+2Q1+Q2+Q3110+Q1+Q2+Q3,B0=2110+25Q1+13Q2+13Q3-Q4+7Q4110+Q1+Q2+Q3,N0=5110+54Q1+50Q2+10Q3-Q4+10Q4110+Q1+Q2+Q3.For the discharged amount(Q1+Q2+Q3) into the river, dissolved oxygen level C(x) at x km from the discharge point can be expressed as in (2). Here, u is flow velocity (this study uses 7.9 km/day); k2 is reaeration rate (this study uses 0.5/day); Cs is saturation DO (this study uses 8.0 ppm); B and N are CBOD and NBOD (ppm) at x; and k1 and kn are rate constants (this study uses 0.35/day and 0.2/day, resp.)(2)udCdx=k2Cs-C-k1B-knN.The first term of the right-hand side (RHS) in (2) stands for oxygen increase owing to reaeration and the second and third terms stand for oxygen decrease owing to oxidation by carbonaceous and nitrogenous material.The differential equation can have an analytic solution by manipulating it using (3) to (14) [3]. From the relationship(3)udBdx=-k1B,udNdx=-k1N,(2) becomes(4)dCdx=k2uCs-C-k1uB0e-k1x/u-knuN0e-knx/u.Equation (4) can be written again in the form of 1st-order nonhomogeneous ordinary differential equation as in (5)dCdx+k2uC=qx,qx=k2uCs-k1uB0e-k1x/u-knuN0e-knx/u.If an integral factorμ is introduced, (6)μ=e∫k2/udx=ek2/ux.From (5) and (6), (7) is derived because dμ/dx=k2/uμ(7)μdCdx+Cdμdx=μqx.Equation (7) can be further rewritten as (8)(8)ddxμC=μqx.Equation (8) can be integrated as (9)(9)μC=∫μqxdx+C~.If Equation (9) is divided by μ, it becomes(10)C=1μ∫μqxdx+1μC~=e-k2/ux∫ek2/uxqxdx+C~e-k2/ux.Here,∫ek2/uxq(x)dx becomes(11)∫k2uCsek2/ux-k1uB0e-k1/uxek2/ux-knuN0e-kn/uxek2/uxdx=Csek2/ux-k1k2-k1B0ek2-k1/ux-knk2-knN0ek2-kn/ux+C~~.Thus, (10) becomes(12)C=Cs-k1k2-k1B0e-k1/ux-knk2-knN0e-kn/ux+C~~e-k2/ux+C~e-k2/ux.Ifx=0 and D=C~~+C~, (12) becomes(13)C0=Cs-k1B0k2-k1-knN0k2-kn+D.Finally, an analytic solution is obtained as in (14), which is known as the DO sag equation by Streeter–Phelps [8](14)Cx=Cs-k1B0k2-k1e-k1/ux-knN0k2-kne-kn/ux+C0-Cs+k1B0k2-k1+knN0k2-kne-k2/ux=Cs1-e-k2/ux+C0e-k2/ux-k1B0k2-k1e-k1/ux-e-k2/ux-knN0k2-kne-kn/ux-e-k2/ux.Another option, instead of the filtration and/or nitrification treatments, is diverted irrigation for crop fertilization. The diverted volumeQ5 has nitrogen. If the nitrogen concentration of Q5 is n (20 ppm in this study), the contained nitrogen amount becomes 0.1rTn (kg/ha). Here, 0.1 is unit conversion coefficient; r is another decision variable, denoting irrigation rate (cm/week); and T is the irrigation period (13 weeks in this study). If the nitrogen consuming amount of crop is NC (170 kg/ha in this study), the nitrogen amount (0.1rTn) in Q5 should be equal to or greater than the crop’s nitrogen demand (NC) as follows:(15)0.1rTn≥NC.The surplus nitrogen amount0.1rTn-NC is percolated into groundwater. And, total liquid amount percolated into groundwater becomes rT+P-ET. Here, P is precipitation amount (cm) during the irrigation period; and ET is evapotranspiration amount (cm) during the irrigation period. Thus, the nitrate-nitrogen concentration cn (ppm) in the percolation amount can be expressed as in (16). Here, 10 is the unit conversion coefficient; and cn should be equal to or less than 10 ppm according to local government regulation(16)cn=surplus nitrogenpercolation=100.1rTn-NCrT+P-ET.


## 3. Improved Optimization Formulation

The objective function of the wastewater treatment problem described in the previous section is the total life cycle cost to be minimized as in (17) [1, 2]. The cost function consists of three subcosts including filtration process cost Cft, nitrification process cost Cnt, and irrigation process cost Cir.(17)Minimizez=fQ1,Q2,Q3,Q4,Q5,r=Cft+Cnt+Cir.C ft ($103/year) is composed of capital cost (first term in RHS of (18)) and operation and maintenance (O&M) cost (second term in RHS of (18))(18)Cft=3Q2+Q40.93+6.7Q2+Q40.55.C nt ($103/year) is composed of capital cost (first term in RHS of (19)) and O&M cost (second term in RHS of (19))(19)Cnt=13.8Q30.68+10.6Q30.42.C ir ($103/year) is composed of capital cost of transmission pipeline (first term in RHS of (20)), capital cost of storage system (second term in RHS of (20)), O&M cost of storage system (third term in RHS of (20)), capital cost of irrigation system (4th term in RHS of (20)), O&M cost of irrigation system (5th term in RHS of (20)), land rent cost (6th term in RHS of (20)), and crop sales benefit (7th term in RHS of (20)). Here, A is irrigated area (ha), which can be calculated as 70Q5/r(20)Cir=21.9Q50.28+1.2Q50.78+0.2Q50.54+13.1+48rQ50.74+0.32/r+5.1+19rQ50.79+0.28/r+0.19A-0.87A.Technical and regulatory constraints for this problem are(21)Q1+Q2+Q3+Q5=40,(22)Q3≥Q4,(23)0≤Qi≤40,i=1,…,5,(24)81-e-0.063x+C0e-0.063x-2.33B0e-0.044x-e-0.063x-0.67N0e-0.025x-e-0.063x≥5,(25)6.54≤r≤13.07.Equation (21) constrains the total wastewater amount to be equal to 40 kilo m3/day; (22) constrains the amount of nitrification to be equal to or greater than that of both nitrification and filtration; (23) constrains any subwastewater amount to stay between lower and upper limits (0 to 40 kilo m3/day); (24) constrains DO level at any point along the river reach to be greater than or equal to 5 ppm; and (25) constrains total nitrogen amount to be greater than or equal to crop nitrogen requirement as specified in (15) and also constrains nitrate-nitrogen concentration cn to be less than or equal to 10 ppm as specified in (16).This wastewater treatment optimization problem was originally proposed by Haith [1] and more optimally solved using harmony search [2]. However, total discharged amount is assigned only to irrigation (Q5=32.19 kilo m3/day) or no further treatment (Q1=7.81 kilo m3/day) while nothing is assigned to filtration (Q2=0) and nitrification (Q3=0) because this way is more cost-efficient [2]. The best solution is f(Q1=7.81,Q2=0,Q3=0,Q4=0,Q5=32.19,r=7.40)=303.0 which satisfies all the constraints in (21) to (25).In order to improve this biased result, a slight modification was made to the cost coefficients [3]. When the cost coefficients for filtration and nitrification were reduced, some portion was assigned to Q2 and Q3 [3]. However, this case is also not very realistic because most of the portion was assigned to Q2 and Q3 while only a tiny amount was assigned to Q5 and Q1.Here, if we analyze the best solution in [2], we may improve the optimization formulation. For example, without the constraint of irrigated area, the area size can be expanded up to 428 ha. But, more realistically we can consider the maximum irrigation size (for example, 100 ha in this study), as follows:(26)A≤100.Also, the filtration process may require minimum treatment amount (e.g., 10 kilo m3/day in this study) because a tiny amount is not realistic for operating the treatment plant cost-effectively, as follows:(27)Q2+Q4≥10.For the DO level constraint specified in (24), we have to ideally check the entire river reach. However, we were not able to check all the continuous points because the number of tasks is astronomical. Thus, previous research [1–3] approximately and arbitrarily checked only 8 points (5, 10, 15, 20, 25, 30, 40, and 50 km from the origin). This approach is not accurate at all and sometimes violates minimal DO level because actual maximum deficit point exists between two points. Also, there is a chance that the deficit point exists out of the range (5 to 50 km) if the model is applied to other problems.In order to overcome this critical drawback, this study proposes an analytical solution which can deterministically find the minimal DO location instead of checking only eight points. Basically, we can obtain the minimal DO location by differentiating the DO function specified in (14). However, the task is too complicated to easily obtain it. Nonetheless, this very problem has a problem-specific way to find the location deterministically.Equation (14) can be differentiated as follows: (28)ddxCx=-αe-k2/ux+βe-k1/ux+γe-kn/ux,α=k2uC0-Cs+k1B0k2-k1+knN0k2-kn,β=k1uk1B0k2-k1,γ=knuknN0k2-kn.To solve (28), we introduce ek2/ux which is greater than 0.(29)ek2/ux-αe-k2/ux+βe-k1/ux+γe-kn/ux=0.It further becomes(30)-α+βek2-k1/ux+γek2-kn/ux=0.For this specific problem,k2=0.5/day, k1=0.35/day, and kn=0.2/day. Thus, the following equation is satisfied:(31)k2-knux=2k2-k1ux.Ifz=ek2-k1/ux, (30) becomes(32)-α+βz+γz2=0.Hence, using quadratic formula,z becomes(33)z=-β±β2+4αγ2γ.Sincez=ek2-k1/ux>0,(34)z=ek2-k1/ux=-β+β2+4αγ2γ.Thus,(35)k2-k1ux=ln⁡-β+β2+4αγ2γ.Finally,(36)x=uk2-k1ln⁡-β+β2+4αγ2γ.


## 4. Harmony Search Algorithm

This study utilizes a parameter-setting-free harmony search (PSF-HS) algorithm for obtaining the optimal solution. Different from the original harmony search (HS) algorithm, the PSF-HS algorithm does not require the tedious process of algorithm parameter value setting [9] and has so far been applied to various bench-mark problems [10, 11] and engineering optimization problems including structural design [12] and groundwater pollution source identification [13]. More generally, the HS algorithm has so far been theoretically developed and practically applied to various computational intelligence and complex problems [14–16].The basic structure of HS algorithm contains a solution pool named harmony memory (HM), which has randomly generated solutions as many as harmony memory size (HMS; 30 in this study) [2]:(37)HM=Q11Q21Q31Q41Q51r1fx1Q12Q22Q32Q42Q52r2fx2⋮⋮⋮⋮⋮⋮⋮Q1HMSQ2HMSQ3HMSQ4HMSQ5HMSrHMSfxHMS.And, at every improvisation (iteration), a new harmony (solution vector)xNew is generated based upon HM as follows: (38)xiNew⟵xi∈xiLower,xiUpperw.p.1-HMCRxi∈HM=xi1,xi2,…,xiHMSw.p.HMCR·1-PARxi+Δ,xi∈HMw.p.HMCR·PAR,i=1,…,6where Δ is pitch adjusting volume that is obtained as (xiUpper-xiLower)/1000×u(-1,1) in this study; u(-1,1) is uniform random number generated between −1 and 1; HMCR stands for harmony memory considering rate (value range: 0 ≤ HMCR ≤ 1); and PAR stands for pitch adjusting rate (value range: 0 ≤ PAR ≤ 1).If the new harmonyxNew satisfies every constraint and is better than the worst harmony xWorst contained in HM, the former is included in HM and the latter is excluded from HM as follows:(39)xNew∈HM∧xWorst∉HM.The processes specified in (38) and (39) are repeated until a termination criterion, such as maximum number of iterations (improvisations), is satisfied.The PSF-HS algorithm, when compared with the basic HS algorithm, has one extra matrix, called operation type matrix (OTM). Equation (40) shows one example of OTM(40)OTM=o11=Randomo21=Pitch⋯o61=Memoryo12=Memoryo22=Memory⋯o62=Pitch⋮⋯⋯⋯o1HMS=Memoryo2HMS=Random⋯o6HMS=Memory.OTM memorizes the operation history of every harmony stored in HM. At the early stage, HMCR and PAR have a constant value of 0.5, and OTM is accumulating the operation information. Then, HMCR and PAR are iteratively updated based on OTM, instead of using fixed parameter values(41)HMCRi=ctoij=Memory∨oij=Pitch,∀jHMS,PARi=ctoij=Pitch,∀jctoij=Memory∨oij=Pitch,∀j,where ct· stands for the function which returns the number of designated operations.Since every decision variable has different HMCR and PAR, (38) can be slightly changed as follows: (42)xiNew⟵xi∈xiLower,xiUpperw.p.1-HMCRixi∈HM=xi1,xi2,…,xiHMSw.p.HMCRi·1-PARixi+Δ,xi∈HMw.p.HMCRi·PARi,i=1,…,6


## 5. Computation Results

The improved optimization model was applied to the wastewater treatment and reuse system and obtained the results using the PSF-HS approach (5,000 iterations). Table2 shows the detailed results out of 10 runs. While a traditional mathematical optimization algorithm such as generalized reduced gradient method gets stuck in local optima or even diverges [2], the PSF-HS was able to robustly find solution vectors.Table 2
Optimization results for wastewater treatment system.
Run #1 #2 #3 #4 #5 #6 #7 #8 #9 #10 Cost(k$/yr) 373.1 375.5 377.6 375.4 383.1 378.2 377.7 371.5 377.2 379.1  Q 1  (k ton/d) 0.12 0.01 0.13 0.15 0.48 0.16 0.10 0.05 0.49 0.37 Q 2  (k ton/d) 0.12 0.30 0.61 0.26 0.84 0.70 0.65 0.05 0.11 0.50 Q 3  (k ton/d) 31.95 32.34 30.55 31.64 28.67 30.08 30.48 32.37 30.67 30.01 Q 4  (k ton/d) 9.96 11.33 9.75 10.38 9.68 9.40 9.67 9.95 9.97 9.75 Q 5  (k ton/d) 7.81 7.35 8.71 7.96 10.01 9.07 8.77 7.53 8.73 9.13 r  (cm/wk) 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07  Q 2 + Q 4  (≥10) 10.08 11.63 10.36 10.64 10.52 10.10 10.32 10.00 10.08 10.24 Q 3 - Q 4  (≥0) 21.99 21.01 20.80 21.26 18.99 20.68 20.81 22.43 20.70 20.26 A  (≤100 ha) 41.9 39.4 46.7 42.6 53.6 48.6 46.9 40.3 46.8 48.9 0.1 r T n  (≥170 kg/ha) 339.8 339.8 339.8 339.8 339.8 339.8 339.8 339.8 339.8 339.8 c n  (≤10 ppm) 9.99 9.99 9.99 9.99 9.99 9.99 9.99 9.99 9.99 9.99 x  (km) 16.79 16.75 16.95 16.83 17.16 17.00 16.95 16.75 16.94 17.01 C x  (≥5 ppm) 5.00 5.00 5.00 5.00 5.00 5.00 5.00 5.00 5.00 5.00As observed in the table, optimal costs were obtained, ranging from 371.5$103/year to 383.1 $103/year with the average of 376.8 $103/year. Also, all the constraints were satisfied: every filtration inflow (Q2+Q4) was greater than minimally required amount (10 kilo-ton/day); every pure nitrification amount (Q3-Q4) was greater than 0, which means Q3≥Q4; every irrigation area is less than 100 ha; every nitrogen amount for crop fertilization is greater than the required amount (170 kg/ha); every water quality in groundwater is less than the regulated level (10 ppm); and every DO level at the pinpointed lowest location is greater than the minimally required level (5 ppm).Figure2 shows DO sag curve for the best cost ($371.5 × 103/year) from the solution vector (Q1=0.05; Q2=0.05; Q3=32.37; Q4=9.95; Q5=7.53; r=13.07). The analytic solution specified in (36) could find the critical deficit location (16.75 km) of DO more easily and efficiently for this problem.Figure 2
Dissolved oxygen sag curve.Figures3 and 4 show the histories of HMCR and PAR values in obtaining the best solution ($371.5 × 103/year). As observed in Figure 3, all the HMCR values have converged into high values (≥0.95) after 600 iterations. This means that PSF-HS conservatively depends on the values stored in HM.Figure 3
History of HMCR for best solution.Figure 4
History of PAR for best solution.Meanwhile, as observed in Figure4, all PAR have converged into low values (≤0.1) after 1,000 iterations, except the PAR for irrigation rate r, which rose up to 0.5 and then slightly went down to 0.35. This means that PSF-HS mostly does not need any further pitch adjustment for each treated or diverted volume; however, the irrigation rate needs to be frequently pitch-adjusted because it should satisfy the nitrate-nitrogen concentration level (cn ≤ 10 ppm) in groundwater.


## 6. Conclusions

This study proposed an improved optimization model for the wastewater treatment and reuse system that contains three options such as filtration, nitrification, and diverted irrigation and found optimal solutions using the PSF-HS technique. The improved optimization model could obtain the minimal life cycle cost design while satisfying DO level at the critical deficit location, minimal amount for filtration process, and maximal size of irrigation area as well as proper groundwater quality and nitrogen amount for crop farming.The major improvements of this study are to consider more realistic design constraints such as maximal irrigation size and minimal filtration amount and to pinpoint the critical deficit location of dissolved oxygen by using differential calculus instead of checking roughly dispersed points. While previous approaches checking eight discrete points had difficulty in finding the exact location of the critical deficit point, this study could exactly spot the point using analytic solution of the DO concentration function.However, the weakness of this study is the fact that the analytic solution can be obtained only in special cases where the difference amount between reaeration rate(k2) and NBOD rate constant (kn) is twice as large as that between reaeration rate (k2) and CBOD rate constant (k1), observed in this bench-mark problem. Thus, for future research, we would like to develop the analytic solution which can be applied to more general cases.With respect to algorithm side, PSF-HS has advantages over original HS because it does not demand a tedious parameter setting process for HMCR and PAR and individually considers HMCR and PAR for each variable [9]. Meanwhile, PSF-HS also has disadvantages because it has an additional matrix and requires additional setting (starting HMCR and PAR values and duration of rehearsal). Also, the solution quality of PSF-HS is not always better than that of original HS whose parameter values are manually and properly chosen [9]. Thus, the future research direction of PSF-HS can be how to efficiently perform the additional setting process and how to enhance the solution quality.



---

*Source: 2480365-2018-04-29.xml*