1. MODELS AND MODELING .......................................... 1
1.1. Why Model? .............................................. 1
1.2. The Modeling Process .................................... 2
1.2.1. Identifying the Nature and Scope of the
Problem .......................................... 2
1.2.2. Developing the Conceptual Model .................. 3
1.2.3. Stating the Assumptions .......................... 5
1.2.4. Formulating the Mathematical Model ............... 6
1.2.5. Implementing the Computational Model ............ 14
1.2.6. Evaluating the Model ............................ 17
1.3. Llyn Efyrnwy ........................................... 20
1.4. Structure and Objectives of the Book ................... 20
1.5. Resources on the CD-ROM ................................ 24
1.6. Typographical Conventions .............................. 25
2. VISUALIZING ENVIRONMENTAL DATA .............................. 27
2.1. Introduction ........................................... 27
2.2. Creating 2D Plots ...................................... 30
2.2.1. Creating a Simple x-y Plot ...................... 30
2.2.2. Labeling the Axes of a Plot ..................... 33
2.2.3. Plotting Multiple Data Series ................... 34
2.2.4. Plotting with Different Data Styles ............. 36
2.3. Plotting Time-Series Data .............................. 37
2.3.1. Plotting Multiple Time-Series ................... 40
2.3.2. Further Control over Plotting Styles ............ 41
2.4. Plotting in Three Dimensions ........................... 42
2.4.1. Description of the Digital Elevation Data Set ... 43
2.4.2. Visualizing 3D Data in gnuplot .................. 44
2.4.3. Altering the View Direction ..................... 45
2.4.4. Generating a 3D Surface Plot .................... 46
2.4.5. Hidden-Line Removal ............................. 49
2.4.6. Producing Solid Surface Models .................. 50
2.4.7. Contouring 3D Surface Plots ..................... 51
2.5. Printing Plots ......................................... 55
2.6. Exporting Graphics Files ............................... 56
2.7. Command-Line Scripts ................................... 57
2.8. Summary ................................................ 57
3. PROCESSING ENVIRONMENTAL DATA ............................... 59
3.1. Introduction ........................................... 59
3.2. Structure of the Llyn Efyrnwy Precipitation Data ....... 60
3.3. Creating and Running a Simple gawk Program ............. 62
3.4. Using gawk to Process Selected Fields .................. 64
3.5. Storing the gawk Program in a File ..................... 66
3.6. Using gawk to Process Selected Records ................. 67
3.7. Controlling the Format of the Output ................... 70
3.8. Redirecting the Output to a File ....................... 73
3.9. Visualizing the Output Data ............................ 74
3.10.Logical or Boolean Operators in gawk ................... 75
3.11.Summary ................................................ 76
4. WIND SPEED AND WIND POWER ................................... 79
4.1. Introduction ........................................... 79
4.2. Description of the Wind Speed Data ..................... 83
4.3. Calculating the Annual Mean Wind Speed ................. 85
4.4. Determining the Maximum Wind Speed ..................... 88
4.5. Exploring Wind Speed Variability ....................... 92
4.5.1. Determining the Absolute Frequency
Distribution .................................... 92
4.5.2. Determining the Relative Frequency
Distribution .................................... 96
4.5.3. Probability Distributions and Probability
Density Functions .............................. 100
4.5.4. Function Fitting in gnuplot .................... 102
4.5.5. Probability of the Wind Speed Exceeding
a Given Value .................................. 104
4.6. Wind Energy and Power ................................. 105
4.6.1. Theoretical Basis .............................. 105
4.6.2. Application to Llyn Efyrnwy Data ............... 108
4.6.3. Visualizing the Output ......................... 109
4.7. Summary ............................................... 110
5. SOLAR RADIATION AT EARTH'S SURFACE ......................... 113
5.1. Introduction .......................................... 113
5.2. Description of the Solar Irradiance Data .............. 114
5.3. Analyzing the Observations ............................ 117
5.3.1. Data Extraction and Pre-Processing ............. 117
5.3.2. Visualizing the Output ......................... 118
5.4. Modeling Solar Irradiance ............................. 120
5.4.1. Formulating the Mathematical Model ............. 121
5.4.2. Implementing the Computational Model ........... 129
5.4.3. Enhancing the Implementation ................... 135
5.4.4. Visualizing the Simulated Variation in Solar
Irradiance ..................................... 138
5.5. Summary ............................................... 140
6. LIGHT INTERACTION WITH A PLANT CANOPY ...................... 143
6.1. Introduction .......................................... 143
6.2. Developing a Model of Light Interaction with Plant
Canopies .............................................. 147
6.2.1. Specifying the Conceptual Model ................ 148
6.2.2. Formulating the Mathematical Model ............. 148
6.2.3. Implementing the Computational Model ........... 153
6.2.4. Running the Model .............................. 155
6.2.5. Evaluating the Output from the Computational
Model .......................................... 155
6.3. A Two-Layer Light Interaction Model ................... 157
6.3.1. Improving the Conceptual Model ................. 157
6.3.2. Reformulating the Mathematical Model ........... 158
6.3.3. Implementing the Two-Layer Model in gawk ....... 160
6.3.4. Running the Two-Layer Model .................... 161
6.3.5. Evaluating the Two-Layer Model ................. 161
6.4. Accounting for Multiple Scattering .................... 161
6.4.1. Enhancing the Conceptual and Mathematical
Models ......................................... 161
6.4.2. Implementing the Revised Two-Layer Model ....... 163
6.4.3. Running the Revised Two-Layer Model ............ 163
6.4.4. Evaluating the Revised Two-Layer Model ......... 163
6.5. Multiple Leaf-Layer Models ............................ 165
6.5.1. Enhancing the Conceptual Model ................. 165
6.5.2. Formulating the Three-Layer Model .............. 166
6.5.3. Implementing the Three-Layer Model ............. 168
6.5.4. Running the Three-Layer Model .................. 170
6.5.5. Evaluating the Multiple-Layer Model ............ 170
6.6. Summary ............................................... 171
7. ANALYTICAL AND NUMERICAL SOLUTIONS ......................... 173
7.1. Introduction .......................................... 173
7.2. An Exact Analytical Solution to the Two-Layer Model ... 174
7.2.1. Reformulating the Two-Layer Model .............. 174
7.2.2. Implementing and Running the Exact
Analytical Solution ............................ 176
7.2.3. Evaluating the Exact Analytical Solution ....... 177
7.3. An Iterative Numerical Solution to the Multiple
Leaf-Layer Model ...................................... 178
7.3.1. Revisiting the Conceptual Model ................ 179
7.3.2. Formulating the Mathematical Model ............. 181
7.3.3. Implementing the Multiple Leaf-Layer Model ..... 183
7.3.4. Running the Multiple Leaf-Layer Model .......... 188
7.3.5. Evaluating the Multiple Leaf-Layer Model ....... 188
7.3.6. How Many Iterations are Required? .............. 190
7.3.7. Objective Determination of the Required
Number of Iterations ........................... 192
7.3.8. Running and Evaluating the Revised
Computational Model ............................ 195
7.4. Bouguer's Law and the Attenuation Coefficient ......... 196
7.4.1. Implementing a Computational Model of
Bouguer's Law .................................. 198
7.4.2. Running and Evaluating the Modified
Computational Model ............................ 198
7.4.3. Visualizing the Output ......................... 200
7.4.4. Function Fitting in gnuplot .................... 200
7.5. Summary ............................................... 202
8. POPULATION DYNAMICS ........................................ 205
8.1. Introduction .......................................... 205
8.2. Unconstrained or Density-Independent Growth ........... 206
8.2.1. Development of the Conceptual Model ............ 206
8.2.2. Formulation, Implementation and Evaluation
of the Discrete Model .......................... 207
8.2.3. Formulation, Implementation and Evaluation
of the Continuous Model ........................ 214
8.3. Constrained or Density-Dependent Growth ............... 218
8.3.1. Developing the Conceptual Model ................ 219
8.3.2. Continuous Logistic Model ...................... 219
8.3.3. Discrete Logistic Model ........................ 222
8.4. Numerical Integration (or Stepping) Methods ........... 228
8.4.1. Euler's Method ................................. 230
8.4.2. Runge-Kutta Methods ............................ 234
8.5. Inter-Specific Competition ............................ 238
8.5.1. Conceptual Basis and Mathematical
Formulation .................................... 238
8.5.2. Implementation ................................. 240
8.5.3. Running the Model .............................. 242
8.5.4. Visualization .................................. 242
8.6. Predator-Prey Relationships ........................... 244
8.6.1. Conceptual Basis and Mathematical
Formulation .................................... 244
8.6.2. Implementation ................................. 245
8.6.3. Running the Model .............................. 245
8.6.4. Visualization .................................. 247
8.7. Summary ............................................... 248
9. BIOSPHERIC FEEDBACK ON DAISYWORLD .......................... 251
9.1. Introduction .......................................... 251
9.2. Description and Assumptions of the Conceptual Model ... 253
9.3. Formulating the Mathematical Model .................... 254
9.4. Implementing the Computational Model .................. 258
9.4.1. Implementation 1: Constant Solar Luminosity .... 258
9.4.2. Implementation 2: Increasing Solar
Luminosity ..................................... 265
9.4.3. Implementation 3: Exploring the Impact of
Biodiversity ................................... 270
9.4.4. Implementation 4: Modularizing the Code with
User-Defined Functions ......................... 274
9.5. Sensitivity Analysis and Uncertainty Analysis ......... 282
9.6. Summary ............................................... 286
10.MODELING INCIDENT SOLAR RADIATION AND HYDROLOGICAL
NETWORKS OVER NATURAL TERRAIN .............................. 289
10.1.Introduction .......................................... 289
10.2.Visualizing Digital Elevation Data as an Array ........ 290
10.3.Handling Multi-Dimensional Arrays in gawk ............. 291
10.4.Determining Terrain Gradient and Aspect ............... 293
10.4.1.Formulation .................................... 293
10.4.2.Implementation ................................. 294
10.4.3.Evaluation ..................................... 298
10.4.4.Visualization .................................. 298
10.5.Solar Irradiance on Sloping Terrain ................... 300
10.5.1.Formulation .................................... 300
10.5.2.Implementation ................................. 301
10.5.3.Evaluation ..................................... 306
10.5.4.Visualization .................................. 307
10.6.Modeling Hydrological Networks ........................ 309
10.6.1.Implementation ................................. 310
10.6.2.Evaluation ..................................... 313
10.6.3.Visualization .................................. 313
10.6.4.Modified Implementation ........................ 315
10.6.5.Evaluation of the Modified Implementation ...... 315
10.6.6.Visualization of the LDD Vectors on a Solid
Surface Model .................................. 315
10.7.Summary and Further Directions ........................ 318
A. INSTALLING AND RUNNING THE SOFTWARE ........................ 321
A.l. Introduction .......................................... 321
A.2. Some Basic Computing Concepts ......................... 321
A.2.1. Operating System ............................... 321
A.2.2. Files, Directories, Paths and File Systems ..... 322
A.3. Installing and Running gnuplot ........................ 323
A.3.1. Instructions for Microsoft Windows ............. 324
A.3.2. Instructions for GNU/Linux ..................... 326
A.4. Installing and Running gawk ........................... 329
A.4.1. Instructions for Microsoft Windows ............. 329
A.4.2. Instructions for GNU/Linux ..................... 333
В. GNU GENERAL PUBLIC LICENSE ................................. 335
B.l. Preamble .............................................. 335
B.2. Terms and Conditions for Copying, Distribution and
Modification .......................................... 336
B.3. No Warranty ........................................... 340
С. GNUPLOT LICENSE ............................................ 341
D. STANDARDS .................................................. 343
D.l. International Standard Date and Time Notation ......... 343
D.2. SI Units (Systeme International d'Unites) ............. 344
E. SOLUTIONS TO EXERCISES ..................................... 347
F. ACRONYMS AND ABBREVIATIONS ................................. 377
G. LIST OF SYMBOLS ............................................ 381
REFERENCES .................................................... 387
INDEX ......................................................... 397
List of Figures
1.1. Schematic representation of the modeling process ........ 2
1.2. Examples of some of the symbols used in Forrester
diagrams ................................................ 5
1.3. Forms of various mathematical functions ................. 8
1.4. Graphical representation of different system states .... 11
1.5. Schematic representation of a feedback relation ........ 12
1.6. Negative and positive feedback relations ............... 12
1.7. Schematic representation of a branching or splitting
relation ............................................... 13
1.8. Photograph of Llyn Efyrnwy ............................. 20
2.1. GUI for the version of gnuplot for Microsoft Windows ... 29
2.2. Extract from the data on air temperature at Llyn
Efyrnwy throughout 1998 (le98temp.dat; first and
last 10 lines only) .................................... 30
2.3. Simple x-y plot of the maximum air temperature
measured at Llyn Efyrnwy every 12 hours throughout
1998 ................................................... 31
2.4. Simple x-y plot of the maximum air temperature
measured at Llyn Efyrnwy every 12 hours throughout
1998, with labeled axes and a boxed key ................ 33
2.5. Simple x-y plot of the maximum and minimum air
temperatures measured at Llyn Efyrnwy every 12
hours throughout 1998 .................................. 36
2.6. Plot of the maximum and minimum air temperatures
measured at Llyn Efyrnwy every 12 hours between
March 12, 1998 and July 1, 1998, illustrating the
lines data style ....................................... 37
2.7. Plot of the maximum and minimum air temperatures
measured at Llyn Efyrnwy every 12 hours between
March 12, 1998 and July 1, 1998, illustrating the
linespoints and boxes data styles ...................... 38
2.8. Time-series plot of the maximum and minimum air
temperatures measured at Llyn Efyrnwy every 12
hours between March 12, 1998 and July 1, 1998 .......... 39
2.9. Extract from the data on precipitation at Llyn
Efyrnwy during 1998 (le98rain.dat; first 12 lines
only) .................................................. 40
2.10.A plot of two time-series (maximum air temperature
and precipitation at Llyn Efyrnwy) contained in
separate data files .................................... 41
2.11.Output from gnuplot's test command for the epslatex
terminal type .......................................... 43
2.12.First 10 lines and last 10 lines of the Llyn Efyrnwy
DEM data file, efyrnwy.dem ............................. 44
2.13.Visualization of the Llyn Efyrnwy DEM .................. 45
2.14.Viewing the Llyn Efyrnwy DEM from a different
direction .............................................. 46
2.15.Wire-frame surface (10 x 10 element grid) generated
from the Llyn Efyrnwy DEM .............................. 47
2.16.Wire-frame surface (51 x 51 element grid) generated
from the Llyn Efyrnwy DEM .............................. 48
2.17.Wire-frame surface (51 x 51 element grid) generated
from the Llyn Efyrnwy DEM, with hidden line removal .... 49
2.18.Grayscale rendered surface model of the terrain
elevation close to Llyn Efyrnwy ........................ 50
2.19.Visualization of the Llyn Efyrnwy DEM, with a contour
map added to the base of the plot ...................... 52
2.20.Extracts from Llyn Efyrnwy contour line data file
(contours.dat; lines 1-10, 55-70 and 840-856) .......... 54
2.21.Contour map of the terrain around Llyn Efyrnwy ......... 55
3.1. Partial contents of the file rain981e.dat (first 25
records) ............................................... 61
3.2. Operation of a gawk program ............................ 64
3.3. Operation of a gawk program designed to manipulate
and print selected fields of an input data file ........ 65
3.4. Operation of a gawk program designed to print
selected records and fields of an input data file ...... 69
3.5. First 12 lines of output produced by Program 3.4
when applied to thedatain rain981e.dat ................. 73
3.6. Hourly precipitation accumulation at Llyn Efyrnwy
throughout 1998 illustrating the "missing data"
problem ................................................ 74
3.7. Hourly precipitation accumulation at Llyn Efyrnwy
throughout 1998 with the "missing data" values
removed by gnuplot ..................................... 75
4.1. Part of the Taff Ely wind farm, South Wales, UK ........ 80
4.2. Location of onshore and offshore wind farms
operating in Wales, UK in 2006 ......................... 81
4.3. Extract from the file wind981e.dat (first 25 records
and first 10 fields only) .............................. 84
4.4. gawk's main pattern-action and end blocks .............. 88
4.5. gawk's if construct .................................... 90
4.6. Absolute frequency distribution of the hourly mean
wind speed at Llyn Efyrnwy ............................. 95
4.7. Visualization of the absolute frequency distribution
of the hourly mean wind speed at Llyn Efyrnwy in
1998 ................................................... 95
4.8. gawk's if else construct ............................... 96
4.9. Relative frequency distribution of the hourly mean
wind speed at Llyn Efyrnwy throughout 1998 ............. 99
4.10.Visualization of the relative frequency distribution
of hourly mean wind speed at LlynEfyrnwy throughout
1998 ................................................... 99
4.11.Relative frequency distributions of hourly mean wind
speed at Llyn Efyrnwy for 1998 and the period 1994
to 2000, inclusive .................................... 100
4.12.Weibull PDFs for various values of the shape
parameter (k) and a fixed value of the scale
parameter (c = 1) ..................................... 101
4.13.Part of the output from the gnuplot function-fitting
procedure ............................................. 103
4.14.Relative frequency distribution of hourly mean wind
speed at Llyn Efyrnwy in 1998 and the Weibull PDF
fitted to these data (k &asump; 1.536; с &asump;
5.295) ................................................ 104
4.15.Theoretical relationship between wind power and
wind speed ............................................ 107
4.16.Partial contents of the file wind981 v.pwr (first
12 records) ........................................... 110
4.17.Time series of the simulated power output from
a small WECS at Llyn Efyrnwy .......................... 111
5.1. Partial contents of the file radt981e.dat (first 25
records) .............................................. 115
5.2. Direct and diffuse solar irradiance ................... 116
5.3. First five lines of the output file, radt981e.out,
produced using Program 5.1 ............................ 117
5.4. Hourly variation in total solar irradiance at Llyn
Efyrnwy throughout 1998 ............................... 118
5.5. Diurnal variation in total solar irradiance at Llyn
Efyrnwy on June 21, 1998 .............................. 119
5.6. Impact of cloud cover on incident solar radiation,
(i) Attenuation of the direct solar beam; (ii)
reflection from clouds over adjacent terrain .......... 120
5.7. Part of the electromagnetic spectrum, showing the
major wavelength regions, including an expanded
representation of the visible spectrum ................ 121
5.8. Spectral distribution of the radiant energy emitted
by a blackbody radiator at 5800 К (e.g., the sun)
in MW·m-2μm-1 .......................................... 122
5.9. Solar spectral irradiance at the top of the
atmosphere, assuming that the sun behaves as
a blackbody radiator at 5800 К ........................ 124
5.10.Reference solar spectral irradiance at the top of
the atmosphere (solid line) and at sea level
(dashed line) for a 1.5 air mass (AMI.5)
atmospheric path length ............................... 125
5.11.Scattering, absorption and transmission of solar
radiation on its passage down through Earth's
atmosphere ............................................ 125
5.12.Gaseous transmission through Earth's atmosphere
as a function of wavelength ........................... 126
5.13.Solar zenith angle, Ψ, with respect to a flat
horizontal surface .................................... 127
5.14.Variation in the solar declination angle at four
times of the year: (a) March 21 (δ = 0°), (b) June
21 (δ = + 23.4°), (c) September 21 (δ = 0°) and (d)
December 21 (δ = -23.4°) .............................. 128
5.15.Variation in the solar declination angle, δ, as
a function of the day ofyear, Do Y .................... 129
5.16.Solar hour angle, θ, as though viewing Earth
vertically downward from a point directly above
the North Pole ........................................ 130
5.17.gawk's begin and main pattern-action blocks ........... 132
5.18.A for loop designed to perform a set of instructions
contained in the body 365 times.The value of the
variable doy increases by 1 each time, from 1
to 365 ................................................ 136
5.19.Simulated variation in the total, direct and
diffuse solar irradiance as a function of the day
of year (DoY) ......................................... 138
5.20.Comparison between observed (vertical impulses)
and simulated (solid line) total solar irradiance
as a function of the time of year ..................... 139
6.1. Earth's shortwave radiation budget, showing
the approximate percentages of the incident solar
radiation that are (a) reflected by the atmosphere,
(b) absorbed by the atmosphere, (c) reflected by
clouds, (d) absorbed by clouds, (e) reflected by
the land and ocean surface and (f) absorbed by
the land and ocean surface ............................ 144
6.2. Earth's longwave radiation budget, showing the
approximate percentages of longwave radiation
emission from the surface that are (a) absorbed
by atmospheric gases or (b) escape to space, (c)
the net emission by atmospheric gases, (d) the
sensible heat flux from the surface, (e) the net
emission by clouds and (f) the latent heat flux
from the surface ...................................... 145
6.3. Typical spectral reflectance curves for vegetation
(solid line) and soil (dashed line) in the range
0.5 μm (blue/green) to 1.05μm (near-infrared) ......... 145
6.4. Upward-looking hemispherical photograph taken from
within a deciduous tree canopy, giving an indication
of the horizontal and vertical distribution of light
within the canopy ..................................... 146
6.5. Reflection from a soil surface ........................ 149
6.6. Reflection from a layer of leaves ..................... 150
6.7. Reflection from a mixed soil and leaf surface ......... 151
6.8. Photograph of a sugar beet crop, showing the
mixture of leaves (dark areas) and soil (light
areas) visible when the canopy is viewed vertically
downward .............................................. 152
6.9. Output from a simple light-interaction model for
a surface comprising a mixture of soil and leaves
(Program 6.1) ......................................... 156
6.10.Expected variation in the spectral reflectance of
a simple plant canopy at red and NIR wavelengths
as a function of vegetation amount, LAI ............... 156
6.11.Two-layer model of light interaction with a plant
canopy ................................................ 157
6.12.Spectral reflectance of a plant canopy as
a function of the fractional cover of leaves based
on the two-layer light interaction model given in
Program 6.2 ........................................... 162
6.13.Fifth-order multiple scattering in a two-layer
model of light interaction ............................ 163
6.14.Spectral reflectance of a plant canopy as
a function of the fractional cover of leaves based
on the two-layer model including fifth-order
scattering ............................................ 165
6.15.Schematic representation of the various pathways
(i-vii) that incident solar radiation can take
through a three-layer model of a plant canopy ......... 166
6.16.Spectral reflectance of a mixed soil and vegetation
canopy as a function of LAI, based on the three-
layer model given in Program .......................... 171
7.1. Multiple scattering of incident solar radiation in
a two-layer plant canopy .............................. 175
7.2. Interaction of a photon stream with a multiple leaf-
layer canopy (time step 0) ............................ 179
7.3. Interaction of a photon stream with a multiple leaf-
layer canopy at time steps 1 (top), 2 (middle) and 3
(bottom) .............................................. 180
7.4. Schematic representation of a plant canopy
comprising multiple plane-parallel leaf layers
(z - 1, z, and z + 1) and a soil substrate (z') ....... 181
7.5. Contributions to flux traveling upward from leaf-
layer z in a simple, plane-parallel, plant canopy ..... 182
7.6. Contributions to flux traveling downward from leaf-
layer z in a simple, plane-parallel, plant canopy ..... 182
7.7. Contribution to flux traveling upward from the soil
substrate (z') in a simple, plane-parallel, plant
canopy ................................................ 183
7.8. Representation of the array 1_Up ...................... 184
7.9. Two-stream model of radiation transport through
a multiple leaf-layer model of a vegetation canopy
(where layers=2; see text for explanation) ............ 185
7.10.Flow-chart representation of the two nested for
loops used in iterate.awk (Program 7.2) ................ 187
7.11.Relationship between LAI and canopy spectral
reflectance at red and NIR wavelengths predicted
by the numerical solution to the multiple leaf-
layer model (iterate.awk; Program 7.2) ................ 189
7.12.Estimated spectral reflectance of a 10 leaf-layer
plant canopy at near-infrared wavelengths as
a function of the number of model iterations .......... 193
7.13.Flow-chart representation of the general structure
of a do while loop .................................... 195
7.14.Attenuation of incident solar radiation as
a function of the distance traversed through
a homogeneous turbid medium, according to Bouguer's
Law for various values of the attenuation
coefficient, к ........................................ 197
7.8. Environmental Modeling: A Practical Introduction
7.15.Attenuation of incident solar radiation at red
wavelengths as a function of the number of leaf-
layers traversed down from the top of the canopy ...... 200
7.16.Results reported by gnuplot when fitting the Bouguer
Law function to the data in the file bouguer.red ...... 201
7.17.Attenuation of incident solar radiation at red
wavelengths as a function of the number of leaf-
layers traversed downward into a multi-layer plant
canopy (points) and the negative exponential
function (Bouguer's Law) fitted to these data
(dashed lines) ........................................ 202
8.1. Factors leading to a change in the size of
a population .......................................... 206
8.2. Population growth predicted by a discrete density-
independent model based on three separate rates of
growth (λ = 1.05 λ = 1.06 and λ = 1.07) and a
common initial population (N0 = 10) ................... 211
8.3. Population decline predicted by a discrete,
density-independent model based on three separate
rates of growth (λ = 0.95, λ = 0.90 and λ = 0.85)
and a common initial population (N0 = 100) ............ 212
8.4. Discrete population growth curves from Figure 8.2
plotted on a semi-logarithmic scale ................... 213
8.5. Discrete population growth curves from Figure 8.3
plotted on a semi-logarithmic scale ................... 213
8.6. Average rate of population growth measured between
two census points, A and B, expressed as the slope
of the secant line AB ................................. 214
8.7. Effect of reducing Δt on the representation of
the continuous population growth curve, N(t) .......... 215
8.8. Results from the continuous model of density-
independent population growth (Program 8.2;
continue.awk) for N0 = 10 and r = 0.05, r = 0.06
and r = 0.07 .......................................... 218
8.9. Output from the continuous logistic model of
population growth (Program 8.3; cntlogst.awk)
for N(0) = 10, К = 1000 and various values of r ....... 222
8.10.Relationship between population size (N) and
population growth (dN/dt) in the continuous
density-dependent model of population growth for
N(0) = 10, K = 1000 and r = 0.05 ...................... 223
8.11.Output from the discrete logistic model of
population growth (Program 8.4; dsclogst.awk)
for N0 = 10, К = 1000 and three different values
of r (0.05, 0.06 and 0.07) ............................ 225
8.12.Variation in population size as predicted by
the discrete logistic growth model as a function
of r for N0 = 2 and К = 1000 .......................... 226
8.13."Bifurcation diagram" showing the population sizes
predicted by the discrete version of the density-
dependent population growth model as a function
of the intrinsic rate of increase, r .................. 227
8.14.Enlarged section of the "bifurcation diagram"
presented in Figure 8.13 showing the fine structure
present ............................................... 229
8.15.Effect of a small difference in N0, N0 = 99 (·) and
N0 = 102 (o), on the population dynamics of
the discrete logistic model for r = 3.0 and
Ј = 500 ............................................... 229
8.16.Diagrammatic representation of Euler's method of
numerical in tegration used to estimate Nt+1 based
on Nt and dN where Δt = 1. The solid gray line
dt
represents the underlying continuous function
N(t) .................................................. 230
8.17.Euler's method of numerical integration used
to estimate Nt+1 based on Nt and dN, where Δt = 0.5.
dt
The gray dot is the value of Nt+1 estimated
using Δt = 1 .......................................... 231
8.18.Analytical and numerical (Euler's method) solutions
to the continuous logistic model of population
growth for r = 0.5, N0 = 10 and Δt = 1,0.5 and 0.1 .... 234
8.19.Schematic of the mid-point method of numerical
integration ........................................... 236
8.20.Results of the analytical (solid line) and fourth-
order Runge-Kutta numerical (dots) solutions to
the continuous logistic model of population growth
for r = 0.05, N(0) = 10 and dt = 0.1 .................. 238
8.21.Example data file, paramsl .dat, containing the set
of parameter values that are required as input to
Program 8.7, compete.awk .............................. 240
8.22.Sustained coexistence: inter-specific competition
modeled using Program 8.7, compete.awk, for N1 = 10
and N2 = 20 initially, r1 = 0.5, r2 = 0.75, a = 0.7,
β = 0.6, K1 = 1000 and K2 = 750 ........................ 242
8.23.Demise of one species: inter-specific competition
modeled using Program 8.7, compete.awk, for N1 = 10
and N2 = 20 initially, and r1 = 0.5, r2 = 0.75,
α = 0.5, β = 0.8, K1 = 1000 and K2 = 750 ............... 243
8.24.Second example data file, params2.dat, containing
the set of pa rameter values that are required as
input to Program 8.7, compete.awk ..................... 244
8.25.Output from the Lotka-Volterra predator-prey
equations (solid line = prey species; dashed line =
predator species) ..................................... 247
8.26.Phase-plane diagram showing the hysteresis loop
between the sizes of the predator and prey
populations predicted by the Lotka-Volterra model
(Program 8.8) ......................................... 248
9.1. Diagrammatic representation of the Daisy world
model ................................................. 255
9.2. Parabolic relationship between daisy growth rate
and local temperature ................................. 257
9.3. First 15 rinesoftheflledaisyl.dat ..................... 262
9.4. Average global temperature of Daisyworld as
a function of time, assuming a constant solar
luminosity (L = 1.0) .................................. 263
9.5. Fractional area of Daisyworld covered by black
daisies and white daisies as a function of time,
assuming a constant solar luminosity (L = 1.0) ........ 264
9.6. Global average temperature versus time for L = 0.8,
0.9, 1.0, 1.1 and 1.2 ................................. 265
9.7. Global average temperature of Daisyworld, with and
without biota, as a function of solar luminosity ...... 268
9.8. Solar luminosity versus the fractional area of
Daisyworld covered by black (solid line) and white
(dashed line) daisies ................................. 269
9.9. Variation in the global average temperature of
Daisyworld as a function of solar luminosity.
Comparison of results obtained using the two-
species and three-species versions of the model ....... 273
9.10.Fractional area of the planet surface covered by
black (solid line), gray (long-dash line) and white
(short-dash line) daisies as a function of relative
solar luminosity ...................................... 273
9.11.Schematic representation of a user-defined function
in gawk ............................................... 276
9.12.Sensitivity analysis of the three-species
Daisyworld model, daisy4.awk, showing variation
in the globally averaged temperature of the planet
as a function of the albedo of the black daisies
(0.10 ≤ Аblack ≤ 0.45) ................................. 284
9.13.Sensitivity analysis of the three-species
Daisyworld model, daisy4.awk, showing variation
in the globally averaged temperature of the planet
as a function of the albedo of the white daisies
(0.55 ≤ Awhite ≤ 0.90) ................................. 284
9.14.Sensitivity analysis of the three-species
Daisyworld model, daisy 4.awk, showing variation
in the fractional area of the planet covered by
black daisies as a function of the albedo of the
black daisies (0.10 ≤ Ablack ≤ 0.45) ................... 285
9.15.Sensitivity analysis of the three-species
Daisyworld model, daisy4.awk, showing variation
in the fractional area of the planet covered by
white daisies as a function of the albedo of the
black daisies (0.10 ≤ Ablack ≤ 0.45) ................... 285
10.1.Planimetric visualization of the terrain
elevation at Llyn Efyrnwy ............................. 291
10.2.Graphical representation of a 2D array, data. The
shaded cell is data [2,3] ............................. 292
10.3.Relative indexing used to calculate the local
gradient and aspect of a given cell, elevation
[E,N], in an array containing digital elevation
data, where e and N are the Easting and Northing,
respectively, of the cell and where Δ is the
cell size ............................................. 294
10.4.Relationship between the size of the data array
given as input to Program 10.2, gradasp.awk, (gray
and white cells combined) and the output data
arrays that it produces (white cells only) ............ 298
10.5.Planimetric visualization of the terrain gradient
(arc degrees) at Llyn Efyrnwy ......................... 299
10.6.Planimetric visualization of the terrain aspect
(arc degrees relative to true north) at Llyn
Efyrnwy ............................................... 300
10.7.Planimetric visualization of the direct solar
irradiance for each cell in the Llyn Efyrnwy DEM
at solar noon on Do Y = 172 (June 21) ................. 307
10.8.Planimetric visualization of the diffuse solar
irradiance for each cell in the Llyn Efyrnwy DEM at
solar noon on Do Y = 172 (June 21) .................... 308
10.9.Planimetric visualization of the total (global)
solar irradiance for each cell in the Llyn Efyrnwy
DEM at solar noon on Do Y = 172 (June 21) ............. 309
10.10.Potential directions in which water may flow
across a DEM in the D8 or "eight-point pour"
algorithm ............................................. 310
10.11.Example of a small DEM array showing the LDD
vectors derived using the D8 ("eight-point pour")
algorithm ............................................. 313
10.12.LDD vectors derived from the Llyn Efyrnwy DEM
using the D8 ("eight-point pour") algorithm ........... 314
10.13.LDD vectors derived from the Llyn Efyrnwy DEM
using the D8 ("eight-point pour") algorithm with
OS stream network superimposed ........................ 314
10.14.Extract from the data file efyrnwy.arr produced
by Program 10.5, d8arrows.awk (first 25
records) .............................................. 317
10.15.D8 LDD vectors superimposed onto a 3D visualization
of the Llyn Efyrnwy DEM ............................... 318
A.1. Graphical representation of some files and
directories on the CD-ROM, illustrating the full
path to the file rain981e.dat under Microsoft
Windows (d:/chapter3/rain981e.dat) .................... 322
A.2. Graphical representation of some files and
directories on the CD-ROM, illustrating the full
path to the file rain981e.dat under GNU/Linux
(/mnt/cdrom/chapter3/rain981e.dat) .................... 323
A.3. The gnuplot download page viewed in a standard web
browser (ftp://ftp.gnuplot.info/pub/gnuplot/) ......... 324
A.4. Installing gnuplot on Microsoft Windows XP.See text
for details ........................................... 325
A.5. Folder containing the gnuplot executable .............. 326
A.6. GUI version of gnuplot for Microsoft Windows .......... 327
A.7. Command-line interface for gnuplot running under
GNU/Linux ............................................. 327
A.8. Some of the steps involved in installing gawk on
Microsoft Windows ..................................... 330
A.9. Further steps involved in installing gawk on
Microsoft Windows ..................................... 331
A.10.Instructing Microsoft Windows where to find gawk on
the system ............................................ 332
A.11.Running gawk under Microsoft Windows .................. 332
A.12.gawk running in a GNU/Linux console ................... 333
E.l. Output from Exercise 3.3 .............................. 351
E.2. Output from Exercise 4.1 .............................. 353
E.3. Output from Exercise 4.3 .............................. 355
E.4. Output from Exercise 5.1 .............................. 356
E.5. Output from Exercise 5.2 .............................. 358
E.6. Output from Exercise 6.2 .............................. 360
E.7. Ouptut from Exercise 8.1 .............................. 362
E.8. First plot from Exercise 8.2 .......................... 363
E.9. Second plot from Exercise 8.2 ......................... 364
E.10.Output from Exercise 8.3 .............................. 365
E.ll.First plot from Exercise 9.1 .......................... 366
E.12.Second plot from Exercise 9.1 ......................... 366
E.13.First plot from Exercise 9.2 .......................... 369
E.14.Second plot from Exercise 9.2 ......................... 369
E.15.First plot from Exercise 9.3 .......................... 371
E.16.Second plot from Exercise 9.3 ......................... 371
E.17.Third plot from Exercise 9.3 .......................... 372
E.18.Output from Exercise 9.4 .............................. 375
E.19.Output from Exercise 10.1 ............................. 376
List of Tables
1.1. Four main phases of systems analysis .................... 3
1.2. Important definitions in environmental modeling ......... 4
1.3. Selection of tools suitable for implementing
computer-based environmental models .................... 15
1.4. Some of the bird species found in the area
surrounding Llyn Efyrnwy ............................... 21
2.1. Examples of "open source" software for scientific
data visualization ..................................... 28
2.2. Selected options of the plot command in gnuplot ........ 34
2.3. Selected data style options of the plot command in
gnuplot ................................................ 35
2.4. Selected time and date format specifiers in gnuplot .... 39
2.5. Selected command-line options to control the
appearance of data series in gnuplot ................... 42
2.6. Selected output file formats supported by gnuplot ...... 56
3.1. Selected properties of the gawk programming language ... 62
3.2. Interpretationofthedatafieldsinthefilerain981e.dat ..... 63
3.3. Selected mathematical operators available in gawk ...... 66
3.4. Numerical comparison operators in gawk ................. 69
3.5. Selected printf format control specifiers .............. 70
3.6. Selected printf format modifiers ....................... 71
3.7. Logical or Boolean operators in gawk ................... 76
4.1. Location and characteristics of wind farms operating
in Wales, UK in 2006 ................................... 82
4.2. Explanation of the data fields in wind981e.dat ......... 85
4.3. Operation of lines l-5 of Program 4.1 applied to
wind981e.dat ........................................... 87
4.4. gawk's arithmetic assignment operators ................. 91
4.5. gawk's increment and decrement operators ............... 91
4.6. Factors affecting the power output of a WECS .......... 106
5.1. Explanation of the data fields in radt981v.dat ........ 116
5.2. Symbols used in the mathematical model (Equations
5.7 through 5.14) and variables used in the
computational model (Program 5.2) of solar
irradiance at Llyn Efyrnwy ............................ 133
6.1. Explanation of the pathways that radiation can
traverse through the three-layer model of a plant
canopy presented in Figure 6.15 and the
corresponding terms in Equation 6.15 .................. 167
7.1. Spectral reflectance of a simple vegetation canopy
with either a soil or a snow substrate derived
using alternative formulations and implementations
of a two-layer model .................................. 178
7.2. Output from iterate.awk at red and MR wavelengths ..... 189
7.3. Output from iterate2.awk (Program 7.3) at red and
NIR wavelengths, showing the predicted canopy
spectral reflectance as a function of the number of
iterations ............................................ 192
7.4. Ouptut from iterate3.awk (Program 7.4) at red and
NIR wavelengths, showing the number of iterations
performed and the predicted canopy spectral
reflectance, RС ....................................... 196
8.1. Approximate threshold values for different types
of behavior in the discrete logistic population
growth model .......................................... 228
8.2. Difference at t = 10 between the analytical
solution to the continuous logistic model for r =
0.5, К = 1000 and N0 = 10 and the numerical
solution based on Euler's method for different
values of Δt .......................................... 235
9.1. Multiple Gaia hypotheses .............................. 252
9.2. List of parameters and variables in the Daisy world
model and their implementation in the corresponding
gawk code (Program 9.1) ............................... 259
D.l. ISO 8601:2004 date and time notations ................. 343
D.2. SI Base Units ......................................... 344
D.3. SI derived and supplementary units .................... 345
D.4. SI prefixes ........................................... 346
List of Programs
1.1. introduction, awk ...................................... 26
3.1. selcols.awk ............................................ 67
3.2. selcols2.awk ........................................... 68
3.3. selcols3.awk ........................................... 70
3.4. selcols4.awk ........................................... 72
3.5. selcols5.awk ........................................... 76
4.1. meanwspd.awk ........................................... 86
4.2. meanmaxw.awk ........................................... 89
4.3. windfreq.awk ........................................... 93
4.4. windfrq2.awk ........................................... 97
4.5. wpower.awk ............................................ 108
5.1. selradt.awk ........................................... 117
5.2. solarrad.awk .......................................... 131
5.3. solarrd2.awk .......................................... 137
6.1. mixture.awk ........................................... 154
6.2. twolayer.awk .......................................... 160
6.3. twolayr2.awk .......................................... 164
6.4. 31ayers.awk ........................................... 169
7.1. analytic.awk .......................................... 177
7.2. iterate.awk ........................................... 186
7.3. iterate2.awk .......................................... 191
7.4. iterate3.awk .......................................... 194
7.5. bouguer.awk ........................................... 199
8.1. discrete.awk .......................................... 209
8.2. continue.awk .......................................... 217
8.3. cntlogst.awk .......................................... 221
8.4. dsclogst.awk .......................................... 225
8.5. euler.awk ............................................. 233
8.6. rk4.awk ............................................... 237
8.7. compete.awk ........................................... 241
8.8. predprey.awk .......................................... 246
9.1. daisy l.awk ........................................... 260
9.2. daisy2.awk ............................................ 266
9.3. daisy3.awk ............................................ 271
9.4. daisy4.awk ............................................ 277
9.5. daisyvar.awk .......................................... 280
9.6. daisy5.awk ............................................ 281
9.7. daisyfns.awk .......................................... 282
10.1. readarr.awk .......................................... 293
10.2. gradasp.awk .......................................... 295
10.3. demirrad.awk ......................................... 302
10.4. d81dd.awk ............................................ 311
10.5. d8arrows.awk ......................................... 316
|