Vous êtes sur la page 1sur 6

L1681_book.

fm Page 87 Tuesday, October 5, 2004 10:51 AM

CHAPTER 4
Algorithms and Environmental Engineering
4.1

INTRODUCTION

In Chapter 3, we pointed out that environmental modeling has become an important tool within
the well-equipped environmental engineers toolbox. Using an analogy, we can say that if a typical
skilled handypersons toolbox contains a socket set ratchet and several differently sized wrench
attachments, then the well-equipped environmental engineers toolbox includes a number of environmental models (socket set ratchets) with a varying set of algorithms (socket wrench attachments).
Although a complete treatment or discussion of algorithms is beyond the scope of this book, we
do provide basic underlying explanations of what algorithms are and examples of their applications
in cyber space (to the real world?). For those interested in a more complete discussion of algorithms,
many excellent texts are available on the general topic. We list several of these resources in the
recommended reading section at the chapters end.

4.2

ALGORITHMS: WHAT ARE THEY?

An algorithm is a specic mathematical calculation procedure. More specically, according to


Cormen et al. (2002), an algorithm is any well-dened computational procedure that takes some
value, or set of values, as input and produces some value, or set of values, as output. In other
words, an algorithm is a recipe for an automated solution to a problem. A computer model may
contain several algorithms. According to Knuth (1973), the word algorithm is derived from the
name al-Khowarizmi, a ninth-century Persian mathematician.
Algorithms should not be confused with computations. An algorithm is a systematic method
for solving problems, and computer science is the study of algorithms (although the algorithm was
developed and used long before any device resembling a modern computer was available); the act
of executing an algorithm that is, manipulating data in a systematic manner is called
computation.
For example, the following algorithm (attributed to Euclid, circa 300 B.C., and thus known for
millennia) for nding the greatest common divisor of two given whole numbers may be stated as
follows:
Set a and b to the values A and B, respectively.
Repeat the following sequence of operations until b has value 0:
Let r take the value of a mod b.
Let a take the value of b.
Let b take the value of r.
The greatest common divisor of A and B is nal value of a.

Note: The operation a mod b gives the remainder obtained on dividing a by b.


87
2005 by CRC Press LLC

L1681_book.fm Page 88 Tuesday, October 5, 2004 10:51 AM

88

ENVIRONMENTAL ENGINEERS MATHEMATICS HANDBOOK

The problem that of nding the greatest common divisor of two numbers is specied by
stating what is to be computed; the problem statement does not require that any particular algorithm
be used to compute the value. Such method-independent specications can be used to dene the
meaning of algorithms: the meaning of an algorithm is the value that it computes.
Several methods can be used to compute the required value; Euclids method is just one. The
chosen method assumes a set of standard operations (such as basic operations on the whole number
and a means to repeat an operation) and combines these operations to form an operation that
computes the required value. Also, something not at all obvious to the vast majority of people is
that the proposed algorithm does actually compute the required value. One reason why a study of
algorithms is important is to develop methods that can be used to establish what a proposed
algorithm achieves.

4.3

EXPRESSING ALGORITHMS

Again, although an in-depth discussion is beyond the scope of this text, we point out that the
analysis of algorithms often requires us to draw upon a body of mathematical operations. Some of
these operations are as simple as high-school algebra, but others may be less familiar to the average
environmental engineer. Along with learning how to manipulate asymptotic notations and solving
recurrences, an environmental engineer must learn several other concepts and methods in order to
analyze algorithms.
For example, methods for evaluating bounding summations are important. Bounding summations are algorithms that contain an iterative control construct such as a while or for loop; the
algorithm running time can be expressed as the sum of the times spent on each execution of the
body of the loop. These occur frequently in the analysis of algorithms. Many of the formulae
commonly used in analyzing algorithms can be found in any calculus text. In addition, in order to
analyze many algorithms, we must be familiar with the basic denitions and notations for sets,
relations, functions, graphs, and trees. A basic understanding of elementary principles of counting
(permutations, combinations, and the like) is important as well. Most algorithms used in environmental engineering require no probability for their analysis; however, a familiarity with these
operations can be useful.
Because mathematical and scientic analysis (and many environmental engineering functions)
is so heavily based upon numbers, people tend to associate computation with numbers. However,
this need not be the case: algorithms can be expressed using any formal manipulation system, i.e.,
any system that denes a set of entities and a set of unambiguous rules for manipulating those
entities. For example, the system called the SKI calculus consists of three combinators (entities)
called (coincidentally) S, K, and I. The computation rules for the calculus are:
Sfgx = fx (gx)
Kxy = x
Ix = x
where f, g, x, and y are strings of the three entities. The SKI calculus is computationally complete;
that is, any computation that can be performed using any formal system can be performed using
the SKI calculus (equivalently, all algorithms can be expressed using the SKI calculus). Not all
systems of computation are equally as powerful, however; some problems that can be solved using
2005 by CRC Press LLC

L1681_book.fm Page 89 Tuesday, October 5, 2004 10:51 AM

ALGORITHMS AND ENVIRONMENTAL ENGINEERING

89

one system cannot be solved using another. Furthermore, we know that some problems cannot be
solved using any formal computation system.

4.4

GENERAL ALGORITHM APPLICATIONS

Practical applications of algorithms are ubiquitous. All computer programs are expressions of
algorithms, in which the instructions are expressed in the computer language used to develop the
program. Computer programs are described as expressions of algorithms because an algorithm is
a general technique for achieving some purpose that can be expressed in a number of different
ways. Algorithms exist for many purposes and are expressed in many different ways. Examples of
algorithms include recipes in cook books; servicing instructions in a computers hardware manual;
knitting patterns; digital instructions to a welding robot as to where each weld should be made; or
cyber-speak to any system working cyberspace.
Algorithms can be used in sorting operations, for example, to reorder a list into some dened
sequence. Expressing the same algorithms as instructions to a human with a similar requirement
to reorder some list (for example, to sort a list of tax record reports into a sequence determined by
the date of birth on the record) is possible. These instructions could employ the insertion sort
algorithm, or the bubble sort algorithm or one of many other available algorithms. Thus, an
algorithm as a general technique for expressing the process of completing a dened task is
independent of the precise manner in which it is expressed.
Sorting is by no means the only application for which algorithms have been developed. Examples of practical applications of algorithms include:

Internet routing: single-source shortest paths


Search engines: string matching
Public-key cryptography and digital signatures: number-theoretic algorithms
Allocating scarce resources in the most benecial way: linear programming

Algorithms are at the core of most technologies used in contemporary computers:

Hardware design uses algorithms.


The design of any GUI relies on algorithms.
Routing in networks relies heavily on algorithms.
Compilers, interpreters, or assemblers make extensive use of algorithms.

A frequently used example (because of its general usefulness and because the algorithm is easy
to explain to almost anyone) of how an algorithm can be applied to real world situations is known
as the traveling salesman problem. This problem is the most notorious NP-complete problem (no
polynomial-time algorithm has yet been discovered for an NP-complete problem, nor has anyone
yet been able to prove that no polynomial-time algorithm can exist for any one of them).
The traveling salesman problem: imagine a traveling salesman who must visit each of a given set of
cities by car. Using Figure 4.1A, nd the cycle of minimum cost (Figure 4.1B), visiting all of the
vertices exactly once.

We have pointed out some of the functions that algorithms can perform. The question arises:
Can every problem be solved algorithmically? The simple and complex answer is NO. For
example, problems exist for which no generalized algorithmic solution can possibly exist (unsolvable). Also, problems exist for which no efcient solution is known e.g., NP-complete problems
that is, whether or not efcient algorithms exist for NP-complete problems is unknown; if an
efcient algorithm exists for any one of them, then efcient algorithms exist for all of them (e.g.,

2005 by CRC Press LLC

L1681_book.fm Page 90 Tuesday, October 5, 2004 10:51 AM

90

ENVIRONMENTAL ENGINEERS MATHEMATICS HANDBOOK

Figure 4.1a

Input.

Figure 4.1b

Output.

traveling salesman problem). Finally, some problems exist that we do not know how to solve
algorithmically.
From the preceding discussion, it should be apparent that computer science is not just about
word processing and spreadsheets; it can include applications and not just software applications.

4.5

ENVIRONMENTAL ENGINEERING ALGORITHM APPLICATIONS

Although algorithms can be used in transportation applications (traveling salesman problem), many
of their most important applications are applied to engineering functions. For example, consider a
robot arm assigned to weld all the metal parts on an automobile in an assembly line. The shortest
tour that visits each weld point exactly once denes the most efcient path for the robot. A similar
application arises in minimizing the amount of time taken by a design engineer or draftsperson to
draw a given structure.
Algorithms have found widespread application in all branches of engineering. In environmental
engineering, for example, the USEPA uses computer models that employ various algorithms to
monitor chemical-spill and ultimate-fate data. In the following section, we provide selected model
summary descriptions of applications used in dispersion modeling. Specically, we discuss how
the USEPA (and others) employ preferred/recommended models (rened models recommended for

2005 by CRC Press LLC

L1681_book.fm Page 91 Tuesday, October 5, 2004 10:51 AM

ALGORITHMS AND ENVIRONMENTAL ENGINEERING

91

a specic type of regulatory application) in monitoring air quality, ambient pollutant concentrations,
and their temporal and spatial distribution. Further information on this important topic can be
accessed at USEPAs Technology Transfer Network Support Center for Regulatory Air Models at
www.epa.gov/scram001/tt22.htm Web site.

4.6

DISPERSION MODELS

The following algorithm-based models are currently listed in Appendix A of the Guidelines on Air
Quality Models (published as Appendix W of 40 CFR Part 51):
BLP (buoyant line and point source model) a Gaussian plume dispersion model designed to
handle unique modeling problems associated with aluminum reduction plants and other industrial
sources in which plume rise and downwash effects from stationary line sources are important.
CALINE3 a steady-state Gaussian dispersion model designed to determine air pollution concentrations at receptor locations downwind of at-grade, ll, bridge, and cut section highways located in relatively uncomplicated terrain.
CALPUFF a multilayer, multispecies non-steady-state puff dispersion model that simulates the
effects of time- and space-varying meteorological conditions on pollution transport, transformation
and removal. CALPUFF can be applied on scales of tens to hundreds of kilometers. It includes
algorithms for subgrid scale effects (such as terrain impingement), as well as longer range effects
(including pollutant removal from wet scavenging and dry deposition, chemical transformation,
and visibility effects of particulate matter concentrations).
CTDMPLUS (complex terrain dispersion model plus algorithms for unstable situations) a
rened point-source Gaussian air quality model for use in all stability conditions for complex
terrain (terrain exceeding the height of the stack being modeled as contrasted with simple terrain
an area in which terrain features are lower in elevation than the top of the stack of the source).
The model contains, in its entirety, the technology of CTDM for stable and neutral conditions.
ISC3 (industrial source complex model) a steady-state Gaussian plume model that can be used
to assess pollutant concentrations from a wide variety of sources associated with an industrial
complex. This model can account for the following: settling and dry deposition of particles;
downwash; point, area, line, and volume sources; plume rise as a function of downwind distance;
separation of point sources; and limited terrain adjustment. ISC3 operates in long- and short-term
modes.
OCD (offshore and coastal dispersion model) a straight-line Gaussian model developed to
determine the impact of offshore emissions from point, area, or line sources on the air quality of
coastal regions. OCD incorporates overwater plume transport and dispersion as well as changes
that occur as the plume crosses the shoreline. Hourly meteorological data are needed from offshore
as well as onshore locations.

4.7

SCREENING TOOLS

Screening tools are relatively simple analysis techniques used to determine if a given source is
likely to pose a threat to air quality. Concentration estimates from screening techniques precede a
rened modeling analysis and are conservative.
CAL3QHC/CAL3QHCR (CALINE3 with queuing and hot spot calculations) a CALINE3based CO model with a trafc model to calculate delays and queues that occur at signalized
intersections; CAL3QHCR requires local meteorological data.
COMPLEX 1 a multiple-point source screening technique with terrain adjustment that incorporates the plume impaction algorithm of the VALLEY model.
CTSCREEN (complex terrain screening model) a Gaussian plume dispersion model designed
as a screening technique for regulatory application to plume impaction assessments in complex
terrain. CTSCREEN is a screening version of the CTDMPLUS model.

2005 by CRC Press LLC

L1681_book.fm Page 92 Tuesday, October 5, 2004 10:51 AM

92

ENVIRONMENTAL ENGINEERS MATHEMATICS HANDBOOK

LONGZ a steady-state Gaussian plume formulation for urban and rural areas in at or complex
terrain to calculate long-term (seasonal and/or annual) ground-level ambient air concentrations
attributable to emissions from up to 14,000 arbitrarily placed sources (stack, building, and area
sources).
SCREEN3 a single source Gaussian plume model that provides maximum ground-level concentrations for point, area, are, and volume sources, as well as concentrations in the cavity zone,
and concentrations from inversion break-up and shoreline fumigation. SCREEN3 is a screening
version of the ISC3 model.
SHORTZ a steady-state bivariate Gaussian plume formulation for urban and rural areas in at
or complex terrain to calculate ground-level ambient air concentrations. It can calculate 1-, 2-, 3h, etc. average concentrations from emissions from stacks, buildings, and area sources for up to
300 arbitrarily placed sources.
VALLEY a steady-state, complex terrain, univariate Gaussian plume dispersion algorithm
designed for estimating 24-h or annual concentrations resulting from emissions from up to 50
(total) point and area sources.
VISCREEN calculates the potential impact of a plume of specied emissions for specic
transport and dispersion conditions.

REFERENCES
Cormen, T.H., Leiserson, C. E., Rivest, R.L., and Stein, C. (2002). Introduction to Algorithms, 2nd ed. New
Delhi: PrenticeHall of India.
Knuth, D.E. (1973). Fundamental Algorithms, Vol. 1 of The Art of Computer Programming. New York:
Addison-Wesley.
USEPA (2003). Technology Transfer Network Support Center for Regulatory Air Models. Accessed at
www.epa.gov/scram001/tt22.htm.
USEPA (1993). Guideline on Air Quality Models (revised Appendix W of 40 CFR part 51 [supplement b]).
Accessed at http://www.osti.gov/energycitations/products.biblio.jsp?osti_id=5948584 on November
11, 2003.

SUGGESTED READING
Guseld, D. (1997). Algorithms on Strings, Trees, and Sequences: Computer Science and Computational
Biology. New York: Cambridge University Press.
Lafore, R. (2002). Data Structures and Algorithms in Java, 2nd ed. Indianapolis, IN: Sams.
Mitchell, T.M. (1997). Machine Learning. New York: McGraw-Hill.
Poynton, C. (2003). Digital Video and HDTV Algorithms and Interfaces. San Francisco: Morgan Kaufmann.

2005 by CRC Press LLC

Vous aimerez peut-être aussi