Geoscience Reference
In-Depth Information
4 Algorithms and
Environmental Engineering
Algorithm— The word comes from the Persian author Abu Ja'far Mohammed ibn Musa al-Khom-
warizmi, who wrote a topic with arithmetic rules dating from about 825 AD.
4.1 INTRODUCTION
In Chapter 3, we observed that environmental modeling has become an important tool within the
environmental engineer's well-equipped toolbox. Continuing with that analogy, we can say that if
a skilled handyperson's toolbox usually contains a socket and ratchet set and several different sized
wrench attachments, then the well-equipped environmental practitioner's toolbox includes a num-
ber of environmental models (sockets and ratchets) with a varying set of algorithms (socket wrench
attachments). Although a complete treatment or discussion of algorithms is beyond the scope of
this topic, we do explain what algorithms are and provide examples of their applications in cyber-
space. For those interested in a more complete discussion of algorithms, many excellent texts on the
general topic are available. We list several of these resources in the References and Recommended
Reading section at the end of the chapter.
4.2 ALGORITHMS: WHAT ARE THEY?
An algorithm is a specific mathematical calculation procedure, a computable set of steps to achieve
a desired result. More specifically, “an algorithm is any well-defined computational procedure that
takes some value, or set of values, as input and produces some value, or set of values, as output”
(Cormen et al., 2002). In other words, an algorithm is a recipe for an automated solution to a prob-
lem. A computer model may contain several algorithms. The word “algorithm” is derived from the
name of a ninth-century Persian mathematician: al-Khomwarizmi.
Algorithms should not be confused with computations. Whereas an algorithm is a systematic
method for solving problems, and computer science is the study of algorithms (although the algo-
rithm 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 for finding the greatest common divisor of two
given whole numbers (attributed to Euclid ca. 300 BC, thus known for millennia) may be stated as
follows:
• Set a and b to the values A and B , resp e ct ively.
• Repeat the following sequence of operations until b has value 0:
1. Let r take the value of a mod b .
2. Let a take the value of b .
3. Let b take the value of r .
• The greatest common divisor of A and B is the final value of a .
Note: The operation a mod b gives the remainder obtained upon dividing a by b .
93
 
Search WWH ::




Custom Search