# Wastewater Treatment Optimization for Fish Migration Using Harmony Search

Authors: Zong Woo Geem; Jin-Hong Kim
Journal: Mathematical Problems in Engineering
 (2014)

---

## Abstract

Certain types of fish migrate between the sea and fresh water to spawn. In order for them to swim without any breathing problem, river should contain enough oxygen. If fish is passing along the river in municipal area, it needs sufficient dissolved oxygen level which is influenced by dumped amount of wastewater into the river. If existing treatment methods such as settling and biological oxidation are not enough, we have to consider additional treatment methods such as microscreening filtration and nitrification. This study constructed a wastewater treatment optimization model for migratory fish, which considers three costs (filtration cost, nitrification cost, and irrigation cost) and two environmental constraints (minimal dissolved oxygen level and maximal nitrate-nitrogen concentration). Results show that the metaheuristic technique such as harmony search could find good solutions robustly while calculus-based technique such as generalized reduced gradient method was trapped in local optima or even divergent.


---

## Body

## 1. Introduction

Various species of fish migrate on time periods ranging from daily to annually and over long distances up to thousands of kilometers [1]. Fish normally migrate because of reproductive or diet purposes.In order for anadromous fishes such as salmon, which migrate from the sea into fresh water to spawn, to swim upstream without any breathing problem, the river should contain enough oxygen or the level of dissolved oxygen (DO) should be more than certain criterion.To control the DO level in a river, wastewater dumped into the river should be well treated. Actually there are several wastewater treatment techniques such as settling, biological oxidation, microscreening filtration, and nitrification [2].This study intends to find the optimal wastewater treatment portfolio which suggests overall minimal cost while satisfying minimal DO level over the river reach in order for migratory fishes to swim upstream well.Actually optimal DO control issue for water quality while limiting wastewater load has been researched for various rivers all over the world, such as Willamette River in Oregon, USA [3], Schuylkill River in Pennsylvania, USA [4], Nitra River in Slovakia [5], Yasu River in Japan [6], and Yamuna River in India [7]. However, real-world problems sometimes require model simplification [8] or experience local optima entrapment [2]. This study tries to adopt a more realistic model considering nonlinearity of the problem and to find good results without being entrapped in premature solutions.


## 2. Optimization Formulation

The basic structure of wastewater treatment model in this study came from Haith [2] and can be visualized in Figure 1.Figure 1
Schematic diagram of wastewater treatment portfolio.A city (population = 100,000) dumps wastewater into a river. The wastewater (40,000 m3/day) undergoes secondary treatment which consists of settling and biological oxidation to remove organic material from the wastewater. However, this treatment is not enough to satisfy the water quality standard for migratory fishes. An environmental regulatory agency set this standard that the outflow of wastewater treatment should be more than 5 mg/liter (or 5 ppm) of DO in summertime to preserve aquatic life. Therefore, the city is now forced to consider additional treatment processes that enhance the water quality.Because the secondary treatment (settling and biological oxidation) is not enough, the city should consider extra processes such as filtration and nitrification as shown in Figure1. Also, certain amount of wastewater can be diverted to reduce the river discharge. This diverted one can be used for crop irrigation.So, we can consider total five decision variables for this wastewater treatment optimization as follows:(1)
Q1: wastewater dumped without additional treatment (unit: 103 m3/day),(2)
Q2: wastewater undergoing additional filtration (unit: 103 m3/day),(3)
Q3: wastewater undergoing additional nitrification (unit: 103 m3/day),(4)
Q4: wastewater undergoing additional nitrification and filtration (unit: 103 m3/day),(5)
Q5: wastewater diverted for irrigation (unit: 103 m3/day).Also, there is one more decision variabler which denotes irrigation rate (cm/week), and the relationship between Q5 and r is r=70Q5/A. Here, A (hectare or 104 m2) denotes irrigated area and 70 is unit conversion factor.With the above decision variables, we can construct the objective function as follows:(1)Minimizez=fQ1,Q2,Q3,Q4,Q5,r=Cft+Cnt+Cir.
Here, the cost for filtration Cft ($103/yr) is represented as follows:
(2)Cft=3Q2+Q40.93+6.7Q2+Q40.55,
where the first term in right-hand side of (2) represents the capital cost of filtration treatment and the second term represents operation and maintenance cost.The cost for nitrificationCnt ($103/yr) is represented as follows:
(3)Cnt=13.8Q30.68+10.6Q30.42,
where the first term in right-hand side of (3) represents the capital cost of nitrification treatment and the second term represents operation and maintenance cost.The cost for irrigationCir ($103/yr) is represented as follows:
(4)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.68A,
where the first term in right-hand side of (4) represents the capital cost of transmission line; the second term represents the capital cost of storage system (lagoon); the third term represents the operation and maintenance cost of storage system; the fourth term represents the capital cost of irrigation system; the fifth term represents the operation and maintenance cost of irrigation system; and the sixth term represents the net benefit (negative cost) of cropping (crop sales minus land rent).Constraints for this optimization problem can be(5)Q1+Q2+Q3+Q5=40(6)Q3≥Q4(7)0≤Qi≤40,i=1,…,5(8)81-e-0.063x+C0e-0.063x-2.33B0e-0.044x-e-0.063x-0.67N0e-0.025x-e-0.063x≥5,x=5,10,15,20,25,30,40,50(9)C0=8(110)+2(Q1+Q2+Q3)110+Q1+Q2+Q3(10)B0=2(110)+25Q1+13Q2+13(Q3-Q4)+7Q4110+Q1+Q2+Q3(11)N0=5(110)+54Q1+50Q2+10(Q3-Q4)+10Q4110+Q1+Q2+Q3(12)6.54≤r≤13.07.
Equations (8) to (11) stand for DO level constraint and (12) stands for nitrate-nitrogen level constraint. More details about these constraints are explained in the next section.


## 3. Mathematical Model of Water Quality

Dissolved oxygenC(x) in ppm at a distance (x km) downstream of a point wastewater discharge can be represented as the following differential equation:
(13)udCdx=k2Cs-C-k1B-knN,
where u is river flow velocity (7.9 km/day in this study); k2 is reaeration rate (0.5/day in this study); Cs is saturation DO (8.0 ppm in this study); B and N are remaining carbonaceous biochemical oxygen demand (CBOD) and nitrogenous biochemical oxygen demand (NBOD) (ppm) at distance x; and k1 and kn are rate constants (0.35/day and 0.2/day, resp.). The first term in the right-hand side of (13) denotes oxygen increase due to reaeration and the second and third terms denote oxygen decrease due to oxidation of carbonaceous and nitrogenous material, respectively.The above differential equation has the analytic solution as follows:(14)Cx=Cs1-e-k2x/u+C0e-k2x/u-B0k1k2-k1e-k1x/u-e-k2x/u-N0knk2-kne-knx/u-e-k2x/u.
Equation (14) is identical to (8), where C0, B0, and N0 are, respectively, river DO, CBOD, and NBOD right after discharge. If river water and wastewater are completely mixed at the discharge point, initial C0, B0, and N0 can be calculated using weighted average as expressed in (9) to (11) where river flow is 110,000 m3/day, river DO is 8.0 ppm, river CBOD is 2.0 ppm, and river NBOD is 5.0 ppm. Table 1 shows effluent water quality after wastewater treatment.Table 1
Effluent water quality after wastewater treatment.
Treatment type
Effluent quality (ppm)
DO
CBOD
NBOD
Secondary (settling + biological oxidation):Q1
2
25
54
Secondary + filtration (microscreening):Q2
2
13
50
Secondary + nitrification:Q3-Q4
2
13
10
Secondary + nitrification + filtration:Q4
2
7
10For the diverted amountQ5, we can consider the following mass balance equation:
(15)Percolation=rT+P-ET,
where T is irrigation duration (13 weeks in this study), P is precipitation (cm) during the irrigation season, and ET is evapotranspiration (cm). Here, P-ET is zero in this study.A nitrogen balance is used for estimating the nitrogen loss in percolation into groundwater. If the nitrogen concentration ofQ5 is n (20 ppm in this study), total nitrogen amount to the irrigation area is 0.1rTn (kg/ha) where 0.1 is unit conversion factor. If NC is crop nitrogen uptake (170 kg/ha in this study), the unused nitrogen of Q5 becomes 0.1rTn-NC, and the nitrate-nitrogen concentration cn (ppm) in the percolation becomes as follows:
(16)cn=nitrogenlosspercolation=rTn-10NCrT+P-ET.
In this study, cn should be less than or equal to 10 ppm for public health purpose, which makes the following constraint:
(17)rTn-10NCrT+P-ET≤10.
Also, the nitrogen contained in Q5 should be enough to satisfy the crop’s nitrogen requirement as follows:
(18)rTn≥10NC.
From (17) and (18), we can obtain (12) for nitrate-nitrogen constraint.


## 4. Optimization Using Harmony Search

The wastewater treatment optimization model for fish migration constructed in previous sections has a complex structure which is difficult to devise a proper search strategy [2]. So, the problem was tackled by commercial software named Microsoft Excel Solver, which uses the generalized reduced gradient (GRG2) technique [9].When Solver was applied to the model with five initial solution vectors, it was trapped in local optima or even divergent instead of convergent. Table2 shows details.Table 2
Results by generalized reduced gradient technique.
Initial vector
Final vector
Q
1
Q
2
Q
3
Q
4
Q
5
r
Cost
Q
1
Q
2
Q
3
Q
4
Q
5
r
Cost
0
0
0
0
0
0
0
0
0
40
30.33
0
6.54
334.9
0
0
0
0
40
10
345.8
0
0
0
0
40
10
345.8
0
0
40
25
0
10
318.7
0
0
40
30.33
0
10
334.9
8
0
0
0
32
10
303.8*
Divergent!
10
10
10
5
10
10
314.9
Divergent!When GRG2 started with the first solution vector (0, 0, 0, 0, 0, 0), it was trapped in one of local optima (334.9) with the final solution vector (0, 0, 40, 30.33, 0, 6.54); when GRG2 started using the second solution vector (0, 0, 0, 0, 40, 10) with the cost of 345.8, it did not move any further from its starting point; when GRG2 started using the third solution vector (0, 0, 40, 25, 0, 10), it was trapped in one of local optima (334.9) with the final solution vector (0, 0, 40, 30.33, 0, 10) which is identical to the final solution vector of the first case in terms of cost but the value ofr is different. Because Q5 is zero, different r values do not affect the objective function value; when GRG2 started using the fourth solution vector (8, 0, 0, 0, 32, 10), it was even divergent and disabled to compute any further. Although the fourth vector has a good cost (303.8), it also slightly violated minimal DO condition at the distance of 20 km downstream; and when GRG2 started using the fifth solution vector (10, 10, 10, 5, 10, 10) with the cost of 314.9, it was also divergent.On top of those five trials, additional trials with different starting vectors have been tried. But mostly it reached divergence instead of convergence because the model structure is complicated. Thus, a metaheuristic approach, instead of calculus-based approach, using the harmony search algorithm was introduced to this study.The harmony search (HS) algorithm was inspired by music improvisation [10] and applied to various optimization problems [11]. It has its own unique human-experience-based derivative [12]. For this DO control problem, the following optimization formulation for HS was used:
(19)Minimizez=f(Q1,Q2,Q3,Q4,Q5,r)=CftQ2,Q4+CntQ3+CirQ5,r,
subject to
(20)Cx,Q1,Q2,Q3,Q4≥5ppm,x=5,10,15,20,25,30,40,50(21)Q1+Q2+Q3+Q5=40(22)Q3≥Q4(23)0≤Qi≤40,i=1,…,5(24)6.54≤r≤13.07.
For the above optimization model, HS found the optimal solution using the following steps.Step 1.
HS constructs initial memory place named harmony memory (HM) as in (25) and fills HM with initial solution vectors as many as harmony memory size (HMS; this is 10 in this study). The initial vectors should satisfy the problem constraints in (20) to (24):
(25)HM=Q11Q21Q31Q41Q51r1f(x1)Q12Q22Q32Q42Q52r2f(x2)⋮⋮⋮⋮⋮⋮⋮Q1HMSQ2HMSQ3HMSQ4HMSQ5HMSrHMSf(xHMS).Step 2.
A new harmony is generated using the following equation:(26)xiNew⟵xi∈xiLower,xiUpperw.p.1-HMCRxi∈HM=xi1,xi2,…,xiHMSw.p.HMCR·1-PARxi+Δ,xi∈HMw.p.HMCR·PAR,i=1,…,6,
where HMCR is harmony memory considering rate (0.95 in this study) and PAR is pitch adjustment rate (0.3 in this study).Step 3.
If the generated vectorxNew is better than the worst one xWorst in HM in terms of objective function value, the latter is replaced with the former as follows:
(27)xNew∈HM∧xWorst∉HM.Step 4.
If termination criterion is satisfied, the computation is ended. Otherwise, Step2 is performed again with updated HM.When the HS approach was applied to the DO control optimization model, it could successfully find good results without any divergence. When ten different runs were performed, HS found solutions ranging from 303.0 to 311.7 with the average of 307.5. Table3 shows more details about the computation results.Table 3
Results by harmony search algorithm.
Run
Final vector
f
(
x
)
DO atx km (ppm)
Q
1
Q
2
Q
3
Q
4
Q
5
r
5
10
15
20
25
30
40
50
1
6.47
0
0
0
33.53
7.28
309.9
6.41
5.70
5.35
5.23
5.27
5.40
5.79
6.21
2
7.56
0
0
0
32.44
7.27
304.3
6.29
5.55
5.18
5.06
5.11
5.25
5.66
6.10
3
7.66
0
0
0
32.34
7.25
303.8
6.28
5.53
5.16
5.05
5.09
5.23
5.65
6.09
4
6.26
0
0
0
33.74
7.13
311.0
6.43
5.73
5.38
5.27
5.30
5.43
5.81
6.23
5
7.81
0
0
0
32.19
7.40
303.0
6.27
5.51
5.14
5.03
5.07
5.21
5.63
6.08
6
6.61
0
0
0
33.39
6.97
309.2
6.40
5.68
5.33
5.21
5.25
5.38
5.77
6.19
7
6.84
0
0
0
33.16
7.14
308.0
6.37
5.65
5.29
5.18
5.22
5.35
5.74
6.17
8
6.46
0
0
0
33.54
7.28
310.0
6.41
5.70
5.35
5.23
5.27
5.40
5.79
6.21
9
7.67
0
0
0
32.33
7.26
303.7
6.28
5.53
5.16
5.05
5.09
5.23
5.64
6.09
10
6.12
0
0
0
33.88
6.88
311.7
6.45
5.75
5.40
5.29
5.33
5.45
5.83
6.24Furthermore, this study tackled the above optimization model using genetic algorithm (GA) which is another popular metaheuristic algorithm. When GA was applied to this model, it could find solutions without any divergence. When ten different runs were performed, GA found solutions ranging from 303.3 to 341.3 with the average of 335.7. Although GA found good solution (303.3) only once, mostly it found premature solutions.


## 5. Conclusions

The wastewater treatment optimization model for fish migration was constructed and solved using HS. The optimization model considered three costs such as filtration cost, nitrification cost, and irrigation cost and two environmental constraints such as minimal DO requirement over river reach and maximal nitrate-nitrogen concentration for public health.While the existing mathematical approach such as GRG2 had hard time to identify solutions, HS could find better solutions without divergence. Also, HS did not require initial solution vectors which are very sensitive to final solution quality. When compared with GA, HS could find better solutions in terms of minimal and average costs.For future study, more realistic problems in wastewater treatment field are expected to be considered, and more updated techniques for these problems are expected to be developed.



---

*Source: 313157-2014-12-04.xml*