Environmental Modelling For Bachelors ST

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 41

Kathmandu University

Dhulikhel, Kavre

Lab Report on Environmental Modeling Lab

Submitted by:
Nirmal Kumar Shahi
Roll No: 21
B.Tech in Environmental Engineering

Submitted to:
Kundan Lal Shrestha
PhD, ENG
Department of Environmental Science and Engineering

January 17, 2013


Table of Contents

SN Title
1 Prey-Predator Model
2 1D Gaussian Puff Model
3 2D Gaussian Puff Model
4 3D Gaussian Puff Model
5 Gaussian Plume Model
6 Hydrological Modeling
7 Streeter-Phelps Model for River Purification
8 Fugacity-based Multimedia Modeling
9 Michaelis-Menten Kinetics Model
10 Monod’s Kinetics Model
11 Richard’s Equation for Modeling Flow in Unsaturated Porous Media
12 Completely Mixed Flow Reactors Modeling
13 0D Box Model for Air Pollution
14 Individual Model (GEM)

A. Modeling Tools
B. References
Prey-Predator Model

Introduction

Predator-prey models are argubly the building blocks of the bio- and ecosystems as biomasses
are grown out of their resource masses. Species compete, evolve and disperse simply for the purpose of
seeking resources to sustain their struggle for their very existence. Depending on their specific settings
of applications, they can take the forms of resource-consumer, plant-herbivore, parasite-host, tumor
cells (virus)-immune system, susceptible-infectious interactions, etc. They deal with the general loss-win
interactions and hence may have applications outside of ecosystems.

A General Prey-Predator Model

Consider two populations whose sizes at a reference time t are denoted by x(t) , y(t) , respectively. The
functions x and y might denote population numbers or concentrations (number per area) or some other
scaled measure of the populations sizes, but are taken to be continuous functions. Changes in population
size with time are described by the time derivatives x˙≡dx/dt and y˙≡dy/dt, respectively, and a general
model of interacting populations is written in terms of two autonomous differential equations

𝑥̇ = 𝑥𝑓(𝑥. 𝑦)
𝑦̇ = 𝑦𝑔(𝑥, 𝑦)
i.e., the time t does not appear explicitly in the functions xf(x,y) and yg(x,y)). The
functions f and g denote the respective per capita growth rates of the two species. It is assumed
that df(x,y)/dy<0 and dg(x,y)/dx>0. This general model is often called Kolmogorov's predator-prey model

Model Application

Main applications of this model are as

 It can be used in spatially heterogeneous environment i.e range in space from favorable to
unfavorable.
 Can be applicable for biological control of some microorganisms.
 Can be used for study of population dynamics.
 Can be used for study of ecosystem that exist in the environment.

Simulation Results

Under following assumption Lokta-Voltera are based:

1. The prey population finds ample food at all times.


2. The food supply of the predator population depends entirely on the prey populations.
3. The rate of change of population is proportional to its size.
4. During the process, the environment does not change in favor of one species and the genetic
adaptation is sufficiently slow.

Fig. Exponential Growth graph using octave which is basic ecological model.

Analysis and Conclusion

The Lotka-Volterra predator-prey model is the simplest description of competition between two species.
The predator-prey model is a pair of differential equations involving a pair of competing populations, y1
(t) and y2 (t). The growth rate for y1 is a linear function of y2 and vice versa. The extra minus sign in the
second equation distinguishes the predators from the prey. Note that if y1 ever becomes zero, then y2
rate =-y2; and the predators are in trouble. But if y2 ever becomes zero, then y1 rate = y1; and prey
population grows exponentially.

There are four parameters, the two constants mu1 and mu2, and the two initial conditions, eta1 = y1 (0)
and eta2= y2 (0). If it starts with eta1 = mu1 and eta2=mu2, then both y1 rate and y2 rate are zero and
the population remain constant at their initial values.

If we happen to start with 1 = 1 and 2 = 2, then both ˙ y1 and ˙ y2 are zero and the populations remain
constant at their initial values. In other words, the point (1; 2) is an equilibrium point. The origin, (0; 0) is
another equilibrium point, but not a very interesting one.
This would be before any of either species adapted to be able to kill and consume the other for food.
The phase portrait shows no signs of inward curl that is a trait of the predator-prey model.

Appendix: Source code

1. T = 100;
2. r = *.5; .5+;
3. a = *1; 1+;
4. c0 = *0.1; 0.1+;
5. options = odeset(‘AbsTol’, 1e-20);
6. *t,c+ = ode15s (@PP, *0 T+,c0,options,r,a);
7. Subplot (2,1,1);
8. Plot (c(:,1)’,c(:,2)’); hold on;
9. Legend (‘trajectory’);
10. Xlabel (‘prey’); ylabel (‘predator’);
11. Subplot (2,1,2);
12. Plot (t,c(:,1)’,’-‘,t,c(:,2)’,’—‘);
13. Legend (‘prey’,’predator’);
14. Xlabel(‘time’);
15. Function dydt= PP(t,y,r,a)
16. Dydt=zeros(2,1);
17. Dydt(1) = y(1)*(r(1)-y(2)*a(1));
18. Dydt(2)= y(2)*(-r(2)+y(1)*a(2));

Puff Model

The Puff model is a volcanic ash tracking model developed at the University of Alaska Fairbanks. It
requires windfield data on a geographic grid covering the area over which ash may be dispersed.
Representative ash particles are initiated at the volcano's location and then allowed to advect, diffuse,
and settle within the atmosphere. The location of the particles at any time after the eruption can be
viewed using the post-processing software included with the model. Output data is in netCDF format and
can also be viewed with a variety of software. There are many atmospheric dispersion puff model. A
puff model releases emissions independent of the source, allowing the puff to respond to the
meteorology immediately surrounding it. This also allows puffs to be tracked across multiple sampling
periods until it has either completely diluted or has tracked across the entire modeling domain and out
of the computational area.
1D Gaussian Puff Model
Introduction

A one-dimensional (1-D) model is a set of adjacent box models, stacked vertically or horizontally. Vertical
1-D models may be used to study radiative transfer with photochemistry, gas and aerosol vertical
transport, aerosol optical properties, aerosol sedimentation, or cloud convection. Most solutions are
derived from the 1D solution for a plume, which is given by the normal distribution function f(x):

𝟏 𝟏 𝒙−𝝁 𝟐
𝒇(𝒙) = 𝒆𝒙𝒑 (− ( ) )
√𝟐𝝅𝝈 𝟐 𝝈

The normal distribution has most application in statistics. 𝜇 is the mean value of the distribution and 𝜍
the standard deviation. As the normal distribution is also referred to as Gaussian distribution, these
methods are also named Gaussian plume or Gaussian puffs.

If the fluid moves with the velocity 𝜗 in x-direction, the solution is:

𝑀 (𝑥 − 𝜗𝑡)2
𝐶(𝑥. 𝑡) = exp (− )
√4𝜋𝑡𝐷 4𝑡𝐷

M denotes the total mass per unit area in the fluid system. The concentration C is a solution of the
transport equation, which account for diffusion and advection:
𝜕𝐶 𝜕 𝜕𝐶 𝜕𝐶
= 𝐷 𝜕𝑥 − 𝜗 𝜕𝑥
𝜕𝑡 𝜕𝑥

Model Application

One dimensional models are used for air pollution modeling, for example in the modeling the local
concentration distribution due to emission from stacks, but they can be applied to problems of point
pollution in rivers, channels, lakes, reservoirs and the sea, in ground water and soil water. Thus it can be
applied to various situations in almost all environmental compartments.
Simulation Results

Analysis and Conclusion

From figure 1 we observed that, when velocity was 0.1 and dispersion along x-axis (Dx) was 0.000625
there exist ten peaks. Initially there was high concentration while on gradual increase in distance,
concentration decreases.

When velocity was increased from 0.1 to 1 there exists a single peak at a distance of 50. There might
exist other peak but due to distance limit of the model other peaks seems to be absent and peak width
ranges from approximately 45 to 55. The concentration is approximately 11.

When keeping the velocity 1 and increasing the dispersion along x-axis from 0.000625 to 0.00725, we
found that peak concentration was at half of distance limit specified in widening its peak width from 30
to 70 and concentration of puff is approximately 3.5.

Thus form above results, we can conclude that in order to have lesser impact at source and its
surrounding, we can either increase the velocity of diffusivity.
Appendix: Source code

1. Dx=0.000625; % Diffusivity
2. v=0.1; % Velocity
3. m=1; % Mass
4. xmin=-0.05 % x-axis interval
5. xmax=2.15
6. t=[1:2:20]; % Time
7. x=linspace(xmin, xmax, 100);
8. c=[];
9. for i=1: size(t,2)
10. xx=x-v*t(i);
11. c=[c;(m/(sqrt(4*pi*Dx*t(i))))*ones(1,size(x)).*exp(-
(xx.*xx)/(4*Dx*t(i)))];
12. end;
13. plot(c');
14. hold on;
15. xlabel('Distance');
16. ylabel('Concentration');
17. title('Fig.1 Puff Model when Velocity is 0.1');

2D Gaussian Puff Model


Introduction

A two-dimensional (2-D) model is a set of 1-D models connected side by side. 2-D models can lie in the x-
y, x-z, or y-z planes. Advantages of a 2-D over a 1-D model are that transport can be treated more
realistically, and a larger spatial region can be simulated in a 2-D model. 2-D models have been used, for
example, to simulate dynamics, transport, gas chemistry, and aerosol evolution.

The generalization of the 1D normal distribution is 2D IS:

𝑀 1 (𝑥 − 𝜗𝑡)2 𝑦 2
𝐶(𝑥, 𝑦, 𝑡) = exp (− ( + ))
4𝜋𝑡√𝐷𝑥 𝐷𝑦 4𝑡 𝐷𝑥 𝐷𝑦

Model Application

Two dimensional models are also used for air pollution modeling, for example in the modeling the local
concentration distribution due to emission from stacks, but they can be applied to problems of point
pollution in rivers, channels, lakes, reservoirs and the sea, in ground water and soil water. Thus it can be
applied to various situations in almost all environmental compartments. But 2D models, transport can be
treated more realistically and a large spatial region can be simulated. And have been used for simulation
dynamics, transport, gas chemistry, and aerosol evolution.
Simulation Results

Analysis and Conclusion

As compared with the result of 1-D, 2-D results were realistic and large spatial region were simulated.
Above graph was obtained when velocity was 0.1 and dispersion along x-axis and y-axis were 0.01 and
0.000625 respectively shows, concentration is almost high at its origin (0).

When velocity was increased from 0.1 to 0.5 above graph was obtained where other parameter were
made as it is. Its shows that increase with the velocity concentration of puff shift from its origin to
approximately to a distance of 0.5. These results show that model is time dependent and varies with
time. Thus, if we need to reduce greater impact at a certain distance from source, by increasing the
velocity or decreasing the time it can be done. Similarly, to know what will be the result or output when
velocity made decrease, we simply decrease the velocity form 0.1 to 0.09 and result are analyzed.

Above outcome shows that concentration is almost high at its origin or source and its movement
towards vertical is slow as compared with above other results. With compared with other above results
it has high concentration at source and with time its movement is too slow. Thus it will have great impact
at source.

Appendix: Source code

1. Dx=0.01; % diffusivity
2. Dy=0.000625;
3. v=0.1; % velocity
4. m=1;
5. xmin=-0.2 % x-axis interval
6. xmax=0.5
7. ymin=-0.2 % y-axis interval
8. ymax=0.2
9. t=[1:4:20]; % Time
10. t=t(1);
11. [x,y]=meshgrid(linspace(xmin, xmax, 100), linspace(ymin, ymax,
100));
12. c=[];
13. for i=1: size(t,2)
14. xx=x-v*t(i);
15. c=[(m/(4*pi*t(i)*sqrt(Dx*Dy)))*ones(100).*exp(1/(-
4*t(i))*((xx.*xx)/(Dx)+(y.*y)/Dy))];
16. end;
17. surf(x,y,c);
18. colorbar;
19. hold on;
20. xlabel('Distance');
21. ylabel('Concentration');
22. title('Fig.2 2D Puff Model when velocity is 0.1');

3D Gaussian Puff Model

Introduction

A three-dimensional (3-D) model is a set of horizontal 2-D models layered on top of one another. The
advantage of 3-D over a 2-D model is that dynamics and transport can be treated more realistically in a
3-D model. The disadvantage of a 3-D model is that it requires significantly more computer time and
memory than does a 2-D model. Computer-time limitations are most apparent for global simulations
that last monthly to years. Because 3-D models represent dynamical and transport processes better than
do 0-D, 1-D, and 2-D models, 3-D models should be used when computer time requirement are not a
hindrance.
The generalization of the 1D formula for 3D is:

𝑀 1 (𝑥 − 𝜗𝑡)2 𝑦 2 𝑧 2
𝐶(𝑥, 𝑦, 𝑧, 𝑡) = 3 𝑒𝑥𝑝 (− ( + + ) − 𝜆𝑡)
(√4𝜋𝑡) √𝐷𝑥 𝐷𝑦 𝐷𝑧 4𝑡 𝐷𝑥 𝐷𝑦 𝐷𝑧

Where 𝝺 is decay coefficient.

Model Application

3D model is also applied to various situations in almost all environmental compartments and dynamics
and transport can be treated more realistically in a 3-D model. Thus it can be applied for global
simulations that last monthly to years

Simulation Results
Analysis and Conclusion

The above result obtained shows in 3-D and slicing was also done. As the 3-D model is a set of horizontal
2-D models layered on top of one another, it is difficult to interpret, thus in order to made easy
interpretation slicing was carried out. Above result was obtained for the velocity 0.3, which shows that
the concentration is high at source or origin and gradually decreases out ward with diffusion. There is
homogeneous diffusion in all direction. This result is more realistic as compared with above to models i.e
1-D and 2-D. Thus in order to know what will happen when other parameters are made change, we
generally made change in velocity but for 3-D we had made change in diffusivity parameters.

Above result was obtained when we made change in diffusivity along x-axis. We kept other as it is and
increased the value of diffusivity along x-axis form 0.004 to 0.08. As compared with above result there is
less concentration at source. Thus if we have greater diffusivity lesser will be the impact.

Above result was obtained when diffusivity along x-axis made to 0.0. The result thus obtained shows that
if we do not have diffusivity concentration will be always high at source and surrounding will not have
any impact. Above result shows that almost no diffusion to the surrounding.

Similarly, we made change in diffusivity along y-axis and above result was obtained. We decrease the
diffusivity from 0.001 to 0.0005. The result thus obtained shows; there is high concentration at source
and decreases outward due to diffusion. As compared with above first result diffusion is almost lesser
which aggress with the change in parameter we made.

Appendix: Source code

1. Dx=0.004; % Diffusivity
2. Dy=0.001;
3. Dz=0.001;
4. v=0.3; % Velocity
5. m=1; % Mass
6. xmin = 0.85 % x-axis interval
7. xmax = 1.15
8. ymin = -0.1 % y-axis interval
9. ymax = 0.1
10. zmin = -0.1 % z-axis interval
11. zmax = 0.1
12. t=3;
13. [x,y,z]=meshgrid(linspace(xmin, xmax, 100), linspace(ymin, ymax,
100), linspace(zmin, zmax, 100));
14. xx=x-v*t;
15. c=[(m/(sqrt(4*pi*t)^3*sqrt(Dx*Dy*Dz)))*ones.*exp(1/(-
4*t)*((xx.*xx)/(Dx)+(y.*y)/Dy+(z.*z)/Dz))];
16. colorbar;
17. hold on;
18. xlabel('X-axis');
19. ylabel('Y-axis');
20. zlabel('Z-axis');
21. title('Fig.3 3D Puff Model when Velocity is 0.3');
22. xslice=[(xmin+xmax)/2];
23. yslice=[(ymin+ymax)/2];
24. zslice=[(zmin+zmax)/2];
25. slice (x,y,z,c,xslice,yslice,zslice);

Gaussian Plume Model


Introduction

Gaussian Plume model uses a realistic description of dispersion, where it represents an


analytical solution to the diffusion equation for idealized circumstances. The model assumes
that the atmospheric turbulence is both stationary and homogeneous. In reality, none of these
conditions is fully satisfied. However, Gaussian plume model has been successfully used for rural
configurations.

Gaussian Plume models the dispersion of a continuous point source, i.e. Plume, in various
conditions and terrains. The output of Gaussian Plume is a 3-dimensional matrix containing the
concentrations of the emitted substance over a field with the first dimension (y) representing
the cross-wind axis, the second dimension (x) the downwind distance, and the third dimension
(z) the vertical axis. It uses a steady-state advection-diffusion equation.

Model Application

It is analytical solution to the diffusion equation for idealized circumstances and used for study
of the dispersion of a continuous point source i.e. Plume, in various conditions and terrains.
Simulation Results

When velocity was 0.5


Initially when the velocity was 0.5, concentration of plum was at high a little far from source and
indicated by dark oval shape. When velocity was made increase to 2, concentration was shifted towards
the wind direction and high at some distance away from the source. As the wind velocity was mad e
increase the size of plume also decreases with respect to above first result and peak concentration also
varies.

When value of decay constant made increase from 0 to 0.01

Above result was obtained when value of decay constant was made change from 0 to 0.01. The result
shows that the peak concentration of plum is at source. As compared with other above results, this
result shows the movement of plum is at a approximate distance of 200 which is quarter of the range
provided to the model. This may be due to less dispersion of the plum.

When z=30
When z=50

When z=70
When z=0

It is to be seen from the figures that the plume center-line concentration drops off while the ground level
concentration goes higher. This continues until both concentrations asymptote to the same value; an
indication to the uniform distribution of the pollutant concentration with height (z). It is seen that the
concentration distribution of the unstable atmosphere becomes uniform much closer to the source than
that of the stable atmosphere. This is due to the much more atmospheric turbulence in the unstable
atmosphere.

Application of Gaussian Plume Model

In the stable atmosphere case (producing a fanning plume), there is horizontal dispersion at a right angle
to the wind due to turbulence and diffusion. In the vertical, dispersion is suppressed by the stability of
the atmosphere, so pollution does not spread toward the ground. This results in very low pollution
concentrations at the ground.

In unstable air, the plume will whip up and down as the atmosphere mixes around (whenever an air
parcel goes up, there must be air going down someplace else to maintain continuity, and the plume
follows these air currents). This gives the plume the appearance that it is looping around.

An inversion aloft will trap pollutants underneath it, since the stable inversion prevents vertical
dispersion. Pollution released underneath the inversion layer will fumigate the mixed layer. Note that if
the smokestack was high enough to release the pollution within the inversion layer, the plume would fan
because the plume occurs within stable air.

In the neutral atmosphere case, the horizontal dispersion at a right angle to the wind is due to
turbulence and diffusion, which occurs at the same rate as the vertical dispersion, which is not being
opposed nor encouraged by the stability (or lack of it) in the atmosphere. So, the plume spreads equally
in the vertical and horizontal as it propagates downstream, forming a coming plume.

In the lofting case, pollution dilutes upward. This produces much lower pollution concentrations at the
ground at a distance downstream than the straight stable case (fanning plume), because molecular
diffusion and some turbulence allow smoke to reach the ground eventually, and the fanning plume does
not have the upward dispersion that the lofting plume has.

Appendix: Source code

1. Dy = 0.2; Dz = 1; % diffusivities
2. u = 0.5; % velocity
3. lambda = 0; % decay rate
4. Q = 1; % emission rate
5. xstack = 0; ystack = 50; % stack location
6. xmin = 10; xmax = 1000; % x-axis interval
7. ymin = 0; ymax = 100; % y-axis interval
8. H = 50; % effective stack height
9. z = 0; % height of observation
10. [x,y] = meshgrid
(linspace(xmin,xmax,100),linspace(ymin,ymax,100));
11. xx = x - xstack;
12. yy = y - ystack;
13. c = Q./(4*pi*xx*sqrt(Dy*Dz)).*...
14. exp(-u*yy.*yy./(4*Dy*xx)).*...
15. (exp(-u*(z-H)*(z-H)./(4*Dz*xx))+...
16. exp(-u*(z+H)*(z+H)./(4*Dz*xx)))...
17. .*exp(-lambda*xx/u);
18. for i = 10:10:100
19. plot (c(:,i)); hold on;
20. end
21. figure;
22. contourf (x,y,c); colorbar;

Hydrological Modeling

Introduction

Hydrologic models are simplified, conceptual representations of a part of the hydrologic cycle. They are
primarily used for hydrologic prediction and for understanding hydrologic processes. Two major types of
hydrologic models can be distinguished:

 Stochastic Models. These models are black box systems, based on data and using mathematical and
statistical concepts to link a certain input to the model output. Commonly used techniques
are regression, transfer functions, neural networks and system identification. These models are
known as stochastic hydrology models.
 Process-Based Models. These models try to represent the physical processes observed in the real
world. Typically, such models contain representations of surface runoff, subsurface
flow, evapotranspiration, and channel flow, but they can be far more complicated. These models
are known as deterministic hydrology models. Deterministic hydrology models can be subdivided
into single-event models and continuous simulation models.

Model Application

Some of the main application of hydrological modelling are as

 It can be used in hydrological and meteorological forecasting.


 It can be used for predicting future climate.

Simulation Results

The following map describes the accumulation of Nakhu Basin.


The CutDEM visual is done:

The drainage of Nakhu Basin

The drainage of Nakhu Basin.

Half Basin
Nakhu
Data requirement

There are many combinations of input data accepted by r.topmodel. First, like many other hydrologic
models, it requires the filled (depressionless) elevation map. The depressionless elevation map can be
directly supplied or automatically generated by r.topmodel with the following sets of input options:

1. Digital Elevation Model or DEM (elevation), Watershed mask (basin)

 Input: elevation, basin, nidxclass, parameters, input

 Output: depressionless, direction, belevation, topidx, idxstats, output

2. Depressionless DEM (elevation), Watershed mask (basin)

 Input: elevation, basin, nidxclass, parameters, input

 0utput: belevation, topidx, idxstats, output

Outputs

Area (m^2) = 42,102,900

Number of channels = 3

Distance from catchment Cumulative area ratio of sub catchment

500 0.0

1000 0.5

1500 1.0

Helps in determination of overland flow runoff (for soil erosion), subsurface runoff (for solute transport)
actual evapotranspiration, vegetation biomass and organic soil (for soil resistance)and Saturation deficit
(for piezometric pressures in soil stability).
Appendix: Source code: Python for Hydrograph generation

1. #!/usr/bin/python
2. # Program coded by Kundan
3. import numpy as N
4. import pylab as P
5. ndays = 365
6. f = N.loadtxt("output.dat",skiprows=65)
7. fin = N.loadtxt("input.dat",skiprows=4)
8. rain = fin*:,0+
9. rain = rain*1000. # Change to mm/d
10. days = f*:,0+
11. q = f*:,1+
12. q = q/86400.
13. qo = f*:,3+
14. #qo = qo/86400.
15. qs = f*:,4+
16. #qs = qs/86400.
17. print q.max(),qo.max(),qs.max()
18. print q.min(),qo.min(),qs.min()
19. print q.sum(),qo.sum()/q.sum()*100.,qs.sum()/q.sum()*100.
20. mth_days = *31,29,31,30,31,30,31,31,30,31,30,31+
21. start = 0
22. qm = N.zeros(12,N.float)
23. qma = *+
24. for i in range(12):
25. qm = q*start:start+mth_days*i++.mean()
26. start = start + mth_days*i+
27. qma.append(qm)
28. print qm
29. #P.plot(q)
30. P.figure(figsize=(10,5))
31. ax1 = P.subplot(211)
32. P.box()
33. P.plot(range(1,ndays+1),q,c="w")
34. P.setp( ax1.get_yticklabels(), visible=False)
35. ax1b = P.twinx()
36. P.bar(range(1,ndays+1),rain,color='k',ec='k')
37. ax1b.invert_yaxis()
38. ax1b.yaxis.tick_right()
39. #ax1b.grid(True)
40. ax1.grid(True)
41. P.setp( ax1.get_xticklines(), visible=False)
42. P.setp( ax1b.get_xticklines(), visible=False)
43. frame = ax1b.axesPatch
44. frame.set_edgecolor(frame.get_facecolor())
45. bottom = P.Line2D(*0, 1+, *1, 1+, transform=ax1b.transAxes, c='k', lw=2.0)
46. top = P.Line2D(*0, 0+, *0, 1+, transform=ax1b.transAxes, c='k', lw=2.0)
47. left = P.Line2D(*1, 1+, *0, 1+, transform=ax1b.transAxes, c='k', lw=2.0)
48. ax1b.add_line(bottom)
49. ax1b.add_line(left)
50. ax1b.add_line(top)
51. P.ylabel("Precipitation (mm/d)", rotation=270)
52. ax2 = P.subplot(212, sharex=ax1)
53. P.box()
54. P.plot(range(1,ndays+1),q,"b",label="Total flow")
55. P.setp( ax2.get_xticklines(), visible=False)
56. #ax2.xaxis.tickline_bottom()
57. frame = ax2.axesPatch
58. frame.set_edgecolor(frame.get_facecolor())
59. bottom = P.Line2D(*0, 1+, *0, 0+, transform=ax2.transAxes, c='k', lw=2.0)
60. top = P.Line2D(*0, 0+, *0, 1+, transform=ax2.transAxes, c='k', lw=2.0)
61. left = P.Line2D(*1, 1+, *0, 1+, transform=ax2.transAxes, c='k', lw=2.0)
62. right = P.Line2D(*0, 1+, *1, 1+, transform=ax2.transAxes, c='k', ls=':')
63. ax2.add_line(bottom)
64. ax2.add_line(left)
65. ax2.add_line(top)
66. ax2.add_line(right)
67. ax2.grid(True)
68. P.ylabel("Discharge (m$,^3-$/s)")
69. P.xlabel("Days since January 1, 1979")
70. P.setp( ax1.get_xticklabels(), visible=False)
71. P.setp( ax1b.get_xticklabels(), visible=False)
72. P.subplots_adjust(wspace=0, hspace=0)
73. P.savefig("hydrograph.png",dpi=600)
74. P.show()

Streeter-Phelps Model for River purification


Introduction

The model describes how dissolved oxygen (DO) decreases in a river or stream along a certain distance
by degradation of biochemical oxygen demand (BOD). The equation was derived by Streeter and Phelps
in 1925, based on field data from the Ohio River. The equation is also known as the DO sag equation. The
Streeter-Phelps equation is used in the study of water pollution as a water quality modelling tool.

The Streeter-Phelps equation determines the relation between the dissolved oxygen concentration and
the biological oxygen demand over time and is a solution to the linear first order differential equation.
𝜕𝐷
= 𝑘1 𝐿𝑡 − 𝑘2 𝐷
𝜕𝑡
This differential equation states that the total change in oxygen deficit (D) is equal to the difference
between the two rates of deoxygenation and reaeration at any time.

Where, k1, k2, and Lt are the deoxygenating rate, reaeration rate and the oxygen demand remaining at
time t.

Degradation concerns both BOD and DO, which is expressed in the system of two ordinary differential
equations as
𝜕𝐶𝐵𝑂𝐷
= 𝑓𝐵𝑂𝐷 − 𝑘𝑑 𝐶𝐵𝑂𝐷
𝜕𝑡

𝜕𝐶𝐷𝑂
= 𝑘𝐵𝑂𝐷 − 𝑘𝑑 𝐶𝐵𝑂𝐷
𝜕𝑡
𝜕𝐶𝐷𝑂
= 𝑘𝑎 (𝐶𝐷𝑂,𝑠𝑎𝑡 − 𝐶𝐷𝑂 ) − 𝑘𝑑 𝐶𝐵𝑂𝐷
𝜕𝑡
The Streeter-Phelps model is based on several conditions.

 Diffusion and dispersion processes are neglected.


 There is no distinction of concentrations within the river cross-section.
 The system of differential is based on a Lagranfian description, which is a formulation for the
concentration along the flow path.
Model Application

The main applications of this model are

 Measure the concentration of DO and BOD of the river.


 It also measure the level of organic pollutant concentration in the river and help in knowing the
purity of the river.
 This model can be used in wastewater treatment plan, hydropower reservoirs and dams.

Simulation Results

Fig. BOD and DO concentration at different travel time

Analysis and Conclusion

Two components like organic matter and Do along the path flow is simulated. The concentration of the
organic pollutant is measured as biodegradable oxygen demand. The two parameters are connected to
the BOD behavior, the inflow rate and the degradable rate. The plot of the DO as a function of time is
called the DO sag curve. There are two competing processes in this interaction: reaeration and
deoxygenation. Reaeration adds molecular oxygen to the stream from the atmosphere (up to the
saturation point); deoxygenation depletes the oxygen.
The Streeter-Phelps model states that the rate of change of the stream oxygen deficit, increases in direct
proportion to the stream BOD remaining, with proportionality constant given by the deoxygenation rate.
Let k1 denote the oxygenation rate (per day), K2, the reaeration rate (per day), When de-oxygenation
rate and aeration rate values are changed from the initial conditions, i.e. k1 increased from 0.3 to 1 and
k2 decreased from 0.4 to 0.04 the graph of Streeter Phelps model seems to be changed. The graph is
represented as;

This graph indicates that the river is more polluted as compared to the initial stage. Since BOD
concentration is increased (this can be observed within the graphs), indication results in greater oxygen
depletion in river or stream. It gives the measure of strength so far, as it indicates the oxygen consuming
property of the waste. So, it is observed; DO is being decreased to minimal amount even though the
initial concentration of both BOD and DO seems equivalent to each other.

The first graph indicates the stream or river is much cleaner than that of the second. The amount of DO
is much higher in comparison to that of BOD. This results in less consumption of oxygen by waste
materials present if any.

The graph second, considers the oxygen amount in the effluent is negligible. Thus BOD at a point on the
river implies that the entire river downstream from that point becomes worse as far as oxygen content is
concerned.

BOD and DO are not only the parameters that indicate whether the river or stream is pollution free or
not. Some other parameters like flow variation, temperature variation, heat discharge are also the major
ones. If the parameters discussed above are taken into account than we may apply this model to actual
river system in Nepal. Moreover, the results like;” BOD at a point on the river implies that the entire river
downstream from that point becomes worse as far as oxygen content is concerned if oxygen amount in
effluent is considered negligible,” are not acceptable in real river system.

If flow variations are undertaken we could observe oxygen concentration is an increasing function of
flow rate and roughly speaking higher the values of flow rate better would be the global condition of the
river.

Similarly, if temperature variation were considered re-aeration would drastically improve by increasing
temperature and would be plus point for the design of waste water treatment plant if necessary.

It helps in the determination of significant oxygen content in the bottom of deep lakes. It helps in
artificial aeration process. It helps to determine the oxygen concentration in the river basins. It
determines the deficit in the water volume. It determines the temperature correction.

Appendix: Source code

1. T= 25;
2. N=60;
3. BODin =7.33;
4. DOin =8.5;
5. x=lsode(@SP,*BODin;DOin+,(linspace(0,T,N)'));
6. plot (t,x);
7. legend ('BOD','DO');
8. xlabel ('time'); ylabel ('concentration');
9. grid;
10. print -dpng bod.png
11. function xdot=SP(x,t)
12. kd =0.3;
13. ka =0.4;
14. DOsat=11;
15. fBOD=1;
16. k3=kd*(1+0.5*sin(t*(pi+pi)));
17. xdot(1)=fBOD-k3*x(1);
18. xdot(2)=ka*(DOsat-x(2))-k3*x(1);

Fugacity-based Multimedia Modeling


Introduction

The fugacity based modeling approach pioneered by Mackay (1991) and Mackay and Paterson (1981) is
adapted to develop a model of the ecosphere. A basic configuration of the unit world proposed by
Mackay consists of the water, soil, air, and sediment compartments.

Fugacity, f, is a measure of a chemical’s “escaping tendency” from a phase and is related to its
concentration, C, in the phase by the equation f = C/Z, where Z is the fugacity capacity of the phase.
When phases are at equilibrium, their fugacities are equal. For example, in an air-water binary system at
equilibrium, fw = fa, and hence, Ca/Cw = Za/Zw = Ka–w, the partition coefficient. The Z values for air (1),
water (2), soil (3), and sediment (4) compartments can be calculated from the physical-chemical
properties of the chemical as follows
1 1
𝑍1 = ; 𝑍2 = ; 𝑍3 = 𝐾𝑠−𝑤 𝑍2 = (0.41𝑌𝑠𝑜𝑖𝑙 𝐾𝑜−𝑤 𝜌𝑠𝑜𝑖𝑙 )
𝑅𝑇 𝐻
And

𝑍4 = 𝐾𝑠−𝑤 𝑍2 = (0.41𝑌𝑠𝑒𝑑 𝐾𝑜−𝑤 𝜌𝑠𝑒𝑑 )


where R is the Ideal Gas constant, T is the absolute temperature, H is the chemical’s Henry’s Constant, Y
is the organic content of soil or sediments, Ko–w is the chemical’s octanol-water partition coefficient, and,
is the density of soil or sediment. The fugacity of the system, f, at equilibrium is calculated from the
following:
𝐼 𝐸 + ∑( 𝐺𝑖 𝐶𝐵,𝑖 )
𝑓= =
∑(𝑉𝑖 𝐾𝑖 𝑍𝑖 + 𝐺𝑖 𝑍𝑖 ) ∑(𝑉𝑖 𝐾𝑖 𝑍𝑖 + 𝐺𝑖 𝑍𝑖 )
where 𝑉𝑖 is the volume of compartment i, 𝐺𝑖 is the advective flow through compartment i, 𝐶𝐵,𝑖 ,i is the
inflow concentration, 𝐾𝑖 is the first-order reaction rate constant in compartment i, and E is the total
emission into the system. The above equations enable concentrations in the four compartments, , to be
calculated based on the chemical’s physical-chemical properties, H, Ko–w, 𝐾𝑖 ; the compartmental
characteristics, 𝑉𝑖 ,Y, , 𝐺𝑖 , and 𝐶𝐵,𝑖 ; and the system temperature, T.

Model Description

Model Application

Main applications of this model are

 It can be used for prediction of chemical distribution at a dasin scale and result can be useful in
understanding the fate and transport of chemical in a multimedia environment.
 It can also be used to assess the environmental fate of different group of chemical which are
present in the environment.
 Model can help in identification of the relative importance of chemical specific partitioning and
transformation.
 It can also help in determination of bioaccumulation in organisms and food weds and also help
in checking the consistency of monitoring data.
 It can acts as a decision supporting tool documenting the sources and nature of contamination
and feasible remedial strategies.

Simulation Results

Fig. Chemical mass Distribution of Fig. Concentration Plot of air, water, Fig. Loss rate from Advection and
Air, Water, Soil and Sediment soil and sediment Reaction Pathways
There are four levels of Multimedia Fugacity Models applied for prediction of fate and transport of
organic chemicals in the multi compartmental environment. Depending on the number of phases and
complexity of processes different level models are applied. Many of the models apply to steady-state
conditions and can be reformulated to describe time-varying conditions by using differential equations.
The concept has been used to assess the relative propensity for chemicals to transform from temperate
zones and “condense out” at the polar regions. The multi compartmental approach has been applied to
the “quantitative water air sediment interaction" or "QWASI" model designed to assist in understanding
chemical fate in lakes.

The rate of diffusion of chemicals is much higher in concentration in sediment in comparison to soil,
water and air. The minimum concentration of chemicals in found on air. This may be due to more likely
of a chemical to bind to the solid phase of soil or sediment than to the liquid phase or in air. The Henry’s
law constant also indicates the potential of a chemical to volatilize from water into atmosphere.

Similarly, loss rate of diffusion of chemicals is much higher in air. This is due to the advection factor. In
the case of water rate is lost by few numbers in water but by high number due to reactions of chemicals
with the molecules of water and other compounds present in water. The maximum loss rate is due to
reaction in the context of soil. This also may be due to the reaction with many compounds present in the
soil.
Air is in abundant in quantity in comparison to water, soil and sediment. Thus much more chemicals are
present in air. So the mass distribution of chemicals is much found in air. Since sediment does not have
many chemicals, it has least mass distribution
Appendix: Source code

#!/usr/bin/python

# Multimedia level II fugacity model

import numpy as N

import pylab as P

1. R=8.314 #ideal gas constant


2. T=300. #K
3. H=10. #Pa-m3/mol
4. Kow=1.0E4 #mol/hr
5. E=100. #mol/hr
6. Ysoil = 0.02
7. Ysediment = 0.04
8. Rho_soil =1500. #kg/m3
9. Rho_sediment =1500. #kg/m3
10. V=N.zeros(4,N.float)
11. C=N.zeros(4,N.float)
12. Cb=N.zeros(4,N.float)
13. G=N.zeros(4,N.float)
14. Z=N.zeros(4,N.float)
15. k=N.zeros(4,N.float)
16. # 0 index: air
17. # 1 index: water
18. # 2 index: soil
19. # 3 index: sediment
20. V*0+=6.0E9 #m3
21. V*1+=7.0E6 #m3
22. V*2+=4.5E4 #m3
23. V*3+=2.1E3 #m3
24. V*0+=6.0E9 #m3
25. V*0+=6.0E9 #m3
26. G*0+=1.0E7 #m3/hr
27. G*1+=1.0E3 #m3/hr
28. G*2+=0.0E0 #m3/hr
29. G*3+=0.0E0 #m3/hr
30. Cb*0+=1.0E-6 #mol/m3
31. Cb*1+=1.0E-2 #mol/m3
32. Cb*2+=0.0E0 #mol/m3
33. Cb*3+=0.0E0 #mol/m3
34. E_GC =E+(G*Cb).sum()
35. Z*0+=1./(R*T)
36. Z*1+=1./H
37. Z*2+=Z*1+*0.41*Ysoil*Kow*Rho_soil/1000.
38. Z*3+=Z*1+*0.41*Ysediment*Kow*Rho_sediment/1000.
39. VZ=V*Z
40. k*0+=0.0
41. k*1+=0.001
42. k*2+=0.01
43. k*3+=0.0001
44. VZk=VZ*k
45. GZ=G*Z
46. VZk_GZ=(VZk +GZ).sum()
47. f=E_GC/VZk_GZ
48. C=Z*f
49. CV=C*V
50. CVp =CV/CV.sum()*100.

51. #Graphics
52. width =0.5
53. labels =*"Air","Water","Soil","Sediment"+
54. P.figure(figsize=(8,8))
55. ax=P.axes(*0.1, 0.1, 0.8, 0.8+)
56. P.pie(CVp, labels=labels,autopct='%1.1f%%')
57. P.title('Chemical mass distribution')
58. P.show()

59. xlocations =N.array(range(len(C)))+0.5


60. P.xticks(xlocations+width/2,labels)
61. P.xlim(0,xlocations*-1++width*2)
62. P.ylabel('Concentration (mol/m$63$)')
63. P.bar(xlocations,C+1.E-99,width,log=True)
64. P.title('Concentration Plot')
65. P.show()

66. xlocations=N.array(range(len(VZk*f)))+0.5
67. P.xticks(xlocations+ width/2, labels)
68. P.xlim(0, xlocations*-1++width*2)
69. p1=P.bar(xlocations,GZ*f, width,color='y')
70. p2=P.bar(xlocations,VZk*f,width,color='r',bottom=GZ*f)
71. P.ylabel('Loss rate (mol/hr)')
72. P.legend((p1*0+,p2*0+),('Advection','Reaction'))
73. P.title('Loss rate from Advection and Reaction Pathways')
74. P.show()

Michaelis-Menten Kinetics Model

Introduction

Michaelis–Menten kinetics is one of the simplest and best-known models of enzyme kinetics. The model
takes the form of an equation describing the rate of enzymatic reactions, by relating reaction
rate to , the concentration of a substrate. Its formula is given by

Here, represents the maximum rate achieved by the system, at maximum (saturating) substrate
concentrations. The Michaelis constant is the substrate concentration at which the reaction rate is
half of . Biochemical reactions involving a single substrate are often assumed to follow Michaelis–
Menten kinetics, without regard to the model's underlying assumptions.
Under certain assumptions- such as the enzyme concentration being much less than the substrate
concentration – the rate of product formation is given by
The reaction rate increases with increasing substrate concentration , asymptotically approaching its
maximum rate , attained when all enzyme is bound to substrate. It also follows
that , where is the enzyme concentration. , the turnover number, is
maximum number of substrate molecules converted to product per enzyme molecule per second.

The Michaelis constant is the substrate concentration at which the reaction rate is at half-
maximum, and is an inverse measure of the substrate's affinity for the enzyme as a small indicates
high affinity, meaning that the rate will approach more quickly. The value of is dependent
on both the enzyme and the substrate, as well as conditions such as temperature and pH.
This model is developed to predict methane release from rice fields. Methane can be a serious
environmental issue because it is 20 times more absorptive than carbon dioxide and global methane is
increasing about 1% per year. While the production of methane and its transport to the atmosphere is a
complex process, simplifying assumptions can be made to include the most important mechanisms and
keep the model reasonably simple.

The following assumption can be made:

Methane is generated from two sources of carbon; carbon initially the soil and carbon provided by the
plants, with the same bio kinetic rate according to Monod’s Kinetic Model, methane transport follows
simple mass transfer theory.

Application

Main applications of the model are as follow

 It can be used for toxicological exposure evaluation with integrated fate and
transport of the toxicants.
 It can be useful in EIA, risk analysis, accidental release management and so on.
 It can be useful to decision maker to take a decisions.

Simulation and Result


Fig. Toxicity graph

Analysis and Conclusion

It is assumed that the toxological intake is through blood and some part is excreted through kidneys. The
amount is then transferred to liver where metabolic process undergoes and finally transfer to bones is
assimilated. All the process other than metabolism are modeled through first-order process. Transfer of
kinetics and their transformation is the major process occurred here. Here, integrating fate and transport
of toxicants with toxicity and exposure assessments are illustrated.

This type of model are mostly applicable in environmental impact assessment, risk analysis, accidental
release management etc.

Annexes: Source Code

1. T = 60; % maximum time *d+


2. N = 200; % number of time steps
3. Blood_in = 2; % initial concentration in blood
4. Liver_in = 4; % initial concentration in liver
5. Bone_in = 0; % initial concentration in bone
6. x = lsode("f", *Blood_in;Liver_in;Bone_in+,(t=linspace(1,T,N)’));
7. plot(t,x);
8. legend(’Blood’,’Liver’,’Bone’);
9. xlabel(’time’); ylabel(’concentration’);
10. grid;
11. print -dpng toxicity.png;

12. function xdot = f(x,t)


13. k01 = 0.4; k12 = 0.5; k13 = 0.8; k21 = 0.8; k31 = 0.1; km = 5.0;
14. R = 3.0; % constant intake rate *mg/d+
15. kr = 1.2;
16. xdot(1) = R-k31*x(1)-k21*x(1)-k01*x(1)+k12*x(2)+k13*x(3); % Blood
17. xdot(2) = k21*x(1)-k12*x(2)-kr*(x(2)/(km+x(2))); % Liver
18. xdot(3) = k31*x(1)-k13*x(3); % Bone
19. end function

Monod’s Kinetics Model


Introduction to the model:

The Monod equation is a mathematical model for the growth of microorganisms. It is named for Jacques
Monod who proposed using an equation of this form to relate microbial growth rates in an aqueous
environment to the concentration of a limiting nutrient. The Monod equation has the same form as
the Michaelis-Menten equation, but differs in that it is empirical while the latter is based on theoretical

considerations.

Where:

 μ is the specific growth rate of the microorganisms


 μmax is the maximum specific growth rate of the microorganisms
 S is the concentration of the limiting substrate for growth
 Ks is the "half-velocity constant"—the value of S when μ/μmax = 0.5

Model Application

It can used to know the rate of substrate utilization to the specific growth rate. It also can be applicable
to know the multiple nutrient factor that is limiting factor for heterogenic bacteria. This type of model is
mostly used as an activated sludge pretreatment system for treating their waste stream to meet the
sewer discharge permit. The pretreatment plant is expected to receive BOD and a non-biodegradable,
toxic chemical.
Simulation Results

Fig. Substrate utilization rate graph

There are two peaks observed at 30 and 50 minutes and after 60 minutes it decreases logarithmically
and tends to zero but doesn’t becomes zero. Other simulation were not observed as Programing
language encountered problem.

Appendix: Source code

1. T=100; N=800; Sin=60.0; Xin=0.2; Min=0.;


2. x=lsode('f',*Sin;Xin;Min+,(t=linspace(1,T,N)'));
3. plot(t,x(:,3));
4. legend('S','X','M');
5. grid;
6. function xdot=f(x,t)
7. V=0.01; k=4.0; Ks=9.5; Y=0.04; b=0.032; Kr=6.0;
8. Ar=0.01; Kp=1.0;
9. if t<22 ft=0.;
10. elseif t<45 ft=0.8;
11. elseif t<58 ft=1.0;
12. else ft=0.;
13. endif
14. xdot(1)=-(k*x(1)*x(2)/(Ks+x(1)))+Kr*Ar*ft/V;
15. xdot(2)=Y*(k*x(1)*x(2)/(Ks+x(1)))-b*x(2);
16. xdot(3)= (k*x(1)*x(2)/(Ks+x(1)))*(1.-… Y+(0.8*b*(Ks+x(1)))/(K*x(1)))*(16./59.)- (Kp*x(3)*Ar/V);
17. endfunction
Completely Mixed Flow Reactors Modeling
Introduction:

Completely mixed flow reactors (CMFRs) are completely mixed with continuous inflow and outflow.
CMFRs are, by far, the most common environmental reactors and are often operated under steady state
conditions, i.e., d( )/dt = 0. Under such conditions, the inflow should equal the outflow, while the active
reactor volume, V, remains constant. A key characteristic of CMFRs is that the effluent concentration is
the same as that inside the reactor. CMFRs can be characterized by their detention time, τ, or the
hydraulic residence time (HRT), which is given by τ = HRT = V/Q. The material balance equation is as
follows:
𝑑(𝑉𝐶)
𝑑𝑡
= 𝑟𝑉 + 𝑄𝐶𝑖𝑛 − 𝑄𝐶……. (1)

Which reduces to under steady state conditions,

0=-kCV + QCin –QC….. (2)

Whose solution is,


𝑄𝐶𝑖𝑛 𝐶𝑖𝑛 𝐶𝑖𝑛
𝐶= = 𝑘𝑉 = …. (3)
𝑄+𝑘𝑉 1+ 1+𝑘𝜏
𝑄

Model Application:

The most common application of this process is magnetic ion exchange resin to remove dissolved organic
carbon from raw drinking water. Other applications of this model is to validate the actual CMFR model.

Simulation Results

Fig. Pretreatment system-effluent profile


Fig. Pretreatment system-effluent profile of CMFR in series

Toxicant very high at beginning slowly decreases with ascending time and Nominal BOD allowed is not
maintained throughout where there is increase in BOD after 20 hours of operation.

This figure shows that Toxicant 1 and BOD1 are same as that of single CMFR. BOD2 is high than BOD1
but under the nominal BOD level. CMFR in series helps in maintaining the nominal BOD level than that of
single CMFR.

Appendix: Source code

1. T=24; N=24; Txin=0.; BODin=0.;


2. x=lsode(@fx,*Txin;BODin+,(t=linspace(0,T,N)'));
3. plot(t,x,'linewidth',2);
4. line(xlim,*20 20+, 'color',"y",'linestyle',':','displayname',Nominal BOD … allowed');
5. line(xlim,*30 30+, 'color',"r",'linestyle',':','displayname',Maximum BOD … allowed');
6. hold on;
7. title ('Pretreatment system-effluent profile');
8. legend('Toxicant','BOD','Nominal BOD allowed','Maximum BOD … allowed','location','west');
9. xlabel('Time(hr)');ylabel('Effluent concentration(mg/L)');
10. grid;

11. function xdot = fx(x,t)


12. if t<=9 && t>=0 xlin =0.; x2in =50.;
13. elseif t<=10 xlin =30.; x2in =60.;
14. elseif t<=11 xlin =45.;x2in=75.;
15. elseif t<=12 xlin =50.; x2in =100.;
16. elseif t<=13 xlin =50.; x2in =125.;
17. elseif t<=14 xlin =50.; x2in =142.;
18. elseif t<=15 xlin =40.; x2in =150.;
19. else xlin=0.; x2in=50.;
20. endif
21. if x(1)< 25. k=3./24.;
22. else k=0.0;
23. endif
24. tau=0.6*24.;
25. alpha=1./tau+k;
26. xdot(1)=(xlin-x(1))/tau;
27. xdot(2)=x2in/tau-alpha*x(2);

For CMFR in Series

1. T=24; N=24; Txin1=0.; BODin1=0.; Txin2=0.;


2. BODin2=0.;
3. x=lsode(@fx,*Txin1;BODin1;Txin2;BODin2+,(t=linspace(0,T,N)'));
4. plot(t,x,'linewidth',2);
5. line(xlim,*20 20+, 'color',"y",'linestyle',':','displayname',Nominal BOD … allowed');
6. line(xlim,*30 30+, 'color',"r",'linestyle',':','displayname',Maximum BOD … allowed');
7. hold on;
8. title ('Pretreatment system-effluent profile');
9. legend('Toxicant 1','BOD 1','Toxicant2','BOD2','Nominal BOD allowed',… 'Maximum BOD
allowed','location','west');
10. xlabel('Time(hr)');ylabel('Effluent concentration(mg/L)');
11. grid;

12. function xdot = fx(x,t)


13. if t<=9 && t>=0 xlin =0.; x2in =50.;
14. elseif t<=10 xlin =30.; x2in =60.;
15. elseif t<=11 xlin =45.;x2in=75.;
16. elseif t<=12 xlin =50.; x2in =100.;
17. elseif t<=13 xlin =50.; x2in =125.;
18. elseif t<=14 xlin =50.; x2in =142.;
19. elseif t<=15 xlin =40.; x2in =150.;
20. else xlin=0.; x2in=50.;
21. endif
22. if x(1)< 25. k=3./24.;
23. else k=0.0;
24. endif
25. tau=0.6*24.;
26. tau1=0.55*tau;
27. tau2=0.45*tau;
28. alpha=1./tau+k;
29. alpha1=1./tau1+k;
30. alpha2=1./tau2 +k;
31. xdot(1)= (xlin-x(1))/tau1;
32. xdot(2)=x2in/tau1-alpha1*x(2);
33. xdot(3)=(x(1)-x(3))/tau2;
34. xdot(4)=x(2)/tau2-alpha2*x(4);

0D Box Model for Air Pollution

Introduction to the model:

Box model (0D) is the simplest model that assumes the air shed (i.e., a given volume of atmospheric air
in a geographical region) is in the shape of a box. It also assumes that the air pollutants inside the box
are homogeneously distributed and uses that assumption to estimate the average pollutant
concentrations anywhere within the air shed. Although useful, this model is very limited in its ability to
accurately predict dispersion of air pollutants over an air shed because the assumption of homogeneous
pollutant distribution is much too simple.

Model Application

This model helps in determining air pollution of a specific geographic region. It also helps to determine
the average concentration of various air pollutants within the region represented by the box.

Simulation Results

Fig.One Box Model Output


Analysis and Conclusion
0D box model produces NO, NO2, O3 concentration, oxidant time series, the latest hourly NO, NO3, O3
concentration. In the box model (0D), the atmospheric domain is represented by only one box. In a box
model concentrations are the same everywhere and therefore are functions of time only: Ci(t). It is zero
dimensional model in which chemical or physical transformation occur. It is a set of adjacent models,
stacked vertically or horizontally.

A one-box model for an atmospheric species X It describes the abundance of X inside a box representing
a selected atmospheric domain (which could be for example an urban area, the United States, or the
global atmosphere). Transport is treated as a flow of X into the box (Fin) and out of the box (Fout).

If the box is the global atmosphere then Fin = Fout = 0. The production and loss rates of X inside the box
may include contributions from emissions (E), chemical production (P), chemical loss (L), and deposition
(D). The terms Fin, E, and P are sources of X in the box; the terms Fout, L, and D are sinks of X in the box.
The mass of X in the box is often called an inventory and the box itself is often called a reservoir. The
one-box model does not resolve the spatial distribution of the concentration of X inside the box. It is
frequently assumed that the box is well-mixed in order to facilitate computation of sources and sinks.

Greenhouse Gas Emissions Model (GEM)

Introduction

The Greenhouse gas Emissions Model was created by EPA as a means for determining compliance with
EPA’s GHG emissions and NHTSA’s fuel consumption vehicle standards. It is a free desktop computer
application. Estimates the GHG emissions and fuel efficiency performance of heavy-duty vehicles i.e to
evaluate both fuel consumption and CO2 emissions from heavy-duty highway vehicles through a whole-
vehicles.

Features of GEM

 The system required to run GEM needs a minimum RAM of 1 GB (4 GB is highly recommended),
and approximately 900 MB of disk storage.

 Window XP or Window 7 operating system is required.

 The validation has not been tested in other computer operating systems.

 The 2007 Microsoft Excel or later version is required.

 Microsoft Visual C++ Redistributable and MATLAB® Runtime 7.15

Input Variables

 There require two set of input variables, first one includes Manufacturer Name, Date Vehicle,
Family Vehicle, and Configuration.
 The input values needed for the simulation model (e.g., drag coefficient, tire rolling resistance
coefficients, tire/wheel weight reduction, vehicle speed limiter and extended idle reduction
technologies) are obtained as manufacturer testing or model default values.

Output

 The outputs produced by the GEM include post processes to calculate the final weighted results.

 The GEM produces a cycle-weighted grams CO2 /ton-mile and gallons/1,000 ton-mile result
which incorporates the drive cycle weightings of the ARB transient cycle, 55 mph steady state
cruise, and 65 mph steady state cruise cycle.

 The GEM converts the mile per gallon result into ton-mile space by using the payload.

 GEM calculates the gallons/1,000 ton-mile weighted result by converting the weighted grams
CO2/ton-mile result. The gram CO2/ton-mile result is multiplied by 1,000 and divided by 10,180
grams CO2 per gallon of diesel fuel.

GEM Running Instructions

 Enter the required parameters into the model, like Manufacturer Name, Date Vehicle, Family
Vehicle, and Configuration.

 The second set of parameters are predefined and affect how GEM calculate the final results.

 A check button for “Plot Output” can be selected if we chooses to output all three cycle plots for
vehicle speed traces as a function of time.

 By clicking Run, GEM will give us required output.

 After the simulation is completed, a window will open, prompting the user where the file is to be
saved.

 The output file will open once clicking OK to save the file.

Evaluation Techniques to validate GEM

Compare model predictions to independent measurements.

 Recognizing limitations and uncertainties in the independent measurements.

Evaluate predictions of relative trends as well as absolute emissions

 EPA regulatory analyses focus on prediction of emission changes due to time, activity, etc.

Evaluation of relative trends

 Moves Sensitivity to operation vs independent data.

Conclusion
The mode is indeed very complete and covers all components that affect overall vehicle performance
and fuel economy and well organize. Assumptions used in model are reasonable and the model itself is
free of major errors of implementation however it have some complexities. Model software is free and is
very useful and helpful for country like Nepal.

A. Modeling Tools
Environment: Linux, Windows
Software: MATLAB, Octave, Python, GRASS GIS
B. References
1. Nirmalakhandan, N. (2002). Modeling Tools for Environmental Engineers and Scientists. CRC
Press.
2. Ramaswami, A. et al. (2005). Integrated Environmental Modeling: Pollutant Transport, Fate,
and Risk in the Environment. John Wiley & Sons, Inc.

You might also like