Environmental Protection Technology Series
                  CONTROL  SCHEMES
                                    FOR
THE  ACTIVATED-SLUDGE  PROCESS
                  National Environmental Research Center
                    Ofiice of Research and Development
                   U.S. Environmental Protection Agency
                            Cincinnati, Ohio 45268

-------
                                       EPA-670/2-74-069
                                       August 1974
CONTROL SCHEMES FOR THE ACTIVATED-SLUDGE PROCESS
                       By

                  Robert Smith
                Richard G. Eilers
  Advanced Waste Treatment Research Laboratory
           Program Element No. 1BB043
     NATIONAL ENVIRONMENTAL RESEARCH CENTER
       OFFICE OF RESEARCH AND DEVELOPMENT
      U.S.  ENVIRONMENTAL PROTECTION AGENCY
             CINCINNATI, OHIO  45268

-------
                   REVIEW NOTICE






          This report has been reviewed by the




National Environmental Research Center - Cincinnati




and approved for publication.  Mention of trade names




or commercial products does not constitute endorsement




or recommendation for use.
                         11

-------
                            FOREWORD
     Man and his environment must be protected from the
adverse effects of pesticides, radiation, noise and other
forms of pollution, and the unwise management of solid
waste.  Efforts to protect the environment require a
focus that recognizes the interplay between the components
of our physical environment—air, water, and land.  The
National Environmental Research Centers provide this
multidisciplinary focus through programs engaged in

     •  studies on the effects of environmental
        contaminants on man and the biosphere, and

     •  a search for ways to prevent contamination
        and to recycle valuable resources.

     This report examines the feasibility of various control
schemes which have been proposed for the activated sludge
process.  The time dependent performance of the process is
simulated by means of a digital computer program.  The
study shows that a significant saving in electrical power
is possible when the process is designed for dissolved
oxygen control.
                                A. W. Breidenbach, Ph.D.
                                Director
                                National Environmental
                                Research Center, Cincinnati
                              111

-------
                           ABSTRACT
A new time-dependent model for the activated-sludge process is
described, and the model is used to investigate the potential
advantages associated with a number of control schemes.  The
control schemes investigated by time-dependent computation
include dissolved oxygen control,  sludge wasting control, and
sludge inventory control.  Quantitative benefits are shown for
some control schemes.  For others, the potential advantages
appear to be minimal.
                              IV

-------
                         TABLE OF CONTENTS










                                                             Page




ABSTRACT                                                      iv




LIST OF FIGURES                                               vi




CONCLUSIONS                                                    1





INTRODUCTION                                                   2




DESCRIPTION OF THE TIME-DEPENDENT MDDEL                       2




TIME-DEPENDENT PRIMARY EFFLUENT CHARACTERISTICS               9




DISSOLVED OXYGEN CONTROL SCHEME                              10




SLUDGE WASTING CONTROL                                       23




SLUDGE INVENTORY CONTROL                                     23




REFERENCES                                                    34




APPENDICES                                                    35
                                v

-------
                             FIGURES
No.

 1   Flow Diagram for Time-Dependent, Activated-                3
     Sludge Process Simulation

 2   Suspended Solids in Raw Sewage and Primary Effluent,       5
     Palo Alto, Calif., August 5-7, 1973

 3   Suspended Solids in Raw Sewage and Primary Effluent,       6
     Palo Alto, Calif., September 9-11, 1973

 4   Sludge Compaction Characteristics of Final Clarifier       8

 5   Primary Effluent Data Drived from Palo Alto Plant         11
     Measurements and Used as Input for the Time-Dependent
     Program:  Volume Flow

 6   Primary Effluent Data Derived from Palo Alto Plant        12
     Measurements and Used as Input for the Time-Dependent
     Program:  BOD

 7   Primary Effluent Data Derived from Palo Alto Plant        13
     Maasurements and Used as Input for the Time-Dependent
     Program:  Ammonia Nitrogen and Inert Suspended Solids

 8   Flow Arrangement for the Activated-Sludge Process at      14
     Palo Alto, Calif., before November 5, 1973

 9   Flow Arrangement for the Activated-Sludge Process         15
     at Palo Alto, Calif., after November 5, 1973

10   Estimated Performance Curve for Roots Single-stage        16
     Centrifugal Compressor with Backward Leaning Blade
     Impeller Adjustable Inlet Guide Vanes

11   Brake Horsepower Demand for the Flexofuser with no        19
     Orifice, 13/32 in. Diameter Orifice, and 11/32-in.
     Diameter Orifice

12   Inlet Guide Vane Position versus Compressor               20
     Operating Point

13   AC Motor Losses versus Output                             21

-------
                         FIGURES  (Cont'd)
No.                                                        Page

14   Palo Alto, Calif., Baseline Measurements of            22
     Dissolved Oxygen in one of three Aerators,
     September 9-11, 1973

15   MLVSS Required to Make F/M Equal to 0.35 and MLVSS     26
     Resulting from Controlled Return Rate (Palo Alto
     Data, August 5-7, 1973)

16   Total Aerator BOD versus Time                          27
     (Palo Alto Data, August 5-7, 1973)

17   Relationship Between Aerator Suspended Solids and      29
     Sludge Retention Time

18   Aerator MLVSS versus Time MLVSS with F/M Control       31
     (Palo Alto Data, August 5-7, 1973)

19   Relationship Between Return Rate and Air Demand to     32
     Make Mass of Sludge Returned Directly Proportional
     to Incoming Load
                            VII

-------
                           CONCLUSIONS
Computations made with a time-dependent digital computer model
for the activated-sludge process show that dissolved oxygen
control installed in a typical 25-mgd (1.1 rn^/sec) municipal
treatment plant will reduce electrical power consumption for air
supply by about 17 percent.  By scheduling the blower in a step
pattern, about 11.5 percent of the electrical power can be
conserved.  The potential for reducing the average dissolved
BOD concentration in the effluent stream by means of food/
microorganism control, using the final settler for sludge storage,
appears to be minimal.  The effectiveness of the final settler for
separating dissolved and suspended fractions of BOD is an important
aspect of the simulation for which adequate relationships are
lacking.

-------
                          INTRODUCTION
     Control of the activated-sludge process to improve effluent
quality and/or reduce the cost of treatment is receiving increased
attention currently because of the national program to enhance and
protect the environment.  The purpose of this report is to describe
most of the control schemes that have been proposed, to consider
the feasibility of each scheme, and to present the results of ex-
ploratory computations made with a digital computer program that
simulates the time-dependent performance of the system shown in
Figure 1.  The digital computer program, as it now stands, does
not represent a fully adequate model for the system shown in
Figure 1.  The program is capable, however, of reliably computing
various important aspects of the activated-sludge process and is
best considered as a tool to be used in support of experimental
programs or demonstration projects.

     Measurements of process variables have been made at the Palo
Alto, Calif. Wastewater Treatment Plant, and these measurements
have been used to supply the digital computer program with a
realistically varying influent stream vector and to check the
computed performance in a cursory way.  The purpose of the EPA
sponsored study at Palo Alto has been to test the effectiveness
of various control schemes for the activated-sludge process.  The
study is not complete at this time, and the measurements shown in
this report are preliminary.  The digital computer model has been
of great value in interpreting the measurements and predicting
certain aspects of the process performance before the test was
initiated.
             DESCRIPTION OF THE TI^E-DEPENDENT MODEL
     The time -dependent model for the equali2ation basin has been
described in an earlier report1 and will not be dealt with here.
The model for the primary settler is based on the following re-
lationship derived from the 24-hr composite removals of suspended
solids from a large number of plants :

            Fraction of SS removed = 0.82 e-GPS/2780

                 GPS = overflow rate, gpd/sq ft

                 (gpd/sq ft) x .04074 = m/day

-------
2

Primary
Settler
\
3 4
• ^

(
i

m
»
5
•_

CO
>.
6 n + 3
^
+
if
n+4 / _.
/ Fin
""•""i Clar
(18



Sludge Storage
or
Stabilization Basin
V(18)
17
• „

7\ i5
ifier /



1C
Figure 1.  Flow diagram for time-dependent, activated-sludge process simulation.

-------
A plot of suspended solids in the raw and primary effluent
streams at Palo Alto is shown in Figures 2 and 3.  There is
some suggestion here that a delay across the primary settler
of about 4 hr. is involved.  The average detention time in the
primary settlers at Palo Alto is 2.7 hr.  A model for the primary
settler developed by Bryant2 visualizes the settler as effect-
ing an instantaneous removal of suspended solids, followed by
four idealized volumes in series.  Perhaps the Bryant model
could be adapted to represent the data shown in Figures 2 and
3, but this has not been attempted.

     The model for the activated-sludge process is similar to
the EPA model3 developed in 1970.  Some significant changes,
however, have been made.  For example, classes of suspended
solids and substrates expressed as mg/1 considered are as follows:

   X(1,I) = heterotrophs             S(1,I) = dissolved BOD
   X(2,I) = Nitrosomonas             S(2,I) = particulate BOD
   X(3,l) = Nitrobacter              S(3,l) = ammonia nitrogen
   X(4,l) = inert solids             S(4,I) = nitrite nitrogen
   X(5,i) = total suspended solids

An important change was the consideration of inert solids repre-
sented by X(4,l).  Here, the integer (I) represents the station
number as shown in Figure 1.  The inert solids are partially
volatile and partially nonvolatile.  The nonvolatile fraction
of the inert solids in the program is represented by the symbol
FNVOL.  The total concentration of suspended solids is then
computed as follows:

    X(5,-I) = X(1,I) + X(2,I) + X(3,I) + X(4,I) + S(2,I)/0.8      (2)

     The biological kinetic equations used are the same as those
described in the 1970 report3.  The same rate equation was used
for both dissolved and particulate BOD.  Predicting the con-
centration of suspended solids that escape over the final settler
weirs is still a major weakness of the program.  This concentration
can be taken as a small fraction of the mixed liquor suspended
solids, or a functional relationship representing measured values
can be used.

     Since the use of the final settler as a storage facility was
one of the important control ideas to be investigated, it was
necessary to predict the concentration of suspended solids in the
underflow stream as a function of time.  For this purpose, some
early measurements made by Zack^ were used.  These measurements
appear to show that the concentration of suspended solids in the
underflow stream is a linear function of the sludge inventory
stored in the final settler.  The sludge inventory in the final
settler  (SMJA) was expressed as pounds of sludge stored per
square foot (kg/m2) of settler surface area.  The relationship

-------
                                                           £ Raw Sewage  (mean value = 201.69)
                                                   Jill';] Primary Effluent  (mean value = 69.21)
                                                                      ..
                                                              n midnight jj+ttrl-
                   Day  1
Day 2
Day 3
Figure 2.  Suspended solids  in raw sewage and primary effluent, Palo Alto,  Calif.,
            August 5-7, 1973.

-------
                                                   ! Raw Sewage (mean value
                  Day 1
Day 2
Day 3
Figure 3.  Suspended solids in raw sewage and primary effluent,  Palo Alto, Calif,
           September 9-11,  1973.

-------
derived from the measurements made by Zack is shown in Figure 4.
The sludge inventory in the final settler is found by con-
tinuously integrating all sludge streams in and out of the final
settler.

     It was further assumed that some functional relationship
exists between SMUA and the height of the sludge blanket in the
final settler, as measured visually or by means of an on-line
sludge blanket detector.  The program is arranged so that the
equalization basin, the primary settler, and the sludge storage
tank can each be included or excluded from the calculation scheme.
All of the exploratory calculations reported here were made with
equalization basin and the primary settler excluded.

     The program listing and the definitions for input and output
variables are given in the Appendix.  Comment statements are
used in the program to explain the structure of the program.

     The principal difference between the new time-dependent
program described here and the old time-dependent program3 is
the inclusion of various kinds of control algorithms.  A list
of control schemes that can be simulated by the time-dependent
model for the activated-sludge process is outlined as follows:

     I.  DISSOLVED OXYGEN CONTROL

         A.  Two-position, manual control of air blowers
         B.  Diffused-air aeration (PI feedback)
         C.  Mechanical aeration (PI feedback)

    II.  SLUDGE WASTING CONTROL

         A.  Q(16) = constant
         B.  Q(16) = fraction of Q(3)
         C.  SRT   = constant
         D.  Q(16) = constant for specific time when sludge
                     blanket exceeds depth limit

   III.  SLUDGE INVENTORY CONTROL

         A.  Sludge storage provided by final settler  (no
             sludge storage tank)

             1.  Q(18) varied to fix mixed liquor suspended
                 solids concentration = constant
             2.  Q(18) varied to hold food/microorganism
                 ratio = constant
             3.  Mass rate of return = constant x incoming
                 BOD load
             4.  Mass rate of return = function of air demand
                 rate (DO = constant)
             5.  Step input for Q(18)

-------
03
                 Activated Sludge Stored in Final Settler,:Ib/sq ft of surface area  (Ib/ft  *
      Figure 4.  Sludge Compaction characteristics of final clarifier for activated sludge
                 process.  Source:  Zack, S.  I.,  Sewage Works Journal,. 7(3):  514, May 1935.

-------
  III.   SLUDGE INVENTORY CONTROL  (Cont'd)

         B.  Separate sludge storage tank provided  (no
             storage in final settler)

             1.  Q(18) varied to fix mixed liquor suspended
                 solids concentration = constant
             2.  Q(18) varied to hold food/microorganism
                 ratio = constant
             3.  Mass rate of return = constant x incoming
                 BOD load
             4.  Mass rate of return = function of  air demand
                 rate (DO = constant)
             5.  Step input for Q(18)

     Many of these control schemes are of the open  loop variety,
but some feedback controllers are  included.  All feedback control
schemes are based on the traditional proportional plus reset  (PI) or
integral control.  The object of feedback control is to make the
controlled variable equal the set point value.  For example, if
the MLSS of the aerator is to be held at 2,000 mg/1 by varying
the rate at which sludge is returned from the final settler, the
set point for MLSS would be 2,000 mg/1.  The error  in the con-
trolled variable is then defined as the difference between the
current value of the controlled variable (MLSS) and the set
point value.  In this case, the final control element is the
volume of the return stream from the final settler.  The first
incremental change in the return rate is then found by multiplying
the error by a constant sometimes called the proportional gain.
If the error is integrated continuously with respect to time, the
second incremental change in the return rate can be found by
multiplying the current value of this integral by a second constant,
usually taken as the proportional gain divided by the integral
time.  The total incremental change in return rate  is the sum of
these two increments.  Both the proportional gain and the integral
time must be found experimentally by operating the program with
different values for proportional gain and integral time until
the value of the controlled variable remains within an acceptable
range around the set point.  If the controlled variable changes
very quickly, this type of controller will tend to  lag, and a
third increment, based on the derivative of the controlled vari-
able with respect to time, may have to be included.  The program
does not, however, provide for derivative control.
         TIME-DEPENDENT PRIMARY EFFLUENT CHARACTERISTICS
     Measurements of significant process variables were made for
a number of days at the Palo Alto Treatment Plant, but the

-------
measurements for August 6, 1973, were selected as input for the
program.  The influent stream vector (primary effluent) derived
from the Palo Alto measurements and used as input for the time-
dependent program is shown in Figures 5, 6, and 7.

     The flow arrangement at the Palo Alto Plant on August 6,
1973, is shown in Figure 8.  After November 5, 1973, the plant
was arranged as shown in Figure 9.

     Since a necessary input to the program is the biologically
inert solids concentration entering the process, an analysis of
the primary settler performance was made to estimate the fraction
of the suspended solids entering the plant that is biologically
inert.  For example, the data showed that for the raw wastewater,
the average BOD for August 6, 1973, was 200 mg/1, and the average
suspended solids concentration was 202 mg/1.  For the same day,
the average BOD or primary effluent was 141.8 mg/1, and the
average concentration of suspended solids in primary effluent
was 66 mg/1.  Therefore, since we can assume that the primary
settler did not remove any dissolved BOD, it can be concluded
that the ratio of BOD/SS is 0.43.  The usually quoted value for
BOD/VSS for biodegradable solids is 0.8.  Therefore, it was
assumed that 50 percent of the suspended solids entering the acti-
vated-sludge process were biologically inert.  Thirty-three
percent of these inert solids were further assumed to be in-
organic .

     The total aerator tankage at Palo Alto is 7.48 mg (28,312 m3).
This tankage is arranged as four separate, completely mixed tanks.
Before November 5, 1973, three of these tanks [5.61 mg (21,234 m3)]
were in parallel, and the fourth [1,87 mg (7,078 m3)] was a
stabilization tank.  The detention time for the aerator was
therefore, 5.25 hr. at the average flow of 25.67 mgd (1,124 m3/sec)
on August 6, 1973.
                 DISSOLVED OXYGEN CONTROL SCHEME
     The program has been equipped with the logic to control
dissolved obygen (DO) by means of PI feedback control and to
compute the power consumption based on the operating characteristics
of the air blower, the diffusers, and the electrical induction
motor.

     A typical single stage compressor map, equipped with variable
inlet guide vanes, was supplied by Dresser Industries, Inc. of
Connersville, Indiana.  This map is shown in Figure 10.  The
diffuser characteristics used were taken from the Chicago Pump
                               10

-------
      35
      30
      25
H
H
      20
   0
   >
      15
      10
                                                   Time, days
         figure 5.   Primary effluent data derived from Palo Alto  Plant  measurements  and used as
                    input for the time-dependent program:  Volume flotv.

-------
250
                                                                      - Average Total BOD = 143.25
                                                                      : Average Particulate BOD =28.58  ~
                                                                       Average Dissolved BOD = 114.67   ^~
         Dissolved BOD ,.-;:
             I: r-j. •

         Particulate BOD ~l~"
                                               Time,  days
   Figure 6.   Primary effluent data  derived from Palo Alto  Plant measurements and  used as
               input for  the time-dependent program:  BOD.

-------
130
                                                             "i Average Ammonia Nitrogen = 28.95
                                                             •a Average Inert -Suspended Solids = 35.74
         Inert Solids
          Ammonia Nitrogen ;
                                              Time,  days
   Figure 7.   Primary effluent  data derived from Palo Alto Plant measurements and used  as
               input for the time-dependent program:   Ammonia nitrogen and inert suspended  solids.

-------
                    Aerator #1
                     1.87 Mgal

                    (7078 m3)
4 /
I\
"

Aerator #3
1.87 Mgal
(7078 m3)

Aerator #4
1.87 Mgal
(7078 m3)

Aerator #2
1.87 Mgal
(7078 m3)
I ,
5
• f
V
1
|
!
/
/
\
/
17
Ht>

Figure 8.  Flow arrangement for the activated sludge process at Palo Alto, Calif,
           before November 5,  1973

-------
         18
                        Aerator
                       1.87 Mgal
                       (7078 m3)
                        Aerator
                       1.87 Mgal
                       (7078 m3
                        Aerator
                       1.87 Mgal
                       (7078 m3)
                        Aerator
                       1.87 Mgal
                       (7078 m3)
                                                                               15
Figure 9.  Flow arrangement for the activated-sludge process  at  Palo  Alto,  Calif,  after

           November 5,  1973.

-------
    120
C   100
•H
o

o

„?    8O
s
W
O,
                                                                  80%
     60
     40
            Adiabatic efficiency =
                                                                   100% GV
                                                                      Open
                                                           70% GV Open

                                                   4O% GV Open
                                            20% GV Open
                                     10% GV Open
              20
                         40
60
80
100
120
                       Inlet Volume, % of Design

        Figure 10.  Estimated performance curve for Dresser Industries,
                    Inc. single-stage, centrifugal compressor with
                    backward leaning blade impeller and adjustable
                    inlet guide vanes (GV).
                                    16

-------
Sewage Equipment Data Book c-1900.  The fine bubble diffuser is
called the Flexofuser and the coarse bubble diffuser is called
the Discfuser.  The pressure drop characteristics of the B-4
Swingfuser aerator and the Flexofuser diffuser were taken from
data sheets appearing in Data Book c-1900.  The following re-
lationship between aeration efficiency and standard cubic feet
of air per diffuser was used in the simulation:

       Aeration Efficiency = 0.13 - 0.0013(scfm/diffuser)        (3)

     The Palo Alto Plant is equipped with turbine aerators in
all four aeration basins, with the air supply being introduced
under the turbines, which operate continuously-  The turbine
horsepower installed is 1,200 hp (0.895 MJ/sec), and the maximum
amount of air that can be supplied by the positive-displacement,
variable-speed air blowers is 8,000 standard cubic feet per
minute (226.6 mVmin).  The computer program is not, therefore,
equipped to simulate the aeration system at Palo Alto.

     Since the compressor map is nondimensional, the design
point scfm must be found and supplied to the program as input.
This is designated as DPCFM in the program.  The exit pressure
of the compressor is determined by the aeration system design.

     The design point for the Flexofuser diffusers was set at 12
scfm per diffuser.  The diffusers are equipped with orifices to
divide the air discharged equally between diffusers.  For this
exercise, a 13/32-in. diameter (10.3 mm) orifice was selected.
The depth of submergence for the diffusers was set at 13 ft.
(3.96 m).  It is recommended that the diffusers be cleaned when
fouling causes an additional drop across the diffuser of 2-3 in.
(50-75 mm) of water.  An average operating drop because of
fouling was therefore assumed to be 1.5 in. (38 mm) of water.
The pressure drop in the piping between the blower and the swing-
arm aerators is negligible, but there is a very small pressure
drop through the swing-arm aerator.  The B-4 Swingfuser Aerator,
manufactured by Chicago Pump, was used for the simulation.  Since
this is a small pressure drop compared to the 5.63 psi (0.3958 kg/
m2) caused by the 13 ft. (3.96 m) submergence, it is sufficient
to estimate the air flow at 10 scfm per foot (0.929 n^/min/m) of
tank length.  Therefore, since the header length of the aerator
is 18 ft. (5.49 m), the flow through the aerator at the design
point will be 180 scfm (5.1 m-Vmin).  The pressure drop across
the Swingfuser aerator is only about 1 in. (25.4 mm) of water.

     Based on the pressure-drop characteristics of the Flexofuser
and Type B-4 Swingfuser, the pressure drop seen by the blower was
computed versus air flow as a fraction of the design point [6.32
psi (0.4444 kg/m2)] corresponding to 12 scfm per diffuser.  The
operating lines shown in Figure 1O were found for no orifice,
                               17

-------
13/32-in. diameter (10.3 mm) orifice, and 11/32-in. diameter
(8.73 mm) orifice.  These three lines represent the limits of
available equipment.   The air blower cannot be operated with
the inlet guide vanes less than 10 percent open or more than
100 percent open.

     From the operating lines shown in Figure 10, the adiabatic
efficiency of the blower and the power demand for compressing
the air can be calculated.  This is shown for the Flexofuser with
no orifice, 13/32-in. diameter (10.3 mm) orifice, and 11/32-in.
diameter (8.73 mm) orifice in Figure 11, expressed as horsepower
demand per 1,000 scf  (28.32 m3) versus percent of design flow.
The line for the 13/32-in diameter (10.3 mm) orifice was used in
the computer program to compute brake horsepower demand.  The
corresponding inlet guide vane position, as a function of percent
design flow along the operating line, is shown in Figure 12.
Notice that for the 13/32-in. diameter (10.3 mm) orifice, the low-
est air volume that can be delivered at the 10 percent inlet guide
vane position is about 26 percent of the design point air volume.

     Relationships for the electrical efficiency of AC induction
motors were supplied by the Cincinnati Office of Westinghouse
Electric Corp.  Their estimates for a 40-hp and a 2OO-hp motor
are shown in Figure 13.  The estimate shown for the 2OO-hp motor
was used in the power computation.  The relationships used to
calculate the oxygen demand of the biological system and the
relationships used for correcting aeration efficiency to local
conditions are fully described in References 1 and .5.

     The dissolved oxygen control system developed at the Palo
Alto Plant was operated over the 3-day period September 9-11,
1973.  These three days fell on Sunday, Monday, and Tuesday.
Volume, flow into the  plant on Sunday is significantly less than
during the weekdays.   Measurements of dissolved oxygen in one of
the three aerators are shown in Figure 14.  The computer simu-
lation of the dissolved oxygen control loop was used to calculate
the air demand using  the standardized influent stream shown in
Figures 5, 6, and 7.   The results of this computation are also
shown in Figure 14 for comparison.  For the two weekdays, Monday
and Tuesday, the agreement is reasonably good.  The design point
for the blower was set at 9,700 scfm (4.578 nrVsec), and the
aeration efficiency was taken as a fixed 14 percent.  The set
point for dissolved oxygen in the aerator was set at 1 mg/1,
corresponding to the  set point used at the Palo Alto Plant.

     With DO control, the average power consumption was 1,544 kwh
per day for each aerator.  When the blower was operated at the
design point, the power consumption was 1,858 kwh per day per
aerator.  Thus, the power saving with DO control was about
17 percent.  The program is also equipped to step the air supply
from the maximum value to a minimum value between 3 a.m. and noon.
                               18

-------
                                                                           8    9   10
                                                                               9   10
                                                                           80  90  100
                           Inlet Volume, % of Design

Figure 11.  Brake horsepower demand for the Flexofuser with no orifice,
            13/32-in. diameter orifice, and 11/32-in.  diameter orifice.
                                        19

-------
                         20             30




                           Inlet Volume, % of Design




Figure 12.  Inlet guide  vane  (IGV) position versus compressor operating point.
                                              00
20

-------
     10
o
o
X

•p
M-l

•P


1

M
0)
ft
 10
 0)
 CO
                                  4**
                                  Electrical efficiency =    "•
                                                          Output1 + Losses
        )          .2          .4         .6        .8
                      Output  (fraction of full load)


         Figure 13.   AC motor losses  versus  output,
                                                            l.o
                                    21

-------
N
W
                 Measured Air Supply
                         •Computed Air Supply -
                                                                         --Aeration Efficiency = .14 f--
                                                                  : midnight "
                                                                                                   24
      Figure  14.   Palo Alto,  Calif., baseline  measurements of  dissolved oxygen in one of three

                   aerators, September 9-11,  1973.

-------
When the minimum value was set at 6,000 scfm, the air supply
was sufficient to hold the DO above 1 mg/1, and the average
power consumption was 1,644 kwh per day per aerator for an
average saving of 11.5 percent.
                     SLUDGE WASTING CONTROL
     Wasting of activated sludge from the process is accomplished
only through stream number 16.  The volume (mgd), m^/sec of
stream 16, Q(16), can be set equal to a fixed value or to a
fraction of the influent stream, Q(3).  The concentration of the
sludge wasted will be determined by the resulting sludge in-
ventory in the final settler, and the mixed liquor suspended
solids level in the aerator will find the proper level to make
the mass into  and out of the process balance.

     Sludge retention time (SRT) is defined in the program as
the mass of active solids in the aerator plus the sludge storage
tank divided by the daily waste rate for active solids.  The
volume of stream 16 is adjusted at each time interval (0.01 days)
to make the SRT equal the input value.

     Finally,  the program will set Q(16) equal to a specific value
when the value of SMQA equals or exceeds a set point designated
as SBLM.  SMQA and SBLM are compared at intervals of 0.01 days
(14.4 min.), and when SMUA becomes less than SBLM, the Q(16) is
set equal to zero.  This computational procedure is intended to
simulate the use of an on-line sludge blanket detector for wasting
control.  The value SBLM is intended to represent a depth setting
for the sludge blanket detector.
                    SLUDGE INVENTORY CONTROL
     The object of sludge inventory control is to increase the
concentration of active solids in the aerator when the BOD load
on the process is at a maximum and to decrease the concentration
of active solids in the aerator when the BOD load on the process
is minimized.  This can be done only if a mechanism for sludge
storage is provided.  The program provides for sludge storage in
the final settler and in a separate sludge storage tank.  The
origin of this idea appears to be a paper by Westberg,  in which
he pointed out that operation of the activated-sludge process can
be optimized in a number of ways, depending on the object of the
optimization.

                               23

-------
     For example, the average amount of BOD discharged per day
to the receiving stream might be minimized.  A cost/effectiveness
ratio might be defined and used as a basis for optimization.
The peak instantaneous BOD discharge might be minimized.
Finally, the BOD in the aerator can be held at a constant value.
This final criterion for optimization of operating policy has
received much attention, and it can be shown that this is
equivalent to holding the food/microorganism ratio in the aerator
at a constant value.  For example, consider the completely mixed
activated-sludge process shown diagrammatically in Figure 9.
The generally accepted relationship for the rate of change of
substrate with time in the aerator is given by the following
relationship:

        dS/dt = Q(S  - S)/V - 4.8 S  X/[0. 5(150 + S)]         (4)
where      S = BOD concentration, mg/1
           X = active solids concentration, mg/1
           t = time, days
           V = aerator volume, mg, m
           Q = volume flow, mgd,  m3/sec

If we assume that the BOD in the aerator is primarily dissolved,
the BOD of stream (18) equals the BOD of stream (5); and if
dS/dt is set equal to zero, the following relationship can be
found:

           Q3 (S3 - S5)/(VX) = 4.8 S5/[0. 5(150 + S5)]            (5)


     If S  is dropped from the expression on the left, the
generally accepted definition of food/microorganism ratio results.
Since S  is normally small compared to S ,  the error in making
this simplification is small.  Notice, however, that the symbol
X refers to active solids rather than to MLVSS.

     The program contains a PI control loop that computes the
food/microorganism ratio existing in the aerator at each time
point and then increases or decreases the volume flow in stream
18, Q(18), to make the F/M ratio in the aerator approach the set
point value supplied to the program as input.  Concentrated sludge
from the final settler or the separate sludge storage tank is re-
turned to the aerator by stream 18, and if F/M is above the set
point, Q(18) is increased; or if F/M is below the set point,
Q(18) is decreased.  In this control loop,  F/M is defined as the
pounds of BOD per day entering the process at station 3, divided
by the pounds of volatile suspended solids in the aerator.

     By trial and error, it has been found that this controller
is not capable of holding the F/M in the aerator equal to the
                               24

-------
set point of 0.35.  The best results obtained with the program
are shown in Figure 15, where the open circled points are the
concentrations of MLVSS in the aerator that must be achieved
to hold F/M equal to 0.35.  The solid circled points are the
computed points using the F/M control loop.  Two principal
difficulties have been noted in attempting to hold the F/M
ratio in the aerator constant.  First, when the BOD load on
the process drops by a factor of about four in the early morning
hours, the MLVSS in the aerator cannot be reduced quickly enough
to hold F/M constant.  Second, when the load on the process is
maximized in the evening hours, up to about midnight, the de-
mand for sludge from the final settler becomes so excessive that
the concentration of sludge out of the final settler approaches
the concentration of MLVSSj, and the required pumping rate becomes
as high as 350 mgd  (15.3 nr/sec).

     Also, the average BOD in the aerator is not reduced signi-
ficantly by means of the F/M control strategy.  This is shown
(Figure 16) by a plot of BOD in the aerator versus time for the
case where Q(18) is set equal to a fixed value  [12 mgd (0.53 m3/
sec)], and where the F/M controller is in operation.  The
average BOD in the aerator, when Q(18) was set equal to 12 mgd
(0.53 m3/sec), was 8.31 mg/1.  The average BOD in the aerator
with the F/M control in operation was 8.37 mg/1.  The average
concentration of active solids in the aerator when Q(18) was held
constant was 943.2 mg/1.  If we substitute this average value with
other average values for the input vector into equation (5 ), the
BOD concentration in the aerator, when the F/M ratio is held
constant, would be about 8.1 mg/1.  From these observations, it
seems clear that very little reduction in average BOD in the
aerator is likely to be achieved with F/M control in a typical
•municipal plant such as the Palo Alto Plant.

     The theoretical performance limits can be studied by assum-
ing that F/M, as defined by equation (5 ), will be held constant
and by substituting average values in the equation.  For example,
if S  is to be held fixed at 8 mg/1, the value for F/M, as de-
finea by equation (5 ), is 0.486.  Now, if the average Palo Alto
values for flow  [25.67 mgd (1.124 m3/sec)] and BOD in the primary
effluent (143.25 mg/1) are substituted into the left hand side
of equation ( 5), the active solids concentration can be computed
as 955 mg/1.  To be more precise, the geometric means should be
used; but for this simplified discussion, the arithmetric means
will be used.

     Since the yield coefficient has been assumed as 0.5 Ib
active solids per pound of BOD used, the production of active
solids per day can be computed.  The endogenous respiration
rate at 20°C will be taken as 0.125 so that the amount of solids
destroyed by endogenous respiration per day can be computed.
The difference between the mass of solids generated and the
                               25

-------
    24OO
    2200
  e
   r\
  (f)
to
                                                                      ; O   MLVSS required to hold F/M = 0.35
                                                                           MLVSS achieved with F/M control
                                                    .9    1.0   .1    .2

                                                       Time, days
        Figure 15.  MLVSS  required to make F/M equal to 0.35 MLVSS  resulting from controlled return
                     rate  (Palo Alto Data, August 5-7, 1973).

-------

                                                     j   return stream held constant [12 mgd  (0.53 m /sec
                                                        modified F/M control  (proportionality constant  =
                                                      ' |'—: ' l • i ' l i '—LJ_I
                                                        F/M feedback control
 a
.9    1.0

 Time, days
Figure 16.  Total aerator  BOD versus  time (Palo  Alto Data,  August 5-7,  1973).

-------
amount destroyed by endogenous respiration will give the mass
of active solids wasted.  Since the mass of active solids in
the 7.48 (28,312 nr*) aerator and the waste rate are known, the
SRT can be computed.

     The concentration of active solids in the aerator, when
the fixed value for substrate is set at 4, 5, 6, 8, 16, 24, and
32 mg/1, is shown plotted versus SRT in Figure 17.  The average
concentration of inert suspended solids entering the process
at Palo Alto, however, was 35.74 mg/1.  If sludge retention
time is defined as the mass of solids in the aerator, divided
by the daily wasting rate, the concentration of inert solids
in the aerator can be expressed as follows:

                     MLISS = Q(3)*ISS3*SRT/V                     (6)

     MLISS = concentration of biologically inert suspended
             solids in aerator, mg/1
      ISS3 = concentration of biologically inert suspended
             solids in stream 3, mg/1
         * = indicates multiplication

Therefore, the average concentration of inert suspended solids
in the aerator will be 122.7 times the sludge retention time
in days.  The concentration of inert solids in the aerator,
as a function of SRT', is shown in Figure 17.

     If the total suspended solids concentration in the aerator
is taken as the sum of the inert solids and the active solids,
the mixed liquor suspended solids concentration can be computed
as shown in Figure 17.

     From Figure 17, it can be seen that the active solids level
off at about 1,600 mg/1 at SRT values above 40 days.  The MLSS
concentration is approaching 6,000 mg/1.  Theoretically, then,
the reduction in dissolved BOD is from 8 mg/1 at MLSS = 2,000
mg/1 to about 5 mg/1 at MLSS = 6,000 mg/1.  Thus, the maximum
reduction in BOD in the aerator is about 38 percent.  The per-
formance of the final settler has not been considered in this
analysis.  The BOD contributed by active solids is about 1 mg/1
of BOD per mg/1 of active solids.  Clearly, the performance
of the final settler can dominate this kind of analysis.

     The variation in MLVSS in the aerator, when the return
stream Q(18) is set at a constant 12 mgd  (0.53 m3/sec), is shown
in Figure 18.  Notice that the maximum variation caused by the
low flow in the early morning hours is only from 1,600 mg/1 to
about 1,800 mg/1.  This deviation is readily corrected by means
of a PI control loop that varies the return rate, Q(18), to hold
MLSS constant.  The effect on the process, however, is negligible.
When MLSS is held constant by means of a controller, it is then
possible to waste sludge when the sludge blanket in the final
settler tends to exceed a specified level.

                               28

-------
-i-l-H i-H-i- HI' Hit +1-H I-I"' '-H:-f- -I- + - -H-i-i-  '-f--! •-» '•'-' H-H-J --j-j-i-^.. -|- -+- + -;- -j-M-j- -;-'— i>!i|'.H
                                         Aerator Substrate, mg/1 == 5
                                                    t=
                         Sludge  Retention Time, days

Figure  17.   Relationship between aerator  suspended  solids and
               sludge retention time.
                                       29

-------
     Because of the difficulty of designing 
-------
2800
2600
2400
                                                         i:   MLVSS required to  hold F/M = 0.35 j ;:.'|  j   [  •-,-  \
                                                         ' -  modified F/M control  (proportionality constant =19)

                                                                                                  •*—3
                                                        3   return  stream held constant  [12 mgd (0.53 m^/sec)]
                                                         f i it 111 j [iiM ]jt: a;; 1;-t "l^"iT" j nr |' ^ h" ] TTJ T f
                                                                                         -J"'   -"

     O.  .1    .2   .3    .4    .5     .6   .7
.8   .9    1.0
  Time,  days
     Figure  18.  Aerator MLVSS  versus time MLVSS with F/M control  (Palo Alto  Data, August 5-7,  1973)

-------
to
                                             Demand Rate, scfm/lOOO
      Figure 19.  Relationship between return rate and air demand  to make  mass  of sludge returned
                  directly proportional to incoming load.

-------
             q
25 mgd (1.1 m /sec) until about noon when it can be returned
to the normal 12 mgd (0.53 m /sec) until it is again set to
zero at about 11 p.m.  The computer program was provided with
logic to simulate this kind of step control of the return rate,
The program was then operated with this kind of control for
Q(18), and the process was allowed to stabilize.  The MLVSS
in the aerator was found to stabilize at around 700 mg/1.
Because of the many variables to be determined by trial and
error in this kind of scheduling for Q(18), no satisfactory
step schedule for Q(18) was ever found.
                                 33

-------
                           REFERENCES
1.  Smith, R.,  Eilers, R. G.,  and Hall, E. D.  Design and
    Simulation of Equalization Basins.  EPA-67O/2-73-046.
    Feb. 1973,  NTIS-PB 222 000

2.  Bryant, J.  O., Wilcox, L.  C.,  and Andrews, J. F.
    Continuous  Time Simulation of  Wastewater Treatment Plants.
    Presented at AIChE Meeting in Cincinnati, Ohio May 1971

3.  Smith, R.,  and Eilers, R.  G.  Simulation of the Time-
    Dependent Performance of the Activated Sludge Process.
    EPA 17090	10/70, Oct. 1970,  NTIS-PB 219 47O

4.  Zack, S. I.  Experiments on Settling and Filtering
    Activated Sludge Aerated Liquors.  Sewage Works Journal,
    7(3):  514-533, May 1935.

5.  Smith, R.,  Eilers, R. G.,  and  Hall, E. D.  Mathematical
    Model for Post Aeration.  EPA-670/2-73-044,  Feb. 1973
    NTIS-PB 222 031

6.  Westberg, N.  An Introductory  Study of Regulation in
    the Activated Sludge Process.   Water Research, 3:  613-621,
    1969.
                               34

-------
APPENDIX
   35

-------
      TIME DEPENDENT MATHEMATICAL MODEL FOR  ACTIVATED  SLUDGE

                     PROGRAM OUTPUT  VARIABLES

BODA   Average mass of BOD discharged per day at station No. 15,
       Ib BOD/day

BODR   Average substrate removal rate, Ib BOD removed per day/lb
       MLVSS in process

BODL   Average BOD loading, Ib BOD entering per day/lb active solids
       in process

DKWH   Average electrical power consumption for air blowers, kwh/day

ASRT   Average sludge retention time,  days (mass of active solids
       in process/total wasting rate,  Ib  active solids per day)

AMLSS  Average mixed liquor suspended solids concentration in
       aerator, mg/1

XRSS   Concentration of suspended solids  in final settler effluent
       stream divided by mixed liquor suspended solids concentration

URSS   Concentration of suspended solids  in underflow stream from
       final settler divided by mixed liquor suspended solids
       concentration

SMUA   Sludge inventory in final settler, Ib stored/sq ft of over-
       flow area

BOUT   Total BOD concentration in final settler effluent, mg/1

FM     Food/microorganism ratio for aerator, Ib of BOD entering
       process divided by Ib of active solids  in aerator

TCFM   Total air supplied to aerators, scfm

TAIR   Total air supplied to aerators  and sludge storage tank, scfm

AERFF  Aeration efficiency, mass of air dissolved in water/mass
       of air supplied

DHP    Larger air blower setting for two  position air control, scfm

DPL    Lower air blower setting for two position air control, scfm

THP    Air blower brake horsepower,  hp

PIGV   Position of inlet guide vanes,  fraction of full open

DPCFM  Design point air supply capacity for air blower, scfm

Cl(l)  Maximum rate constant for synthesis (heterotrophs), day"1

                               36

-------
     TIME DEPENDENT MATHEMATICAL MODEL FOR ACTIVATED SLUDGE

                     PROGRAM INPUT VARIABLES
IPS(l)     Program control;  -1,0 indicates no equalization basin
           is provided, 1 indicates an equalization basin is used
IPS(2)
Program control:  -1,0 indicates no primary sedimentation
is provided, 1 indicates primary sedimentation is used
IPS(3)     Program control:  -1 indicates no sludge storage is pro-
           vided, 0 indicates final settler sludge storage is used,
           1 indicates separate sludge storage  (stabilization basin)
           is used

IPS(4)     Program control:  -1 indicates modified F/M control with
           sludge storage, 0 indicates MLSS control with sludge
           storage, 1 indicates F/M control with sludge storage

IPS(5)     Program control:  -2 indicates waste stream volume is
           constant, -1 indicates waste stream volume is proportional
           to the flow at station 3, 0 indicates SRT control of the
           waste stream by setting it equal to a fixed fraction of
           the aerator sludge per day, 1 indicates SBL control of
           the waste stream by setting it equal to a fixed rate when
           the sludge blanket level gets above a specified limit

IPS(6)     Program control:  -1 indicates two position manual con-
           trol of air blowers for dissolved oxygen control in the
           aeration tank, 0 indicates DO control with diffused air
           aeration, 1 indicates DO control with mechanical aeration
           (for no DO control, set PGDO(I) and RSDO(I) input values
           equal to zero)

IPS(7)     Program control: -1 indicates step input for influent
           variables (flow, dissolved BOD, particulate BOD, ammonia
           nitrogen, and inert solids) is provided, O indicates sine
           wave variation is used for influent variables, 1 indicates
           constant values are used for influent variables

XN         Total number of H-size time increments for the program
           to calculate (for example, 15 days would be XN = 1500
           time increments of size H = .01)

H          Time increment between program calculations, days (an
           increment of .01 days is normally used)

T          Starting time of the first calculation, days
                               37

-------
TD
XCALC



QA

DT

XL

V(18)

GPS

GSS

WRATE


FNVOL

SRT


SBLM



ALPHA


BETA


HPHRO


RP


QW


XNTKS

CON

SPML
The program will only begin to print out calculations
at the time in days specified by this input value; if
it is set equal to 0, then all of the calculations will
be printed out

The program will only print out every XCALCth calculation
that the program makes; if XCALC is set equal to 1, then
every calculation is printed out

Average influent flow to the system, mgd

Aerator detention time, hours

Water temperature, degrees centigrade

Volume of the stabilization basin, millions of gallons

Primary settler overflow rate, gpd/sq ft

Final settler overflow rate, gpd/sq ft

Sludge wasting rate, fraction (fraction of stream 3
that is wasted for proportional control of sludge wasting)

Fraction of non-volatile inert suspended solids

Sludge retention time, Ibs of sludge in the process/
Ibs of sludge wasted per day

Set point for sludge blanket level control of sludge
wasting, Ibs of sludge in the final settler per sq ft
of surface area

Aeration efficiency in wastewater/aeration efficiency
in tap water

Oxygen saturation value of wastewater/oxygen saturation
value of tap water

Efficiency measure for mechanical aerators, Ibs of
oxygen/hp-hr

Atmospheric pressure at aerator/atmospheric pressure
at sea level

Constant sludge wasting rate for sludge blanket control
of wasting, mgd

Number of equal volume sub-aerators in the system

Proportionality constant for modified F/M control

set point for MLSS control with sludge storage, mg/1

                       38

-------
PGML       Proportional gain for MLSS control

RSML       Reset constant for MLSS control

SPFM       Set point for F/M control

PGFM       Proportional gain for F/M control

RSFM       Reset constant for F/M control

Q16        Sludge wasting rate when the waste stream is held
           constant, mgd

DPH        Higher air supply set point for two position manual
           control of air blowers, scfm

DPL        Lower air supply set point for two position manual
           control of air blowers, scfm

TIME1      Beginning time for changing air supply set point for
           two position manual control of air blowers, time of day

TIME2      Ending time for changing air supply set point for two
           position manual control of air blowers, time of day

Q17        Sludge return rate when the return stream is held
           constant, mgd

CFMM3(18)  Air supply to the stabilization tank, scfm/million gallons

SPDO(I)
PGDO(I)

RSDO(I)

OKI)*

Sll(I)*
X41(I)
Set point dissolved oxygen level in aerator sub-volume I,
mg/1

Proportional gain for DO control in aerator sub-volume I

Reset constant for DO control in aerator sub-volume I

100 step input values for influent flow, mgd

100 step input values for influent dissolved BOD con-
centration, mg/1

100 step input values for influent particulate BOD con-
centration, mg/1

10O step input values for influent ammonia nitrogen con-
centration, mg/1

100 step input values for influent inert solids concentration,
mg/1
*Note that the 1OO step input values for Q1(I), Sll(I), S21(I), S31(I),
and X41(I) are only required if the IPS(7) = -1 option is used.  All
other input variables are always required to run the program.
                                 39

-------
PAGE   2              TIME DEPENDENT MATHEMATICAL  MODEL FOR ACTIVATED SLUDGE


C   THIS DECK USES BRUTE FORCE NUMERICAL  INTEGRATION

      DIMENSION X<5,18),SU,18),Q(18),V<18),C1<4),C2(4),C3(4),CM4>,
     . DELS(4,18),DELX(5,18),DLS18(4),DLX18(5),BODA( 100),BODR( 100) ,
     . BODL( 100) ,DKWH( 100) ,DO( 18) ,HPMG(18) fCFMMG(18) tSPDO(18)»EDO(18)t
     . EDOK 18),PGDO( 18 ) , RSDO ( 18 ) , I PS< 10) ,DELS2<4) ,OELX2(5) ,
     . ASRT(IOO) ,AMLSS(100) , Ql ( 1 00 ) , S 11 ( 100 ) , S21 ( 100 ) , S31 ( 100 ) i X41 ( 100 )

C   SET ALL DIMENSIONED VARIABLFS  TO ZERO

      DATA X/90*0.0/,S/72*0.0/,Q/18*0.0/,V/18*0.0/
      DATA C 1/4*0. 0/fC 2/4*0. 0/,C3M*d.O/,C4M*0.0/
      DATA DEL S/72*0 .O/ , DELX/ 90*0. 0/,DL SI 8/4*0. O/ ,DLX1 8/5*0. O/
      DATA BOD A, BOOR, BOOL, DKWH/ 400*0.07, DO/ 18 *0.0/,HPMG /1 8*0. O/
      DATA CFMMG/1 8*0. 0/,SPDO/lfl*0.0/, EDO/ 1 8*0. 0/,EDOI/ 18*0. O/
      DATA PGDO/18*0.0/,RSDO/18*0.0/
      DATA IPS/10 *0/,D EL S2/4*0.n/, DELX 2/ 5*0. O/
      DATA ASRT,AMLSS,Ql,Sll,S21tS3l ,X41/ 700*0 .O/

C   FUNCTION STATEMENTS

      DSDTF(A,6,C,D,E,F,G)=Q4*< A-B ) /C-D*B*E/ (F+B)/G
      DXDTF(A,B,C,D,E,F,G)=04*( A-B) /C+D*B*E / ( F+E ) -G*B
      DSVTF(A,B,C,D,E,F!=(QIN*A-QOUT*B)/VL-C*B*D/(E+B)/F-B*(QIN-OOUT) /VL
      DXVTF(A,B,C,D,E,F)=(QIN*A-QOUT*B)/VL-B*(QIN-QOUT)/VL+C*B*D/(E+D)-
     . F*B
      DOUPF(A,B,C,D,E,F,G,H,P,0,R,S,T,U,V)=A*(B-C)/D+.58*E*F*G/H/
     . (P+F)+4.6*Q*R*S/T/(U+R)+1 .16*V*G

C   SET INITIAL VALUES

      IN = 2
      10 = 5
      [P=7
      I I 1=0
      Y = 0.
      XREM=0.
      XLCAD=0.
      BKWH=0.
      DELY=0.
      D6LR=0.
      DELL=0.
      BKW=6.
      AS = 0.
      AM = 0.
      SRT1=0.
      M = 0
      AERK1=0.
      AERK2=0.
      AXL=0.
      EXL=0.
      X-iDOT=0
      EMLI=0.
      DHP=0.
      THP=0 .
      PFL=0.                            40

-------
PAGE
                  TIME DEPENDENT  MATHEMATICAL  MODEL  FOR  ACTIVATED SLUDGE
C
C
C
C
C
C
C
C
C
C
C

C
C

C
C
C

C
C
C
C

C
C
C
C

C
C
C
C

C

C

C
      ELOSS=0.
      EEFF=0.
      PIGV=0.
      CFMDF=0.
      XRSS=0.
      URSS=0.
      SMUA=0.
      IC=0
      TAIR=0.

    CLASSES OF PARTICIPATES
     X(L,I
     X(2,I
     X(3,
     X(4,
     X(5,
     S(l,
     S(2,
     S(3,
= HETEROTROPHS
= NITROSOMONAS
= NITROBACTER
= INERT SOLIDS
= TOTAL SUSPENDED SOLIDS
= DISSOLVED BOD
= PARTICULATE BOD
= AMMONIA NITROGEN
= NITRITE
    DEFINITION OF  PROCESS  VECTOR  -  IPS(I)
     IPS(1)= -1,0,
                 1,

     IPS(2)= -1,0,
                 1,
       NO EQUALIZATION BASIN
       USE EQUALIZATION BASIN

       NO PRIMARY SEDIMENTATION
       USE PRIMARY SEDIMENTATION
      IPS(3)=
      IPSK) =
     IPS(5)=
     IPS(6)=
     IPS(7)=
   -1, NO SLUDGF STORAGE
    0, SLUDGE STORAGE IS
    1, SLUDGE STORAGE IS
IS PROVIDED
PROVIDED - FINAL SETTLER STORAGE
PROVIDED - SEPARATE STORAGE V(18)
   -17 MODIFIED F/M CONTROL
    0, MLSS CONTROL
    1, F/M CONTROL
    NOTE - THESE CONTROLS ARE NOT USED IF NO  SLUDGE  STORAGE

   -2, Q(16) IS CONSTANT FOR SLUDGE WASTING"
   -1, 0(16) IS PROPORTIONAL TO 0(3) FOR SLUDGE WASTING
    0, SRT CONTROL ON 0(16) FOR SLUDGE WASTING
    1, SBL CONTROL ON Q(16) FOR SLUDGE WASTING
   -1, TWO POSITION MANUAL CONTROL OF AIR BLOWER
    0, DO CONTROL WITH DIFFUSED AIR
    1, DO CONTROL WITH MECHANICAL AIR
    NOTE - INPUT PGDO(I)=0. + RSDO(I)=0.  1=5,K FOR
                                                                NO DO CONTROL
   -1 ,  100 STEP INPUTS - Q(l ) ,S( 1T 1) ,S(2, 1) ,S(3, 1 ),X(4, 1)
    0,  SINE WAVE VARIATION - Q ( 1 ) , S ( 1 , 1 ) , S ( 2 , 1 ) , S ( 3 , 1 ) , X ( A , 1 )
    1,  CONSTANT AVERAGE VALUE - 0 ( 1 ) , S ( 1 , 1 ) , S ( 2 , 1 ) , S ( 3 , 1 ) , X ( 4
                                                                           1 )
READ ALL CONSTANT INPUT VALUES
      READ! IN, 101 )
  101 FORMATI10I2)
      READtIN,103)
      RbAD(IN,103)
                (IPS!I),1 = 1,7 )

                XN,H,T,TD,XCALC
                QA,DT,TL,V(18),GPS,GSS,WRATE,FNVOL
                                   41

-------
PAGE   4              TIME DEPENDENT  MATHEMATICAL MODEL FOR ACTIVATED SLUDGE

      READ(IN,103) SRT.SBLM,ALPHA, BETA ,HPHRO,RP,QW,XNTKS
      READ(IN,103) CON,SPML,PGML,RSML,SPFM,PGFM,RSFM,Q16
      READ(IN,103) DPH,DPL,TIME1,TIME2,Q17,CFMMG(18)
  103 FORMAT(SFIO.O)
      K=XNTKS+4
      READ(IN,104)  (SPDO( I ) , 1 = 5, 18 )
      READ(IN,104)  (PGDOd ) ,1=5,18)
      READ( IN,104)  (RSDO(I),1=5,18)
  104 FORMATUOF8.0)

      IF(IPS(7))  106,108,108

  106 READ(IN,104) (Ql(I), I = 1,100)
      READ(IN,104) (Sll(I),1=1 ,100)
      READ(IN,104) (521(11.1=1,100)
      R€AD( IN,104) (531(11,1=1,100)
      READIIN.104) (X41(I) ,1=1,100)

C   WRITE ALL CONSTANT INPUT  VALUES

  108 WRITE(IO,100)
  100 FORMAT!1H1,/)
      WRITE)  10, 101) ( IPS( I ),1=1,7)
      WRITE(IO,114) XN,H,T,TD,XCALC
      WRITE!10, 114) QAjDT,TL,V(18),GPS,GSS,WRATE,FNVOL
      WRITE!  10,114) SRT,SBLM,ALPHA,BETA,HPHRO,RP,QW,XNTKS
      WRITE!  10,114) CON,SPML,PGML,RSML,SPFM,PGFM,RSFM,Q16
      WRITE!10,114) DPH,DPL,TIMF1,TIME2,Q17,CFMMG(18)
      WRITE!  10,114) (SPDO(I ),I=5,K)
      WRITE!  10,114) (PGDO!I),I = 5,K)
      WRITE(IO,114) (KSDO!I ) , 1=5,K)
  114 FORMAT( 10F10.3)

      IF! IPSI7 ) )  116,112,112

  116 WRITE)  10, 114) (01! I ) ,1=1,100)
      WRITE!  10,114) (Sll! I ) , 1=1, 100)
      WRITE(IO,114) (S2K I ) ,1=1 ,100)
      WRITE!10, 114) (531(11,1=1,100)
      WRITE!  10, 114) (X4K I ) , 1 = 1, 100)

C   SET INITIAL VALUES AND MAKE  INITIAL  CALCULATIONS

  112 Cl( 1 1=4.8
      C2(1)=150.
      C3( 1 ) =  . 125
      C4( 1 )=.5
      Cl (2 )=4.8
      C2(2)=150.
      C3(2) =  . 125
      C4(2 )=.5
      Cl (3 ) =  .28
      C2(3)=1.
      C3(3)=. 18
      C4(3 )=.05
      Cl (4) =  1.
      Cl (4)=0.
      C2(4)=2. 1
      C3(4)=.18
                                       42

-------
PAGE   5              TIME DEPENDENT MATHEMATICAL  MODEL  FOR  ACTIVATED SLUDGE

      C4<4)=.02

      X(1,5)=750.
      X(2,51=75.
      X(3,5)=5.
      X(4,51=1200.
      X(5,51=2000.
      S(1,51=20.
      5(2,51=60.
      5(3,51=30.
      5(4,51=1.
      DC 1  J=5,K
      DO 1  1=1,5
    1  XII,J)=X(I,5)
      DO 2  J=5,K
      DO 2  1=1,4
    2  S(I,J)=S(1,5)

      IF(IPS(1)1 4,4,3

    3  V(2)=.(QP-OA)/3.1416*1.25
      X( 1,21=50.
      X(2,21=20.
      X(3,21 = 10.
      X(4,21=50.
      X(5,21=150.
      S( 1,21 = 60.
      S(2,21=140.
      5(3,21=30.
      S(4,2)=0.

    4  IF(V(181 1 7,7,6

    6  X( 1, 181 = 2300.
      X(2, 181 = 100.
      X(3,181=15.
      X(4,181=3500.
      X(5,181=6000.
      5(1,181=1.
      S(2,181=1.
      5(3, 181=1.
      S(4,18 1=0.

    7  T=.002
      ALP18=.90
      AER18=.17
      AERFF=.16
      APS=QA*1000000./GPS
      AFS=OA*1000000./GSS
      SMFS=SBLM*AFS
      QP=1.78*QA**.92
      CLA=ALPHA*1.025**(TL-20. 1
      CSS=14.652-.41022*TL+.0079910*TL**2.-.000077774*TL**3.
      CSW=CSS*BETA*RP
      VAER=DT*QA/24.
      DPCFM=DPH


      DO  20 J=5,K                        43

-------
PAGE   6               TIME  DEPENDENT MATHEMATICAL MODEL  FOR  ACTIVATED SLUDGE

      V(J)=VAER/XNTKS
      CFMMG1J ) = DPH/XNTKS/V(J)
   20 HPMG(J)=CFMMG(J)/39.45

C   BEGIN  TIME-DEPENDENT  CALCULATIONS (  BIG DO-LOOP  )

      NSTOP=XN+1
      DO 1000 LL=1TNSTOP

C   SET DESIGN POINT  CFM  (DPCFM)

      IF (IPSI6))   170,179,179

  170 IT=T
      T1=IT+TIME1
      T2=IT+TIME2
      IF (T-T1)  177,171,171
  171 IF (T-T2)  173,177,177
  173 DO 10   J=5,K
      CFMMGIJ)=(DPL/XNTKS)/V(J)
   10 HPMGIJ)=CFMMG(J)/39.45
      GO TO 179
  177 DO 11   J=5,K
      CFMMG(J)=(DPH/XNTKS)/V(J)
   11 HPMGIJ)=CFMMG(Jt/39.45

C   GENERATE  RAW WASThWATER  STREAM

  179 IF(LL-l) 553,553,150

  150 IF( IPSI7) ) 151, 152,154

  151 IC=IC+1
      Q( 1)=Q1(1C)
      S( 1, 1 ) = S11( 1C)
      S(2,l )=S21(1C)
      S(3,1)=S31(1C)
      X(4, 1)=X41(1C)
      GO TO 156
  152 Q( 1)=QA-(QP-QA)*SIN(6.203*T)
      S(l,11=60.-40.*SIN(6.283*T)
      S(2,1)=140.-93.*SIN(6.283*T)
      S(3,1)=30.-20.*SIN(6.283*T)
      X(4,1)=90.-72.*SIN(6.283*T)
      GO TO 156
  154 0(1)=25.67
      S( 1, 1)=114.67
      S(2, 1 ) = 28.58
      S(3, 1 )=28.95
      X(4, 1 (=35.74
  156 X(5, 1)=X(4, 1) + S(2,1)/.8

      IF( IPSd ) ) 80,80,99

C   NO EQUALIZATION BASIN  PROVIDED

   80 DO 81 1=1 ,4
   81 S( I ,2)=S( I , 1)
      DO 82 1=1,5

-------
PAGE   7              TIME  DEPENDENT  MATHEMATICAL  MODEL  FOR ACTIVATED SLUDGE

   62 XI I ,2)=X( I , 1 )
      0(2)=0( 1)
      GO TO  120

C   EQUALIZATION BASIN PERFORMANCE

   99 Q(2)=QA
      X4DOT=(Q( 1)*X(4,1)-Q(2)*X(4,2) )/V(2)-X(4,2)*(Q(l )-Q(2»/V<2)
      EXL=V(2)*X(1,2)/0(1)/(S(1,1)+S(1,2))
      Cl(1)=5.341-2.54*(ALOG(EXL))
      C1(1)=CL(1)*1.08**(TL-20.)
      IF(C1( D-25. )  118,118,117
  117 Cl( 1 )=25.
      GO TO  121
  118 IF(C1( 1)-1. )  119,119,121
  119 Cl( 1 ) = 1.
  121 DLV2=Q(11-0(2)
      CK2 )=C1( 1 )
      OIN=0(1)
      QOUT=Q(2 )
      VL=V(2)
      DU 631 1=1,2
  631 DELS2(I)=DSVTF(S(I,1),S(I,2),C1(I),X(1,2),C2(I),C4(I))
      00 632 1=3,4
  632 DELS2(I)=DSVTF(S(I,1),S(I,2),C1(I),X(I,2),C2(I),C4(I))
      ST2=S(1,21+5(2,2)
      DELX2(1)=DXVTF(X(1T1),X(1,2),C1(1),ST2,C2(1),C3(11)
      DELX2(2)=DXVTF(X(2,1),X(2,2),C1(3),S(3,2),C2(3),C3(31)
      DELX2(3)=DXVTF(X(3,1),X(3,2),C1(4),S(4,2),C2(4),C3<4))

  120 IF( IPSI2) ) 124,124,122

C   NO  PRIMARY SETTLER

  124 0(31=0(2)
      DO 127 1=1,4
  127 S( I,3)=S(1,2)
      DO 128 1=1,5
  128 X(I,3)=X(I,2)
      GO TO  126

C  PRIMARY SETTLER  PERFORMANCE

  122 GPS=0(2)*1000000./APS
      S(1,3)=S(1,21
      S(2,3)=S(2,2)*(l.-.82/EXP(GPS/2780.)1
      S(3,3)=S(3,2)
      S(4,3)=S(4,2)
      Q(3)=Q(2)
      00 125 1=1,4
  125 X(I,3) =X(I,2)*(l.-.82/EXP(GPS/2780.))
      X(5,3)=X(1,3)+X(2,3)+X(3,^)+X(4,3)+S(2,3)*.8

C   ACTIVATED  SLUDGE  AND  FINAL  SETTLER PERFORMANCE

  126 BUGS=0.
      BUGS=V(18)*X(1,18)
      DO 560 1=5,K
  560 BUGS=BUGS+V
-------
PAGE   8              TIME DEPENDENT  MATHEMATICAL  MODEL  FOR ACTIVATED SLUDGE

      FM=(S(1,3)+S(2,3))*Q(3)/(X(5,5)-X(4,5)*FNVOL)/VAER
      URSS=(.3565*5MUA-.0418)*!0000./X(5,K)
      GSS=Q(15)*1000000./AFS
      XRSS=556.*GSS**.494/X(5,K)**1.82/DT**.439
      X(5,151=37.-20.*SIN(6.283*7-1.571)
      XRSS=X(5,15)/X(5,K)
      IF(XRSS-.l) 142,142,141
  141 XRSS=.l
  142 DO 140 1=1,5
      X( I , 15)=X(I ,K)*XRSS
      X(I,16)=X(I,K)*URSS
  140 X( I,17)=X( 1,16 1
      S(1,15)=S(1,K)
      S( 1, 16) = S( 1,K)
      S(1,17)=S(1,K)
      S(2,15)=S(2,K)*XRSS
      S(2,16)=S(2,K)*URSS
      S(2, 171=5(2,16)
      DU 180 1=3,4
      S(I ,15)=S(I ,K)
      S( I, 16) = S( I,K)
  180 S( I,17)=S ( I',K )

      IF(IPS(5)1 229,231,232

  229 IF(IPS(5)+1) 320,330,330

C   0(16) IS CONSTANT FOR  SLUDGF  WASTING

  320 Q(16)=Q16
      GO TO 230

C   0(16) IS PROPORTIONAL  TO 0(1)  FOR  SLUDGE  WASTING

  330 Q( 16)=Q(3)*WRATE
      GO TO 230

C   SRT CONTROL  ON 0(16) FOR SLUDGE  WASTING

  231 Q(16)=BUGS/SRT/X(1,K)/URSS-Q(15)*XRSS/URSS
      IF(Q(16)1  299,230,230
  299 Q<16)=0.
      GO TO 230

C   SBL CONTROL  ON Q(16) FOR SLUDGE  WASTING

  232 IF(SMUA-SBLM)  233,233,234
  233 Q(16 )=0.
      GO TO 230
  234 Q(16)=QW

  230 IF(IPS(31) 235,236,237

C   NO SLUDGE STORAGE PROVIDED

  235 Q(17)=((Q(3)-Q(16))*(1.-XRSS)-Q(16)*(URSS-1.))/(URSS-1.)
      Q(17)=-5.836735+2.122449*TCFM/1000.
      0117)=017"
      IFIQI17))  262,264,264

-------
PAGE   9              TIME  DEPENDENT  MATHEMATICAL  MODEL  FUR ACTIVATED SLUDGE

  262 0(17)=0.
  264 Q(18)=Q(17)
      Q(15)=Q(3)-Q(16)

      IF(V(18)) 247,247,245

C   FINAL SETTLER SLUDGE STORAGE  IS  PROVIDED

  236 IF(IPS(4)) 292,238,239

C        MODIFIED F/M CONTROL  OF  SUSPENDED  SOLIDS  -  FINAL  SETTLER

  292 0(17)=CON*(S(1,3)+S(2,3))*Q(3)/(X(5,17)-X(4,17)*FNVOL)
      Q(17)=5.58*CON*Q(3)**2./(X(5, 17 )-X(4,17 ) *FNVOL)
      ITT = T
      TT=ITT
      IF(T-(TT+.34)) 391,391,39?
  391 Q(17)=0.
      GO TO 398
  392 IF(T-(TT + .49) ) 393,393,39^
  393 Q(17)=25.
      GO TO 398
  394 IF(T-(TT+.94)) 396,396,397
  396 Q(17)=12.
      GO TO 396
  397 Q(171=0.
  398 CONTINUE
      IF(Q(17) ) 293,294,294
  293 Q(17)=0.
  294 0(18)=Q(17)
      Q(15)=Q(3)-Q(16>
      GO TO 247

C        MLSS CONTROL OF SUSPENDED  SOLIDS -  FINAL  SETTLER

  238 EML=SPML-X(5,K)
      EMLI=EMLI+EML*H
      Q(17)=Q(17)+PGML*EML+RSML*EMLI
      IF(0(17)) 266,268,268
  266 Q(17)=0.
  268 Q(18)=0(17)
      Q(15)=Q(3)-0(16)
      GO TO 247

C        F/M CONTROL OF SUSPENDFD  SOLIDS -  FINAL  SETTLER

  239 EFM=FM-SPFM
      EFMI=EFMI+EFM*H
      Q(17)=Q(17)+PGFM*EFM+RSFM*EFMI
      IF(Q(17))  272,274,274
  272 Q(17)=0.
  274 Q(18)=0(17)
      Q(15)=Q(3)-Q(16)

  247 DO 210 1=1,5
  210 X(I,18)=X(I, 17)
      DO 211 1=1,4
  211 S(I,18)=S(I,17)
      GO TO 245                        _4?

-------
PAGE  10               TIME  DEPENDENT MATHEMATICAL MODEL  FOR ACTIVATED SLUDGE


C   SEPARATE SLUDGE  STORAGE  IS  PROVIDED IN A RETURN  TANK V(18)

  237 IFUPSI4)) 296,240,241

C        MODIFIED  F/M  CONTROL OF SUSPENDED SOLIDS -  RETURN TANK V(18)

  296 Q( 18)=CON*(S(1,3)+S(2,3) ) *Q ( 3 ) / ( X < 5 , 18 ) -X (4, 18 ) *FNVOL )
      IF(0( 18) ) 297,298,298
  297 0(18)=0..
      0( 171=0.
      GO TO 214
  298 Q( 17) = ( (Q(3)-Q(16) )*< l.-XRSS)-Q< 16).*(URSS-1. ) (/(URSS-1. )
      0(17)=Q(18)
  214 Q( 15)=Q(3)-Q( 16)
      GO TO 245

C        MLSS  CONTROL  OF  SUSPENDED  SOLIDS - RETURN TANK  V(18)

  240 EML=SPML-X( 5,K)
      EMLI =EMLI+EML*H
      Q(18)=Q(18)+PGML*EML+RSML*EMLI
      IF(0( 18) ) 2 76,276,278
  276 Q(1C)=0.
      Q( 171=0.
      GO TO 279
  278 Q( 17 ) = (Q(3)+Q(18) )*( l.-XR<^S)/(URSS-XRSS)-Q( 16)
      0( 17)=0( 18)
  279 Q( 15)=Q( 18)+C( 3)-Q( 16)-Q( 17)
      GO TO 245

C        F/M CONTROL OF  SUSPENOFD SOLIDS  - RETURN TANK V ( 18 )
  241 L;FM = FM-SPFM
      EFMI=EFMH-EFM*H
      Q(18)=Q(18)+PGFM*EFM+RSFM*EFMI
      IF(0( 18) )  282,282,284
  282 0(18
      Q( 17
      .GO TO 286
  284 Q(17
  286 U( 15
= 0.
= 0.
= (Un)+Q(18))*(l.-XR<:S)/(URSS-XRSS)-Q(16)
= Q( 18)
= 0( 10)+Q( 3)-Q( 16)-(j( 1 7)
  245 BODAI I I I ) = Y
      HOOK (III) =XREM.
      KODL (III )=XLCAD
      DKWH( I [ I )=BKWH
      ASKT (III) =AS
      AMLSSI III ) =AM
      SRT1=1./(X(1,K )*URSS/BUGS*(0( 16)+C(15)*ARSS/URSS)>
      BODI,M = S (1,3)45(2,3)
      BOUT=S(l,L5)+S(2,15)+.84*X(l,15)
      SLDG=0.
      DO ^59  1=5 ,K
      SLDG=SLDG+V(I)*(X(5,I)-X(^,I)*FNVOL)
      OELR= ( Q ( 3 > *PODlN-0( 15)*ROUTJ/SLDG
                                        48

-------
PAGE  11              TIME DEPENDENT  MATHEMATICAL  MODEL  FOR ACTIVATED SLUDGE

      DELL=BODIN*0( 31/BUGS
      AXL=BUGS/Q(3)/BODIN
      C1(1)=5.341-2.54*(ALOG(AXL) )
      Cl( 1)=10.0
      Cld )=4.8
      C1(1)=C1 (!)*(!. 047 )**
-------
PAGE  12              TIME DEPENDENT  MATHEMATICAL MODEL FOR ACTIVATED  SLUDGE

      DLX18(2)=DXVTF(X(2,17),X<2,18),CK3),S(3,18),C2(3),C3(3))
      DLX18(3)=DXVTF(X(3,17), X < 3 ,18 ) , Cl ( 4 ) , S ( 4 , 18 ) , C2 ( 4 ) , C3 ( 4 ) )
      DLS18(1)=DSVTF(S(lf17)tS(l,18),Cl(l),X(l,18),C2(l),C4(l))
      DLS18(2)=DSVTF(S(2,17),S(2,18),C1(2),X(1,18),C2(2),C4(2)),
      DLS18(3)=DSVTF(S(3,17),S(3,18),CK3),X(2f18),C2(3),C4(3))
      DLS18(4)=(QIN*S(4,17)-QOUT*S(4,18)1/VL-C1(4)*S(4,18)*X(3,18)/
     . (C2(41+5(4,18) )/C4(4)-S(4,18)*(QIN-QOUT)/VL+
     . C1(3)*S(3,18)*X(2,18)/(C2<3)+S(3,18))/C4(3)

C   COMPUTE DISSOLVED OXYGEN REQUIREMENTS

  246 DO 920 J = 5,K
      ST=S(1, J)+S(2,J)

      IF( IPS(6) ) 892,892,894

  892 AERK1=.33347*CFMMG(J)*AERFF*ALPHA*1.025**(TL-20. )
      GO TO 896
  894 AERK1=HPMG(J)*HPHRO*CLA/9.02/8.33*24.
  896 AERK2=DOUPF(Q(J) ,DO(J) ,DO(J-l) ,V(J),Cl( 1 ) , ST , X ( 1, J ) ,
     . C4(1),C2(1),C1(2),S(3,J),X(2,J),C4(2),C2(2),C3(D)
      D0(J )=CSW-AERK2/AERK1-(CSW-DO(J)-AERK2/AERKl)/EXP(AERKl*H)
      IF(DO(J>) 897,898,898
  897 D0(J)=0.
  898 EDO(J )=SPDO(J )-DO(J )
      EDOI(J)=EDOI(J)-KSPDO(J ) -CSW + AERK2/ AERK 1 ) *H- ( CSW-DO ( J )-
     . AERK2/AERK1)/AERK1/EXP(AFRK1*H)

      IF( IPS(6 ) ) 920,900,910

  900 CFMMG(J)=CFMMG(J)+PGDO(J)*EDO(J)+RSDO(J)*EDOI(J)
      IFICFMMGU 1-150. )  905,920,920
  905 CFMMG(J)=150.
      GO TO 920
  910 HPMGIJ)=HPMG(J)+PGDO(J)*EDO(J)+RSDO(J)*EDOI(J/
      IF(HPMG(J ) ) 915,920,920
  915 HPMG(J)=0.
  920 CONTINUE

      IF(V( 18) ) 932,932 ,929

  929 ST=S( 1, 18)+S(2, 18)
      AERK1=.33347*CFMMG(18)*AER18*ALP18*1.025**(TL-20.)
      AERK2=DOUPF(Q(18),DO(18),nO(17),V(18),Cl(l),ST,X(l,18),
     . C4(1),C2(1),C1(2),S(3,18),X(2,1H),C4(2),C2(2),C3(1))
      D0(18)=CSW-AERK2/AERK1-(CSW-DU(18)-AERK2/AERK1)/EXP(AERK1*H)
      IF (00(18)1   930,930,931
  930 D0(181=0.0
  931 EDO(18 )=SPDO( 18)-DO( 18)
      EDOI(18)=EDOI(18) + (SPDO(1R)-CSW + AERK2/AERK1)*H-(CSW-DO( 16)-
     . AERK2/AERK1)/AERK1/EXP(AFRK1*H)
      CFMMG(18)=CFMMG(18)+PGDU(18)*EDO(18)+RSDO(18)*EDOI(18)
      HPMG(18)=CFMMG(18)/39.45

  932 IF(IPS(fa)) 922,922,551

  922 TCFM=0.
      DO 925 J=5,K
  925 TCFM = TCFM+CFMMG(J)*V(J )
                                       50

-------
PAGE  13              TIME DEPENDENT MATHEMATICAL  MODEL  FOR  ACTIVATED SLUDGE

      TAIR=TCFM+CFMMG(18)*V(18)
      CFMDF=12.*TCFM/DPCFM
      AERFF=(12.994-.1313*CFMDF)/100.
      AERFF=.16
      DHP=DPCFM*.03009
      THP=TCFM*.03009/(TCFM/DPCFM)**.2045
      PFL=THP/DHP
      IFIQA-10.) 341,342,342
  341 ELOSS=.04007+.0555*PFL
      GO TO 343
  342 ELOSS=.02008+.0473*PFL
  343 EEFF=PFL/(PFL+ELOSS)
      BKW=THP*.7457/EEFF
      PIGV=100.*(TCFM/DPCFM)**1.689

C   CALCULATE ACCUMULATED BOD, BOD REMOVAL,  BOD  LOADING,  KILOWATT  HOURS,
C   AVERAGE SRT, AND AVERAGE MLSS - ALL  FOR  ONE  DAY  OF  OPERATION

  553 111=111+1
      IF( I 11-101) 690,670,670
  670 111=1
  690 Y=Y+DELY*H
      BODAIIII)=Y-BODA(III)
      XREM=XREM+DELR*H
      BODRIIII)=XREM-BODR( III )
      XLOAD=XLOAD+DELL*H
      BODL(I I I) = XLOAD-BODL(I I I )
      BKWH=BKWH+BKW*24.*H
      DKWH(III)=BKWH-DKWH(III)
      AS=AS+SRT1*H
      ASRTl MI )=AS-ASRT( III)
      AM=AM+X(5,5)*H
      AMLSSIII I )=AM-AMLSS(III )

C   PRINT PROGRAM OUTPUT

      IF(M) 500,400,500
  400 IF(T-TD) 490,420,420
  420 WRITE!10,425 ) T
  425 FORMAT(/,2X,'TIME = ",F6.2)
      WRITE(IO,435)
  435 FORMAT(2X, ' STAT ION',4X, 'MGD',6X, 'HETEROTROPHS',3X,'NITROSOMGNAS1 ,
     .  3X,'NITROBACTER',3X,'INERT SOL IDS•,5X,'TSS',12X, • DO ' ,
     .  10X,'VOLUME',/)
      DO 440 L=1,K
  440 WRITEf 10,445 ) L , Q(L) ,(X(M,L),M= 1,5 ) ,DO(L ) ,V(L )
  445 FORMAT(5X,I2,3X,E10.4,4X,F.10.4,4X,E10.4,4X,E10.4,4X,E10.4,4XT
     .  E10.4,4X,E10.4,4X,E10.4)
      DO 450 L=15,18
  450 WRITE(IO,445) L , Q(L ) , (X(M,L),M=l,5) , DO(L ) ,V(L )
      WRITE(IO,460)
  460 FORMAT( )
      WRITE!10,465)
  465 FORMATI22X,'DISSOLVED BOD',2X,'PART ICULATE  BOD• ,3X,•AMMONIA•,
     .  6X, 'NITRITE1 ,6X, 'SCFM/MG'.9X, 'HP/MG'/)
      DO 470 L=1,K
  470 WRITE!10,471) L , (S
-------
PAGE  14              TIME  DEPENDENT  MATHEMATICAL MODEL FOR ACTIVATED SLUDGE

      DO 475 L=15,18
  475 WRITE!10,471) L , (S(M,L ) ,M=1,4),CFMMG(L),HPMG(L)
      WRITE(10,485) BODA(III) ,BDDR(III),BODL(III),DKWH(III),ASRT(III),
     . AMLSSlIII),XRSS,URSS,SMUA,BOUT,FM
  485 FURMAT(9X,'BODA',6X, 'BOOR',6X,'BOOL',6X, 'DKWH',6X, ' ASRTf ,5X,
     . 'AMLSS' ,6X,'XRSS',6X,'URSS',6X,'SMUA',6X,'BOUT',8X, ' FM ' ,
     . /,5X,6F10.3,2F10.4, 3F10.3)
      WRITE(IO,486) TCFM,TA IR,AERFF,DHP,THP,PFL,PIGV,DPCFM,C1(1)
  486 FORMAT(9X,'TCFM',6X,'TA IR',5X,'AERFF•,7X,'DHP',7X,'THP',7X,
     . 'PFL',6X,'PIGV , 5X, 'DPCFM' ,5X,'C1(1)',/,5X,2F10.2,F10.3,6F10.2)
  490 M=XCALC

C   UPDATE  ALL  VARIABLES  BY  MULTIPLYING  DERIVATIVES BY  DELTA  TIME

  500 IF(IPSm) 807,807,804

  804 DO 806 1=1,4
  806 S(I,2)=S(I,2)+DELS2(I)*H
      DO 805 1=1,3
  805 X(I ,2)=X
-------
PAGE  15              TIME DEPENDENT  MATHEMATICAL  MODEL FOR ACTIVATED SLUDGE

      T = T+H
      M=M-l
      IFUC-100) 1000,895,895
  895 IC=0
 1000 CONTINUE
      CALL EXIT
      END
                                      53

-------
SAMPLE PRINTOUT FROM COMPUTER PROGRAM
0 0-1 0-2
1500.000
25.187
10.000
19.000
6840.000
1.000
530.000
18.000
29.400
20.400
13.200
17.900
28.600
29.300
27.700
30.400
30.400
30.400
131.200
118.000
110.600
86.600
80.600
114.000
120.400
114.800
122.400
148.400
34.800
30.000
28.400
18.400
18.400
31.200
35.600
35.200
29.600
23.600
27.000
18.000
21.000
24.000
22.000
30.000
39.000
34.000
35.000
41.000
43.500
37.500
35.500
23.000
23.000
39.000
44.500
44.000
37.000
29. 500
0-1
0.010
7.044
i.aoo
1250.000
5445.000



29.000
17.800
13.500
18.800
29.300
29.100
27.800
30.300
30.800
30.500-
129.600
117'. 000
111.000
83.200
82.200
116.000
119.400
115.600
123.200
150.400
34.400
30.000
28.000
16.800
18.800
32.000
35.600
34.400
28.800
23.600
26.000
19.000
21.000
24.000
22.000
31.000
38.000
34.000
35.000
42.000
43.000
37.500
35.000
21.000
23.500
40.000
44.500
43.000
36.000
29.3BO

0.000
20.000
0.900
0.010
0.105



28.600
15.200
13.800
19.700
29.400
28.900
27.900
30.300
31. 100
30.500
128.400
116.400
111 .000
78.400
85.600
117.600
118 .000
116.000
124.600
147.800
33.600
29.600
28.000
15.600
20.400
32.400
36.000
34.000
28.400
25.200
25.000
19.000
21.000
24.000
23.000
32.000
37.000
34.000
35.000
40.000
42.000
37.000
35.000
19.500
25.500
40.500
45.000
42.500
35.500
31.500

14.000
0.000
0.900
0.000
0.480



28.400
14.100
14.000
20.800
29.600
28.800
28.000
30.200
31. 100
30.500
127.200
115.400
110.400
74.800
90.000
119.200
117.000
116.400
126.400
145.600
32 .800
29-. 600
27.600
15.200
22.000
32.800
36.000
33.600
27.600
26.400
23.000
19.000
22 .000
24.000
24.000
34.000
36.000
34.000
36.000
38.000
41.000
37.000
34.500
19.000
27.500
41.000
45.000
42.000
34.500
33.000

5.000
718.000
3.500
0.350
12.000



28.000
14.000
14.300
22.100
29.800
28.600
28.200
30.200
30.800
30.500
126.000
114.400
110.800
76.400
93.800
119.800
115.600
116.800
129.800
144.000
32.000
29.600
27.200
15.600
23.200
33.200
36.400
33.200
27.200
28.000
22.000
19.000
22.000
24.000
24.000
35.000
35.000
34.000
36.000
36.000
40.000
37.000
34.000
19.500
29.000
41.500
45.500
41.500
34.000
35.000
-Ll

478.000
1.000
600.000
0.000



27.000
13.600
14.800
23.600
29.900
28.200
28.300
30.100
30.400
30.500
123.400
113.400
107.400
77.000
98.200
121.400
114.200
117.200
132.600
141.400
31.600
29.600
25.600
16.000
24.800
33.600
36.800
32.800
26.400
29.600
21.000
19.000
22.000
24.000
25.000
37.000
34.000
34.000
37.000
35.000
39.500
37.000
32.000
20.000
31.000
42.000
46.000
41.000
33.000
37.000
*ruj. ut\±t\

0.010
0.500
0.000




26.000
13.600
15.400
24.800
29.800
27.900
28.500
30.000
30. 100
30.300
122.200
112.400
104.000
77.600
102.400
121.600
113.200
119.000
136.000
138.800
30.800
29.600
24.000
16.400
25.600
34.400
36.800
32.000
26.000
31.200
20.000
20.000
23.000
23.000
26.000
38.000
34.000
34.000
38.000
33.000
38.500
37.000
30.000
20.500
32.000
43.000
46.000
40.000
32.500
39.000


0.333
1.000
0.140




25.000
13.500
15.900
26.000
29.700
27.600
29.000
30.000
30.000
30.100
120.600
111.800
99.200
79.200
105.000
123.200
113.600
119.800
138.400
137.200
30.400
29.200
22.800
16.800
28.000
34.800
36.400
31.200
25.600
32.800
19.000
20.000
23.000
23.000
26.000
40.000
34.000
34.000
39.000
32.000
38.000
36.500
28.500
21.000
35.000
43.500
45.500
39.000
32.000
41.000









24.600
13.400
16.400
26.900
29.600
27.500
29.400
29.900
30.200
29.900
120.000
111.200
94.500
79.400
108.400
122. BOO
114.000
121.200
141.200
134.600
30.000
28.800
21.500
17.600
29.600
35.200
36.000
30.800
24.800
34.400
19.000
20.000
23.000
23.000
27.000
40.000
34.000
34 .000
40.000
30.000
37.500
36.000
28.000
22.000
37.000
44.000
45.000
38.500
31.000
43.000









23.000
13.300
17.000
27. 800
29.500
27.600
29.900
30.000
30.300
29. 700
119.000
111.200
91.000
80.000
112.200
121.800
114.600
121.600
145.000
132.600
30.000
28.800
20.000
18.000
30.800
35.200
35.400
30.400
24.000
35.600
18.000
20.000
24.000
22.000
28.000
40.000
34.000
34.000
40.000
28.000
37.500
36.000
25.000
22.500
38.500
44.000
44. 500
38.000
30.000
44.500

-------
SAMPLE  PRINTOUT FROM COMPUTER-PROGRAM
             OUTPUT DATA
TIME = 14.00
STATION MGD
1 0.2970E
2 0.2970E
3 0.2970E
4 0.4170E
5 0.4170E
15 0.2955E
16 0.1400E
17 0.1200E
18 0.1200E

1
2
3
4
5
15
16
17
IS
BOOA
45^39.969
TCFM
12204.56
TIME = 14.05
STATION MGO
1 0.2800E
2 0.2800E
3 0.2800E
4 0.4000E
5 0.4000E
15 0.2786E
16 0.1400E
17 0.1200E
18 0.1200E

1.
2
3
4
5
15
16
17
18
BODA
4600.649
TCFM
11373.70
TIME = 14.10
STATION MGD

HETEROTROPHS
02 O.OOOOE 00
02 O.OOOOE 00
02 O.OOOOE 00
02 O.B868E 03
02 0.9034E 03
02 0.26906 02
00 0.30B1E 04
02 0.3081t 04
02 0.3081E 04
DISSOLVED SOD
0.1326E 03
0.1326E 03
0.1326E 03
0.9714E 02
0.9398E 01
0.9398E 01
0.9398E 01
0.939HE 01
0.9398E 01
BODR BOOL
0.260 0.539
TAIR AERFF
12204.56 0.160

HETEROTROPHS
02 O.OOOOE 00
02 O.OOOOE 00
02 O.OOOOE 00
02 0.9179E 03
02 0.9112E 03
02 0.2647E 02
00 0.3059E 04
02 0.3059E 04
02 0.3059E 04
DISSOLVED BOD
0.1260E 03
0.1260E 03
0.1260E 03
0.9069E 02
0.8332E 01
0.8332E 01
0.8332E 01
0.8332E 01
0.8332E 01
BODR BODL
0.260 0.538
TAIR AERFF
11373.70 0.160

HETEROTROPHS

NITROSOMONAS
O.OOOOE 00
O.OOOOE 00
O.OOOOE 00
0.1227E 02
0.1250E 02
0.3725E 00
0.4266E 02
0.4266E 02
0.4266E 02
PARTICULATE
0.3560E 02
0.3560E 02
0.3560E 02
0.2764E 02
0.2336E 01
0.6957E-01
0.7969E 01
0.7969E 01
0.7969E 01
DKWH
5186.571
DHP
205.81

NITROSOMONAS
O.OOOOE 00
O.OOOOE 00
O.OOOOE 00
0.1262E 02
0.1253E 02
0.3A42E 00
0.4209E 02
0.4209E 02
0.4209E 02
PARTICULATE
0.3200E 02
0.3200E 02
0.3200E 02
0.2464E 02
0.2226E 01
0.6466E-01
0.7474E 01
0.7474E 01
0.7474E 01
DKWH
5186.446
DHR
205 .81


NITROBACTER
O.OOOOE 00
O.OOOOE 00
O.OOOOE 00
0.6442E-01
0.6563E-01
0. 1954E-02
0.2238F. 00
0.2238E 00
0.2238E 00
BOD AMMONIA
0.2800E 02
0.2800E 02
0.2800E 02
0.2492E 02
0.1732E 02
0.1732E 02
0.1732E 02
0.1732E 02
0.1732E 02
ASRT AMLSS
9.093 2005.343
THP PfL
326.22 1.58

NITROBACTER
O.OOOOE 00
O.OOOOE 00
O.OCFOOE 00
0.6538E-01
0.6491E-01
0.1885E-02
0.2179E 00
0.2179E 00
0.2179E 00
BOD AMMONIA
0.2200E 02
0.2200E 02
0.2200F 02
0.2013E 02
0.1577fc 02
0.1577E 02
0.1577E 02
0.1577E 02
0.1577E 02
ASRT AMLSS
9.093 2005.226
THP PFL
308.43 1.49

NI'TRUSOMONAS NITROBACTER

INERT SOLIDS
0.4450E 02
0.4450E 02
0.4450E 02
0.1008E 04
0.9952E 03
0.2963E 02
0.3394E 04
0.3394E 04
0.3394E 04
NITRITE
O.OOOOE 00
O.OOOOE 00
O.OOOOE 00
0.4941E 01
0.1717E 02
O.L717E 02
0.1-717E 02
0.1717E 02
0.1717E 02
XKSS
0.0297
PIGV
265.90

INERT SOLIDS
0.4000E 02
0.4000E 02
0.4000E 02
0.1036E 04
0.1001E 04
0.2909E 02
0.3362E 04
0.3362E 04
0.3362E 04
NITRITE
O.OOOOE 00
O.OOOOE 00
O.OOOOE 00
0.5145E 01
0.1715E 02
0.1715E 02
0.1715E 02
0.1715E 02
0.1-715E 02
XRSS
0.0290
PIGV
236.05

INERT SOLIDS

TSS
0.8900E
0.8900E
0.8900E
0.1942E
0.19146
0.5699E
0.6529E
0.6529E
0.6529E
SCFM/MG
O.OOOOE
o.ooooe
O.OOOOE
O.OOOOE
0.1631E
O.OOOOE
O.OOOOE
O.OOOOE
O.OOOOE
URSS
3.4108
DPCFM
6840.00

TSS
0.8000E
0.8000E
O.flOOOE
0.1998E
0.1928E
0.5601E
0.6474(5
0.6474E
0.6474E
SCFM/MG
O.OOOOE
O.OOOOE
O.OOOOE
O.OOOOE
0.1520E
O.OOOOE
O.OOOOE
O.OOOOE
O.OOOOE
URSS
3.3575
DPCFM
6840.00

TSS


02
02
02
04
04
02
04
04
04

00
00
00
00
04
00
00
00
00
SMUA


0
•o
0
0
0
0
0
0
0

0
0
0
0
0
0
0
0
0

1.948
Cl (1 1
4.


02
02
02
04
04
02
04
04
04

00
00
00
00
04
00
00
00
00
SMUA

80


0
0
0
0
0
0
0
0
0

0
0
0
0
0
0
0
0
0

1.933
Cl( 1)
4.



80



00
.OOOOE 00
.OOOOE 00
.OOOOE 00
.3027E 00
.1054E 01
.1052E 01
.1052E 01
.1052E 01
.1052E 01
HP/MG
.OOOOE 00
.OOOOE 00
.OOOOE 00
.OOOOE 00
.2317E 02
.OOOOE 00
.OOOOE 00
.OOOOE 00
.OOOOE 00
BOUT
32.067



DO
.OOOOE 00
.OOOOE 00
.OOOOE 00
.3251E 00
.1073E 01
.1083E 01
. 10R3F 01
.1083E 01
.10R3E 01
HP/MG
.OOOOE 00
.OOOOE 00
.OOOOE 00
.OOOOE 00
.2317E 02
.OOOOE 00
.OOOOE 00
.OOOOE 00
.OOOOE 00
BOUT
30.633



DO


0
0
0
0
0
0
0
0
0
















0
0
0
0
0
0
0
0
0

















VOLUME
.OOOOE
.OOOOE
.OOOOE
.OOOOE
.7480E
.OOOOE
.OOOOE
.OOOOE
.OOOOE










FM
0.421



VOLUME
.OOOOE
.OOOOE
.OOOOE
.OOOCE
.7480E
.OOOOE
.OOOOE
.OOOOE
.OOOOE










FM
0.370



V-OLUME


00
00
00
00
01
00
00
00
00
















00
00
00
00
01
00
00
00
00

















-------
                              TECHNICAL REPORT DATA
                        (Please read Instructions on the reverse before completing)
1. REPORT NO.
    EPA-670/2-74-069
                         2.
                                                   3. RECIPIENT'S ACCESSION-NO.
4. TITLE AND SUBTITLE

 CONTROL SCHEMES FOR THE ACTIVATED-SLUDGE
 PROCESS
                                                   5. REPORT DATE
                                                  August  1974;  Issuing  Date
                                                  6. PERFORMING ORGANIZATION CODE
7. AUTHOR(S)

 Robert Smith  and Richard G. Eilers
                                                   8. PERFORMING ORGANIZATION REPORT NO.
9. PERFORMING ORG \NIZATION NAME AND ADDRESS
 National Environmental Research Center
 Office of Research and Development
 U.S. Environmental Protection Agency
 Cincinnati,  Ohio  45268
                                                  10. PROGRAM ELEMENT NO.
                                                  1BB043/ROAP ASC/Task 204
                                                  11. CONTRACT/GRANT NO.
12. SPONSORING AGENCY NAME AND ADDRESS
  Same as above
                                                    13. TYPE OF REPORT AND PERIOD COVERED
                                                    Inhouse
                                                    14. SPONSORING AGENCY CODE
15. SUPPLEMENTARY NOTES
16. ABSTRACT
      A new  time-dependent model  for the activated-sludge  process is
 described,  and the model is used to investigate the potential advan-
 tages associated with  a  number of control schemes.  The control schemes
 investigated by time-dependent computation include dissolved oxygen
 control,  sludge wasting  control,  and sludge  inventory control.  Quanti-
 tative benefits are  shown for some control schemes.  For  others, the
 potential advantages appear to be minimal.
17.
                            KEY WORDS AND DOCUMENT ANALYSIS
                DESCRIPTORS
                                        b.lDENTIFIERS/OPEN ENDED TERMS
                                         *Palo Alto (Calif.)
                                           wastewater plant
                                         *Dissolved oxygen
                                           control
                                         *Sludge wasting
                                           control
                                         *Sludge inventory
                                           control	
                                                              c.  cos AT i Field/Group
*Waste  treatment
*Activated"sludge process
*Mathematical models
*Time dependence
*Process  control
13B
18. DISTRIBUTION STATEMENT
                                        19. SECURITY CLASS (ThisReport)
                                            UNCLASSIFIED
                                                              21. NO. OF PAGES
                                                                    64
       RELEASE  TO PUBLIC
                                      20. SECURITY CLASS (Thispage)
                                          UNCLASSIFIED
                                                               22. PRICE
EPA Form 2220-1 (9-73)
                                      56
                                              U. S. GOVERNMENT PRINTING OFFICE: 197'i-657-58't/530'i Region No. 5-11

-------