You are on page 1of 10

DYNAMIC MODELING AND REACTION

INVARIANT CONTROL OF pH

TORE K. GUSTAFSSON and KURT V. WALLER


Process Control Laboratory, Department of Chemical Engineering, Abe Akademi, 20500 Abe, Finland

(Received 8 February 1982; accepted 30 June 1982)

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.

1. INTRODUCTION The traditional way to form dynamic models for


The control of pH has been paid considerable attention chemical reaction processes is to form a set of balances,
in many practical papers. The dynamics of an acid-base usually for the amount of substance, including a reaction
reaction process in a CSTR is often fuzzily taken to be a rate term for every proposed reaction. For processes
first order system, i.e. of the type including only acid-base reactions, it is suitable to set up
substance balances for hydrogen and hydroxide ions and
T d(pW
-=Ku-pH. for every weak acid, base and ampholyte present.
dt
Through suitable linear combinations of these balances
From the control engineers point of view this is a the reaction rate terms can be eliminated from the model.
linearized model where the time constant T and the The reduction of the number of equations is compen-
process gain K vary both with pH and with the huffer sated by inclusion of equilibrium conditions. Such
concentrations in the system. From the point of view of models have been used by, e.g. Richter ef n1.(3] and
a chemical engineer who wants to derive models from Orava and Niemi[4] for some simple systems.
balance equations, e.g. for simulation purpose, this In this paper a general and systematic approach lo
equation is absurd. derive dynamic models for fast acid-base reaction pro-
If the total concentrations of the weak acids in the cesses is presented. The treatment is based on a con-
solution are constant, the variable gain of eqn (1) is sistent use of the theory of chemical reaction variants
obtained from the titration curve for the acid-base solu- and invariants[S-71. The approach does not merely result
tion in question. However, a model of the type in eqn (I) in a dynamic model, but the systematic treatment reveals
is not sufficient, if the buffer capacity is not constant, the basic features of the process. And this gives a natural
which is the case, e.g. when control is performed with a starting-point for systematic design of control strategies
solution containing weak acids or bases. For the general and control systems.
case a dynamic model is obtained from material
balances, from the electroneutrality condition, and from 2. REACTION INVARIANTS IN ACID-BASE
the reaction kinetics. REACTION SYSTEMS
Usually the reaction rates for acid-base reactions be- Consider an acid-base reaction process involving water
tween dissolved components are extremely high. For solutions of strong acids and bases, l-, 2- and 3-basic
such fast acid-base reactions, equilibrium conditions are weak acids as well as the corresponding bases and am-
approached sufficiently near to justify these conditions to pholytes. The stoichiometry can be described by the
be used as additionaI algebraic state equations. following reactions
McAvoy ef al. [l, 21 give examples of how this may be
accomplished by forming mass balances for species like H,O=H + OHIO
sodium and carbon, and by combining these balances
agh+b
with equilibrium and electroneutrality conditions. The
(2)
mass balances for species like sodium and carbon are b=h+d
independent of reaction rates and thus no reaction rate
d+h+g
term needs to be considered.
where a, b, d, g and h are vectors with chemical symbols
*Author to whom correspondence should be addressed. as elements. a denotes undissociated weak acids, b, d
390 T. K. GUSTAFSSON and K. V. WALER

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)

Here dim (m) = 4a + 2, dim (N) = (3~1+ 1) x (4a + 2) and


rank UV) = 3a! + 1. where the vector yz contains a elements of y. ji is the
In order to obtain a set of state variables which are charge of ai. i.e. the charge of the undissociated weak
invariant to the chemical reactions (5), a vector of inert acid i. The invariance matrix of eqn (8) was obtained in
species, y, and an invariance matrix, A, transforming m the following way.
into the vector y, are set up The atomic groups of g are components of d, b and a,
which results in unit matrices in the entries correspond-
y=Am. (6)
ing to these vectors. The species of a may or may not
The elements of y. also called transparent species [S], are possess electric charge. Therefore a vector of electric
inert with respect to the reactions (5), which means that charges of the species of a is introduced in eqn (8) and is
they neither are formed nor broken up in the reactions denoted j. The charges of the species i of b, d and g are
considered. Such transparent species may be atoms or thus ji - I, j, - 2 and ji - 3, respectively.
atomic groups [8,9], or electric charge171. The elements The invariance matrix of eqn (8) may be simplified by
of the invariance matrix A are defined so that A, = the linear transformation of subtracting the product JTyZ
Dynamic modeling and reaction invariant control of pH 391
from the first row of the matrix. The result is a new set
of transparent species, and a new simpler invariance
matrix. WI = CH - con - CHCOI - CHS - CHSO, - 2cco3 - 2cs
- 2CSO~

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 +

invariant variables in the acid-base reaction system. The


first element in w represents the electroneutrality con- One example of this is the following. Consider a mixture
dition, and the next cy elements in w are the total con- of a volume VI of a strong acid of the concentration ca
centrations of each conjugate acid-base system present. and a solution of NH, of a concentration cB. We have
In a more lucid form the reaction invariant variables of for the first solution w, = cA (cu + cou and thus IV, =
eqn (10) may be written co), and wZ = 0. For the second solution w, = - cB and
w2 = cB. Thus, for the mixture composed of the two
solutions we have

W*=c,+cb+c,+c,. (12)

Examples of reaction invariant variables for some


simple acid-base reaction systems are the following.
(1) For strong acids and bases, mT = [OH-, H]
A topical application of this property is in the cal-
w, = CH - Co. culation of pH of mixtures, seemingly still a conceptually
difficult problem causing serious mistakes in the recent
(2) For the system mr = [OH-, AC-, HAc, H] literature. Failing to take the chemical reactions into
account may lead to completely erroneous results[l3].
W,=C~-COH-C*E On the other hand, if the solutions to be mixed are
characterized by chemical reaction invariants, the chem-
w2 = cn.&c + CU. istry is automatically taken care of. How to use reaction
invariants in calculating the pH of mixtures is illustrated
(3) For the system mT = [OH-, NH,, NH,, H] by Gustafsson[lO], who also gives an example of how to
calculate the pH of a mixture of solutions of unknown
WI = CH - COH - CNH) composition.

WZ= CNHq+ CNH,. 3. TBB DYNAMIC MODEL FOR ACID.BASE SYSTEMS


The number of variables needed to define the ther-
(4) For the system mT = [OH-, HCOY-, HS-, HSO,-, modynamic state of a chemical system is given by the
392 T. K. GUSTAPSSON and K. V. WALLER

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

where is the vector rates for each of the Gi+ ,+k,,+k&.i


wit1 = ka,i ---r-)c,., (i=l,2 ,..., a).
eqn (5). CH Cn
The vector c, which the (21)

Inserting this equation into eqn (19) and defining pH =


- log (cJmo1 I-) give the relation between pH and the
A defined in reaction invariants
eqn (9).

(16)

As a consequence of the orthogonal properties between


the matrices A and N, i.e. AN = 0,and by use of eqn (lo), co
eqn (16) is reduced to
where, e.g. ~k,.~ = -log (kJmo1 . I-) and K, has been
taken to be IO-l4 moll-*.
$(fwdV)=~~,wT-CF.w, (17)
Thus, the dynamic model for pH in a fast acid-base
reaction process consists of the linear differential equa-
The elements of the reaction invariant vector w are tion (17) and the nonlinear implicit algebraic relation (22).
linearly independent and dim(w) = a + 1. Thus w is In the case of a completely mixed stirred tank reactor
sufficient to define the thermodynamic state and eqn (17) with one feed inlet, one control stream and one effluent
is a dynamic model for the acid-base reaction process. stream, eqn (17) will take the simple form
Although a state vector equal to E is more familiar and
consequently may be conceptually simpler to work with, dw
Vt= F,w,+F,w,-Few. (23)
the use of the state vector w instead of e has a number of
general advantages, both numerically and for modeling
and design reasons, as illustrated in 171. For the subject Through the introduction of the reaction invariants the
of this paper, i.e. modeling and control of pH, modeling dynamic part of the model has been reduced to Q + 1 fist
by reaction invariants is a necessity in order to eliminate order decoupled differential equations.
the reaction rates from the equation system. If the total concentrations of all conjugate weak acid-
In order to obtain a model for the pH-value in the base systems are constant, eqn (22) may be considered to
Dynamic modeling and reaction invariant control of pH 393

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

state w,. Instead the value of w, corresponding to the INVARIANT CONTROL OF pA


constant pH set value will change, and thus the deviation Consider a linear control loop with feedback of the
A w, can be used for feedback in this case, too. whole reaction invariant state vector w. The state vector
In the case when the control stream contains only a is not measurable but may be estimated. Using a model
weak base the state vector will be w,= of the type (23) means that the control problem is for-
[w,.,, 0,. ..,O,w,,~,O,. .,OIT, i.e. the control action will mulated in terms of multivariable feedback with state
affect two partial systems of eqn (23). Both the variable estimation. The linear model makes a state estimator of
w, and the value of w, corresponding to the set value for Kalman filter type[l6,17] possible.
pH are thus affected. On the other hand, the process model may be viewed
The reason for the difference between a weak acid and as a scalar model of the type (24) with w2 to w,,, as
a weak base in this respect is that in our modeling adjustable parameters to adapt eqn (22) to the actual
approach we have not included a balance for the cation relation between w, and pH. In this way the adaption
of the weak base, but we have included a balance for the problem may be formulated as a linear parameter esti-
cation of the weak acid, H. mation problem, and solved, e.g. by using the recursive
For economic and environmental reasons the control least squares method. This second approach is adapted
stream contains only a strong acid or base in most cases. here for the derivation of the adaptive reaction invariant
Theoretically this is the simplest case since the state control algorithm.
vector tben is w, = [ w~.~,0, . . , OJT and the control con- Consider, as an example, a llrst-order dead-time model
394 T. K. GUSTAPSSON and K. V. WALER

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

ql.set(k + 1) = q,IpH..J WI = CH - COH - cncos - zcco,


w2 = eH*co) + CHCO, + cco,
(5) Feed back Aq, = q, - q,...r, e.g. through a sampled
PID-algorithm, and the static relation between pH and the reaction
invariants is described by eqns (43) and (46). The CSTR
u(k + 1) = u(k) + K,Aq,(k t l)+ K,Aq,(k) is described by two equal parallel first order systems+
dead times. The pH measurement system of the feed-
+ K,Aq,(k - 1). W) back loop is described by a first order linear system in w
(combined in eqns 41 and 42 with the model of the
Some comments on the suggested estimation procc- CSTR), the static relation (43) and a linear first order
dure may be appropriate. system in pH, eqn (44). Equation (44) introduces a
Some approximations have been used in the derivation dynamic nonlinearity into the process, which means that
of the estimator. Firstly eqn (30) is not used, the the feedback loop cannot be completely linearized by the
parameter vector q2 is treated as a constant. This ap- means described above. Furthermore eqn (45) represents
proximation is made for convenience and is not con- a pH measurement system for the feed. This pH
sidered serious. To allow tracking of variations in q2, an measurement system is simulated without dynamics.
exponential forgetting factor A is used. To illustrate the computation scheme, the simulation
Secondly, the formulation of eqn (32) implies that configuration is in Fig. 1 represented by a block diagram
including references to the process equations for each
qz.r(k - n) = q,(k) block.
The adaptive controller, eqns (34) to (40), was tuned to
i.e. the total concentrations of the weak protolytes in the this process. The parameters of the first order +dead
feed at time k-n equal the corresponding concen- time model, eqn (32) were adapted to the process model,
trations of the effluent at time k. The equation does not eqns (41) to (46), by applying least squares estimation to
hold if q2.1 is not constant. This approximation night be the perturbed open-loop process model. The values for n,
crucial for a successful implementation of the estimator cp and y so obtained are given in Table 1.
if the total concentrations of the weak protolytes are ,V was chosen to be 7, and pk, =6, pkz = 7, pk,=
frequently changing to a high degree. However, the S,..., pk, = 12. This choice allows eqn (31) to be well
approximation seems inevitable if no a priori knowledge adapted to any relation w, = $(w2,pH) in the pa-range
of q2,, is available. of 6 to 12. This is the pH-range of interest for this
example, because PH.., is 7 and pH, lies around 12. Thus
A simulation example of the adaptive controller the estimator used for this example is of a general form,
The adaptive reaction invariant controller discussed that is, we assume no knowledge of the chemical com-
above has been applied in a simulation study to the position of the feed.
deterministic process defined by eqns (41)-(46) The initial state of the system, for k : 0, is

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

p&t rp Y n ph pkz pk,...pk, A e K, Kz K,

7 0.9862 0.0138 5 6 7 8...12 0.95 1000 -54 90 - 37

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

Fig. 4. Response using adaptive reaction invariant control.

6. SUMMARY AND DISCUSSION

A systematic derivation of dynamic models for pH


control systems has been presented. The approach
decouples the static nonlinear part of the model that
expresses the chemical reactions of the system from the 500
dynamic model expressing the flow properties. This ap- k
preach elucidates the possibilities to apply linear feed-
forward and feedback control. Fig. 5. Estimates of the most important elements of q. Upper
diagram: - q2; . . . . qs, lower diagram: - 4,; __---
As a straightforward application a new type of gjJ
. . . . 0,.
adaptive pH control is proposed. The adaptive controller
is here treated schematically only and the proposed idea
allows variations from the given algorithm.

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

The adaptive pH controller discussed in this paper is dimension of a


basically different from other adaptive pH controllers dimension of q2
recently suggested in the literature [l&20]. i deviation from set value
An adaptive pH controller is usually taken to mean a rl auxiliary vector, eqn (32)
controller which automatically can adjust its gain to the A exponential weighting constant
process gain, as defined in eqn (1). The variations in the process parameters
process gain may be of two different kinds: fast pH- g:: process parameter matrices
dependent variations, and slow variations due to varia- auxiliary variable, eqn (33)
tions in the buffer concentrations in the reactor.
trollers of the type linear selftuning controllers
have no mechanism that takes into account
Con-
[l g-201
the fast
x zero vector, 0 = [0 0. . . OIT
zero matrix

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).

You might also like