Dynamic modelling and control applications in water quality maintenance

Dynamic modelling and control applications in water quality maintenance

Id,~.ter Research VoI. I0. pp, 5",5 to 595. Pergamon Press 1976. Printed in Great Britain. DYNAMIC MODELLING AND CONTROL APPLICATIONS IN WATER QUALIT...

2MB Sizes 0 Downloads 44 Views

Id,~.ter Research VoI. I0. pp, 5",5 to 595. Pergamon Press 1976. Printed in Great Britain.

DYNAMIC MODELLING AND CONTROL APPLICATIONS IN WATER QUALITY MAINTENANCE M. B. BECK* Control Division. University Engineering Department, Cambridge. U.K.

(Receired 4 October 1975) Abstract--The purpose of this paper is to develop and illustrate a unified, systematic approach to problems of water quality management. In order to achieve this a water quality system is defined as the following group of component features: the abstraction, purification, and supply of potable water from a river: consumer effluent, rainfall-runoff from an urban land surface, and the sewer network; the wastewater treatment plant; the river itself. A systems analysis approach to the study of the dynamic and control aspects of the system is discussed, with particular reference to the practical limitations of instrumentation and technology. In an attempt to blend the theory with the practice recent studies on the dynamic modelling and control of parts of the water quality system are reviewed. Special attention is paid to the practical application of techniques of system identification and parameter estimation. Finally, piecing together several individual results, it is possible to give a good indication of the manner in which control studies should be directed in the near future.

I. INTRODUCTION

scope and direction of recent and future developments in the area of water quality control. In doing this The application of control and systems theory to it is not our intention to confine the analysis within water quality maintenance has reached a point where any particular systems theory; rather the approach the members of that theoretical discipline have a basic appears to be intuitively useful, since it permits a understanding of the types of problem involved. One good view of the microscopic detail without losing question which arises now is whether this understandsight of the macroscopic whole. ing can be utilised to achieve the practical aims of The primary objectives of the analysis are the idenfurther development in the field. For it should be a tification and control of the dynamics of the system. matter of considerable importance that a balance is A water quality system is subject to many time-varykept between theoretical and practical progress. ing disturbances; consequently, it is very rarely the Current developments in control theory are somecase that it is in a steady state. Moreover, the design times criticised for being rather esoteric and of the system is based on the assumption that output abstracted from the real problems of industry. This product specifications will be achieved when the sysmay be so; and it is certainly true that the problems tem is brought into operation. From an understandof water management require research with a practiing of the system's dynamic responses we may implecal bias and a sound appreciation of the industry's ment an operational control such that, in spite of all technology. In the immediate future it can be anticithe input disturbances, the desired set of products is pated that any implementation of automatic control output from the process. And in order to accomplish in wastewater treatment, for example, will employ this properly it is necessary to develop mathematical relatively standard pieces of theory. Nevertheless, this models, which both represent concisely our knowobservation should not preclude considerations of the ledge of the system dynamics and are a useful means potential benefits of using newer techniques of control of evaluating control schemes before they are put into (e.g. self-tuning regulators, multivariable control) now practice. However, it is essential that any model used being developed. in this context is shown to be a reasonable description This report attempts to construct a systematic basis of the true nature of the system. for the treatment of problems of water quality mainIn Section 2 we discuss what is meant by a systems tenance in a "resource" sense. In order to bring analysis of water quality management. While it seems together all the relevant details we define a water quafeasible in theory to suggest a variety of control objeclity system which encompasses the following factors: tives, Section 2.2 outlines the physical nature of the potable water abstraction from a river, its purificasystem so that the practical constraints on the applition, and the distribution of supply to consumers; the cation of the theory may be properly understood. sewer network and urban land runoff; the wastewater And, since any theoretical proposal must be comtreatment plant; the river itself. A systems analysis promised to meet the existing levels of technology approach is proposed for the rationalisation of the and instrumentation in practice, Section 2.3 tries to formulate a framework within which solutions to the * Ernest Cook Trust research fellow in Environmental Sciences. control problems can be obtained. 575

576

~W~/ll B . B~cCK

Section 3 illustrates the systems analysis approach by reviewing some recent studies of the dynamic properties of the water quality system. A major part of the work so far has concentrated on the identification and parameter estimation of dynamic models. As Section 3.L indicates, a number of techniques are available and from these we can derive a powerful tool for solving many of the modelling problems; these methods are assessed critically from the experience of applying identification and estimation to field data (Section 3.1.3). The progress of modelling and control for each subdivision of the water quality system is then followed through various sections: Section 3.2 looks at potable abstraction, purification, and supply; Section 3.3, the effects of urban land runoff and the sewer network control; Section 3.4, the sewage treatment plant; Section 3.5 examines the models and control schemes for river water quality. In particular, certain aspects of flow modelling (see Sections 3.2.2, 3.3, and 3.5.1) and of biological process models (see Sections 3.4.1 and 3.5.2) are discussed at some length. Further, it is becoming apparent that nitrogen-bearing pollutants may have a major significance for the water quality system as a whole; this is considered briefly in Section 3.5.2. Finally, drawing together a number of individual results and observations, Section 3.6 investigates the conditions which are required for introducing a viable operational control of the water quality resource. It appears that any scheme will be strongly dependent upon the capacity for flow storage in the system, since this creates the much needed flexibility required for practical control manoeuvres.

2. A S Y S T E M S

ANALYSIS

APPROACH

Since a systems analysis approach to the problem is to be pursued in this particular discussion, it is as well to define now the boundaries of the system and the objectives to be achieved. Further, the physical nature of the system needs to be outlined, with special reference to the limitations of its instrumentation and technology. And. finally, having defined the problems, a methodology for their solution should be proposed. But, before describing the system, let us point out that water quality management is only one facet of water resources organisation in the wide sense. If we were to consider the latter and larger system as hierarchical, then we should place river quality at a secondary level and at parity with resources such as reservoirs and groundwater schemes, for example. Thus, although the quality system is artificially isolated for the convenience of the present treatment, its relationships and interactions with other parts of the resources system are significant and must be borne in mind. Some of these aspects, which are external to the central problem here, are discussed, for instance, by Page and Warn, 1974.

Rotnfatl voz .....

.~--

. . . . . . . .

Uf )on run )if

1

3

(2)

I I

I

V¢2

1 '

'



..... flow

t t

n.,.oa

I

I I I I'---I--

'

'

~

°°'

I

t2 ..... li

tll

: I IL .... A v~4 v~4 v~

..... 1

k~ J I"Y

I v34

-

L.. . . . . . . . . . . . . . . . . . .

II flow

A

Subsystems ( f ) Potable wat'er abstraction, purlfcarion, and supply network (Z) Urban land runoff and the sewer rletwork {3) Wostewoter treatment plant (4) A stretch of river

Fig. 1. The water quality system.

2.1 Definition, notation and objectives 2.1.1 Definition. Figure 1 shows the scope of the water quality system by illustrating most of the features which may occur in a typical urban area. For the purposes of a systems analysis approach four major subsystems are defined: (1) the water abstraction plant and distribution network providing potable supplies, (2) the urban land surface (i.e. rainfall runoff) and the sewer network, (3) the wastewater treatment plant, and (4) a stretch of the river. We might consider the subsystem boundaries as being drawn arbitrarily, although most fall in line with the more obvious groupings of the physical features themselves. The block representing the consumers presents some conceptual difficulties and could, alternatively, be considered as part of(l) or (2), or be defined as a separate subsystem altogether. However, it emerges that for certain reasons the definition of Fig. 1 is more convenient for this discussion. A notable assumption in Fig. 1 is the exclusion of potable water supplies from reservoirs or aquifers to the consumers. This is not necessarily a simplifying assumption, nor is it an indication of the currently preferred operating practice, but some restriction must be placed on the size and complexity of the problem definition. Even with the given system it is not difficult to postulate the more complicated situation in which several like systems (of Fig. 1) are compounded along a water course passing through highly urbanised and industrialised areas. Another point to be observed is the sequence of unit processes for wastewater treatment. The order shown, i.e. physical

Dynamic modelling and control applications in water qualit? maintenance

577

of the system's objectives, and hopefully these will be resolved as the understanding of the system improves, it is possible at this early stage to comment upon some tangible restrictions on the choice of objectives. It may appear that a specification of a desired value for v.~0. say. implies a corresponding set of reference levels for all other material fluxes into and within the system. But, if the flow of information vii: i . j = 0 . 1 . 2 , 3 . 4 , c. is followed backwards from subsystem 14) through (3) i denotes the subsystem from which the flux originates and (2) we arrive at an "'impasse" upon reaching the a n d j denotes the subsystem to which the flux passes. flux v~c to the consumers block. Thus, rather, we Where i = 0 we have external inputs to the system should fix a set-point for v~c. since the quality condiand where j = 0 we have outputs to the environment tions on water intended for human consumption are of the system. Elsewhere. each signal v,-j describes the most stringent. From this follow constraints upon v0t, output from one subsystem and the input to a con- v0,,, and v,,o where necessary, and, hence, desired nected subsystem, except for the cases i,j = c which values may be specified for the other signals. On the whole, the choice of objectives for v~c and denote respectively inputs to, and outputs from, the consumers. The vectors v~,, and v~,L represent material V,,o is not a choice between competing demands: the fluxes which are intermittent overflows from the sewer abstraction of water for potable supply implies a network and wastewater treatment plant caused by clean river; and a clean river is potentially a source excessive loads on these subsystems during storm of potable supply. Competition for resources is introduced by the use of the river as a supplier of potable weather conditions. 2.1.3 Operational objectit,es. Under the assumptions water and a receiver of effluent discharge. Such comthat design considerations are not to be tackled here, petition arises when there are two water quality systhe objectives in the problem definition concern the tems (as defined by Fig. 1) adjacent to each other operational aspects of an existing system. Loosely along the river. This can occur quite often in practice speaking, this divides into the two categories of pre- and Fig. 2 shows, in simplified form, why it is so scribing objectives for the system's external inputs important to improve the operation of the water quaand outputs, and objectives for the endogenous vari- lity system. We now see the convenience of treating ables (i,j # 0) between individual subsystems. It is not the consumers block as separate in concept from any necessary to formalise these latter objectives for oper- of the subsystems: Fig. 2 also illuminates the preferational control since they conform to a fairly standard ence for specifying a set-point for vtc as the key objecpattern for each subsystem and are largely self-evi- tive of the system. Thus, Fig. I, being the basis for dent. Simply, we may desire that each material flux the discussion of the water quality system, represents vii (i,j ~ 0) is to be regulated according to the a more logical grouping of the physical characterdemands of the two subsystems connected by that istics, while Fig. 2 is a more logical schematic for flux. Then, in an ideal situation, the subsystems' the information flow and input-output control objecobjectives might be governed by the overall system's tives for the system(s). Neither is the better represencriteria of maximising the amenity value and quality tation of the system; they should be considered as of the river, maximising the utility of the solids complementary. Given the suggested hierarchy of reference level wastes, V3o, for agricultural fertiliser and land reclamation, minimising the overflows v~,4 and v],,, and choices in the system, the output of solids wastes V3o meeting all (future) demands for potable supplies v~c. can only be considered as a by-product of the main Now, while these kinds of objectives are all creditable goals towards Which practical innovations may WaterQuality Waterauality system( I ) system(2) advance, they are clearly not all mutually attainable. Furthermore, it is very difficult to formulate and ~ V l COnsumers (out!out] optimise an appropriate mathematical cost-benefit c function. For instance, the specification of suitable quality standards for the river, that is to say values I Subsyste~m Subsystem I SubsystemI (f) for the set-points of %.,, V,~o,is by no means straight(2) (3) forward; and, since such set-points would be combinations of minimum or maximum tolerable levels of quality indices, the cost function may need to be more complex than a simple quadratic form. In other words, the term "tolerable" must be defined quantitatl Subsystem t ' ively and thence control effort should be conserved (4) under the satisfaction of a multitude of inequality River constraints specified in the set-points. But, leaving aside the more controversial aspects Fig. 2. Competition for the quality resources of a river.

treatment (PT) followed by biolo~cal treatment (BT) and final chemical treatment (CT). illustrates merely the general component features of the total treatment. 2.1.2 Notation. The notation applied to the schematic refers to vectors comprising flow and a number of concentration variables which describe the material fluxes through the system. According to the following,

57~

M . B . BECK

process. And. in any event, there would be a limited flexibility within which its utility value could be maximised. On the other hand. it is rarely publicised that the abstraction Vot and the discharge v3,, must be consistent with the maintenance of a minimum flow in the reach of river, especially during the summer period. This kind of restriction may well affect decisions on the quantity and quality of the potable supply. vt¢, and any hierarchy of set-points subordinate to that choice, 2.2 The physical tzature, iJ~strumoltation, and technology of the system Whatever the proposals and schemes brought to mind by the foregoing it is now necessary to temper them with the hard constraints of practicality. These constraints are partly a function of a limited instrumentation and technology available for process control. and partly a function of the physical nature of the system. 2.2.1 Physical nature. Let us expand first upon what is meant by the physical nature of the water quality system. Each material flux into, through, or out of the system is described by a vector composed of the variables flow and quality; it is almost certain that the set of quality variables which have some significance for the system dynamics is prohibitively large. Indeed, the complete description of water quality covers a multitude of characteristics ranging from physical properties through inorganic and organic chemicals to living micro-organisms. Moreover, the inputs to the system, rot, Vo,~, %., are stochastic and often not predictable, let alone controllable, since they are strongly dependent upon the caprice of the weather. In essence, we have a system which (i) receives a raw material of widely varying character and whose perturbations with time are generally poorly quantified, (ii) employs a very heterogeneous collection of physical, chemical, and biological processes, and (iii) contains a number of fundamental process units whose successful operation is quite sensitive to trace elements of "'impurity". Characteristic (iii) is particularly relevant to the biological stages of wastewater treatment and to the purification of water for potable supply. But above all these considerations there is one point which cannot be emphasised too strongly: the water quality system must produce an acceptable output product independently of the raw input material dynamics; and, in some senses, the market of demand for the output product, V4o, is not well understood in economic and mathematical terms. 2.2.2 Instrumentation. While an improved system design can do much to alleviate the problems of maintaining product specifications, there is no * Notice that a sewer network design, subsystem (2), may take into account a statistical consideration of the transient excess sewer flows resulting from rainfall-runoff, although this cannot cater for all the effects of the more infrequent, heavy storm events.

guarantee that the ob',iously time-varying inputs will allow efficient operation at the steady states on which that design is based*. However. given an understanding of the dynamical responses of the system, we can innovate automatic control to bring about a desirable operation at the steady state or reference point. And a crucial factor in the implementation of automatic control is the availability of reliable, robust, and sensitive on-line instrumentation at reasonable costs. The current focus of attention on environmental technology is broadening the scope of commercial probes and instruments available for on-line operation. Nevertheless. there continue to be difficulties in developing the techniques required for direct access to. or correlative measures of, some of the most important biochemical and biological variables. These problems are compounded by the hostile environment in which sensors are fouled rapidly and require frequent calibration, cleaning, and maintenance. In addition, the instruments must be sensitive to minute changes in the concentrations of dissolved and suspended substances. Contrary to popular belief, sewage is only slightly contaminated water: in fact, normal domestic waste water is 99.9'~, water with major contaminant levels of between 5--700 mg 1-t (ppm), and for potable water supply we may expect to be dealing with impurity concentrations of the order of fractions o f a mgl - t 2.2.3 Tectmology. Although the treatment technology need remove only small amounts of contaminants, it is clear that this technology has to reduce low concentrations to very low concentrations. This suggests, perhaps, a high level of technology, yet there is a general lack of automatic control and there are very few installations of process computers. Where this equipment exists it is restricted to data-logging activity and to one or two local controllers, which by no means represent an entire unit process control. But, if this seems to be a condemnation, there are mitigating circumstances: for the system as a whole the retrieval of data, and hence the implementation of control, is severely hampered by the large distances over which any information must be transmitted. It is unfair to blame the industry itself for the inadequacies we find today; they are a function of a situation which has seemed plausible in the past. Simply, it is this: with low operational costs and a lack of satisfying profit margins on the output product there has been no incentive to invest money in forcing the system design to work efficiently. Now, with the projected increasing use of impure river water for potable supply and stricter controls on the discharge of effluent, the prevailing economic environment of water quality systems is changing. And it will require a better technology for the provision of a market commodity whose potential for supply must be exploited fully to meet the demand. 2.3 Towards a solution The complexity of the system is massive and many

Dynamic modelling and control applications in water quality maintenance

579

of the objectives to be achieved are poorly posed and vague. What. then. is the philosophy of approach and how should we use the techniques at our disposal'? For the present, solutions to the problems must be approached piecemeal and in an an f,oc manner: a manner in which we can focus on individual problems of technological innovation, yet coordinate solutions not only to improve the overall operating practice. but also to update the precision and coherence of the objectives. The methodology adopted here has evolved from a deliberate attempt to tackle welldefined, and frequently small-scale, problems in the area. From the individual details it has become evident that an integrated framework should be constructed for the direction of further projects. The following is a brief introduction to the systems analysis approach in the water quality system; we shall attempt to illustrate the approach by giving examples of recent studies on the modelling and control of various parts of the system (Section 3). The initial major task of a systems analysis is the derivation of a better understanding of the system and the unit process dytlamics: similarly, we require a more precise description and forecasting procedure for the time-variations of the system and subsystem inputs. Consequently, we are only interested in the steady-state characteristics of the system in so much as they define suitable, and possibly optimal, reference levels for operation. Our preoccupation with dynamic models can, therefore, be explained as follows: a knowledge of the process dynamics permits (i) the control of the input disturbances to bring the process outputs to the desired reference values, or (ii) the smooth transfer of an operation between deliberate changes of set-point. A superficial glance at the water quality system leaves one with the impression that its design is quite "'stiff". i.e, there is little room for control manoeuvres within the system which can deal with the central problem of producing an acceptable output, given the large variations in the input. The modelling and control exercise, therefore, should be able to discover, or create, the flexibility necessary for attenuating the effects of uncontrollable disturbances of the system, especially those of rainfall and diurnal oscillations. Two options are available: either (i) the flow component of the fluxes v~ is manipulated, or (ii) we control the quality components of v~. Of these the former offers the more immediate likelihood of success, since it depends upon the utilisation of all potential storage facilities within the system. Further, although it is rather more dependent upon advances in the fundamental treatment technologies, the second option is notably dependent on the first option. This follows from the fact that each unit process tends to be characterised by transportation delay or continuous stirred tank reactor (CSTR) elements, whose dyna-

mics are a function of flow-rate. Thus. to summarise. by operating on the flow in the system we can both control the gross volumetric loading rate of the system and adjust the parameters which characterise many of the unit process dynamics. Fortunately, the importance of flow-rate information is reflected in the general availability of this kind of data. There is also on-line measurement of some quality indices, e.g. temperature, dissolved oxygen concentration, pH, conductivity, and turbidity, to name the more common. These may represent only a few of the relevant variables for a thorough systems analysis, but they are a starting point from which a system model can be built block by block. Accordingly, studies may be confined, in the first instance, to single loop controllers, since these problems are small-scale and any results can be quickly evaluated in practice. And, in general, the limitations of the instrumentation also require that, where the subsystem or process inputs cannot be disturbed artificially, the model identification procedure is restricted to the analysis of normal operating records*. But the important point is that the relevance of the individual result may be minimal unless it can be seen from the perspective of an analysis which tackles the water quality system on a broad front. Indeed, the ability to focus on the individual without blurring the image of the whole is the essence of a systems analysis approach,

* Doubtless an advantage in the present economic circumstances, since the research costs of planned experiment, or laboratory/pilot plant construction, can be avoided.

3.1 System identification and parameter estimation

3. SO,ME RECENT STUDIES OF THE DYNAMIC WATER QUALITY SYSTEM Perhaps the best way of illustrating the techniques at our disposal for solving the problems of the water quality system is to review some of the more recent results in this area. It is not intended that the review should represent an exhaustive survey of the literature. Rather it is an expression of how a control engineer would apply his expertise to a dynamic analysis of a system; how he must choose between theoretical complexity and practical expedience; and how he is concerned with making a process behave more effectively through the innovation of automation. Whereas the control engineer has been traditionally associated with the chemical process industries, electrical systems, aeronautics, and astronautics, for example, it is only of recent (primarily during the past five years) that he has turned his attention to the water resources field. Consequently, he finds considerable possibilities for the application of what, to him, are fairly standard techniques of analysis and synthesis. At the same time, however, it is becoming apparent that the control engineer will need to adapt some of these techniques to meet the special requirements of the water quality system (Beck, 1976b). It is also apparent that he must continue to learn more about the basic nature of water quality management.

The bulk of the work so far has concentrated on

580

M. B, BECK

the problem of model building and it is in the area of dynamic models where the literature has continued to be sadly lacking. For it is not always appropriate to use steady-state models in control system synthesis. nor is it good enough to use dynamic models which have not been verified against field data. And, as should be clear by now, data on the water quality system are at a premium. It is important, therefore. to discuss briefly the techniques of system identification and parameter estimation which have proved to be so useful in constructing the models. The field of systems identification has developed rapidly over the past decade. Much of the large body of literature on the subject suggests a multitude of methods for solving a multitude of problems; however. this is only a superficial impression, since, in effect, very similar methodologies are being proposed to attack the same central questions. Yet, despite the attention it has received, a theory which unifies the field of identification and estimation is still absent. And, although we can see its emergence in a review paper by Astrt~'n and Eykhoff (1971), it is difficult to judge how long the theory will take to materialise. Meanwhile, and for our purposes here, it suffices to outline a framework within which many of the modelling aspects of the water quality system can be treated with a fair chance of success. The concepts and techniques presented are an aggregate of those which have been applied to the analysis of field data and any comments made on them are based upon practical experience rather than theoretical considerations. In view of this it is preferable to give an insight into the subject of system identification without the confusion that might result from a discussion of some of the thorny problems of a more theoretical nature. Wherever possible, therefore, we have not introduced topics such as the convergence properties of the parameter estimates, the removal of bias on the estimates, the quantification of noise statistics, and nonlinearities in the model, to name but a few. Broadly speaking, the modelling exercise, as it applies to the analysis of real data, divides into two stages: (a) identification, (b) parameter estimation. At the identification stage the causal relationships between the inputs and outputs, together with the order and structure, of the model are defined. The separation of the identification and estimation stages is essentially one of concept. Identification is often carried out with a parameter estimation scheme in which the analyst is more concerned with assessing the adequacy of the model structure than with estimating the parameters accurately. It is at this stage where the analyst's own understanding of the physical system is fully exploited in the interpretation of the results. For. despite the attempts to put the identifica* Subject to all the a priori information available to the analyst.

tion stage on a firm mathematical basis, the choice of the final model structure remains very much an art*. Once the model structure is identified the parameters of that model are estimated according to any one of a number of procedures which fall into the two categories of: (a) off-line methods. (b) recursive (or on-line) methods. By off-line we mean the estimation of parameters by repeated updating of the estimates after each iteration through a given block of N data samples, whereas the recursive methods adapt the estimates at each sampling instant k (where k = 1, 2. . . . . N) within that set of N sampled observations. There has been considerable debate over the relative merits and demerits of off-line (or block data processing) and of recursive approaches to parameter estimation. Judging by the literature it would appear that the former has received the more popular acclaim, although the recursive approaches can offer the added insight into possible variations of the parameters with time and they require a smaller computational effort in the treatment of the data. These benefits, however, are gained for the loss of some statistical efficiency and of many of the theoretical proofs for convergence. The crucial point in an applications context is that, while being cognizant of these considerations, some of the statistical efficiency of the estimation procedure can afford to be lost without undue damage to the validity and viability of the model. And, in any case, whether estimation schemes are recursive or off-line, each can still yield its own piece of information about the nature of the system's dynamics. Thus, if we are concerned only with the class of parametric models, there are two choices as to how the system is to be viewed in terms of the model. 3.1.1 Black box or input-output models. The first of these choices is a black box or input-output model given by the linear difference equation,

y(k) = ,=t

a(z-')

u,(k) +

D(z- l)

e(k)

(I)

in which u,(k), i = 1, 2 . . . . . m, and ~k) are respectively the observations of the multiple (m) system inputs and the system output at the kth sampling instant; e(k) is a sequence of independent, normal (0,).2) random variables and z - t is the backward shift operator, i.e. z - t [)~k)} = g k - 1) etc. A ( z - 1), Bi(z- t), C(z- t),and D(z- x) are the polynomials,

with the parameters a, b, c, d, to be estimated, A ( z - t ) = 1 + a t z ~ t + . . . + anz-n ] B~Z - t ) = bio + b n z - I + . . . + bi,z-";

i - - 1,2 . . . . . m C(z - t ) = 1 + c t z -~ + . . . + c . z - " D(z-t)=

1 + dtz-t + ... + d.z-.

(2)

D,,namic modelling and control applications in water quality maintenance The essential feature of this t.vpe of model is that it assumes no knowledge of physical or internal relationships between the system's inputs and output other than that the inputs should produce observable responses in the output. In other words, it is a timeseries model in which the prediction of the output is a function of previous observations of that output and the inputs ui. together with past realisations of the "'lumped" stochastic noise sequence e. i.e. factors arising from measurement error and random disturbances of the system. The use of the model is particularly advantageous when the a priori information on the physical phenomena governing the system dynamics is minimal: in this case the black box is literally a fair reflection of our knowledge of the system and the model is a first attempt at elucidating any observed dynamical relationships. Alternatively, where a mechanistic, or internally descriptive, model (see below) is available, but its form is so complex that it requires the characterisation of many parameters from an insufficient number of data, an input-output model can yield equally useful results in forecasting or control system synthesis applications. The limitations of the model are that it is not, generally. a t, niversal description of a system's dynamics, being specific to the sample data set from which it is derived, and it is not necessarily amenable to interpretations on the physical nature of the system*. But, most significantly, the model of equation (1) is restricted to a single output system: we shall discuss this feature later. Equation (1). therefore, is the general form of a multiple input/single output black box model. The identification stage of the modelling procedure consists of defining the basic cause-effect relationships in the system and this is usually implicit in the choice of the inputs u, or it may be governed simply by the number of variables u~ which are available for measurement. Secondly, the order of the polynomials of equation (1) must be decided. While there exist some fairly rigorous tests of a suitable value for n'J', the identification as such tends to be only weakly differentiated from the parameter estimation phase of the analysis. For instance, having substituted a set of parameter estimates for the polynomials of equation (2), say ,,i(z-t), /~;(z-t), t~(z-~), and /)(z-t), the computation of the residuals sequence e(k), where from (1)

e(k)= ~

"(k)-

ui(k)

(3)

* There are. however, many examples where such interpretations are possible, although they should always be treated with caution. t e.g. (a) correlation analysis, or (b) statistical tests which indicate whether an increase in the model order n gives a correspondingly significant (within certain confidence bounds) increase in the ability of the model to describe the observed dynamical variations.

581

can be used to check the statistical assumptions of the model. These assumptions concern the independence of etkJ and the normality of its distribution. The statistical checks may then reveal inadequacies in the order n of the model an& particularly, those inadequacies which relate to the structure, i.e. the C(z-I). 1)(z-l) polynomials, of the noise process affecting the system. Indeed. many of the estimation techniques have evolved from an effort to tackle the fundamental problems of characterising the noise component of the model, i.e.

D(z- l)

~(k) = - etk) C(z- ~)

(4)

when C(z-l) va A(z-t), and O ( z - 1 ) # 1. for which case the simple least squares approach gives biased estimates. 3.1.2 Mechanistic or internally descriptive models. The second choice for a model structure exploits much more. if not all. of the available a priori information on the physieo-chemical, or bioloDeal phenomena governing the system's dynamics. We have, therefore, the following continuous-time representation of the linear, state-space, mechanistic mode[ /~(t) = Ax(t) + Bu(t) + Dw(t)

(5)

in which the dot notation refers to differentiation with respect to time t, x is the n-dimensional state vector. u is an m-dimensional vector of deterministic inputs or forcing functions, and w is a p-dimensional vector of zero-mean "white" noise disturbances of the system. A, B, and D are respectively n x n, n x m, and n x p matrices containing the parameters that characterise the system. In addition, consider that we have the set of q noisy, sampled observations ~k) of the outputs of the system given by y(k) = Cx(k) + tl(k )

(6)

at the instant of time k, where C is a q x n observation matrix and q is a vector of zero-mean, independent measurement error sequences. Equations (5) and (6) constitute the so-called continuous-discrete version of the state-space model with continuous-time dynamics and discrete-time observations; discrete-time transformations of (5) and continuous-time representations of (6) exist such that we have the alternative continuous and discrete versions of the model. The advantages of using this type of model are that it can give considerable insight into the physical nature of the system's dynamics and it has a greater potential for universal application than the black box model. In addition, it is not restricted to a single output system and, at the same time, the noisy environment of the process is defined more closely by the separation of stochastic system disturbances w(t) from the output measurement errors r/(k). However, these latter advantages lead to difficulties in the operation of the corresponding estimation and identification procedures, since the statistics of the

582

M.B. BECK

noise processes must usually be specified a priori, for which several assumptions have to be made. Again. the identification and estimation stages are not always clearly distinguished from each other. One particular problem of identification is the adaptation of the model structure, generally specified by the choice of x. and the non-zero elements of ,4 and B, when the a priori information is not borne out by the observed variations in the data from the system. In addition, especially with respect to biological and biochemical processes, it is not a trivial problem to develop tractable mathematical expressions which both describe the "'anomalous" behaviour of the system and do not distort the laws thought to govern such mechanisms. Final assessment of the model's viability is largely a matter of checking the statistics of various types of prediction error sequences when the model is used with the set of estimates ,i, /~. C, /5. say, substituted for the matrices of equations (5 and 6). 3.1.3 Methods of identificotion and parameter estimation. The procedures for identification/estimation and the model structures outlined above give an introduction to the type of problem that confronts the dynamic systems analyst. However, it does not indicate any of the methods which it might be desirable to use. For a good introductory review of the whole field the reader is referred to Astrrm and Eykhoff (1971) and, in more detail, to Eykhoff(1974). Alternatively, a concise and clear exposition of recursive approaches to time-series analysis is given in two papers by Young (1974) and Young and Whitehead (1975). Further, and of particular importance to the application of the theory, Gustavsson (1973) surveys the practical aspects of experimental preparation for systems identification. More specifically, the techniques which have been applied to the water quality system are listed as follows. (a) For black box models. (i) Least squares (LS) (Astr6m and Eykhoff, 1971). (ii) Recursive least squares (RLS) (Young, 1974). (iii) Maximum likelihood (MLll (/kstr6m and Bohlin, 1965). (iv) (Recursire) Instrumental variable--approximate maximum likelihood (IVAML) (Young, 1974). (b) For internally descriptice models. (i) (Recursive) Extended Kalman filter (EKF) (Beck and Young, 1976). (ii) Maximum likelihood (ML2) (Astrtim and Eykhoff, 1971). (iii)IRecursive) Multivariable extension to IVAML (MIVAML) (Young and Whitehead, 1975). This ensemble of techniques represents a powerful tool for the identification and modelling of a system's d wtamics. * From the Division of Automatic Control, Lund Institute of Technology, Sweden. t From the Control Engineering Group. University Engineering Department. Cambridge. U.K.

While it is quite unnecessary to qualify their individual utility values, it is instructive to enlarge upon how and where each scheme might be used to the best advantage. For instance, given a black box model structure and assuming the vector of parameter estimates /J = 0, say. i.e. to all intents and purposes nothing is known about the parameter values, both the least squares methods provide approximate estimates which can then be refined by an MLI or IVAML scheme. The simple LS and RLS algorithms require a very strong, and, in practice, generally erroneous, assumption about the noisy process environment [see equation (4)]. In spite of this, the biased estimates thus obtained are a good starting point for the more sophisticated MLI and IVAML routines which embody a more realistic description of the lumped noise statistics. In that sense the MLI algorithms treat the parameters of the system and noise dynamics simultaneously, while the IVAML approach estimates the basic (and deterministic) process parameters, the AIz- t) and B(z- t) polynomials, using the IV algorithms, and then constructs the noisy environment model. C(:- t) and D(z- ~), with an AML procedu re. Generally, the synthesis of a black box model is more straightforward than that of a mechanistic model, Indeed, this is reflected by the degree of sophistication to which the methodology has progressed: much effort can be avoided by the use of interactive program packages designed specifically for system identification/estimation. Two such packages have been used extensively here: (i) the IDPAC (Identification Package) suite of programs (Gustavsson, 1969; Gustavsson, Selander and Wieslander, 1973)* employs off-line routines based on LS and MLI methods, whereas (ii) the CAPTAIN (Computer Aided Procedure for Time-series Analysis and Identification of Noisy processes) package (Shellswell, 1972; Young. Shellswell and Neethling, 1971)'I" utilises the recursive least squares and IVAML algorithms. Both approaches are accompanied by techniques of correlation analysis for model order identification and routines for making statistical checks on the validity of the model, For the internally descriptive model the EKF is, perhaps, best suited to a purely identification phase, since the very flexibility which lends itself to this part of the analysis is a considerable drawback in the parameter estimation phase. We may note that the EKF algorithms are notoriously sensitive to a good choice of initial parameter estimates and to the quantification (usually subjective) of the statistical properties of the noise processes w and q in equation (5). It is common sense, therefore, to test the general validity of the model by a deterministic simulation comparison with the experimental data; even if the a priori model structure is inadequate, this can provide crude measures of the parameter magnitudes required for initialising the E K F algorithms. The real value of the EKF lies in its ability to illuminate any time-varia-

Dynamic modelling and control applications in water quality maintenance tions in the parameters which are not consistent with the (assumed) dynamics of the system. The point here is that one should attempt, where possible, to eliminate such parameter variations by describing them in terms of additional, deterministic, causal relationships within the system. Following the identification stage, the less "~flexible" ML2 and MIVAML routines tackle the estimation problem by constraining the observed variations in the data to a rigid, mechanistic model structure. Both procedures can circumvent some of the difficulties associated with specifying the noise statistics of w and q a priori, although MIVAML seems to achieve this more easily. It may occur that the estimation of the noise statistics does not enhance the performance of the ML2 algorithms in the simultaneous estimation of the parameters: furthermore, the method requires considerable computational effort. On the other hand. MIVAML is equally sophisticated in its own way and is computationally less burdensome. Being similar to IVAML in its approach. MIVAML is an interesting combination of the methods for both the internally descriptive and the black box models, although the full implications of this are beyond the scope of the present discussion. Notice, however, that the discretetime form of the state-space equations, which are utilised in MIVAML, preserve the all-important couplings and causal relationships between the system's inputs and outputs; we assume that these relationships have already been identified for the mechanistic model of equation (5). The vexed question of specifying a suitable canonical form for a vector-matrix difference equation, a problem which is characteristic of the alternative multivariate black box approach, is thus avoided. The one possible drawback of the MIVAML procedure is that it may present some intellectual hurdles in referring the interpretations of the parameters in a discrete-time, state-space model back to the physical system: it is usual for most natural systems to be visualised in continuous-time terminology. It would be inappropriate to suggest that the ensemble of methods that we have given is a panacea for the model builder. Thus, in concluding the discussion on system identification/estimation, it is worthwhile to pass one or two messages of caution. There is no hard and fast rule which governs the procedure of system identification and parameter estimation; our framework here is merely a heuristic methodology drawn from a practical experience of the various techniques. All models of a physical system are approximations to the truth and, consequently, any values estimated for parameters are a function of these approximations. By this we mean that, if a parameter has a physical interpretation, then it is only realistic to compare estimates and interpretations of that parameter with respect to identical model structures. Indeed, the interpretation and viability of mathematical models in general is a provocative issue which causes much fervent, and often polarised, argu-

583

ment between systems analysts and members of the physical sciences disciplines. It is clear that there is room for improved communication from both sides, particularly in the translation of biological theory or empirical evidence into a tractable mathematical form. Yet the scepticism that surrounds the mathematical model is understandable, for control theory as such pays no particular attention to the physical nature of a system. Unfortunately. this ~tct that equations can seem divorced from reality may lead to abuse of the models. Conversely. black box models, which are not derived from any laws of physical phenomena and are thereb? often much maligned. may have a leading role to play in studies of biological process behaviour (Beck. 1976b). 3.2 Subsystem l--the potable water purification plant and supply distribtttion network For a potable supply the raw water abstracted from the river passes through a number of treatment stages in the purification plant: these include sedimentation, coagulation, rapid and slow sand filtration, ozonisation and chlorination. Prior to the plant the water may be impounded in a reservoir, which, in itself, attenuates most of the dynamic variations in the flux rot and, at the same time, achieves some purification by reducing the turbidity and bacterial content of the water. The processes of sedimentation and coagulation remove any larger suspended particles and. with the additional filtration, the turbidity is progressively lowered to an acceptable level. Rapid sand filtration also aids the removal of colour, tastes, odours, iron. and manganese. The slow sand filtration is more efficient in the removal of disease-carrying bacteria and, together with ozonisation and chlorination, completes the process of disinfecting the water for potable supply. It is not easy to make a general statement on that quality of the supply vie which is considered fit for human consumption. Now, while this does not imply a lack of control objectives for the subsystem, it usually implies a fairly good river water quality vo~ at the abstraction point. Consequently. the level of technology for a water purification plant is well suited to the treatment of an unpolluted water, but it could be grossly overloaded where future demands for water supply may require the exploitation of moderately polluted rivers (see Section 3.5.11. Any imposition of heavier loads on existing or new plants should, therefore, create a more urgent need for the wide-scale application of automatic, on-line control. For it is not apparent from the literature that the dynamic modelling and control of water abstraction facilities has received much attention at all. Clearly, the control of the plant is closely allied to that of the distribution network and. of all the subsystems in the water quality system, subsystem (1) is probably the most flexible in view of the considerable storage capacity inherent in its design. Thus, the

584

M.B. BtcK

problems of control for subsystem (1) are. in two senses, significantly different from those existing in other subsystems: firstly, the presence of a storage lake at the input effectively damps out many of the input disturbances %1, and. secondly, the output demand must satisfy the continually time-varying daily and aeekly habits of the consumer population. That is to say. we are concerned with operating the process so that there is a smooth transition in the output which follows a time-variable quantitative, if not qualitative, set-point on the si~maal vtc. 3.2.1 Purification plant control. One of the few people currently working on control system synthesis for the purification plant is Klinck (1973a; 1973b; 1974; 1975). Surprisingly, perhaps, the results of his simulation studies show a noticeable absence of any control of quality variables. It would appear, therefore. that the integrated operation of the various processes, being consistent with changes in the desired volumetric q,Jantity of the output, is dominated by flow and level control loops, with special consideration given to the transient start-up problem of the rapid sand filter section (Klinck, 1973b)*. Significantly, Klinck establishes that the control of the overall plant is sensitive to the control of the slow sand filters (Klinck, 1975). This is interesting because the action of the slow sand filters is governed by the growth of slimes of micro-organisms in the filter bed; these micro-organisms play an important role in the efficient removal of organic matter from the water. Although there is no evidence to suggest that the process of slow sand filtration is strongly dependent upon the stability of the micro-organism population, such factors may become important for the treatment of a more impure abstraction of river water. And the nature of that kind of problem, possibly coupled with the activity of an algal population in a storage reservoir, would bear a close resemblance to similar problems of a biological nature in the sewage treatment plant and the river {see Sections 3.4.1 and 3.5.2). We may also note that it is quite costly to remove nitrate contamination from a potable water: indeed, for the control of the whole water quality system the control of this form of pollution may become very significant [see Section 3.5.2). 3.2.2 Disrributio~z network control. It is not generally the rule that the technology of the water quality system favours the application of the sophisticated control scheme. A hierarchical strategy for the on-line control of a water supply distribution network, as proposed by Fallside and Perry (1975), is, therefore,

* This is necessary because of a regular cleaning procedure, e.g. once per day, which backwashes the filter. ? i.e. the orders of n, m, and q of equation (5). **The EKF algorithms (see Section 3.1.3) are similar, but evolve from this linear Kalman filter for the case where both the state and the parameters of the system description are estimated simultaneously.

a notable exception to the rule. Indeed. their control strategy is none the less remarkable for the fact that it has been implemented in practice for the East Worcestershire Waterworks Company. A generalised model is developed for the dynamic behaviour of a water suppl~ network from the viewpoint of modern controL theory {Fallside et al.. 1975): the model is formulated in terms of state-space equations, as given by equation (5). This model is then used in an off-line manner in order to synthesise and evaluate the form of an optimal control law. Since the dimensionalityt associated with the characterisation of the dynamic state of the system, e.g. flows, pressures, etc., is large, it is conceptually and computationally easier to decompose the control problem into a number of hierarchical levels (Fallside and Perry, 1975). Now, for such an optimising multilevel control, it is further required that the dynamics of the output consumer demand vtc are known completely for each time-interval of operation, over which the performance/cost index is to be minimised. In order to acquire this knowledge, and, thus, to implement the on-line control of a distribution network, an on-line prediction, or forecast, must be made for the volumetric flow component of vtc (Fallside, Perry and Rice, 1975). This can be achieved in two ways: either by using a black box model for the dynamics of vtc; or by a spectral expansion technique. The first of the two methods is closely related both to the system identification and parameter estimation procedures of Section 3.1 and to the adaptive predictor problem for urban sewer flows (Section 3.3). In the black box formulation the deterministic daily and weekly periodic patterns of the consumer demand are modelled separately from those which arise from a residual stochastic noise sequence. This latter component is modelled in a time-series black box form, of the type given by equation (I); a prediction of vlc is then made on the basis of a discrete-time version of the Kalman filter-predictor algorithms++. The estimation of the model parameters is treated in an offline manner which repeatedly adapts the model to relatively slow trends in the output demand dynamics. In other words, the predictor is not adaptive in quite the same sense as that of the urban sewer flow predictor, which treats the parameter estimation as recursive and on-line (Beck, 1976a). The salient features of Fallside and Perry's collaborative project with the East Worcestershire Waterworks Company are not restricted to the details outlined above. More than anything else, perhaps, the value of modern control theory has been demonstrated in an application to the water quality system. However, even this might not have been possible if it were not for two key factors: collaboration, i.e. a good communication between theory and practice; and a computer-based monitoring facility, i.e. a refreshing absence of the debilitating problem of data retrieval, which is so typical in other parts of the water quality system.

Dynamic modelling and control applications in water quality maintenance 3.3 Subsystem 2--urban land runoff and the sewer network Not unnaturally, the problems of sewer network modelling and control are similar to those of the potable supply distribution network. In concept, however. subsystem (1) takes a point source input and distributes it to a number of spatially separated output locations, whereas subsystem (2) is the exact mirror image process. Besides this there are other less obvious differences in the input-output dynamics and control objectives of subsystem (2). Consider the input simaal v~2 which, apart from the diversion of direct discharges to the river by some industrial users, may be expected to display time-variations of a sinusoidal nature. Now suppose that for the operation of subsystem (3). and indirectly subsystem (4), it is desirable to minimise the deviation of the effluent from the sewer network, v2a. about some fixed set-point*. The control problem for subsystem (2), with respect to the spatially distributed inputs vc2 and the single output v23. is one of manipulating the process dynamics to attenuate any input time-variations and, thus, to produce an effectively steady output: In this sense too, then. we have a reversal of the control objectives for the supply distribution network. However, the nature of the sewer network is further complicated by two significant factors: its design is superficially, at least, much less flexible than that of the supply distribution network, since it has very little buih-in storage capacity; secondly, the effects of urban land runoff from the stochastic rainfall input %2 can override the importance of controlling the (deterministic) input vc2. The runoff produces a large transient disturbance in the system which, in view of its increasing pollution of rivers, should not be controlled by allowing the intermittent discharges of the overflows v~4 and v~4. In order to alleviate some of the disruptive aspects of urban runoff from storms, the prediction of the dynamic variations of such excessive loads on the sewer system has been studied widely. However, nearly all the models are large and unwieldy, since, if the3' are of the internally descriptive type [equation (5)], they must consider a multitude of complex properties pertaining to the surface topography and cover, e.g, asphalt, turf, etc. And it has been stated previously that there are often considerable difficulties in estimating the parameters which characterise a large model of this form. In addition, the routing of flows across the sewer network can involve an equally complicated model when the problem is treated in the traditional manner with partial differential equations in the variables of depth and flow velocity. Yet despite this complexity, it has been possible to implement control schemes for sewers in the cities of Cleve* For the time being this seems reasonable, although it may emerge that the treatment process can cope with, and even exploit, a continuously time.varying input v23 (see Section 3.6).

585

land (Pew et al.. 1973) and Seattle (Leiser. 1974). although the alternative generalised lumped-parameter model and hierarchical approach, as suggested for the distribution network, would seem to have attractive potential. But by now it should be apparent that what may really be required for certain control and forecasting objectives is a much simpler conception of the subsystem as a black box. In fact. this kind of input/output view of urban runoff/sewer effluent relationships is analogous to models for the prediction of river flows (see Section 3.5.1) and it seems appropriate to adopt the approach here. The results of a time-series model for the flow in a sewer network are reported fully by Beck (1976a); the pertinent details of this study are as follows. A maximum likelihood (ML1) procedure is applied to the input-output system defined by Vo, and v_,3. The data, sampled once hourly and representing the normal operating conditions for one month (October 1973), are taken from the K~ippala treatment plant and a number of meteorological stations in the Stockholm district. The form of the data proves to be particularly difficult to use in the identification/estimation of a model owing to the presence of large pumping disturbances in the flow measurements of v: 3. The effects of pumping, which are equivalent to a high-frequency noise with low signal/noise ratio, can only be partially removed with low-pass filtering. Nevertheless, reasonable results are obtained by separating the deterministic, periodic daily and weekly component of the output vz3, which originates from the input v,2 (i.e. consumers effluent), from a residual, black box, stochastic rainfall/runoff model. The principle of separating the deterministic and stochastic components of vz3 is the same as that used for the forecasting of a distribution network output demand and river flows. Other than in an off-line simulation sense, the more immediately practicable results of the study (Beck. 1976a) concern the on-line prediction of v23. This signal is, as it were, the fulcrum about which the control of both the sewer network and the sewage treatment plant is balanced. Under mild assumptions it is feasible to use a recursive least squares (RLS) scheme for the estimation of the parameters in an adaptive predictor for v23. The predictor is adaptive in the sense that its parameter values are adjusted automatically, and on-line, to any unknown changes in the dynamic properties of the subsystem; it is practicable in the sense that it assumes very little on-line instrumentation of the sewer network. It turns out that the delayed and temporally-distributed transient runoff effects observed in v, 3, which result from the spatial distribution of the rainfall inputs Vo,, can be predicted ahead in time in the absence of any measurements of the rainfall events. The practical utility of such advance knowledge of v23, both its quantitative (i.e. flow) and, as yet untested, qualitative aspects, should not be underestimated in consideration of the feed-

586

M.B. BECK

back* control of subsystem (2) and the feedforward* control of subsystem (3). In this example the black box approach can be shown to be a very useful solution to the modelling problem; it is particularly suited to the case where the description of the high-order, complex, dynamic internal state of a system is not the primary objective of the model. There are also some significant by-products of the study. Firstly. the apparent inflexibility of the sewer network can be reduced by exploiting, and closely monitoring, the inherent storage capacity of a trunk sewer. Secondly, it is worth noting that many wastewater treatment plants are designed with a buffering well adjacent to the plant influent gates; for example, the K~ippala system has a buffering well with a retention capacity of up to 5 h under typical operating conditions. We shall see in Sections 3.5.3 and 3.6 that these potential storage sites may have a direct bearing on the feasibility of implementing water quality control schemes in the near future. 3.4 Subsystem 3--the wastewater treatment plant Unlike most industrial processes a wastewater treatment plant receives a raw input material whose variations with time are large and generally imprecisely defined. It is now more obvious, therefore, why the implications of the adaptive predictor analysis for v23 are so relevant to the implementation of automatic control in the treatment plant. And, in view of the heterogeneous collection of unit treatment processes, it is important to have an immediate and continuous knowledge of the complete vector input v23. As a general rule, however, a knowledge of the flow variations in v23 is essential, since it not only directly affects the efficiency of physical treatment (PT), e.g. sedimentation, but also determines indirectly the dynamic properties of the elements which form the basis of the biological (BT) and chemical treatment (CT) stages. Comparatively speaking, the problems of wastewater treatment plant operation have received much attention in the recent literature. However, very few analyses have concentrated on the application of modern control and estimation theory, with the following notable exceptions: a good introduction to a comprehensive study of dynamic models for wastewater treatment plants is reported by Andrews (1975); a similar review of the "state of the art", and a concise formulation of the control problems to be tackled, are given in Olsson et al. (1973, 1974). Briefly (see Fig. 1), physical treatment removes the suspended solids particles from the wastewater, biological treatment concerns the growth and support of micro-organism populations for the removal of dissolved organic matter, and, finally, chemical treat-

* Used here in an information sense. ~"This, perhaps, was not his intention in writing the paper; it is, nevertheless, a most instructive tutorial on the theory.

ment reduces the levels of some inorganic contaminants (in particular, phosphorus). All three processes refer to the treatment of liquids wastes. At several points within the plant solids sediments are withdrawn and collected for sludge treatment (ST); this may often be of a biological form involving, once again, the growth of active micro-organisms which progressively break down complex organics into less noxious products such as methane and carbon dioxide. Possibly the greatest challenge to the application of control and systems theory is the identification and modelling of the physico-chemical and biochemical phenomena which characterise the biological processes of treatment. So far this has been the major effort of the studies conducted by Andrews, Olsson, and their collaborators. But, in this most important of areas, it is also true that the fundamental step of model identification and verification is severely hampered by the difficulties in measuring many of the qualitative variables. We shall attempt, therefore, to summarise the problems of modelling the two processes of wastewater treatment (with respect to those that are biological in nature) which have been the subject of much discussion, namely the activated sludge process and the anaerobic digestion chamber. Otherwise, for more specific details of models for the processes of physical treatment such as sedimentation, the reader is referred to Bryant and Wilcox (1972) and to Larsson and Schr~Sder (1974), and for the processes of chemical treatment, particularly the precipitation of phosphorus-bearing compounds, to Olsson et al. (I973). It is worth mentioning in passing that the physical fluid-mechanical principles, upon which sedimentation is founded, make it one of the unit processes that is most sensitive to variations in the flow component of the input v2a. Thus, in practice, it may become the case that an overall control scheme for the plant may be obliged to consider the regulation of a sedimentation basin as the most important individual control loop. 3.4.1 Biological processes of wastewater treatment. When examining the identification and dynamic modelling of biological processes, one problem which faces the systems analyst is his level of understanding of the fundamental theories which govern these processes. Indeed, it is a problem which recurs with embarrassing regularity. Since we are concerned primarily with dynamic models, which are inherently more difficult to use than any corresponding steadystate models, we may, in the interests of utility, be forced to accept less detailed, but more tractable, mathematical descriptions of the internal mechanisms of a biological system. This conflict between the microscopic and the macroscopic is well articulated in a paper by Andrews (1970), who, for those not conversant with the intricacies of the biochemical kinetic theory, gives an excellent introduction to the subjectt. The activated sludge process treats the liquids wastes streams passing from the sedimentation units;

Dynamic modelling and control applications in water quality maintenance the anaerobic digestion process is applied to the separated solids wastes stream. In outline the following is occurring in these processes. Complex organic materials in the sewage are considered to act as substrate, or nutrient, for the growth of various species of micro-organisms. For the activated sludge unit, which is essentially an open channel flow process, these organisms operate in an aerobic environment; they are attached to a slurry-like material and kept in suspension by the mixing action of the aerator valves on the bed of the channel. In contrast, the anaerobic digestion process is carried out in a sealed vessel and, as the name suggests, the relevant microorganisms operate in a strictly anaerobic manner. The organisms take part in autocatalytic reactions, during which they act as catalyst in the breakdown of organic pollutants to carbon dioxide and water (in activated sludge), and to methane and carbon dioxide (in anaerobic digestion), with the production of more micro-organisms. The details of these reactions differ between the two processes. For the activated sludge the organisms pass through a "stored" mass phase, becoming later "active", and, finally, reach an "inert" stage through death and decay (Busby and Andrews, 1973). In anaerobic digestion the insoluble organics are first dissolved by extra-cellular enzymes; acid-producing bacteria then decompose the soluble organics to give volatile acids, e.g. propionic, butyric, and acetic acid. which, in turn, are converted into the final products by methane-producing bacteria (Andrews, 1969). This last step is generally believed to be rate limiting and can, therefore, be assumed to be the only significant biochemical reaction in a model of the overall digestion process dynamics. Clearly, we are dealing with very complex phenomena; moreover, it is true to say that these phenomena are not well understood. In practice, however, it has been possible to formulate internally descriptive models from the theory; a central feature of these models is a growth function developed by Monod (1942), a Nobel prize-winner. Using a Monod function. it is proposed that for a given concentration of substrate, i.e. organic pollutant, s, say, the growth of a concentration of micro-organism species, m, say, is described by

~h

=

(') -

-

~ Ks+s

m

(7)

where k and K, are constants. Since, in any mechanistic model [equati6n (5)], it is convenient, if not essential, to define m and s as elements of the state vector x, a non-linearitv is immediately introduced into the model structure. Some of the identification/estimation procedures are then no longer applicable to such a non-linear generalisation of equation (5). Indeed, as Andrews (1969) has pointed out, anaerobic digestion requires a model with a more complex, and more non-linear, growth function than that given in equation (7). And, while this may not be necessary for

587

the acti~ated sludge, an adequate model for this process should consider the distinction between the three forms of micro-organisms, viz. stored, active, and inert, in terms of additional state variables and Monod functions. The simplest statement of the growth function, equation (7). usually treats these different types of organism states as aggregated in the definition of m. The substrate/micro-organism relationship, thus, together with a consideration of a host of other important control and stability variables, make up the basis of the mechanistic models proposed for the activated sludge (Busby and Andrews. 1973) and anaerobic digestion units (Andrews, 1975; Andrews and Graef, 1971; Graef and Andrews, 1974) of wastewater treatment. They are, in general, multivariable, nonlinear, dynamic models with a h i ~ degree of complexity. In fact, notice that their complexity is quite daunting even without the inclusion of any predatorprey relationships that may exist among the microorganism species in the system's ecological balances (Curds, 1973). Nevertheless, it is still feasible to use the models in an analysis of process stability, or in a control system synthesis context, as reported by Busby and Andrews (1973) and Graef and Andrews (1974). But the verification of the models against field data remains an awkward problem. For example, in addition to the problems associated with their multivariate and non-linear nature, it is no small task to define which nutrient s is rate limiting [as implied by equation (7)] to the heterogeneous collection of microorganism species described by m. And, once these matters are clarified, it is highly unlikely that a direct or on-line measurement of the true values of m and s can be obtained from the plant with its present level of instrumentation. The question arises, where do we go from here? Judging by the work of Olsson and Andrews and their collaborators, there appear to be two options. Either, taking a black box approach, the more "observable" parts of the processes, e.g. the effects of dissolved oxygen and aeration on the activated sludge unit, are identified from normal operational data. This is the approach adopted by Olsson for experimental work on the K~ippala treatment plant in Sweden (Olsson, 1976). The verification of an internally descriptive model can thus be approached piecewise by drawing inferences from the black box results; simultaneously, individual control loops can be implemented and tested in practice. Or, with a mechanistic model based partly on the theory and partly on its qualitative similarity with empirical observation, control strategies are hypothesised, evaluated by simulation, and applied to the real plant. Loosely speaking, this approach forms the basis of the work carried out by Andrews (1975). In this latter case too, the verification of the complete mechanistic model must await the availability of the necessary data. We may surmise that for the time being any model validation can probably be accomplished only

5~

M.B. BECK

trol effectively, the resources of a river it must be possible to identify the dynamic relationships between the inputs Vo~, vc,t, v;_,~, v3~. v3~ and the output vector V,~o. Apart from the desire for clean rivers. Fig. 2 shows why this is important for the operation of the whole system. The major problem of control in subsystem (4) is one of regulating the effluent discharges from the other subsystems so that they are consistent with the independent dynamic disturbance of v.~o by vo,~. We have, then, the familiar separation of the problem into the modelling of flow and quality dynamics within the subsystem. We shall refer to models for a reach of river which is normally defined such that the input v3~, in particular, can be considered to enter the reach at its physical upstream boundary. For notational convenience we shall also continue to denote the input from a previous reach into the reach under study as %4. 3.5.t Flow models. The flow model discussed in this section has been developed for the Bedford Ouse study. This project has used extensively the techniques of recursive identification and parameter estimation in a systems analysis of the present utilisation and future potential of the Bedford-Ouse river as a source of potable supply and recreation. Part of the work is concerned with the development of a dynamic, stochastic model of a 55 km stretch of the river between the proposed new city of Milton Keynes and Bedford. This is particularly interesting here. since we have an example of the situation represented in Fig. 2. When the new city is eventually discharging its effluent to the river, it will be essential to know how this effluent affects the quality of the water downstream at the point where the Bedford Water Board 3.5 Subsystem 4 ~ reach of rit:er abstracts its potable supply. Moreover, the impact of It is unusual to visualise a river as part of an indus- the effluent on a relatively clean river needs to be trial process, but, since we have defined the water assessed not only in the long term, but also in the quality system in terms of a resource, this, in essence, short term, since this latter defines the important dayis what it is: it is a medium from which potable water to-day and diurnal variations in the quality of the supplies are obtained and a cost-effective network for abstraction rot. The progress in the development of the transportation of that supply from one area to the dynamic, stochastic model thus required for the another; it is also a convenient medium for the final short-term variations can be followed in a number treatment and assimilation of a waste effluent. In of reports by Whitehead and Young (1973. 1974a. many cases this latter function can be undertaken 1974b, 1975). without undue damage to the aquatic environment In many senses a flow model forms the basis of and the amenity value of the river. Our present con- any river water quality model, since it has considercern with matching the competing demands of able influence over the dynamic properties of the subpotable water supply v0~ and waste, v3,~, assimilation system and it affects, for example, the rate of reaeris aimed at the formulation of a more tangible objec- ation of the stream, the aeration at weirs, and the tive for the operational control of river water quality. dilution of effluents. The final version of Whitehead That does not imply a disregard for the benefits which and Young's river flow prediction model is presented would accrue from the aesthetic appeal of a clean in detail elsewhere (Whitehead and Young, 1975a). river, but. if we were to try and define such benefits Their approach is similar to that of Kashyap and (in mathematical and economics terminology), we Rao (1973) and Rao and Kashyap (1974) and, like should be drawn into the nebulous field of political the flow prediction problem for a sewer network (Secdecisions. tion 3.3), the use of a black box model can circumvent some of the difficulties associated with the estimation Thus. in order to evaluate fully, and, hence, to con* Composed of a number of discrete-time delay and con- of a large number of parameters which charaeterise tinuous-time first-order exponential lag elements for each the compartmental hydrological models. A simple component reach in the 55 km stretch of the Bedford-Ouse. deterministic modeI* is used to relate flow variations

b~ means of a simple deterministic simulation comparison with field observations. Bearing in mind the discussions of Sections 2.3 and 3. t. the problems in the modelling of biological systems are seen to be a kind of microcosm of all those problems that confront us in our attempts to systematise the operational control of water quality as a resource. For instance, the dichotomy of approach, i.e. black box or mechanistic model, is a fundamental part of the solution to the modelling problem. Advantage should be taken of both methods and the results blended to form an understanding of the whole. The tendency for models to be used without due regard to the practical limitations of the system is also exemplified here in a paper by D'Ans, Kokotovich and Gottlieb (197l). They propose a non-linear regulator for anaerobic digester control; this is suitably discussed by Wells (1971), who points out that such a controller is necessarily some distance from being innovated in practice. Further, there is some indication that the inflexibility of the system can be shown to be apparent and not real. Recent work by Olsson {1976) and Busby and Andrews (i973) establishes that a proper co-ordination of the flow feeding patterns to the step-feed form of the activated sludge process can otter the much needed capacity to control the quality of the final eflluent v34 to the river. In other words, the input flow can be manipulated to adjust the dynamic properties of the unit and, hence, this creates the flexibility required to meet a given desired set-point on the process output. All these aspects, then. are typical of the problems and solutions which exist generally in the water quality system.

Dynamic modelling and control applications in ~ater quality maintenance at different points in the river system to input variations of Vo~ at the system boundary. The deterministic prediction is enhanced by stochastic time-series models that are used to represent the residual excess flow variations caused by rainfall and runoff effects. In other words, the deterministic model contains a measure of the internally descriptive mechanisms of the flow in each reach, while a black box model is used to relate input rainfall to the output additional flows resulting from runoff into the river. The two parts of the model together predict the output flow component of the vector v.~0. A significant feature of the model is its ability to simulate the dispersive fluid properties of a reach of river: this is also of particular relevance to a quality model, since dispersion is an important factor affecting the dynamics of dissolved and suspended substances. The black box part of the flow model is identified and estimated with a combination of the recursive least squares (RLS) and instrumental variable-approximate maximum likelihood {IVAML) methods. The data for the construction of the model are taken from the Bedford-Ouse river for the year 1972. The ability of the recursive algorithms to pick out any time-variations in the parameter estimates proves to be of great value in examining seasonal and temporary changes in the process dynamics. These time-variations of the parameters are utilised to incorporate factors representing the internally descriptive phenomena of evaporation and soil moisture deficit. Thus, although a black box model is not generally amenable to the physical interpretation, we have a good illustration of one case where such a model can, in practice, reflect some of the physical properties of the real system. We have also stated in Section 3.1.1 that a black box model is often specific to the data from which it has been constructed; it is usually possible to compare favourably the ex post forecasts of the model with this set of observations. Whitehead and Young further demonstrate the validity of their model (from the 1972 data) by making a successful ex ante forecast of the dynamic flow variations in the Bedford-Ouse over the ,,'ear 1973 {Whitehead and Young, 1974b). 3.5.2 Quality models. The separation of a dynamic model for river water quality into a number of constituent models each dealing with individual elements of the vectors Vo., and v4o is an artificial conception of the system. For the quality of the water can only be evaluated properly from a consideration of a whole range of interacting variables which describe the state of the aquatic environment. However, dynamic models for conservative substances can be represented in fairly simple terms which essentially describe the transportation and dispersive fluid properties of the * The frequently used test of BOD takes five days to measure and samples are often collected manually for subsequent laboratory analysis. t-Sunlight. among other factors such as nitrogen- and phosphorus-bearing substances, influences the growth of algae in a river.

589

reach. In fact. by definition, conservative substances are assumed to have no interaction with other quality variables in the river. On the other hand. non-consert,atire substances exhibit dynamic variations which are governed not only by the fluid-mechanical properties of the reach but also by a variety of physico--chemical and biological mechanisms, for instance. mass transfer across the air-water interface, chemical reactions, and biological growth and decay. Therefore. it is convenient to isolate some of the more s i ~ i ficant non-conservative substances from each other so that the scope of the model identification can be limited to a manageable size. Later, it may become feasible to combine the individual models if they are believed to have significant mutual interactions. Here. we merely indicate that a conservative quality state model for a river has been identified and estimated with the extended Kalman filter (EKF) for chloride concentration in parts of the Bedford-Ouse (Whitehead and Young. 1974b). In principle, the basic structure of this dynamic model, which idealises the reach of river as a continuous stirred tank reactor (CSTR), seems to be generally applicable to other conservative substances. We consider in detail the dynamic models proposed for two of the more important non-conservative substances in a river, namely dissolved oxygen (DO) and nitrate concentrations. DO-BOD-algae. Historically, the analysis of dissolved oxygen-biochemical oxygen demand (BOD) interaction in a reach of river has occupied a large portion of the literature on water quality models. DO is a major index of the general state of an aquatic environment. Its interaction with the BOD is significant because this latter variable is a good measure of many of the pollutants that characterise a domestic waste; BOD is also principally responsible for the reduction of DO levels in the river. However, until recently the existing models of the physico-chemical and biological mechanisms governing the dynamics of DO--BOD interaction (for a review, see Beck, 1976c) had not been verified owing to the difficulties in obtaining data*. This state of affairs has now changed significantly and several versions of a DO--BOD model have been identified and verified against experimental measurements, The development of the model can be traced through a number of stages. Since a reasonable internally descriptive model structure exists a priorL it is appropriate to utilise this information for identification purposes. But, before applying any identification algorithms, a simple deterministic simulation can give a very good indication of the viability of the model structure, as suggested in Section 3.1.3. Beck and Young report this initial phase of the analysis (Beck and Young. 1975); the data on the DO and BOD are taken from an 80-day experimental study of a 4.7 km stretch of the River Cam outside Cambridge during the summer of 1972. It is observed that algal populations, through the process of stimulated growth during prolonged sunny periods'l', significantly

590

M.B. BECK

disturb the DO--BOD dynamics. This observation. and the pseudo-empirical expression developed to account Ibr it. gives rise to the expanded title of DO-BOD-algae models. In a second stage the model is identified more et'ficientl3 in a probabilistic setting with the EKF algorithms IBeck and Young. 1976): these results also represent out interpretation of the manner in which the EKF should be used as a general method of identification. While it is possible to extend the original pseudoempirical expression, what is really required is a more fundamental growth and decay model for algae. In order to accomplish this with the Cam data. the model identification is transferred to a black box analysis of the input-output relationships for the DO and BOD. The two variables can be considered as separate and imlependem elements of the vectors v0,~ and v~o with no mutual interaction since, from the EKF identification, it turns out that the coupling between the DO and BOD is relatively weak in comparison to their independent dynamic variations. Applying the MLt algorithms to a black box model structure, significant differences are identified in the time-dependency of the output DO and BOD on an external input of sunlight. These results for the system's dynamics can be interpreted in a physical manncr and translated into an improved form of the mechanistic model. The ML2 estimation procedure is used to confirm the viability of the new internally descriptive model structure. Then. noting the clear correspondence of the nature of algal population dynamics to the kinetics of micro-organism growth in the biological processes of wastewater treatment {Section 3.4.1), a Monod-type function, equation (7), is hypothesised for the growth-rate of algae in a freshwater stream. With respect to equation (7). the sunlight incident on the river is incorporated as the limiting substrate, or nutrient, s, for algal growth in a combined DO-BOD-algae model. These results are described in Beck (1976c) and, with special reference to the MLI and ML2 identification/estimation procedures, in Beck (1975). Concurrently with the later maximum likelihood analysis of DO-BOD-algae interaction, a model, of the structure identified by the E K F method, has been similarly identified (again, using the EKF) for two reaches of the Bedford-Ouse from data collected in the summer of 1973 (Whitehead and Young, 1975a). The particular form of the original pseudo-empirical expression for the prediction of algal growth and decay can be improved by the inclusion of a term relating the production of DO by algae to the observed chlorophyll-A concentration in the river. But. as we have stated earlier in Section 3.1.3, the E K F has certain limitations at the parameter estimation stage, and particularly so when there are large * Nitrification is the oxidation of ammonia products, for example, through nitrite to nitrate compounds; denitrificalion is the reverse process.

quantities of data to be analysed. Thus. in order to meet the specific demands of parameter estimation in a mechanistic model of DO-BOD-algae interaction Young and Whitehead (1975) propose a multi-variable extension to IVAML. which they call MIVAML. In their paper they present the new algorithms and demonstrate the application of MIVAML to the Cam data: in a second paper MIVAML is applied to the Bedford-Ouse data IWhitehead and Young. 1975a). Subsequently, more recent results from the analysis of a year's data show that seasonal variations in the process can be accommodated in the basic model structure with the parameters estimated according to MIVAML (Whitehead and Young, 1975a). Of course, the experience gained from the study of DO-BOD-algae models is quite considerable. A great deal has been learnt about the use of identification and parameter estimation techniques and about the difficulty in obtaining experimental field data. But the question may be asked, what is the value of the models? The answer is that they are an integral link in the process which leads from experimental observation of a system's dynamics to the implementation of a real control of those dynamics. It remains to be seen which modei will prove to be most useful in this context, although we might add that it should, in the first instance, be as simple as possible: in other words, it is consistent with the instrumentation and technology available for putting the theory into practice. Therefore, while the model presented by Beck (1975) is the most sophisticated of the DO--BODalgae models, it is also somewhat hypothetical and, for that reason, it is the least suited to an initial control system synthesis (see Section 3.5.3). Nitrate. The nitrogen cycle in a river is a complex process involving the presence of the element in various compound forms, e.g. waste organic materials, ammonia, nitrite and nitrate, plant and animal growths, and mud deposits. In practice, the nitrogen cycle has some interaction with the DO balance through the reactions of nitrification and denitrificalion* ; likewise, a population of algae takes up nitrogen-bearing materials as nutrients in its growth process. So it can be seen that, for the time being, by defining the system of interest as the nitrogen cycle we are making a convenient assumption of no coupling between this system and the DO-:.BOD-algae quality system. For a more complete study one should really investigate the manner in which DO consumption by nitrification, for example, is related to the algal population and, thus, is indirectly connected back to the nitrogen cycle through algal uptake of nitrogen. Indeed, one of the primary reasons for the removal of nitrogen in a wastewater treatment plant is to reduce its adverse effects, in terms of depressed DO levels and excess algal growth, when discharged in the effluent vs4 to the river. For these reasons, it is possible to operate the activated sludge process (Section 3.4.l) in a manner which pays special attention

Dynamic modelling and control applications in water quality maintenance to the removal, or conversion, of various forms of compound nitrogen, see e,g. Olsson et ~tl. (1973). But the effects of nitrogenous materials on the water quality system are far-reaching and. perhaps, they have not been ~ven a wide enough coverage in this report. First. notice that nitrogen not only enters the river via the effluent v3.~, but also by runoff from land adjacent to the river: this latter is particularly important for reaches of a river which pass through agricultural areas. And apart from their interaction with the D O BOD-algae system, nitrogen-bearing materials are a serious contaminant of potable water supplies. Thus. since it is a costly procedure to remove nitrogen in the purification plant of subsystem {1), it may very well be appropriate, for this reason too, to remove it in the treatment plant of subsystem (3). In other words, for the situation shown in Fig. 2, which is quite typical, e.g. as in the Bedford-Ouse Study (Section 3.5.1), it is probable that a knowledge of the dynamics of the nitrogen cycle and nitrogenous pollution will become a major factor in the operational control of the water quality system. A preliminary dynamic model for the nitrogen cycle has been identified with the EKF algorithms and is reported in Whitehead and Young (1974a); the data are taken from a part of the Bedford-Ouse during the summer of 1973. Because of a limited number of measurements referring only to ammonia and nitrate nitrogen, and in view of the negligibly small concentrations of ammonia observed in this particular experiment, they restrict their model of the nitrogen cycle to a consideration of the nitrate form. It is found that a significant proportion of the nitrate is lost either by its uptake in phytoplankton or by denitrification in the mud deposits. 3.5.3 In-stream DO let'el control. Most of the currently available methods of control system synthesis are readily applicable to a model which is governed by a single independent variable, i.e. a lumped-parameter model. It is well known that the control problem is more awkward to solve when there are two independent variables in the model, such as onedimensional space and time, i.e. a distributed-parameter model. This latter would appear naturally to be the case for a river. In fact, a major objective in constructing a model for any part of the water quality system is that the model, wherever feasible, should be a function of the single independent variable of time. It is fortunate, then, that one particular mechanistic model structure, which avoids the difficulties in using a distributed-parameter model, is the continuous stirred tank reactor (CSTR). Although the mixing properties of many processes lie somewhere between the ideals of a plug flow reactor and a CSTR, it is possible to simulate these properties by appropriate * Notice that a black box, or time-series, model can equally well account for transportation delays, while any fluid mixing properties are absorbed in the structure of the input--output relationships.

591

combinations of transportation delays and multiple CSTR elements* ~see e.g. Whitehead and Young 1975a). Consequently. the CSTR is a fundamental feature of many mechanistic models and it has found wide application in the modelling of biolo~cal processes of wastewater treatment and in both the flow and quality aspects of the dynamics of a reach of river. However, there are some situations where the distributed-parameter model is indispensable, especially in the modelling of sedimentation processes. The basic approach of the CSTR model, as it applies to a reach of river, is described in more detail elsewhere (Beck and Young. 1975: Young and Beck, 1974). From a DO-BOD-algae model founded upon this structural form, and using the parameter values estimated with the EKF algorithms, Young and Beck (1974) report an initial feasibility study for the automatic control of DO levels in a reach of river. The results are based upon the experimental data from the River Cam (summer 1972) and they examine a simple feedback control design which regulates the amount of BOD discharged to the river in the effluent v3,,. The control objectives can be achieved in two ways: either one assumes a variable and controllable treatment process for the removal of BOD or, and this appears to be more immediately practicable in view of the industry's technology, the flow-rate of the effluent discharge is manipulated by the introduction of a fairly large storage lagoon into the treatment plant. Both schemes are able to maintain prescribed "satisfactory" levels of DO at some appropriate downstream location on the river, say the output V,~o. Note, however, that the controller performance is only slightly degraded when the more realistic assumption is made of no information on the BOD (which takes five days to measure); such a restriction can be avoided by using a phase-advance filter (see e.g. Youag and Beck, 1974) or by applying an ordinary proportional + integral control to the DO (Beck, 1973). Alternatively. the DO level in a reach of river can be controlled by artificial aeration of the stream. And, since it was felt originally that this method is less practical (in theory), it is now especially interesting to find that artificial aeration is to be implemented on the very same reach of the Cam for which the previous results are described. Prior to bringing the aerators on line a control simulation study is being undertaken with the 1972 Cam data. The preliminary results show that a DDC (direct digital control) scheme, as suggested by Young and Beck (1974), for example, offers a viable form of feedforward-feedback control when tested with a discrete-time DO--BODalgae model estimated from MIVAML (Whitehead and Young, 1975). Let us hope, therefore, that the innovation of such a control scheme proves itself to be successful in practice, for then we shall finally see that the whole dynamic model identification, estimation, and control synthesis process has not been just an academic exercise.

592

M.B.

BECK

vc,. and v3~: we have then. say. for subsystems (2) and (3).

3.6 Creating flexibility )or control A major part of the discussion has been devoted to the problems of systems identification and model building. This reflects not only the predominant feature of the more recent studies, but also the effort that has been required to reach a stage where a control analysis can be approached with a sound understanding of the water quality system. For although in some isolated instances control studies have progressed in detail, it is not easy to collate results and to show how they relate to a comprehensive control of the whole. It is always difficult to present both a macroscopic and a microscopic view of such a complex system. And, despite the more obvious crossreferences between the various subsystems, much of the significance of the individual result can be lost in the welter of detailed discussion. This is particularly true in consideration of subsystems (2). (3), and (4). where there does not appear to be a great deal o[" r o o m for control manoeuvres. We do not feel that the control problems of subsystem (1) are quite so critical at the present time for the following reason. In the case shown by Fig. 2 it is clear that no water will be abstracted from the river for consumers in water quality system (2), if the state of the river in system (1). as defined by v,~o, is unfit for potable supply. This state of affairs will continue to be reasonable until either increased consumer demand forces the issue of accepting a poorer quality abstraction, or the construction of a new city upstream creates problems for an already existing downstream potable supply (see Section 3.5.l). [n a crude sense the input-output relationship between %2, v~2, and v3~ (via v:3) can be conveniently viewed as a "long pipe", in which what goes in must come out. Let us suppose that there is a transportation delay of Ta in the long pipe connecting Voz, VOZ

v3.~(t} = ft[Vo2(t - Ta), Vcz(r -- Ta)]

where f, is a vector function in the ~ven quantities. Typically. the input Vo, is approximated by a pulse, i.e. a rainfall event lasting a number of hours, whereas the input v,., exhibits sinusoidal variations with a frequency of 2rt tad d a y - t . Of course, to some extent subsystem (3) can attenuate the disturbances of Vo: and v~2 by recycling various flow streams within the plant, but essentially it does not have a large capacity for temporary flow storage. In addition, the wastewater treatment plant tends to operate on a basis of fixed percentage p, say, of removal of pollutant quantities entering the subsystem in L,3. This means that in terms of both flow and quality variations we may expect to see similarly shaped responses in v3~ as shown, very approximately, by Fig. 3. The crucial point here is that the dynamic variations in v3, fire unlikely to be consistent with other input variations in Vo4 for the control of subsystem (4) and, hence, for the control of the system output V,o. whose dynamic response is given by. V.~o(t) = f,l-vo.,(t - Ta), vc,(t - Ta), Vo~(t)].

I

Transportation delay Td

I ( F i x e d pollutant removal}

4-4 J

I Vc 2

(a)

Quality

'I '

(b)

I',P

I

--Td --

Flow

t

--T~ --

f

t

Quolity Vs¢2

(9)

Therefore, in attempting to control these parts of the overall system we are looking for a degree of flexibility in a 9ieen operational design, such that the quantities Ta and p are not made inherently time-invariant by that design. In other words, we should search for "'pockets" of flexibility in subsystems (2) and (3) which allow a variation of Ta and p and then control this variation with respect to time. In fact, in the ideal situation, where the percentage removal p of pollutant is truly variable between 0 and 100%, there is no need to control or alter the design value of Ta. How-

-- --

Flow

(8)

/V34 ss--~

-- Td --

t

Fig. 3. Input-output relationships and responses for sub-systems (2) and (3J.

593

Dynamic modelling and control applications in water quality maintenance

( Variable pollutant removal _~p(t) V34

[

L_

Variable transpor'laflon delay T~(t)

Fig. 4. Flexibility for control in subsystems (2) and (3k ever. in practice p is only variable between much narrower bounds (071o < p < 100~'o) and the remainder of the control action is required to regulate T~ by flow storage*, see Fig. 4. Thus. the loading-rate of pollutant discharge in v3, can be controlled to be consistent with the input disturbances of %, in order to achieve the desired set-point on the output V,Lo. In terms of a variable and controllable transportation delay, T~(t), some of the necessary storage flexibility may come from several potential locations within the sewer network and treatment plant. For instance, in Section 3.3 we have mentioned the control analyses of the Cleveland (Pew et al., 1973) and Seattle (Leiser, 1974) sewer systems. Both studies report the flexibility of using trunk sewers ancl strategically placed tanks for operational storage capacity. Further, in the identification and adaptive predictor examination for the influent flow v23 to the treatment plant (Beck, 1976a) we find a reference to a common feature of design, namely a buffering well preceding the plant gates. Similarly, the use of a detention lagoon, either before or after the treatment processes, is proposed for the control of the DO level in a reach of river (Young and Beck, 1974) (Section 3.5.3). In contrast, the flexibility required for a variable a n d controllable pollutant removal, p(t), might be less easily achieved. Primarily, it appears that the activated sludge process, and particularly the stepfeed form, offers the greatest scope for a variable effluent quality control (Busby and Andrews, 1973; Olsson. 1976) (Section 3.4.1). Clearly, a controlled variation in the flow through certain sections of the process affects the time-constants of the system; in turn, these time-constants affect the dynamics of micro-organism/substrate interaction and permits, in theory, the controlled variation of percentage pollutant removal. However, notice that the regulation of the system output v,,o by a variable removal coefficient p(t) may be considerably enhanced by the additional flexibility of methods such as artificial instream aeration (Whitehead and Young, 1975b) (Section 3.5.3). But the desire for flexibility in the system does not imply a desire to attenuate all the disturbances in the inputs %2 and vc2; in any case, this would be impractical. Let us consider the following: suppose * Ignoring the overflows v~, and v~,,, which are not an alternative to proper control of the system.

the diurnal, sinusoidal variauons in vc, are described by v~_,(t) = v~z sin(cot - ~t)

(10)

where i,¢, is a mean amplitude of the fluctuations, co is the frequency (2z~radday -~) and ~bt the phase lag (with respect to 00.00 h) of the oscillations. Now let the sinusoidal variations in the imput v04, as defined, for example, by factors which affect the diurnal photosynthetic/respiratory cycle of plants and algae, be Vo~(t) -- %, sin(cot - ~b2)

(11)

in which qgz is the phase lag of the oscillations, again with respect to 00.00 h. Then, through equation (9), and assuming vo., = 0, the output V,,o is described by the following function, V~.o(t) = f31"Vc2 sin(cot - coTa - ~bt), %4sin(cot- ¢2)].

(12)

Thus it may be desirable to control Ta such that, for example, T~ = ! ( ¢ 2

co

+ ,~ -

4,~)

(13)

where the linear superposition of two out of phase sinusoids could have significant advantages for the control of V,o. That is to say, it may alleviate the problems of very low DO levels over the night period, to give one example of the possible benefits of such operation. But naturally, like the concept of a long pipe, this crude analysis of the system's dynamics merely illustrates a speculative direction for investigation. The implementation of any such control is necessarily some way off and, in any event, it would need to be evaluated by prior simulation with a validated model of the process dynamics. 4. CONCLUSIONS The aim of this report has been to present an overall view of those problems which characterise the implementation of a practical control for water quality in a river. In particular, there has been an emphasis upon the identification and parameter estimation of dynamic models for various component processes in the water quality system. Although a considerable amount of progress has been demonstrated, many modelling problems still remain. Of these, the outstanding challenge to the dynamic systems analyst

594

M.B. BECK

is that of biological process modelling: more attention must be given to the achievement of a proper understanding of. for example, the substrate/microorganism relationships of activated sludge and anaerobic digestion, and of nitrification and the nitrogen cycle as they apply to activated sludge operation and river water quality. Further. the quality dynamics of potable abstraction treatment and a combined DO-BOD-algae-nitrogen model are areas worthy of more detailed examination and experimentation. Thus, taking these developments to their conclusion, it is possible that full-scale ecological models for an aquatic system will need to be considered in the future. However, while this may be a subject of great interest. it is also one which is fraught with difficulties, for there are always the problems of restricting the model to a manageable size and problems in obtaining measurements for model validation. Clearly, if we are to obtain positive results and useful models for biological systems, it is imperative that the systems analyst should work closely with the biologist. As opposed to model identification, the control of the water quality system is a matter for the more distant future. We have presented what promises to be a useful overall approach to the solution of the problem. It is felt that automatic control is necessary, and a prerequisite for control is the development of the relevant reliable, and robust, measurement instrumentation. We may then use the observations of the system to identify a dynamic model, with which we can synthesise and evaluate practicable control schemes. But. as with so many things, this control will only be put into practice when it can be shown to give tangible economic rewards. Certainly, it is to be expected that operational costs will be affected by the innovation of automatic control. But what potential does the design of a fully controlled system have for reducing the large investment costs which accompany today's practice of "over-designing", say, a wastewater treatment plant? Moreover, if it is intended to exploit the water quality system as a natural resource, what standards must be maintained in the river by an operational control'? The answers to these kinds of questions will be resolved by a systematic analysis of the water quality system; and, we believe, dynamic models and control theory have a fundamental part to play in this analysis. REFERENCES

Andrews J. F. (1969) Dynamic model of the anaerobic digestion process. Proc. Am. Soc. cir. Engrs, J. Sanit. Engng Div. 95 (No. SAI), 95-116. Andrews J. F. (1970) Kinetics of biological processes used for wastewater treatment. Paper presented at a Workshop on Research Problems in Air and Water Pollution, University of Colorado, Boulder, Colorado. Andrews J. F. (1975) Dynamic models and computer simulation of wastewater treatment systems. Modeling and Simulation of Water Resources Systems (Edited by Vansteenkiste G. C.). pp. 457--464. North-Holland, Amsterdam.

Andrews J. F. & Gracf S. P. ~197l) Dynamic modeling and simulation of the anaerobic digestion process. Advances in Chemistry Series. No. 105. Anaerobic Biological Treatment Processes. American Chemical Society. pp. 126--162. A.str~Sm K. J. & Bohlin T. ~1965) Numerical identification of linear dynamic systems from normal operating records. Proc, I FAC Syrup. o~r the Theory ojSelf.adaprire Control Systems, Teddingron. EnglamL .-kstrOm K. J. & Eykhoff P. 11971) System identification--a survey. Automatica 7 (2), 123-162, Beck M. B. i19731 Ph.D. thesis. University Engineering Department. Cambridge. Beck M. B. (1975) The identification of algal population dynamics in a freshwater stream. Modeling and Simulation of Water Resources Systems (Edited by Vansteenkiste G. C.), pp. 483-4.94. North-Holland. Amsterdam. Beck M. B. (1976a~ Identification and adaptive prediction of urban sewer flows. Int. J. Control (in press). Beck M. B. (1976b) Identification and parameter estimation of biological process models. System Simulation in Water Resources (Edited b.~ Vansteenkiste G. C.). NorthHolland, Amsterdam (in press). Beck M. B. (t976c) Modelling of dissolved oxygen in a non-tidal stream. The Use of Mathematical Models in Water Pollution Control (Edited by .lames A.). Wiley. London {in press). Beck M, B. & Young P. C. /1975) A dynamic model for DO-BOD relationships in a non-tidal stream. Water Res. 9, 769-776. Beck M. B. & Young P. C. (1976) Identification and parameter estimation of DO-BOD models using the extended Kalman filter. Report CUED F-Control/TR93, Engineering Department, Cambridge. Bryant J. O. & Wilcox L. C. (1972) Real-time simulation of the conventional activated-sludge process, Paper 25-3. Proc. JACC. Stanford Unicersity. CaliJbrnia, pp. 701-716. Busby J. B. & Andrews J. F. (1973) Dynamic modeling and control strategies for the activated sludge process. Paper presented at 46th Ammal Conference of the Water Pollution Control Federation. Clereland. Curds C. R. (1973) A theoretical study of factors influencing the microbial population dynamics of the activatedsludge process--l. The effects of diurnal variations of sewage and carnivorous ciliated protozoa. Water Res. 7, 1269-1284. D'Ans G., Kokotovich P. V. & Gottlieb D. (1971) A nonlinear regulator problem for a model of biological waste treatment. IEEE Trans. on Aut. Contr. AC-16 (4), 341-347. Eykhoff P. (1974) System l,lentification--Parameter and State Estimation. Wiley, London. Fallside F. & Perry P. F. (1975) Hierarchical optimisation of a water supply network. Proc. IEE 122 (2), 202-208. Fallside F., Perry P. F. & Rice P. D. (1975) On-line prediction of consumption for water supply network control. 6th IFAC Congress. Boston, Massachusetts. Fallside F., Perry P. F., Burch R. H. & Marlow K. C. (1975~ The development of modelling and simulation techniques applied to a computer-based telecontrol water supply system. Modeling and Simulation of Water Resources Systems (Edited by Vansteenkiste G. C.), pp. 617-640. North-Holland, Amsterdam. Graef S. P. & Andrews J. F. (1974) Stability and control of anaerobic digestion. J. War. Pollut. Control Fed. 46 (41. 666--683. Gustavsson I. (1969) Parametric identification of multiple input, single output linear dynamic systems. Report 6907, Lund Institute of Technology, Division of Automatic Control, Sweden. Gustavsson I. (1973) Survey of applications of identification in chemical and ph.~sical processes. Idemification

D~namic modelling and control applications in water qualit? maintenance and System Parameter Estimation (Edited by Eykhoff P.). North-Holland. Amsterdam. Gustavsson I.. Selander S. & ',Vieslander J. (1973) IDPAC--User's guise, Report 7331. Lund Institute of Technology. Division of Automatic Control, Sweden. Kashyap R. L. & Rao A. R. 11973) Real time recursive prediction of river flows. Automatica 9 12). 175-183. Klinck M. (1973a) The input/output behaviour of a levelcontrolled rapid sand filter, IF.4C Symp. on Control of Water Resource Systems. Haifa. Israel. Klinck M. (1973b) The start-up model of a rapid sand filter. Water Research Association ConJerence on Computer Uses in k['2lter Systems, Unirersity of Reading, Reading. Klinck M. (1975) Simulation aided modeling of the dynamic behaviour for some elements of a surface water treatment plant. Modelin¢l and Simulation 01" W~lter Resources Systems (Edited b.~ Vansteenkiste G. C.). pp. 467-475. North-Holland, Amsterdam. Klinck M. [1974) Simulation aided design of the automatic control concept for a water treatment plant. AICA Syrup. on Hybrid Computation in Dynamic Systems Design, Rome. Larsson R. & Schr6der G. (1974) Dynamiska modeller f6r prim/i,rsedimentering i reningsverk [Dynamic models for primary sedimentation in wastewater treatment). Report RE-146, Lund Institute of Technology, Division of Automatic Control, Sweden (in Swedish). Leiser C. P. (1974) Computer management of a combined sewer system. Environmental Protection Technology Series, EPA-670/2-74-022, U.S. Environmental-Protection Agency. Cincinnati. Monod J. (1942) Recherches su la croissance des cultures bacteriennes. Hermannn et Cie, Paris. Olsson G. (1974) Measurement and control in chemical and environmental engineering. Report 7407. Lund Institute of Technology. Division of Automatic Control, Sweden. Olsson G. [19761 State of the art in sewage treatment plant control. Proc. ,4silomar Engineerhtg Foundation Conf on Chemical Process Control, Pacific Grove, California, January. Olsson G.. Dahlqvist K.-I.. Eklund K. & Ulmgren L. (1973) Control problems in wastewater treatment plants. Technical report, The Axel Johnson Institute for Industrial Research, Nyn~ishamn, Sweden. Page C. & Warn A. E. (1974) Water quality considerations in the design of water resource systems. Water Res. 8, 969-975. Pew K. A., Callery R. L., Brandsetter A. & Anderson J. J. (1973) Data acquisition and combined sewer controls in Cleveland. J. Wat. Pollut. Control Fed. 45 (11), 2276-2289.

595

Rao A. R. & Kashyap R. L. (1974) Stochastic modeling of river flows. IEEE Trans. Aut. Control AC-19 (6), 87'4--881. Shellswell S. H. (19721 A Computer Aided Procedure for Time-series Analysis and Identification of Noisy processes (CAPTAIN). Report CUED/B-Contro[.TR25, Control Division. University Engineering Department. Cambridge. Wells C. H. [1971) On the application of a nonlinear regulator problem for a model of biological waste treatment. IEEE Trans. Aut. Contr. AC-16 14), 385-388. Whitehead P. G. [1975). Ph.D. thesis, University Engineering Department. Cambridge. Whitehead P. G. & Young P. C. (1974a) The Bedford-Ouse Study dynamic model--second report to the Steering Group of the Great Ouse Associated Committee. Technical note. CN 74 l, Control Division, University Engineering Department. Cambridge. Whitehead P. G. & Young P. C. (1975a) A dynamic stochastic model for water quality in part of the BedfordOuse River system. Modelin 9 and Simulation of Water Resources Systems (Edited by Vansteenkiste G. C.), pp. 417-438. North-Holland, Amsterdam. Whitehead P. G, & Young P. C. (1974b)The Bedford-Ouse Study dynamic model--third report to the Steering Group of the Great Ouse Associated Committee, Technical note, CN74/4. Control Division, University Engineering Department. Cambridge. Whitehead P. G. & Young P. C. (1975b)The Bedford-Ouse Study dynamic model--fourth report to the Steering Group of the Great Ouse Associated Committee. Technical note, CN,75q. Control Division, University Engineering Department, Cambridge. Young P. C. (1974) A recursive approach to time-series analysis. Bulletin of the Institute of Mathematics and its Applications (IMA) 10 (5/'6), 209-224. Young P. C. & Beck M. B. (1974) The modelling and control of water quality in a river system. Automatica 10 (5), 455-468. Young P. C. & Whitehead P. G. (1975) A recursive approach to time-series analysis for multivariable systems. Modeling and Simulation of Water Resources Systems (Edited by Vansteenkiste G. C,). pp. 39-52. NorthHolland, Amsterdam. Young P. C., Shellswell S. H, & Neethling C. G. (1971) A recursive approach to time-series analyses. Report CUED/B-Control/TRI6, Control Division. University Engineering Department, Cambridge. Young P. C., Whitehead P. G. & Beck M. B, (1973) The Bedford-Ouse Study dynamic model--first report to the Steering Group of the Great Ouse Associated Committee. Technical Note CN/73'4, Control Division, University Engineering Department, Cambridge.