Moreno-1999-Optimal_Control_Applications_and_Methods
Moreno-1999-Optimal_Control_Applications_and_Methods
JAIME MORENO*
Instituto de Ingenieria, UNAM. Ciudad Universitaria, Apdo. Postal 70-472, Coyoacan, 04510 Mexico, D.F., Mexico
SUMMARY
In this work the time optimal control problem for a biological sequencing batch reactor, used for wastewater
treatment, is solved. This operation strategy increases greatly the e$ciency of these plants. New is the
consideration of the substrate concentration in the input #ow, the main disturbance for these systems, as
a variable signal and not as a constant parameter. The problem will be solved using a known method based
on Green's theorem that allows one to obtain analytically the unique global solution. Furthermore, an
optimal feedback control law can be derived that can be made robust against parameter uncertainties and
the input disturbance. Simulations of a realistic model of an industrial wastewater treatment plant show the
advantages of using an optimal strategy in the control of the plant, since this reduces, among other aspects,
the costs of operation and the size of the plant. Copyright 1999 John Wiley & Sons, Ltd.
KEY WORDS: time optimal control; non-linear systems; biological reactors; robust feedback control
1. INTRODUCTION
Activated sludge is an aerobic biological process in which wastewater is mixed with a suspension
of microorganisms to assimilate pollutants and is then settled to separate the treated e%uent. It
has been traditionally applied in continuous #ow processes with "xed volume tanks. The
treatment of industrial wastewaters by the activated sludge process is common, but the nature of
many industrial discharges often cause operational problems in continuous #ow systems. Se-
quencing batch reactors (SBR) o!er a number of advantages over continuous #ow systems. They
o!er for example greater #exibility in control strategy and to be e!ective they require fully
automated computer controls.
In general the SBR process is distinguished by three major characteristics: periodic repetition
of a sequence of well-de"ned process phases; planned duration of each process phase in accord-
ance with the treatment result to be met; progress of the various biological and physical reactions
in time rather than in space.
In the SBR system all treatment takes place in a single reactor with di!erent phases separated in
time. The cycle in a typical SBR is divided into "ve discrete time periods: Fill, React, Settle, Draw,
and Idle. At the beginning of each cycle, the SBR contains a certain volume of water, and activated
sludge settled at the bottom of the reactor. The cycle starts with a "ll phase of distinct duration.
The "ll phase may be short or long depending on the e!ects which are desired to be achieved.
* Correspondence to: J. Moreno, Instituto de Ingenieria, UNAM. Ciudad Universitaria, Apdo. Postal 70-472,
Coyoacan, 04510 Mexico, D.F., Mexico. E-mail: [email protected]
With the beginning of the "ll phase, or some time later, the aerator is turned on. The reaction
(or aeration) phase which now begins may last until the biodegradable portion of the organic
wastewater constituents has been degraded. Mixer and aerator are turned o! for the settle phase.
The sludge is allowed to settle under entirely quiescent conditions. A clear water zone (super-
natant) appears which can be progressively withdrawn as the sludge blanket moves downwards.
When the low operating level is reached the draw is stopped. Excess solids are withdrawn from
the bottom at the end of the draw phase. The reactor then enters the idle phase which continues
until the beginning of the next cycle.
A reduction of the cycle time of the SBR increases the quantity of pollutants that can be treated
by the process. As the settle, draw and idle phases are usually of "xed time or not controllable by
the operator, the cycle time of the SBR can be only reduced if the "ll and reaction times can be
reduced. A simpli"ed model of these phases (see (1)) can be easily obtained using mass balance
equations. The obtained model has three state and one control variables. In this paper this
model will be taken as the basis to "nd the best strategy for the control variable in the sense that
the total time of the "ll and reaction phases will reach a minimum. Such problems are usually
solved using the Maximum Principle of Pontryagin of the Optimal Control Theory. This
principle provides a set of necessary conditions that have to be satis"ed by the optimal control
law. In this paper an alternative method due to Miele, based on Green's theorem, and suited for
plane systems, will be used for solving this problem. For that purpose an equivalent plane
description of the original three-state model has to be found. This is done after a controllability
analysis of the original system. An advantage of this method is that it is a global approach to
minimization, i.e. does not depend on local approximations as does the maximum principle.
Furthermore, for singular arcs, where the maximum principle yields no constructive information,
Green's method can solve the problem.
Optimal problems have been solved for biological reactors for other purposes, specially in
biotechnology. In References 7 and 8, the Green's method has been used to optimize the
transient of a continuous reactor. In Reference 9 the feed rate was considered as a control variable
of a fed batch fermenter and an analytic expression for the switching times between bang}bang
control intervals and singular arcs was derived. The objective was the maximization of the
product output. General characteristics for the optimal feed rate pro"les for di!erent classes of fed
batch fermentations were presented in Reference 10, and in Reference 11 these characteristics
were used to establish a numerical procedure. In Reference 12 the substrate concentration in the
fermenter was used as the control variable to derive a non-singular control problem. A numerical
procedure to solve optimization problems in batch fermentation is proposed in Reference 13. In
Reference 14 a numerical optimization procedure is presented to optimize fed batch fermenters in
the presence of uncertainty in the model parameters. In References 15 and 16 a methodology is
introduced to derive easy-to-implement adaptive controllers from optimal control solutions for
fermentation processes.
In all these works the substrate concentration at the input #ow (S ) is considered as a constant.
Whereas this is possible in biotechnological processes, since this concentration can be controlled,
for wastewater treatment processes this variable is one of the most important disturbances and
cannot be considered either as a constant nor as a control variable. The main objectives of this
article are: (1) To determine rigorously (i.e. necessary and su$cient conditions) the optimal
feeding policy for a fed batch bioreactor for the wastewater treatment. Green's method will be
used for this purpose. A contribution in this aspect is the consideration of varying substrate
concentration in the input #ow , which is an important disturbance. Analytical expressions are
derived and the interest is not in a numerical procedure. This leads to an understanding of
the fundamental features of the optimal strategy, that is not possible by numerical solutions.
Copyright 1999 John Wiley & Sons, Ltd. Optim. Control Appl. Meth., 20, 145}164 (1999)
WASTEWATER TREATMENT 147
(2) A feedback control law will be found that solves the optimal problem for di!erent initial
conditions. (3) A robust feedback control law will be given that is almost optimal and is robust
against some disturbances and parameter uncertainties in the model of the plant.
F (t)
XQ (t)" k(S(t))! X(t)
<(t)
1 F (t)
SQ (t)"! k(S(t))X(t)# (S (t)!S(t)) (1)
> <(t)
Copyright 1999 John Wiley & Sons, Ltd. Optim. Control Appl. Meth., 20, 145}164 (1999)
148 J. MORENO
i.e. the quantity of substrate degraded during the cycle divided by ¹ , the cycle time (The value of
¹ depends on the input function F (t)). If we assume that the shape of the substrate concentra-
tion in the pipeline does not change with time, then for every pair of control functions F (t), F (t)
that satisfy R F (q) dq"R F (q) dq, for some t , t *0, it follows that RF (q)S (q) dq"
R F (q)S (q) dq. Therefore the numerator of the expression for e is equal for all
control inputs
that satisfy 2 F (q) dq"< !< , and the maximization of e coincides with the minimization of
D
¹ . The cycle time ¹ consists of a "xed period ¹ , for decantation and emptying the tank, and of
the "ll and reaction time ¹ , which can be controlled.
Therefore it is sought a state feedback control law for the input variable F that brings the
system from a given initial state x "[X , S , < ] to a "nal one x "[X , S , < ], in a set of
desired "nal states X &+x "0)S )S , < ,, in minimal time, using an admissible input
function and along an admissible trajectory.
According to the physical conditions of the system an input function is considered admissible if
0)F )F (2)
and a trajectory is also admissible if for every time t*0 it lies in the region
) &+(X, S, <)"X'0, S*0, 0(< )<)< , (3)
The case X"0 is excluded because it is not physically interesting (the reactor is &dead'), and if
X '0 it cannot be reached for any input by the system (1). The restrictions for the volume of the
tank < come from the fact that the tank cannot be completely emptied and that it has "nite
physical dimensions.
The cost functional to be minimized is the reaction time ¹ , i.e.
2
J[F ]" dq (4)
Under the conditions imposed on S (t) the quantity of substrate input into the tank at any time,
i.e. R F (q)S (q) dq, depends only on the quantity of water that has been input, i.e.
R F (q) dq"<(t), and not on how this is done, i.e. on the form of F (q). Therefore the input
quantity of substrate is a function of the volume change
R
F (q)S (q) dq"=(<(t))!=(< ) (5)
For simplicity it will be assumed that =( ) ) is a twice continuously di!erentiable function of its
argument. Di!erentiating (5) with respect to t it can be seen that S (t) can be replaced by
a function of <(t), i.e.
S (t)"SI (<(t))"d=(<(t))/d< (6)
Note that (6) implies that =(<) is a monotone increasing function of < and that SI ( ) ) is once
continuously di!erentiable. To solve the posed problem it will be useful to introduce new state
variables: z &X<, the total amount of biomass, z &S<, the total amount of substrate, and
z &<. The dynamics of the system in these new variables is given by
zR (t)"k(z (t)/z (t))z (t)
1
zR (t)"! k(z (t)/z (t))z (t)#SI (z (t))F (t) (7)
>
zR (t)"F (t)
Copyright 1999 John Wiley & Sons, Ltd. Optim. Control Appl. Meth., 20, 145}164 (1999)
WASTEWATER TREATMENT 149
The corresponding initial and "nal states and the "nal set are z "[z , z , z ]"
[X < , S < , < ]; z "[X < , S < , < ]; and Z &+z "0)z )S < , z "< ,, respectively.
This is a typical time optimal control problem, which is usually solved recalling the Maximum
Principle of Pontryagin. In this paper an alternative method based on Green's theorem will be
used for solving this problem.
Dexnition 1
The reachable set from z is
R(z )&+z3R"z z,,
where z z means that there exists an admissible time function F such that z" (t, F , z ), for
some "nite t*0.
The following proposition gives some properties of the reachable set for system (7)
Proposition 2
Let z2"[X < , S < , < ] and F satisfy (3) and (2), respectively. For system (7) the following
statements are true:
p ) (f (z)#g(z)F )"0
Copyright 1999 John Wiley & Sons, Ltd. Optim. Control Appl. Meth., 20, 145}164 (1999)
150 J. MORENO
The expression for surface (9) can be found integrating between 0 and t the equation
Remark 3
It follows easily from Proposition 2 that the plant (7) is not controllable, i.e. not every pair of
points, even in the permitted region (3), can be connected through a trajectory. Given the initial
point z all reachable states lie on the surface p(z ).
Remark 4
As an important consequence of Proposition 2 one has that the optimization problem is not
well posed because of the lack of controllability of the plant. For the problem to make sense, if the
initial state x "[X , S , < ] is given, then the "nal state x "[X , S , < ] has to be on the
surface p(z ) (9). In other words, if x is given, only two components of x can be arbitrarily
chosen, and the third one will be determined by the surface p(z ). So for example if [S , < ] are
selected, X has to be chosen to satisfy (9).
Remark 5
The existence of the invariant surface p(z ) for the system is a direct consequence of the
conservation of mass in the biological reactor: the ongoing mass of substrate is converted in
cellular mass or it accumulates in the tank. If there would be a decaying term in the balance of
X in (7), the balance equations (7) would not re#ect this conservation of mass, and therefore there
would not exist the invariant surface p(z ).
Remark 6
It follows from Proposition 2 that the set
Copyright 1999 John Wiley & Sons, Ltd. Optim. Control Appl. Meth., 20, 145}164 (1999)
WASTEWATER TREATMENT 151
Proposition 2 shows that if an initial state z is given, the dynamics of the system evolves on the
two dimensional surface p(z ). One can therefore "nd a representation of the dynamics of the
plant on this surface.
Proposition 7
Let z be a given initial state for the system (7) and let )(z ) be the invariant set de"ned by (10).
Then the dynamics on )(z ) of the plant (7) can be described by a set of two ordinary di!erential
equations and an algebraic equation
1 SI (<)!S
SQ "! k(S) (>(=(<)/<!S)#o(z )/<)# F
> <
Proof. From (9) one can obtain the third equation of (11) and replacing it in (1) the rest of (11)
will follow. )
¹ime optimal control problem (OP): Let a surface p(z ) (9) together with the admissible set ) (z )
(13) be given. Let x 3) (z ) be an initial point and X &+x "0)S )S , < ,L) (z ) be
a set of "nal states for the system (12). Find an admissible control function F , to which
corresponds an admissible trajectory (t, F , x ), such that F transfers x to a point in X in
minimal time, i.e. J[F ] in (4) will be minimized.
For some kinds of optimal problems in the plane Miele introduced a solution method
based on Green's theorem. The method consists essentially in three steps:
1. Determination of the attainable set for the problem, i.e. the region of the plane where the
trajectory path of a possible solution should lie.
2. By using Green's theorem the relative optimality of any two possible trajectories in the
attainable set can be determined without knowledge of the solutions of the di!erential
Copyright 1999 John Wiley & Sons, Ltd. Optim. Control Appl. Meth., 20, 145}164 (1999)
152 J. MORENO
equations, which describe the system. This permits the determination of the optimal
trajectory.
3. Once the optimal trajectory has been determined the last step consists in determining an
admissible control function (here F ), which leads to a solution of the system equations with
a trajectory arc which coincides with the optimal path found.
These steps will be further clari"ed in this section for the concrete time optimal problem (4).
The results in the references cannot be applied directly to the present problem but the technique
can be adapted to solve it.
Figure 1. Admissible set (shaded) and sign of the function u of Green's theorem
Copyright 1999 John Wiley & Sons, Ltd. Optim. Control Appl. Meth., 20, 145}164 (1999)
WASTEWATER TREATMENT 153
Proposition 8
Let x2"[S , < ]3) (z ) and X "+x "0)S )S , < ,L) (z ) be given, such that
S '0, and < (< )< . Let SM be the compact simply connected set bounded by the arcs
(t, F , x ), (t, 0, x ) and (!t, 0, x2"[0, < ]) and the segment j"+(S, <)"S"0,
< )<)< ,. Let also S&SM 3 j, i.e. S is the set SM without the left boundary (see Figure 1). Then
S"R(x )5R(X ) and its interior is not empty.
Proof. Note that since X '0 then S(t)(o(z )/><(t)#=(<(t))/<(t) for every F (t) and
t*0. Let us describe "rst the three trajectories that de"ne S:
(1) (t, 0, x ): <(t)"< and SQ "!kX/>, i.e. < is constant and S tends asymptotically to
S"0, when t goes to R. Therefore j is not reached in "nite time.
(2) (!t, 0, x ): <(t)"< and SQ "kX/>, i.e. < is constant, S grows monotonically and
asymptotically towards S"o(z )/>< #=(< )/< (i.e. X"0).
(3) (t, F , x ): <(t)"< #F t, i.e. < grows monotonically and 0(S(o(z )/
>< #=(< )/< . Therefore this trajectory intersects the line <"< at a unique point
0(S< (o(z )/>< #=(< )/< .
Now let us prove the proposition:
(a) Assume y,S. It will be shown that y,R(x )5R(X ). Write yO(S , < ). There are four
W W
possibilities for y to be outside S. Let us consider each case:
1. y is to the left of S"0, i.e. S 60. From Proposition 2 and the preceding discussion it
W
follows that y,R(x ).
2. y is over the line <"< , i.e. < '< . Since <Q *0 it follows that y,R(X ).
W
3. y is under the line <"< , i.e. < (< . Since <Q *0 it follows that y,R(x ).
W
4. y is to the right of the arc (t, F , x ). In this case it happens that y,R(x ). To show this
note that the only possibility to reach y from x is crossing the arc (t, F , x ), since this
trajectory goes to in"nity for big t and no trajectory can go around x under the line <"< .
To cross the arc (t, F , x ) it is necessary that the velocity vector x for some F at
some point on the arc points to the right of it. But this is not possible because the velocity
vector for any F is always between the corresponding vectors for F "0 and F "F ,
and the velocity vector for F "0 points always to the left of the arc (t, F , x ) for any
point in S.
(b) Assume y3S. It will be shown that y3R(x )5R(X ) . If y"(S , < ) then the following
W W
control strategy will always steer x to y: make F "F until the line <"< is reached
W
(this occurs in "nite time), and then change to F "0 until y has been reached. Therefore
y3R(x ). The following control strategy always steers y to X : make F "F until the
line <"< is reached, and then change to F "0 until X has been reached. Since < '<
and S '0 then it is clear that the interior of S is not empty. )
Proposition 9
Under the hypothesis of Proposition 8 there exists a solution to the time optimal control
problem (OP).
Proof. This follows easily from standard results on existence of optimal controllers. See for
example (Corollary 2, Section 4.2). )
Copyright 1999 John Wiley & Sons, Ltd. Optim. Control Appl. Meth., 20, 145}164 (1999)
154 J. MORENO
2 2 xR g (x)!xR g (x) . g (x)
J[F , P , P ]" dq"
g (x)
dq" dx ! dx
*(x) *(x) *(x)
.
i.e. as a line integral along the arc ( ), F , ) ).
Now suppose that there are two di!erent trajectories ( ), F , )) and ( ), F* , ) ), both joining
P to P in S, and having no points other than P and P in common. Let ! be the closed curve
formed by these trajectory arcs. If ! is traversed in counterclockwise direction by following "rst
the arc of ( ), F , )) from P to P and next the arc of ( ), F* , )) from P to P , then the
di!erence of the functional values of the trajectories
g (x) g (x)
J[F , P , P ]!J[F* , P , P ]" dx ! dx (15)
*(x) *(x)
is a measure of the relative optimality of the two trajectories, i.e. if the di!erence is positive the
trajectory ( ), F* , )) is better than ( ), F , )), and vice versa.
Since the bounding curve ! is a Jordan curve, applying Green's Theorem (This is permissible
because f and g are once continuously di!erentiable functions in S), i.e.
*u *v
u dy#v dx" ! dx dy" u(x, y) dx dy
*x *y
0 0
to (15) the following result is obtained:
where
* g (x) * g (x)
u(x)" # (17)
*x *(x) *x *(x)
and ' is the region enclosed by !. Since u(x) is uniquely determined for all x3S and can be
calculated without solving the di!erential equation (12), then (16) provides a direct means for
determining the optimal strategy. This has to be done for each concrete case. In next section this
will be pursued for some concrete situations of the wastewater treatment reactors.
Copyright 1999 John Wiley & Sons, Ltd. Optim. Control Appl. Meth., 20, 145}164 (1999)
WASTEWATER TREATMENT 155
theorem. The next step consists in "nding a control function F< leading to the optimal trajectory,
i.e. (t, F< , x ) is the optimal trajectory. For most of the cases it is easy to "nd such a control
function, so that this issue will not be further discussed.
If there is a control function which realizes the optimal trajectory two important questions are
if this control function is unique and if it is admissible. The uniqueness (within a set of measure
zero) of the control function is assured if the function *(x) is di!erent from zero along the
trajectory, i.e. *(x)O0 for x3 (t, F< , x ) (see References 17 and 18).
It may happen that the optimal trajectory can be realized by a control function F in a unique
manner but that this function is not admissible, i.e. F does not satisfy the restrictions imposed on
it. In this case the solution is not valid and the method is inconclusive. It is therefore important to
assure for each case that the admissibility condition on the control function is satis"ed.
The sign of u in R(x )5R(X ) depends essentially on the signs of dk/dS and (SI (<)!S), because
the denominator of (18) is always positive in this region. The following results are given only for
the case when the trajectories lie in the region S)SI (<), since then the integral (16) does not
have to be evaluated explicitly and its sign is su$cient information for the determination of the
optimal path. Therefore it will be assumed
(H1) For system (11) x is such that X '0, and SI (<(t))!S(t)*0 for t*0 and <(t))< ,
where <(t) and S(t) correspond to the trajectory (t, F , x ).
If (H1) is not satis"ed the optimal control law can be calculated integrating (16) explicitly. That
(H1) is satis"ed will depend in general on the parameters of the system, the form of SI (<) and the
initial conditions. The following lemma gives some su$cient conditions for (H1) to be ful"lled
independently of the parameters of the system:
Lemma 10
For system (11) suppose that x is such that X '0, SI (< )!S *0, that SI (<) is di!erenti-
able and dSI (<)/d<*0 for < )<)< , then SI (<(t))!S(t)*0 for t*0 and <(t))< for
every admissible F (t).
Proof. Set e&SI (<)!S. Therefore eR "!F e/<#k(S)X/>#SI (<)F and it can be
easily seen that if e(0)"SI (< )!S *0 and SI (<)*0 then e(t)"SI (<(t))!S(t)*0 for
t*0. )
Copyright 1999 John Wiley & Sons, Ltd. Optim. Control Appl. Meth., 20, 145}164 (1999)
156 J. MORENO
In particular if S (t) is constant the conditions of the lemma are satis"ed. Two cases for the
form of the speci"c growth rate k(S) will be considered: monotonic k(S) (Monod law); and
non-monotonic k(S) with just one maximum point (Haldane model).
Theorem 11
Let k(S) be positive (i.e. k(S)'0 for S'0), k(0)"0, bounded (i.e. k(S))M for every S'0
and for some positive constant M), once continuously di!erentiable, and strictly monotone
Figure 2. ¹op: Monotonic speci"c growth rate: Monod law. Bottom: Haldane law
Copyright 1999 John Wiley & Sons, Ltd. Optim. Control Appl. Meth., 20, 145}164 (1999)
WASTEWATER TREATMENT 157
increasing, i.e. dk/dS'0 for every S*0. If (H1) is satis"ed then the time optimal problem for the
system (11) will be uniquely solved by the feedback control law
0, if <"< ,
F " (20)
F , if <(< ,
and the reaction will be "nished if (<"< )(S)S ).
Proof. From (H1) it follows that there is no point of the set +S'SI (<), in the attainable set
R(x )5R(X ). Because k(S) is strictly monotone increasing the sign of the function u(x) (see (18))
is negative in all the attainable set (except possible on the right boundary (t, F , x )).
According to Green's theorem the global and unique time optimal trajectory consists at most of
two arcs:
(i) First the arc (t, F , x ) will be followed until <"< is reached, and
(ii) if the substrate concentration is still bigger than required, i.e. S'S , then a trajectory arc
corresponding to (!t, 0, X ) should be followed (backwards) until the desired set X has
been reached.
The feedback control law for F , necessary to obtain this trajectory, can be expressed as in (20),
and its uniqueness is assured by the fact that *(x)O0 on the trajectory. )
Remark 12
In the present case the control function is of the Bang}Bang type, as is typical for time optimal
control problems. The same solution applies for the original problem with system (7).
Remark 13
For the implementation of the feedback control law (20) it is necessary to measure the volume
of the tank <, to determine the end of the "ll phase, and the concentration of substrate S, to decide
the end of the reaction phase, i.e. when S has been reached.
k S
k(S)" (21)
K #S#S/K
Q G
where K (M L\) is the a.nity constant, K (M L\) is the inhibition constant and k (T\) is the
Q G
maximum speci"c growth rate. The maximum value of the speci"c growth rate k* for the
substrate concentration S* is characteristic for the Haldane law.
This type of speci"c growth rates are typical for processes where the substrate is a toxic
substance and, for big concentrations, inhibits the activity of the biomass. This is the case in
the treatment of industrial wastewater.
The following theorem gives the solution of the time optimal control problem for a generic
class of Haldane-type speci"c growth rates.
Copyright 1999 John Wiley & Sons, Ltd. Optim. Control Appl. Meth., 20, 145}164 (1999)
158 J. MORENO
Theorem 14
Let k(S) be positive (i.e. k(S)'0 for S'0), k(0)"0, bounded (i.e. k(S))M for every S'0
and for some positive constant M) and once continuously di!erentiable. Furthermore let k(S) be
a Haldane-type function, i.e. it is monotonically increasing (dk/dS'0) up to the point S*, where
the maximum value k* is reached, and for S'S* the function is monotonically decreasing
(dk/dS(0). If (H1) is satis"ed, SI (<)*S* for < )<)< , S )S* and F )F , then the
time optimal control problem for the system (11) will be uniquely solved by the feedback control
law:
(1) If V"< then F "0 until S)S , then stop
(2) If <(< and S"S* then F "F until <"< , then go to (1)
F* " (3) If <(< and S'S* then F "0 until S"S*, then go to (2) (22)
(4) If <(< and S(S* then F "F until S"S*, then go to (2)
or until <"< , then go to (1)
where F is the control function that achieves that S"S*, i.e.
k*<X
F " (23)
>(SI (<)!S*)
Proof. From (H1) it follows that there is no point of the set +S'SI (<), in the attainable set
R(x )5R(X ). Because k(S) is monotonically increasing up to S* and then monotonically
decreasing, the function u(x) (see (18)) is negative for S(S*, zero for S"S*, and positive for
S'S* (except possible on the right boundary (t, F , x )), (see Figure 1). According to Green's
theorem the global and unique time optimal trajectory consists of at most three arcs. They will be
described depending on the position of the initial point x :
1. If < "< : The trajectory (!t, 0, X ) will be followed (backwards) until the "nal point
S"S will be reached.
2. If (< (< )(S 'S*): the optimal trajectory consists of three arcs: (see Figure 3)
(a) Follow the trajectory arc (t, 0, x ) until S"S*,
(b) then follow the trajectory (t, F , [S*, < ]), that maintains S"S*, until the tank is
"lled <"< . This is possible since F )F .
Figure 3. Time optimal trajectory for a Haldane-type function (*). Boundary layer and (possible) trajectory for the
Robust feedback control law (} })
Copyright 1999 John Wiley & Sons, Ltd. Optim. Control Appl. Meth., 20, 145}164 (1999)
WASTEWATER TREATMENT 159
(c) If the concentration of substrate is still bigger than required (S'S ), the trajectory
(t, 0, [S*, < ]) will be followed until S"S .
3. If (< (< )(S (S*) the time optimal trajectory is: Follow (t, F , x ) until S"S*
(in this case go to step (ii) (b)) or <"< (then go to step (ii) (c)).
The feedback control low for F , necessary to obtain all this trajectories, can be expressed as in
(22), its uniqueness is assured by the fact that *(x)O0 on the trajectory and its admissibility is
assured by the hypothesis F )F .
F is the control function that makes S"S*, which is a singular arc of the trajectory
From equation (7), making dS/dt"0, it is easy to arrive to the expression (23) for F .
)
Remark 15
The control law (22) is not, in general, of Bang}Bang type, because it can have a singular arc. It
can be implemented, for the original system (7) if all state variables X, S and < and the
disturbance SI (<) or S (t) can be measured.
0 if (<"< )R(S'S*)
F " F if (S"S*)(<(< ) (24)
F if (S(S*)(<(< )
It is easy to see that S"S* is a sliding surface and that the control law is discontinuous across it.
Because of noise, disturbances and necessary imperfection of the implementation of the control
this leads to chattering, what is highly undesirable in practice. It is also easy to note that the
singular control (23) is just the equivalent control in Filippov's construction. Using well-known
techniques in the sliding mode control the discontinuous law can be smoothed by di!erent means
in such a way, that the trajectory stays arbitrarily near to the sliding surface. However it is not
clear that the so obtained trajectory is also arbitrarily near optimality. It will be shown that any
(smoothed) control law that maintains the trajectory in an e-boundary layer is also e-time
optimal.
Copyright 1999 John Wiley & Sons, Ltd. Optim. Control Appl. Meth., 20, 145}164 (1999)
160 J. MORENO
Theorem 16
Let the hypothesis of Theorem 14 be satis"ed. Suppose that the optimal control law (22) is
replaced by one of the form
0 if (S*S*#e)R(<"< )
FC " F if (S*!e)S)S*#e)(<(< ) (25)
F if (S)S*!e)(<(< )
where
o(z ) =(< ) o(z ) =(< )
0(e(min S*, # !S*, # !S*
>< < >< <
and F is any function that has values between 0 and F when the trajectory is within the
boundary layer
B "+(X, S, <)"S*!e)S)S*#e,
C
neighbouring the sliding surface. Then for every initial condition x 3) J[FC ]"J[F* ]#¹(e),
such that lim >¹(e)"0, and ¹(e) is bounded for every x . In other words the time along the
C
trajectory (t, FC , x ) can be made arbitrarily near to the optimal time by decreasing the width of
the boundary layer B (see Figure 3).
C
Proof. Fix e'0 and x . Consider two cases: whether the optimal trajectory touches or does
not touch the set B&B !+S*!e)S)S*#e, <"< ,. If it does not then ¹(e)"0, since then
C C
(t, FC , x ) and (t, F* , x ) are identical.
In the other case it will be shown that if (t, F* , x ) or (t, FC , x ) touches once B, then it will
C
stay in B and will converge to the set +S*!e)S)S*#e, <"< , where it can eventually
C
leave B . For this it is enough to show that on the boundaries !>"+(X, S, <)"S"S*#e, and
C
!\"+(X, S, <)"S"S*!e, of B the vector "eld points into the interior of B, when this
C C
intersection lies in the region given by S(=(<)/<#o(z )/(><). For the points of the intersec-
tion that lie outside that region then by the hypothesis of the theorem and because of the results of
Proposition 2 they cannot be reached and the trajectory cannot go out of B through such points.
C
Consider "rst the vector "eld of system (11) on !>, for F* or FC , given by the vector
1 2
f(x)" ! k(S)(>(=(<)/<!S)#o(z )/<), 0 .
>
f (x) points into the set B for every <'0. Now on the other boundary !\ the vector "eld
C
1 SI (<)!S 2
f (x)#g(x)F " ! k(S)(>(=(<)/<!S)#o(z )/<)# F ,F ,
> <
for either F* or FC , also points into B for every 0(<(< . This follows from the fact that for
C
every 0)S(S*, and <'0 the "rst component of f(x)#g(x)F ,
1 SI (<)!S
c(S, <)"! k(S)(>(=(<)/<!S)#o(z )/<)# F ,
> <
is strictly positive (c(S, <)'0), if the hypothesis F )F is satis"ed and k(S) is a Haldane-type
function. To see why note "rst that for <'0, c(0, <)'0, and F )F implies that for <'0,
Copyright 1999 John Wiley & Sons, Ltd. Optim. Control Appl. Meth., 20, 145}164 (1999)
WASTEWATER TREATMENT 161
c(S*, <)'0. These two conditions cannot be simultaneously satis"ed if c(S, <)"0 has a solution
for S3 (0, S*). This follows easily by writing the equation c(S, <)"0 as
S!SI (<)
k(S)# > F "0
<(>(=(<)/<!S)#o(z )/<)
and noting that both terms of this equation are monotonically increasing functions of S for
S3 (0, S*).
Now it will be shown that if a trajectory starts in B it will reach the set
C
+S*!e)S)S*#e, <"< ,, where it can eventually leave B . For this note that for a point in
C
the boundary layer S*!e)S)S*#e, and therefore k )k(S))k*, where k &
C C
min[k(S*#e), k(S*!e)]. From (7), i.e. cR "k(S)c, where c&X<, and standard di!erential
inequalities it follows easily that for every trajectory starting in t"0 in B at X(0)"X ,
C
<(0)"< , i.e. c "X < , for any time t*0 the inequality c exp(k t))c(t))c exp(k*t) is
C
satis"ed. Since (11) c">(=(<)!S<)#o(z ) and using the conditions on e it is easy to see that
the maximal (¹C ) and minimal (¹C ) times of permanence of a trajectory in the set B are given
C
by
1 c*#>< e 1 c*!>< e
¹C " ln and ¹C " ln ,
k c*!>< e k* c*#>< e
C
where c*">(=(< )!S*< )#o(z ) and c*">(=(< )!S*< )#o(z ). Since the time di!er-
ence between the two trajectories obtained by the two controls F* and FC is only caused by the
time di!erence in the set B , i.e. ¹C!¹C , where ¹C is the residence time in B with the input
C C
FC and ¹C is the residence time in B with the input F* . It is clear that ¹C )¹C )¹C)¹C
C
and that for every x considered ¹C is bounded and therefore ¹(e) is bounded. Furthermore
since k(S) is continuous, bounded away from 0 in B and lim k "k* it follows that
C C C
lim >¹C"lim >¹C "(1/k*) ln (c*/c*) and therefore lim >¹(e)"0. )
C C C
For the implantation of this robust control law it is only necessary to know: that the speci"c
growth rate is a Haldane-type law (the speci"c form is not important); the value of S*, the
measurement of S, the moment when <"< , and that the conditions of the theorem are satis"ed.
It is therefore robust against all parameters of the plant (except for S*"(K K ), the value of S ,
Q '
the value of the biomass concentration X, and the exactness in the measurement of <, since only
an on}o! controller in this variable is necessary. It is clear from the foregoing theorem that ¹(e) is
small if e is small and if (k*!k ) is also small. On the other side if e is small the control input is
C
more likely to chatter and the frequency band of the input is higher, what is not desirable.
Moreover if the disturbance S changes a lot the control input has to switch more frequently.
Therefore there is a trade-o! between been near to optimality, the frequency band of the control
signal and the uncertainty in the parameters (to determine an upper bound for (k*!k )) and in
C
the disturbance. Finally a possible and simple form of F in FC is F"(1!(S!S*)/e)F /2,
a linear function in B .
C
Copyright 1999 John Wiley & Sons, Ltd. Optim. Control Appl. Meth., 20, 145}164 (1999)
162 J. MORENO
advantages of using the optimal-strategy some simulations for a realistic plant will be run for the
optimal control and for a batch-strategy, for which the reactor will be "lled as fast as possible and
the reaction phase will be stopped as soon as S)S .
The parameters of the model have been taken from Reference 20. The substrate to be degraded
is phenol. Because of the inhibitory e!ect of phenol on the biomass, the speci"c growth rate
follows the Haldane law (21).
The values of the used parameters were: < "50 m, F "50 m h\, K "2 mg l\,
Q
K "50 mg l\, k "0)072 h\ and >"1/2. The substrate concentration in the input #ow
G
S will be considered to be 200 mg l\ until the reactor has reached a volume of 25 m and there
it changes abruptly to S "400 mg l\ until the end (this function is not continuously di!erenti-
able but can be approximated by one with any desired degree of accuracy).
As initial condition (X , S , < ) for the "rst cycle and "nal condition (S ,< ) for every cycle the
values: X "13 000 mg l\, S "50 mg l\, < "5 m, S "1 mg l\ and < "< were used.
As initial values of X and S for the second and following cycles will be considered the "nal values
of the foregoing cycle. In each cycle a total time of 0)65 h has been included for the settling and
drawing phases.
Figure 4 show the simulations results for several SBR-cycles using both strategies. A robust
implantation was used with e"0)05. In them the time behaviour of two relevant variables is
shown: S, the concentration of phenol in the tank (mg l\) and F , the input water #ow to the
tank (m h\). Note that the amount of phenol treated in each cycle is equal for both strategies.
Note "rst that while one cycle is completed with the batch-strategy almost two cycles have been
done by the optimal-strategy. This means that the optimal control law allows to treat almost two
times more water than with the batch-strategy. If, as usual in practice, a 24 h-strategy is implanted
instead of the batch-strategy the comparison with the optimal-strategy is obviously worse. If the
optimal control can be implanted a much smaller reactor can treat the same amount of water
than the one needed by the other control methods.
From Figure 4 one can also notice that the substrate concentration in the reactor with the
batch-strategy is much higher than with the optimal one. Since the substrate is a toxic substance
these high concentrations can cause the death of the biomass, an e!ect that has not been included
in the model (1), but that can be observed experimentally, and makes the optimal-strategy also
more attractive for the operation of the treatment plant. Moreover the substrate concentration in
the tank is independently of the concentration in the input #ow (S ) for the optimal-strategy
whereas for the batch-strategy an increase in S causes an increase in S in the tank (this is called
a Shock Load) and reduces the performance of the plant. This implies that the optimal-strategy is
an excellent solution for Shock-Loads. The predicted robustness of the algorithm was tested by
simulations (not shown).
There is obviously an advantage in using the optimal strategy or some feedback strategy
instead of the batch-strategy or the usual one of 24 h per cycle. The complexity in the measure-
ment of the state variables and in the equipment to implant the feedback control law is the pay o!
for the better performance of the plant. This is really a challenge because the di$culty in the on
line measurement of the substrate concentration S and of the biomass concentration X.
8. CONCLUSIONS
Motivated by the problem of e$ciency optimization of an SBR used in the wastewater treatment,
the time optimal control problem of a family of models of such reactors has been solved. An
important di!erence with existing works is the consideration of a variant substrate concentration
in the input #ow, which is the main disturbance for these processes. For two di!erent general
Copyright 1999 John Wiley & Sons, Ltd. Optim. Control Appl. Meth., 20, 145}164 (1999)
WASTEWATER TREATMENT 163
Figure 4. Simulation of some cycles of the SBR using the batch (*) and the optimal (} }) strategies. ¹op: Substrate
concentration, Bottom: Input #ow
forms of the speci"c growth rate k(S), which are often found in practice, the solution of the
optimal problem has di!erent characteristics. If k(S) is a Monod-type function the solution
is of Bang}Bang type, while it has a singular arc if the speci"c growth rate is a Haldane-type
function.
The solution method for the time optimal problem was, instead of the usual Maximum
Principle of Pontryagin, a method based on Green's theorem. Global and necessary and su$cient
conditions for optimality were obtained and the solution of the singular case was possible
using this technique. As the original model is of third order and the method is only usable for
systems in the plane, an equivalent second-order description of the original model had to be
found. This was possible because the uncontrollability of that model, so that a minimal descrip-
tion of it is of second order, and therefore suited for Green's method. Analytical instead of
numerical solutions for the problem were obtained. This has lead to the development of a robust
feedback control law that is, on the one side, as near to optimality as desired and, on the other
side, has important robustness properties. Furthermore for the implementation of this control
law it is necessary neither to measure all the state variables nor the perturbation signal, and only
one parameter is really necessary to be known. There is of course a trade o! between optimality
and robustness.
Simulations of a realistic model of an industrial wastewater treatment plant have shown
the advantages of using an optimal strategy in the control of the plant. The increase in
e$ciency is high, what reduces the costs of operation and the size of the plant. Further-
more the solution of the usual problem of shock-loads for batch and continuous reactors, and
the death of the microorganisms caused by them is another positive aspect of the optimal-
strategy.
Copyright 1999 John Wiley & Sons, Ltd. Optim. Control Appl. Meth., 20, 145}164 (1999)
164 J. MORENO
ACKNOWLEDGEMENT
REFERENCES
1. Irvine, R. L. and L. H. Ketchum Jr., &Sequencing batch reactors for biological wastewater treatment',
Critical Rev. Environ. Control, 18, 255}294 (1989).
2. Bailey, J. E. and D. F. Ollis, Biochemical Engineering Fundamentals, 2nd ed., McGraw-Hill, New York,
1986.
3. SchuK gerl, K. Bioreaction Engineering, Vol. I, Wiley, Chichester, 1987.
4. Pontryagin, L. S., V. G. Boltyanskii, R. V. Gamkrelidze and E. F. Mischchenko, ¹he Mathematical
¹heory of Optimal Processes, The Macmillan Company, New York, 1964.
5. Lee, E. B. and L. Markus, Foundations of Optimal Control ¹heory, Wiley, New York, 1967.
6. Miele, A., &Application of Green's Theorem to the extremization of linear integrals', Symp. on <ehicle
Systems Optimization, Garden City, L. I. New York, 1961, pp. 26}35.
7. D'Ans, G., D. Gottlieb and P. Kokotovic, &Optimal control of bacterial growth', Automatica, 8, 729}736
(1972).
8. D'Ans, G., P. Kokotovic and D. Gottlieb, &A nonlinear regulator problem for a model of biological
waste treatment', IEEE ¹rans. Automat. Control, 16, 341}347 (1971).
9. Hong, J. &Optimal substrate feeding policy for fed batch fermentation with substrate and product
inhibition kinetics', Biotechnol. Bioengng., 28, 1421}1431 (1986).
10. Modak, J. M., H. C. Lim and Y. J. Tayeb, &General characteristics of optimal feed rate pro"les for
various fed-batch fermentation processes', Biotechnol. Bioengng., 28, 1396}1407 (1986).
11. Lim, H. C., Y. J. Tayeb, J. M. Modak and P. Bonte, &Computational algorithms for optimal feed rates for
a class of fed-batch fermentation: numerical results for penicillin and cell production', Biotechnol.
Bioengng., 28, 1408}1420 (1986).
12. San, K. and G. Stephanopoulos, &Optimization of fed-batch penicillin fermentation: a case of singular
optimal control with state constrains', Biotechnol. Bioengng., 34, 72}78 (1989).
13. Tsoneva, R. G., T. D. Patarinska and I. P. Popchev, &Augmented Lagrange decomposition method for
optimal control calculation of batch fermentation processes', Bioprocess Engng., 18, 143}153 (1998).
14. Kuhlmann, Ch., I. D. L. Bogle and Z. S. Chalabi, &Robust operation of fed batch fermenters', Bioprocess
Engng., 19, 53}59 (1998).
15. Van Impe, J. F. and G. Bastin, &Optimal adaptive control of fed-batch fermentation processes', Control
Engng. Practice, 3, 939}954 (1995).
16. Bastin, G. and J. F. Van Impe, &Nonlinear and adaptive control in biotechnology: a tutorial', European J.
Control, 1, 37}53 (1995).
17. Hermes, H. and J. P. LaSalle, Functional Analysis and ¹ime Optimal Control, Academic Press, New
York, 1969.
18. Hermes, H. and G. Haynes, &On the nonlinear control problem with control appearing linearly',
J. SIAM Control. Ser. A, 1, 85}108 (1963).
19. Sontag, E. D., Mathematical Control ¹heory; Deterministic Finite Dimensional Systems, Springer, New
York, 1990.
20. BuitroH n, G., &BiodeH gradation de composeH s xeH nobiotiques par un procedeH discontinu de type SBR', PhD
¹hesis, Nr. 254, Institut National des Sciences AppliqueH es de Toulouse, France, 1993.
21. Slotine, J.-J. and W. Li, Applied Nonlinear Control, Prentice-Hall, Englewood Cli!s, NJ, 1991.
Copyright 1999 John Wiley & Sons, Ltd. Optim. Control Appl. Meth., 20, 145}164 (1999)