GEOG 410 Modeling of Environmental Systems
Lab 10 Modeling Surface Water Contamination
Due Time: Dec, 7th, 2007
Objectives: Familiarize yourself with the dynamics of the dissolved oxygen model described in Chapter 5 of the course text, construct a model that makes use of the mathematical relationships and system structure as they have been described, and model surface water contamination in the system, such that you can examine the impact of adding a wastewater treatment facility to the system.
Background: Managing surface water contamination is an activity that is critical to human life in the modern age. As we live in greater and greater concentrations in urban environments, we are faced with the dual problems of maintaining a safe drinking water supply upstream of the population, while still managing and disposing of wastewater downstream in a fashion that both does not adversely affect water quality and unreasonably increase the risk of contamination for those that live further down the river. As you might guess, addressing such a problem can be accomplished through a simulation approach, as contamination in a surface water system can exhibit complex behavior. We need some means of assessing the likely impact of management decisions before we decide where to build a wastewater treatment plant, and modeling can provide that means.
Resources: This lab exercise does not include the background and theory required for you to understand contamination in a surface water system. For that information, you should look to material from the lectures and the entirety of Chapter 5 (pp. 113-126) of the course text, paying special attention to Sections 5.2.2 through 5.3 where the system structure and mathematical relationships are described. At this point, you should have already become quite comfortable working with MATLAB, and building models in MATLAB to represent systems based solely on a description of that system. You can refer back to the course text’s background material on perturbation experiments and sensitivity analysis (Section 3.5, pp. 77-87), if you should choose to use these approaches to examining the behavior of the model you create.
Procedure: Be sure to read Chapter 5 before attempting this lab, in order to familiarize yourself with this model’s components and how they function.
1. Start the MATLAB software, and set current directory.
2. For this lab, we are going to use a model that is depicted in Figure 5.5 on page 122 of the text.
3. The basic difference equations can be written as and the time for simulation is 25 days:
DOsat is the saturation level of DO; is the deoxygenation coefficient; is the reoxygenation coefficient; A is the natural BOD inflow; we also need the initial value for BOD and DO.
The model can be implemented in Matlab as in the following:
% Define the parameters in the model
>>BOD_initial=3.33; % Initial BOD, mg/L
>>DO_initial=8.5; % Initial DO, mg/L
>>DO_sat=11; % Saturated DO, mg/L
>>k1=0.3; %deoxygenation coefficient
>>k2=0.4;%reoxygenation coefficient
>>A=1.0; %natural BOD inflow, mg/L
%Construct the difference equation
>>dt=0.25; %dt is 0.25 day
>>total_time=25; % simulation time is 25 days;
>>time_step=total_time/dt; %the total time step which needs simulation
%Difference equation
>>BOD(1)=BOD_initial; % Provide the initial values for BOD and DO
>>DO(1)=DO_initial;
>>for i=2:time_step
BOD(i)=BOD(i-1)+(A-k1*BOD(i-1))*dt;
DO(i)=DO(i-1)+(k2*(DO_sat-DO(i-1))-k1*BOD(i-1))*dt;
>>end
%Plot the figure
>>Days=(0:time_step-1)*dt;
>>plot(Days,BOD,'-');
>>hold on
>>plot(Days, DO,':');
>>hold off
>>xlabel('Days');
>>ylabel('DO and BOD(mg/L');
>>legend('BOD','DO','Location', 'Best');
Similar to previous labs, we can put the above commands in a single m-file. We created one for you in the data/ directory named lab10_water.m.
4. Let us begin by examining the model in its basic form, initially using the parameters provided on page 124 of the text, and then perform a sensitivity analysis (3 runs, varying the initial value by 50%) on each of the 4 model parameters (k1, k2, DO_sat and A) to get a sense of how the system behaves when those parameters are changed. Each time that you manually change the value of one parameter and re-run the model. You always set the other parameters to its default values as you are move to another parameter. Answer the following questions:
(1) If you change a parameter and then let the model continue to run, does the DO value move towards equilibrium point? Is it a “stable” model? Be sure to answer this question for every parameter you examine, and be sure to examine any and all parameters that might have an impact on the stability of the model.
(2) For each simulation (or group of simulations if you use sensitivity analysis) that you ran, explain what you did and what your results were. Is there any variable that seems to “drive” this system?
5. Now we are ready to examine the impact of adding a wastewater treatment plant to the system. The facility will discharge treated wastewater directly into the river. Though the treatment will substantially reduce the organic concentration of the wastewater arriving the facility, but treated wastewater discharged still have a much higher organic matter concentration than the natural water. Thus the treated wastewater will have high BOD and low DO values, which will initially increase the BOD and lower the DO of the river water. The most straightforward way to model the impact of the addition of the facility without modifying the model structure would be to assume that the treatment plant effluent will mix well with river water, and reach new initial values of DO and BOD for our model. Here are the flow rates of river and the wastewater:
Qs (river flow before mixing)=300000 L/min;
BODs(river BOS before mixing)=3.33 mg/L;
DOs(river DO before mixing) 8.5 mg/L;
Qp(wastewater flow before mixing)=100000L/min;
DOp(wastewater DO before mixing)=2mg/L;
BODp(wastewater BOD before mixing)=40mg/L;
V(velocity of the river after mixing)=20m/min;
D(distance from discharge to fishing site)=40km;
Use the following mass balance equations to get the new initial BOD and DO values for the model which is equivalent to adding a wastewater treatment plant.
Note: Based on the distance and velocity and you can determine the simulation time steps.
6. Now, run the simulation again, keeping all the other values as they were set previously, and change the DO and BOD initial values to those from your calculations in order to incorporate the presence of the wastewater treatment plant into the system. What are the DO and BOD concentration when the water reach the fishing site? Do you think the problem will be worse in summer or winter?
4