Professional Documents
Culture Documents
INVARIANT CONTROL OF pH
Ahslraet-A systematic treatment of the dynamics and control of acid-base reactions is presented. A state model
consisting of mass balances for the species present is formed. Through a linear transformation of the concentration
vector a new model is set up. The state vector of this model is partitioned into a reaction invariant and a reaction
variant part. The model is thus split into two parts, one describing the physical properties of the reactor system
independent of chemical reactions, the other describing the chemical reactions.
For fast acid-base reactions the reaction invariant part of the model is sufficient to define the thermodynamic
state of the system. The reaction rate vector is thus eliminated from the model. In this case the reaction variant
part of the model consists of a static equation, relating p&I to the reaction invariant state variables.
The model obtained provides a sound basis for design of control loops for feedback and feedforward control of
pH. As a diiect application a new scheme for adaptive control of pH is proposed.
and g denote l-, Z- and 3-acidic bases or ampholytes, multiplicity of the transparent group yi included in the
respectively. Further, hT = [H, H, . . , H]. The species ml.
dimension of all symbol vectors is equal, dim (a) = o. The relation to stoichiometry is contained in the con-
If not all weak acids in reaction system (2) are 3-basic, dition that is necessary to make the elements of y trans-
the symbol vectors g and d will include purely hypo- parent throughout the reactions. This condition is that A
thetical species. This is no limitation for the description and N possess orthogonal properties [7-91, i.e.
(2), because the dissociation constants of the conjugate
acids can be chosen to be zero. Thus the concentrations AN=O. (7)
of such hypothetical species will always be zero. The
choice of equal dimensions for all symbol vectors in (2) A should be constructed[7] so that rank (A) =
is made only to reduce the notation in the general treat- dim (m) - rank (N), in this case rank (A) = CY+ 1.
ment of stoichiometry and reaction invariance in the These two conditions are met through choosing a
sequel. For a specific case there is no need to construct suitable set of a + 1 species for the vector y from the set
such hypothetical species since the derivation of reaction of possible transparent species. The generality of the
invariants in the sequel is valid for all combinations of l-, reaction formula (5) indicates that atomic elements are
2- and 3-basic weak acids. not a suitable choice in this case. Furthermore, it should
The water concentration of dilute acid-base solutions be noted that hydrogen and oxygen are not transparent
is usually considered constant. To be able to utilize this species according to the reactions (5) because water is
assumption, the reaction formulae (2) should be modified not included in m. A natural choice of elements for y is
accordingly. The assumption that the concentration of the atomic groups which are the elements of the vector g.
water is constant leads to the modification of the first These atomic groups are the 3-acidic bases, which, ac-
reaction in (2) Cl= H +OH-, i.e. the symbol of water cording to the reaction formula (5), cannot yield further
is excluded from (2). This modification is in accordance protons. The atomic groups of the vectors d, b and a are
with the common representation of the degree of dis- obtained from the corresponding bases of group g
sociation of water, c,, . coH = K,. through adding one, two or three protons respectively.
The modified reaction formulae (2) can be written Thus g is a vector of transparent groups which are
compactly in standard matrix form contained in d, b and a in the ratio 1 : 1. This choice gives
(I of the elements of y and, thus, only one more element
N*m5 0 (3) is needed. A suitable choice is the total electric charge of
all species included in m. This is a valid choice because
where NT is the stoichiometric matrix and m is a vector the total charge of the species of m is not changed
of chemical symbols. The vector m should be chosen so through the reactions (5). It is suitable to denote this
as to give a stoichiometric _.
matrix of appropriate struc- element of the y vector y,. According to the elec-
ture. Such a choice is troneutrality condition, y, is equal to the negative total
charge of all species in the solution not represented in m.
III = [OH-, bq dT, g=, ar, H*]T (4) With this choice of transparent species eqn (6) may be
written
c1=
The modified reaction formulae (2) written in the form
(3) are then YI
Y2
-1 (jr-]) (j-2i) (j-31) j
0 I I I I
tie. (5)
1Y1
-jTyz = -1 -iT -2i -3iT oT 1
I I I I em. w2 = CH,CO, + CHCOl + cco,
YZ I c0 3
(9) w3 = C&S f CHS + cs
wq = CH$KlJ + cHsOl+ csox.
It is easily confirmed that this new matrix is a true
invariance matrix for the reactions (5) satisfying the
orthogonality condition (7) and having a rank = n + 1. In example 3 the nondissociated acid is a charged ion,
In the linear transformation above the charges of the NH,. This example illustrates that eqns (1 I) and (12) are
weak acids disappeared from the invariance matrix. This independent of possible charges of the considered acids.
emphasizes the important fact that the derivation of In this case the expression for w, differs from the
reaction invariant state variables and dynamic properties common expression for the electroneutrality condition.
is independent of the eIectric charges of the weak acids However, addition of w2 to w, gives another reaction
present. invariant state variable..
The reaction invariant state variables are now chosen
as the concentrations of the transparent species defined
in eqn (9). The reaction invariant state vector, w, is then
defined as a vector resulting from a linear transformation which is the familiar expression for the electroneutrality
of the concentration vector e= condition.
[COH, CbT, cd=, c,=, c,=, CHIT by means of the invariance One comment can be added. If two acid-base solutions
matrix, i.e. are mixed, the reaction invariants can be directly
averaged to form the reaction invariants of the mixture.
The reaction invariant vector of a mixture of a flow FA
with w,, and a flow Fa with wa is thus
w=~w*++wB~
FA FE4
Equation (10) defines a convenient set of reaction Fa FB +
W*=c,+cb+c,+c,. (12)
phase rule of Gibbs. For a system of C components reactor, a relation between pH and w has still to be
(including the solvent), P phases and R independent derived. This is done as follows. The equilibrium con-
chemical reactions at equilibrium, the degrees of ditions for the reaction formula (5) are
freedom are [1 11
CHCOH = K,
F= C+2-P-R. (13)
CHC~ = K,c,
An acid-base reaction system with chemical reactions (18)
CHCd = K&b
according to eqn (5) involves dim (m) + 1 components.
The assumption of chemical equilibrium involves CHCg = &Cd.
rank (N) independent reactions at equilibrium. For a sys-
tem of one phase the number of state variables needed is The equilibrium matrices K,, Kb and K, are constant
thus diagonal matrices, i.e. IL = diag %.I, &z, . - . , k..)
where k,, is the first dissociation constant of the weak
F=(4cu+3)+2-1-(3a+l)=a+3. (14) acid i, kb,, is the second dissociation constant and so on.
Inserting the equilibrium conditions (18) into eqns (11)
When two state variables are chosen as temperature and and (12) gives
pressure, which in the sequel will be considered constant
and therefore can be neglected, the remaining number of
state variables needed to define the acid-base reaction
system at chemical equilibrium is a + 1.
The material balance of a chemical reactor including a
_ 3 kw ki Cb.i
#=I
number of feed streams and a number of effluent streams
may generally be written Kb
wz= K,-cH+I+-++ b. (20)
CH
~(~cdV)=~F,c,-~P.e.+NlrdV (15)
Equation (20) may rewritten form
(16)
express the equations for the titration curve. This is the sequently affects only the first partial system of eqn (23).
case in a titration with a strong acid or base. The change The dynamics of the control loop may then be represen-
in w, equals the amount of strong acid added as titrant ted by the scalar equation
per volume of the solution. If a strong base is used as
titrant, its amount added (per volume of solution) equals ydawl =F,Aw,,~iF,Aw,,,-F.Aw, (24)
the change in - w,. Thus, with a suitable choice of zero dt
point, w, may represent the amount of titraut added and
eqn (22) the titration curve. An illustration is,given in [IO] and in a linear control loop F, is manipulated through a
of how this can be utilized for calculation of pH for a linear feedback of Aw,. When the control stream con-
mixture composed of solutions of unknown composition tains only strong acids or bases the reaction invariant
but with known titration curves. variable w,.< of this stream is w,,, = cH.,- - coH.P. Thus,
if cus s cOH,< or cH,= * con,. the reaction invariant
4. REACTION INVARIANT FEEDBACK variable may be considered equal to cut or - tour,
CONTROL OF pE respectively.
We shall now analyze the control of pH, for simplicity As stated above a linear control system necessitates
in a completely mixed stirred tank reactor, starting from feedback of not only pH but of the total concentration of
the state equation (23). w, is a function of pH while every weak acid present. To be able to compute w, the
w*, w3,. . . , w,,, are independent of pH. On the other concentration of at least one component of every acid-
hand, pH is a function of all reaction invariant variables base system present in addition to pH must be known.
w, to NJ,+,. A linear feedback control loop may be Usually these concentrations cannot be measured in
accomplished by feedback of the reaction invariant vec- practice, but the reaction invariant control scheme can
tor w. It may be convenient to feed back only Aw,. i.e. still be applied using an estimated relation between pH
the deviation of iv, from its set value. Because of the and Aw,.
linear relationship between Aw, and wi (i = 1,2,. . . , a + In many cases the total concentration of most or all
1) this in fact involves linear feedback of all elements of weak acids may be considered constant. Otherwise ele-
w. The ratios between the feedback coefficients for the ments of the w-vector might be estimated through suit-
different elements of w are obtained from eqn (22). able measurements or other information about the
Assume that the control is realized through manipulat- process.
ing a control stream with a constant state vector, w,. If As an illustration of the benefits of the linear process
the control stream does not contain all species of m, model, a method to estimate the reaction invariant state
which is the usual case, the treatment is simplified as of the reactor continuously is derived from this model in
the control action is limited to only a part of the system the sequel.
(23). If for instance the control reagent is a water solut- At this point it could be added that the above choice of
ion of a weak acid, the state vector will be w, = reaction invariants is by no means the only possible one.
ro.. . . , 0, Wi..,0, . . . , OIT, where wi., is the concentration There actually is a considerable freedom in choosing the
of the weak acid. The state w,.~ is zero because the species on which to base the reaction invariants. Or,
reagent is prepared from a weak acid and water, neither equivalently, the reaction invariants as chosen above can
of which affects the state wI. As a consequence of be calculated from measurements of other species than
chemical reactions the reagent will contain species such those included in m. An example, where an ion-selective
as H , OH , ampholytes and bases which are included in electrode is used for this purpose, is discussed in [7].
the formula (12) for w,, but because of the reaction
invariance the total effect of these species on w, will be
zero. In this case the control action will not alter the 5. APPLICATION EXAMPLE: ADAPTIVE REACTION
for a CSTR which in sampled form can be written 10, the mixture could be assumed to consist of 7 mono-
basic acids and conjugate bases, where pk, = 4, pkz =
w(k + 1) = &v(k) + lTu(k - n)+ w,(k - n)]. (25) 5.. ,pk, = 10. With proper values of qi+, (i E [1,7])
eqn (31) may then well approximate eqn (22) for any
Here dim (w) = a + 1 and the relation values of a, pk.,i, pkb,i and pt., (i E [1, a]) within the pH
interval in question.
w,(k) = w&H(k)} (26) The scalar estimation model (29) can be written in
terms of known or measurable variables, as
is defined by eqn (22). The relation
qi(pH(k + 1)) = cpq,{pU(k)}
w,.,(k) = w,{pH,(kH (27) (32)
+ ytn(k - a)+ qr{pHf(k - n)]]
is defined analogously.
Consider further the control reagent to contain only with the relation y&H} defined by eqn (31).
strong acids or bases, i.e. Inserting eqn (31) into eqn (32) and collecting terms
give an equation which is linear in q2
u(k) = [u(k), 0,. . , O]=. (28)
v(k + 1) = qT=v(k + 1) (33)
The physical parameters of the process, i.e. the
parameters describing the flow pattern, 0 = ~1, P = ?I with the scalar v(k + 1) defined as
and n, where p. y and n are scalars, are identical with
the reactor parameters in a situation where no chemical (k + ,)= ,0-&&a_ 10~(*+*)--14
reactions occur, e.g. a dilution process. They are con- _ p(lo-P~ _ ,OP* 14)
sidered to be known in the sequel. The pH value in the _ r(u(k _ n) + IO-P*-_ 10Hfk-m4).
reactor and that in the feed stream are considered
measurable. In addition the control vector is considered (34)
to be known. Thus, also pH, pH, and IJ are considered to
be known. The elements of the q-vector are defined as
The number and properties of the weak acid-base
systems are considered unknown. This means that in eqn
(22) (Yas well as pk,.e pkbei, pkd,i (i E [l, cu]) are unknown
parameters.
Estimation of w2, wj, _. , w, , , based on eqn (25)
would include identification of a and pk,.;, pka.i and pkd.i
(i E [l, a]). This identification task is in general too for-
midable for on-line application. Instead the following The recursive least squares (RLS) method[14,15] can
approach is used. be used for estimation of q2 in the model (33). The RLS
A model which is independent of the actual acid-base algorithm can be written
reactions occurring in the reactor is used. Such a model,
which, for the application in question, reasonably well qr(k + 1) = qz(k)+ L(k)[p(k + 1) - qzr(k)q(k + I)1
describes any process of fast acid-base reactions, can be (36)
set up by assuming some hypothetical reactions. The
mixture can, e.g. be assumed to consist of a number of L(k) = P(k)v(k + l)/[h + qT(k + l)P(k)q(k + l)]
(hypothetical) monobasic acids and conjugate bases in (37)
addition to the strong acids and bases.
Denoting the state variables of the estimation model with the auxiliary matrix P recursively defined as
by q. the estimation model takes the following form.
P(k + 1) = [P(k) - L(k)r)=(k + l)P(k)]/n (38)
q,(k + 1) = pq,(k) + r[u(k - n)+ q,.r(k - n)l (29)
P(0) is suitably chosen as a diagonal matrix
qz(k + 1) = q&k)+ rqr(k - n) (30)
P(0) = eI. (39)
with an a priori fixed order, dim (q2) = p, and a static
relation Summing up, the adaptive reaction invariant controller
operates according to the following scheme:
(1) Measure pH(k + 1) and pHf(k + 1).
q,=lO H-lo pHm14- i=l
f: 4i*1 1 + l;+prr (31)
(2) Compute v(k + 1) and q(k + 1) by use of eqns (34)
and (35).
with a priori fixed values pk,. (3) Compute by use of eqns (37) and (36) the
If, for example, one wants to emphasize the system parameter estimate q2. Use eqn (38) to compute a new
properties in the neutral region, between, say, pH 4 and auxiliary matrix P(k + 1).
Dynamic modeling and reaction invariant control of pH 395
(4) Compute by means of eqn (31) the reaction in- only one weak acid, carbonic acid. Consequently, the
variant output signal q,(k + 1) and the set value for q, reaction invariants of the system are thus
w,(k+l)= 1.6989w,(k)-0.7040w,(k- 1)
w(k)=w,(k)= [-;:$:].
+O.O027[u(k -3)+ w,,(k - 3)]
+O.O024[u(k -4)+ w,,(k - 4)] (41)
The numerical values of the initial reaction invariant
wl(k+l)= 1.6989w2(k)-0.7040w2(k- 1) state may be interpreted as follows: the total concen-
+ 0.0027 w,,(k - 3) + 0.0024 w&k - 4) (42) tration of carbonate is 0.025 molf, and the carbonate is in
a form as if it is in the form of HCO,- (e.g. NaHCOa),
w,(k + l)= ${wz(k+ l),pfi(k + 1)} (43) was added to pure water.
pH(k + 1) = 0.6065 pH(k) + 0.3935 pfi(k) (44) Equation (43) gives for k 5 0 pH(k) = 8.20 = pH,(k).
Adaptation of eqn (31) to eqn (43) using least squares
w,.,(k + 1) = $i(wz.,(k + l),pH,(k + 1)) (45) estimation (allowing only nonnegative estimates) then
resulted in the initial q,-vector
with the function @ defined as
qz(0) = [0.0214,0.0045,0,0,0.023,0,0]=.
$( w,(k). pH(k)) = 10-Hk - 10pH*4 - w,(k)
It is seen that only three elements are nonzero. The
first two, associated with pk-values of 6 and 7, together
describes the dissociation of carbonic acid (pk = 6.3).
In physical terms the process (41)-(46) may be inter- Note that the sum of them is close to 0.025, the correct
preted as follows. carbonate concentration being 0.025 mol/l. The fifth
The pH of the effluent from a CSTR is to be held at a element, the acid with pk = 10, describes the second
given set value, pH,,. The feed to the CSTR contains stage of the dissociation of carbonic acid (pk = 10.1).
T. K. GUSTAPSSONand K. V. WALLBR
e-L6 1 PH
Y p;; - ZOH - --
(T,"Cl ) (T2s+1) T>E+l
(41)-(42) (43) (44)
L I
Fig. 1. Simulation configuration for the simulation example witb references to equations in the text. ZOH = zero
order bold (sampling function).
Table 1. Parameters for the adaptive reaction invariant controller of the simulation example
Also here the numerical value is close to 0.025, as could estimates were held constant at q&k) = q?(O). The res-
be expected. ponse soon turns into sustained oscillations because of
In Pi. 6 (k = 0) the resulting initial estimate is com- the changing process parameter w,, i.e. the (exponential)
pared to the actual initial process relation (43). decrease in tbe buffer capacity in tbe CSTR. The bias of
The adaptive controller was constrained according to the oscillations is caused by the constraints on the con-
trol signal.
q, nonnegative, i E [2. a+ l] Figure 4 shows the response using the adaptive con-
troller, whose parameters are given in Table 1.
u(k) E [O,0.0062] Figure 5 shows the estimates of the most important
elements of q2. The upper diagram shows how the two
and by restricting the elements of P to the range most important elements of q2 track the carbonic acid
concentration reduction to one tenth of its initial value.
pii E [lo, 1000], i E [2, /3 + 11. No correct values for the estimates are given because
of the interaction of the elements of qz in eqn (31): The
At k = 0 a step change occurred in wt to estimated vector q2 should be treated as a whole. Inter-
pretations of the estimates for some discrete times are
given in Fig. 6, where the estimated relation (31) is
w,= [-;:g:j pHt=8.18
compared to the actual static process relation (43).
Figure 6 illustrates the response of the relation (43) to the
i.e. the buffer capacity of the feed was decreased by a step change of wL,, (full line) and the ability of the
reduction of carbonate concentration to one tenth of its estimator to track this changing relation (dotted line).
original value.
At k > 0 step changes in wlf occurred, i.e. changes in
the concentration of the strong base in the feed, which
resulted in the pH changes in the feed plotted in Fig. 2.
Pie 3 shows the response using stationary reaction 12
invariant control tuned for the situation at k = 0, i.e. the 11
10
9
B
PH ?
12 6
P% . 5
11 - 4
*
0 500 1000
k
Fig. 2. Step changes in pH, caused by step changes in W,Jin tbe Fig. 3. Response using stationary reaction invariant control,
. . .. r.~ I_.
sunumnon example. q(K)= WUJ.
Dynamic modeling and reaction invariant control of pH 397
PH
500
k
2
-0.02 0 -0.02 0 -0.02 0 mol/l
12
10
8
PH
6
2
-0.01 0 -0.01 0 -0.01 0 mol/l
12
10
4
2
Fig. 6. The true relation IV, pH (- ) and the corresponding estimated relation q, pH(. . .) at some
different sampling times.
398 T. K. GIJSTAPSSONand K. V. WALLER
pH-dependent variations of the process gain. Other lower-case letters denote elements of respective
The adaptive controller discussed in this paper is matrix or vector.
designed to estimate the process gain, as defined in eqn
(l), in the form of a nonlinear function of pH. This Subscripts
function is linear in a set of parameters which may be
estimated using hnear regression. Furthermore this non- a, b, d, g relating to elements of a, b, d and g respec-
linear function of the process is only slowly changing tively
with buffer concentrations in the reactor and con- c relating to control stream
sequently the parameters to be estimated are changing e relating to effluent stream
only.slowly in this case. f relating to feed stream
The main characteristic of the adaptive controller set set value
proposed in this paper is the inclusion of a detailed
model of the chemical acid-base reactions. This makes it Superscripts
possible to estimate the buffer capacity of the reactor
contents as a slowly changing function of pH, and to T denotes transpose
achieve a linearized feedback from the pH value by
using this function.
The adaptive controller discussed in the paper is
RWISRENCES
experimentally evaluated at present. The results will be
reported in a separate paper. [II McAvoy T. J., Ind. Engng Chem. Pmt. Des. Dee. 1972 11
630.
[21 McAvoy T. J., Hsu H. and Lowenthal S., Znd. Engng Chem.
NOTATION Pmt. Des. Dev. 1972 1168.
a,hd,g.h symbol vectors [3] Richter J. D., Foumier C. D., Ash R. II. and Marciklc S..
A invariance matrix InstrumentTechnol. 1974 21(4) 35.
[4] Orava P. .I. aad Niemi A. J., Znf. J. Conrrol 1974 20 557.
e concentration vector 151 Fjeld M., Asbjomsen 0. A. and Astiim K. J., Chem.
constant, eqn (36) Engng Sci. 1974 29 1917.
; flow [6] Asbjldrnsen 0. A., Lecture Notes in Process Dynamics. ho
i = [l 1 1.. . t]= Akademi 1974.
[I] WaBer K. V. and MttkiRl P. M., bd. Engng Chem. Proc.
I identity matrix Des. Dev. 1981 20 I.
. charge vector [S] AsbjGmsen 0. A., Survey paper, EFCE European Sym-
: dissociation constant, discrete time eosium. Firenze. 23-24 Seutember 1976.
K process gain [91 kis R.and Ma6 R. H. S.,-Znd. Engng Chem. Fundts I%3 2
K equilibrium matrix
[lo] &t&son T. K., Chem. Engng Sci. 1982 37 1419
K, >IL IL controller gains ill] Denbii K., The Principles of Chemical EquiZib~~m. Cam-
KW dissociation product of water bridge University Press 1%4.
m symbol vector [12] Niemi A. J., Jutila P. K., 2nd Polish-English Seminar on
dead time Real Time Process Control, Rogow, Poland, 22-24 May
1978, pp. 282-292. Tech. Univ. of Warsaw, Inst. of Control
Nf stoichiometric matrix and Industrial Electronics 1978.
P auxiliary matrix, eqn (39, (36) [13] Howe R. II. L., Howe R. C., Chem. Engng 1981 88(7) 109.
q reaction invariant state vector of estimation [14] Eykhoff P., System Zdentiflcation. Wiley, New York 1974.
model [IS] Astram K. J., Borisson U., Ljung L., Wittenmark B.,
Automatica 1977 13 457.
42 qT = [41, chTl [la] Astram K. J., Introduction to Stochastic Control~heot-y,
r reaction rate vector Academic Press 1970.
t time [17] Wieslander J. and Wittenmsrk B., Automafico 1971 7 211.
T time constant [IS] Baehholt F. and KUmmel M., Automatica 1979 Is 665.
control vector [19] Bergman S. and Lachmann K. M., Pmt. IACC, Paper
TAZ-E. San Francisco 1980.
t volume [20] Holmberg A., Report R 80-02, Control Eng. Lab., Chalmers
w reaction invariant state vector University of Technology, Gateborg, Sweden 1980 (in
Y symbol vector of transparent species Swedish).