Evolutionary Algorithms For The Determination of Critical Depth
Evolutionary Algorithms For The Determination of Critical Depth
Depths in Conduits
A. Kanani1; M. Bakhtiari2; S. M. Borghei3; and D.-S. Jeng4
Downloaded from ascelibrary.org by University of Southern Queensland on 05/11/16. Copyright ASCE. For personal use only; all rights reserved.
Abstract: The determination of critical depth and the position of control sections is important in open-channel hydraulics. Calculation of
critical depth in open channels is useful not only for determining the condition of a flow but also for hydraulic design and analysis of
experimental and analytical results. In this study, unlike the conventional approaches, an alternative method, based on a genetic algorithm
共GA兲, for the calculation of critical depth in conduits is presented. In our model, the governing equations are transferred into an objective
function that is then minimized using a GA in order to calculate critical depth. This method does not have the limitations of existing
empirical and semiempirical methods and can be used for any prismatic or nonprismatic open-channel cross section. The concepts
presented in this paper can be generalized for solving other tortuous hydraulic engineering equations and problems.
DOI: 10.1061/共ASCE兲0733-9437共2008兲134:6共847兲
CE Database subject headings: Open channels; Algorithms; Conduits; Hydraulic design.
lutionary computation are important areas of soft computing. An In this study, the minimum value of the objective function is
evolutionary algorithm 共EA兲, a subset of evolutionary computa- definite; limitations in time or fitness are not appropriate criteria
tion, is a generic population-based metaheuristic optimization al- for stopping the algorithm and the algorithm stops when the num-
gorithm. An EA uses mechanisms inspired by biological ber of generations reaches a predefined value.
evolution: reproduction, mutation, recombination, natural selec-
tion, and survival of the fittest. Candidate solutions for the opti-
Basic Equations
mization problem play the role of individuals in a population, and
the cost function determines the environment within which the Specific energy 共E兲 in an open channel is calculated from Eq. 共1兲
solutions “live.” Evolution of the population then takes place after
repeated applications of the above operators. v2 Q2
A genetic algorithm is one of the most popular classes of EA E = y cos2 + ␣ = y cos2 + ␣ 共1兲
2g 2gA2
used in soft computing. The common form of GA was described
by Goldberg 共1989兲. A GA is a stochastic search technique based
where ␣ = kinetic energy correction factor; y = flow depth;
on the mechanisms of natural selection and natural genetics. In
v = flow velocity; A = flow area; Q = discharge; and g
contrast to conventional search techniques, GAs start with an ini-
= gravitational acceleration 共Fig. 1兲. Since the minimum specific
tial set of random solutions, which are called parent populations
energy occurs at the critical point, the value of the critical depth
of the first generation. Each individual in the population is de-
can be found by taking the first derivative of Eq. 共1兲 with respect
noted as a chromosome, representing a solution to the problem. A
to y
chromosome is a string of symbols that is usually, but not neces-
sarily, a binary bit string. In recent years, GAs have been applied
冤 冥
to numerous civil engineering problems, particularly relating to dA dA
− 2A ␣Q2
system optimization or calibration 共Wang 1991; Balascio et al. dE ␣Q2 dy dy
= cos2 + = cos2 − 共2兲
1998; Karpouzos et al. 2001; Bozorg-Hadad and Sharifi 2005; dy 2g A4 gA3
Bakhtiari et al. 2007兲
The procedure of the genetic algorithm is outlined here: Using dA = Tdy cos and setting Eq. 共2兲 equal to zero to find the
1. The algorithm begins by creating a random initial population. minimum E, we have
2. The algorithm then creates a sequence of new populations 共or
children兲. At each step, the algorithm uses the individuals in ␣Q2T
the current generation to create the next generation. To create =1 共3兲
gA3 cos
the new generation, the algorithm performs the following
steps:
where T = width of the flow surface. Eq. 共3兲 is the basic relation
a. Scores each member of the current population by com-
for calculation of critical depth in open-channel flow. If the slope
puting its fitness value.
of the channel is small 共less than 10%兲 and flow is uniform,
b. Scales the raw fitness scores to convert them into a
cos = 1 and ␣ = 1 are acceptable assumptions. Thus, Eq. 共3兲
more usable range of values.
becomes
c. Selects parents based on their fitness.
d. Produces children from the parents. Children are pro-
duced either by making random changes to a single Q 2T
=1 共4兲
parent—mutation—or by combining the vector entries gA3
of a pair of parents—crossover—or from individuals in
the current generation with the best fitness values— Knowing the discharge and channel geometry, the critical depth
elite children. can be obtained from Eq. 共4兲. For the majority of cross sections,
e. Replaces the current population with the children to where A and T are complex functions of y, the equation needs to
form the next generation. be solved numerically.
3. Generally, the algorithm stops when one of the following
stopping criteria is met:
Critical Depth Using GA
a. Number of generations.
b. Time limit in seconds. In order to find the critical depth using a GA, Eq. 共4兲 should be
c. Fitness limit. transformed into an objective function or
再 min F
constraint: 0 ⬍ y ⬍ y max
冎 共6兲
The above problem has just one constraint, depth, and the effect
of this constraint is incorporated into the GA using a penalty
function. If the generated depth is more than the maximum depth
Downloaded from ascelibrary.org by University of Southern Queensland on 05/11/16. Copyright ASCE. For personal use only; all rights reserved.
b⫽ 2 m 3 0.86047* 0.86043 60 10
Downloaded from ascelibrary.org by University of Southern Queensland on 05/11/16. Copyright ASCE. For personal use only; all rights reserved.
b⫽6 m
17 0.84** 0.84616 80 20
z⫽2
generation are shown. Comparison between the two methods Natural Channel
shows superiority of the GA solution technique. The difference
As mentioned previously, the advantage of the GA method is that
between the trial and error solution and the GA solution is less
it can be generalized for any arbitrary cross section. To check the
than 1%, and this again shows the high performance of this
ability of this method, a general cross section of a river, as shown
method.
in Fig. 9, is chosen. Any general cross section can be illustrated as
Using the same specifications 共discharge= 0.4 m3 / s兲, the prob-
a series of straight lines with different slopes.
lem was solved for the illustrated jaw-shaped cross section of Fig.
For a flow of 5 m3 / s, setting the stopping criteria as 150 gen-
4. The critical depth from the model after 30 generations with 50
erations and the number of chromosomes as 50, critical depth will
chromosomes was equal to 0.228 m. A trial and error solution
be equal to 1.10636 m. In Fig. 10, the procedure of minimization
gave this value equal to 0.219. In Figs. 7 and 8, comparisons
for the objective function for this example is shown. Dot points
between the conventional and GA-based solutions for jaw shape
are best fitness in each generation and circle points are the aver-
section are shown.
age fitness value in each generation. High values of average fit-
ness in some generations are due to the penalty function.
Fig. 9. Arbitrary cross section of a river Fig. 11. Channel and flow specifications resulted by HEC-RAS
38共2兲, 71–73.
MathWorks. 共2004兲. Genetic algorithm and direct search toolbox user’s
The writers are grateful for the assistance from Mr. Farzad guide, The Mathworks Inc., Natick, Mass.
Faridafshin at Chalmers University of Technology. Smith, K. 共1972兲. “Computer determination of critical depth control
points in open channel flow.” Proc., Insitute of Civil Engineers, Part
2, Vol. 53, Institute of Civil Engineers, London, 461–470.
References Straub, W. O. 共1978兲. “A quick and easy way to calculate critical and
conjugate depths in circular open channels.” Civ. Eng. (N.Y.), 48共12兲,
Bakhtiari, M., Kanani, A., and Borghei, S. M. 共2007兲. “Normal depth in 70–71.
open channels based on genetic algorithm.” Proc., 32nd Int. Associa- Swamee, P. K., and Rathie, P. N. 共2005兲. “Exact equations for critical
tion of Hydraulic Engineering and Research, Venice. depth in a trapezoidal canal.” J. Irrig. Drain. Eng., 131共5兲, 474–476.
Balascio, C. C., Palmeri, D. J., and Gao, H. 共1998兲. “Use of a genetic U.S. Army Corps of Engineers 共USACE兲. 共2002兲. Hydraulic reference
algorithm and multiobjective programming for calibration of a hydro- manual, Institute For Water Resources, Hydrological Engineering
logical model.” Trans. ASAE, 41共3兲, 615–619. Center, USACE, Washington, D.C.
Bozorg-Hadad, O., and Sharifi, F. 共2005兲. “Genetic algorithm in optimal Wang, Q. J. 共1991兲. “The genetic algorithm and its application to cali-
design of stepped spillway and its down stream energy dissipaters.” brating conceptual rainfall-runoff models.” Water Resour. Res., 27共9兲,
Proc., 73rd Annual Meeting of the Int. Commission of Large Dams, 2467–2471.
Paper 058-OT. Wang, Z. 共1998兲. “Formula for calculating critical depth of trapezoidal
Chaudhry, M. H., and Bhallamudi, S. M. 共1988兲. “Computation of critical open channel.” J. Hydraul. Eng., 124共1兲, 90–91.