You are on page 1of 6


Mordechai Shacham is Professor and Head of
the Chemical Engineering Department at the Ben
Gurion University of the Negev, Beer Sheva, Is-
rael. He received his BSc and DSc from the
Technion, Israel Institute of Technology. His re-
search interests include applied numerical meth-
ods, computer-aided instruction, chemical pro-
cess simulation, design, and optimization, and
expert systems.
Neima Brauner received her BSc and MSc
from the Technion, Israel Institute of Technol-
ogy, and her PhD from the University of Tel
Aviv. She is currently Associate Professor in the
FluidMechanics and Heat Transfer Department.
She teaches courses in Mass and Heat Trans-
fer and Process Control. Her main research
interests include two-phase flows and transport
phenomena in thin films.
vent of user-friendl y, interacti ve simulation packages, and
as a result many of them put too much emphasis on linear
systems and linear izati on methods. Most current mathemat i-
cal and control packages employ numerical solution meth-
ods which can solve si multaneous nonl inear ordinary differ-
ential equation (ODE) systems as easily as they solve linear
ones. That means that the traditional depe ndence on linear-
izat ion could and should be reevaluated and substantially
Another curriculum revision would be in the required use
of block diagrams within the control package. Such dia-
grams were absolut el y necessary when analog computers
were used, and they can be very helpful in demonstrating
the behavior of linear systems; but thei r importance should
be carefully reevaluated in light of the new si mulation pack-
ages. The differential equations (which are the basis for the
block diagrams) can now be inserted direc tly into the simu-
Michael B. Cutlip received his BChE and MS
from The Ohio State University and his PhD from
the University of Colorado. He has taught at the
University of Connecticut for the last twenty-five
years, servingas Department Head for nine years.
His research interests include catalytic and elec-
trochemical reaction engineering, and he is co-
author of the POLYMATH numerical analysis
Copyright ChE Division of ASEE 1994
Tel-Aviv Uni versity
Tel-Aviv, 69978, Israel
1 Ben-Gurion Universi ty of the Negev, Beer-Sheua, 84105 Israel
2 Uni versity of Connecticut , St orrs, CT 06269
n a paper titled "Process Control Education in the Year
2000,"[1) strong emp hasis was put on the importance of
mathematical modeling and computer simulation with
interacti ve graphics as key pedagogical tools in both the
present and the future of process control education. Since
computer simulation has been used in control educ ation for
at least twent y years now, it is valid to ask what has changed
and what additional roles an interacti ve simulation package
can play in process control education.
In the past the most commonly used packages have been
control-oriented packages such as ACS[2) or industrial con-
trol systems.!" These packages are appropria te for demon-
strating the behavior of practi cal control systems and are
quit e suited for use as "add ons" for a traditional control
course. A maj or deficiency, however, is that these programs
beha ve as a black box, giving results when input is provided
but hiding the mathematical mode l from the user.
There are now available some new interactive simulation
packages which acce pt the mathematical model of the con-
trol system as input in addition to the numerical data of the
process. The user must provide the model, thus creating the
desirable connection between control theory and practical
application. Using this type of package can beco me an inte-
gral part of the control course and not just an add-on as it
has been in the past with the older packages.
In order to take full adva ntage of the many desirabl e
capabilities of the new simulation tools, however, the con-
tent of the traditi onal undergraduate control course should
be substantially revised. One of the needed revisions, for
exa mple, is a reduced emphasis on linear systems theor y.
Most process control textbooks were written before the ad-
130 Chemical Engineeri ng Education
q( t)=qs+ Kc(TR-Tm)+ KRf(TR- Tm) dt (3a)
Online!" or the user is required to convert the equations
into block diagrams prior to solution (such as TutsimI6.p.SJ21
or UCA 11
) .
Problem set- up, solut ion, and modification times are very
short. Thi s is especially impor tant in educational use where
a long wai t for the result often discourages exploration
and curiosi ty.
Control of a Stirred Tank Heater
pVC - =WC(Tj -T) + q; To(O) =T
( I)
The thermocouple dynamics as described by fi rst-order lag
+ dead time:
where q, is the heat supply in design condition
q s=WC(TR- Tjs) (3b)
The dynamics and control of a stirred tank heater are
disc ussed in several popular textbooks.P'" This simple sys-
tem incl udes the st irred tank and a PI controller and is
depi cted in Figur e I.
The feed stream at constant rate (units: W kg/min) flows
into a stirred tank equipped with a heatin g devic e; we want
to heat this stream to a higher temperature TR(C) . The
out let temperature is measured by a thermocouple, and the
required heat supply, q, is adj usted by a PI temperature
controller. The control objective is to maintain To = TR in
the presence of a load due to an inlet temperature, Tj, which
differs from the design value, Tis.
The model equations are:
Energy balance on the stirred rank:
To(t)= T(t-t
) (2a)
= T
Tm(O) =To(O) =T
(2 b)
The heat supply as manipul ated by the PI controller and
actuator can be defined as
The numerical values of the parameters are
pVC = 4000.0 KJ 1C
WC = 500 KJ I( mi n e)
Tis =60C
= 80C
This simple process can be used to demon strat e various
concepts in different sections of the control course. Three
possi ble applications are:
--- --- --0---- ~ I P O i n l
I m
lation program, and the required conversion to block dia-
grams becomes unnecessary.
Modi fying and reorgani zing an exis ting control course to
embrace the new tools is an evolutionary process and can
present an interesting challenge for the instructor. In this
paper we will offer several practi cal examples for using an
interacti ve simulation package in different sec tions of an
undergraduate control course.
There are seve ral interactive simulation packages which
can be used as a learning tool in the control course, but it is
not our intent to review all of them. We will demonstrate
some applications using the POLYMATH software (which
was developed by two of the authors, Shacham and Cutl ip),
but we want to emphasize that other software (such as the
widely used MATLAB package) can also be used for the
same purposes.
The POLYMATH softwa re package was orig inally devel-
oped for the mainframe Plato education computer system. !"
The current version of POLYMATH (2. I. l .PC) is distrib-
uted by the CACHE (Computer Aids for Chemi cal Engi-
neerin g Education) Corporat ion, a non-profit orga nization
that disseminates educational computer programs to chemi-
cal engineering department s. Thi s version runs on the IBM
Personal Computer, PS/2, and most compatibles.
Var ious forms of POLYMATH have been in use for al-
most a decade in support of chemical engineering educa-
tion. Some important features are:
It is a general purpose program now in use in ove r one
hundred chemical engi neering departments. In several de-
part ment s the students are introduced to POLYMATH in
their first chemical engi neering course, so that when they
reach the control course it is a familiar calc ulational tool
for them. Stud ent s can also put this softwa re on their own
personal computers for easy access and use.
The user works dir ectl y with the model equations which
provide a direct link betwee n the physical phenomena and
the control sys tem. Thi s is in co ntrast to many control -
systems si mulato r progr ams where the user only provides
parameter s to "black box" model s (such as ACS
or UC
Figure 1. Stirred tank heater
1. Closed loop dynamics
Demonstrate stable and unstable regions for PI co ntrol using
Spring 1994 131
2. Controller Tuning
Tune the PI controller using Astrorn's "ATV" method!" and
the Ziegler-Nichol's!" p.m) settings.
K, = 1000 - 10,000, K, = a- 5,000 without ('t
, 'td= 0) and
with ('t
= 0 min, 'td= I ) measurement deadtime.
The equa l ions:
dCI enp) .t d{ ') =(UCJl: ( 1i- 1enp)+q>rrhove
dC er r sull)/ d( t)=tr - l l'l
dCI ll ) I'dC t )=( I enp- th-( 1/ 2).d tellpdt)12/1
,r 'O
q=1OOOO..kel Ctr - t il) +I::r . er rsun
s'ep" (. - 1l +abs( ,-I)It<2.( ,-1)+0.000001)
li =60-s tepI20
dl ell pdt =( UCJ:( 1i - ten p) +q) sr hovc
tni ual values: o' 0. 0, ,e.Po' BO.OOo, 0.0, ' . 0' BO.OOO
Final val ue: ' I ' 10.000
1. Closed loop dyna mics of the stirred tank heater
Fig ure 2 shows the mathemati cal model , numer ical con-
stants, and initial values as the y were entered into the
POLYMATH OD E solver program for the case where Ld =
I , K: =10,000, K
=0 (P-on ly controller) and a step change
of -20C in the feed is introduced at t = I sec . The options
available to the user at this point are also shown: they in-
clude solution or modi ficat ion of the probl em, storage in a
librar y, request for addi tional information regardin g solu-
tion methods used, etc. If the "solve the prob lem" option is
selected, the equations are numericall y integrated, and the
program selects eit her the explicit Euler or the 4th-ord er
Runge-Kutta method, accordi ng to the required acc uracy.
For stiff systems, the user may ask to use the impl icit Eul er
method. All of these methods include algorithms for esti-
mating the integrati on er ror and changi ng step size if neces-
sary. Solut ion times may vary from seve ral seconds (for a
PC with out a math co- processor) to less than one second
(t- I)+ abs( t -I)
step = --'----'--- ----'---"-
2(t - I) +0.00000 I
This equation generates: step = 0 for t I ; step - I for t > I .
The value 0.00000 I is added to the denominator in order to
prevent division by zero when t =I .
The integral of the error, required in Eq. (3a), is obtai ned
by solving the differential equati on
3. Reset Windup
Investigate the controller behavior if the output from the
heating tank is limited to twice the design value (q 20,000
kJ/s) and the inlet temperature reduced to half of its design
value and then is restored to the steady state value after
thirty minutes.
Most of the equations needed to solve thi s probl em can be
typed directl y into POLYMATH wit hout any modi ficati on.
But since POLYMATH is a ge neral-purpose soft ware pro-
gram, it does not have functions which are specific to the
control area, such as step, ramp, time delay, etc. Most of
these functions can be generated, howeve r. The generation
of a step change at t = I , for example, is accomplished by
the equat ion
) _
- - - - T
- T
, t = 0, e
= 0
r7 '0 solve 'his proble
"lr ...-J to al ter the prcbl ee. r6 for helpful infornation
r9 lor {il e and li bra r y cpnc os. lor 'h e MAIN M[NU.
r9 to di spl ay results. (9, I, d active )
"'Ir +-J 10 "ale e chanqes. 'irrs lor neu probl E' ll. r6 lor hel p
ti nal val ue
10. 000
72. -150
5. 5925
1000. 0
0. 100010
- 0. 307010
1.00 0
-1 0. 000
Mi n. val ue
-0.- 0--
72. -150
- 0. 2722
73. 696
0. 100. 10
- 0. -1 891010
-10. 000
- 16.7-16
nn" n n"on Inn n" 00'"10 " nnn I
1. 000 6.0 00 8. 000 10. 000
Max. val ue

9.8 250
1000. 0
0. 100'10
0. 730.10
Part ia l re sults
2. 000
Ini ti al val ue
0. 0
80. 000
80. 000
500. 00
-1000. 0
0. 100010
0.100 .10
er rsun
" q
dt enpdt
Variabl e
te ep
U. U
l OQ(er r or)
- -1.0 1----;"-'lt\O-D.-I"""''+-o.n.Di''-''-' ..e,a. o..c...
0. 000
Figure 2. Mathematical model inp ut to POLYMATH ODE
solver for Example 1.
Figure 3. Partial results for Example 1.
Chemical Engineering Education
e- t
5 == (I - 'tds / 2) /(I+ 'tds12)
yields in the time domain a first-order differential equation
for the measured temperature
= [T - T dTl] 2 .
dt 0 2 l dt ) 't
Pade approxi mation'" p.103) ca n be employed for represen-
tation of time del ay. For instance, the first-order Pade ap-
Nonlinear and nonideal aspects can be demonstrated us-
ing the limi ts on the operation of the controller. The basic PI
controller may require negative or inacc essibl y high posi-
tive values of heat input, q, for some combinations of con-
troll er setti ng and magnitude of the step change in the input
temperat ure. Limits can be put on the variables using equa-
tions similar to Eq. (4) . For example, the operation
q + abs(q) (7)
ql = 2
gives ql =q if q 0; q I =0 otherwi se.
/ 32
Figure 3 give s the history of the integration error. The infor-
mat ion in this chart can be used to asse ss the acc uracy of the
results and reduce the final time if more accura te results are
needed. User options shown at the bottom include display as
well as change, storage, and retrieval options . The display
options include graphical ("g") or tabular ("t") presentat ion
and output of the result s to a DOS file (li d"). If graphical
display of the temperature is selected, the grap h shown in
Figure 4a appears, indicating that for the speci fied param-
eter values the response is indeed unstabl e.
The mat hematical model can be made more realistic by
introducing Eq. (7) into it to prevent the heat input from
beco mi ng negative. The growth rate of the osc illations is
more moderate in thi s case, as shown in Figure 4b, but the
system is still unstable.
This first part of the example problem can be used as an
introductory exa mple in an undergraduate process control
course. Studen ts can introduce changes to the system and
observe for the first time the difference between sys tems
with and without control, P vs. PI controller, effect of sys-
tem parameters (time constants, dead time ) and can fami l-
iari ze themselves with the concep ts of offset, sta bility, etc.
Most of these concepts are shown in the textbooks, but the
fact that the student can introduce the desired change and
immediately observe the results can contribute considerably
to an understanding of the mater ial.
2. Controller tuning using Astriim's "ATV,,/8/ method
When usi ng thi s method, a relay of height , h, is inserted
as a feedback controller. This nonl inear controller will cause
the system to prod uce limit cycle of the controlled variable.
The relay type change of the manipulated variable is achieved
by two equations similar to Eq. (7) which generate ( 1,0) and
(- 1,0) values according to the sign of the error. The equa-
tions typed into POLYMATH for this assig nment are shown
in Table I for parameter values (td = I; t
= 0). A small
change in the controller set-point is introduced (TR is in-
creased to 81C) . The behavior of the manipulat ed and con-
trolled variable during the II ATV" procedure is shown in
Figure 5. The period of the limit cycle is the ultimate per iod
cPu). Thus, the ultimate freq uency is
(() = - (8)
u P
and the ult imate gain is
x, = ~ (9)
where a is the amplitude of the primary harmoni c of the
The ultimate per iod and gain, as found above , can be used
with the standard tuning formulas. The process response to
a 33% step change in the inlet temp erature obta ined with a
PI controller tuned using the Ziegler-Nichols controller
settings I6.p223] is shown in Figure 6.
t (min)
2.000 4. 000 6.000 8. 000 10. 000
80. 00
78. 10
4b. Heat supply limited
to positive values
Controller Tuning Using Astrorn's "ATV" Method
4a. No limit on
heat supply 81.00
and s e t e r rsum(O) =O.
- To c he ck t he res p onse with different kc a nd kr
set t i ngs change e qua t i ons ( 6 ) a nd (8 ) .
(1) d(temp) /d (t )=dtempdt
(2) d(tm) /d(t)=(temp-tm- (tau/ 2 ) *d t empdt ) *2 /tau
(3) wc=5 00
(4 ) rhovc=4 000
(5) err=81-tm
(6) h=40 00
( 7) m1=(err+abs (err ) ) /( 2 *err+0. 000001)
(8) m2=(err-abs(err)) /( -2*err+0 . 00 0001)
(9) q= 10000+h *m1+h *m2
(10) dtempdt =(wc*(60-temp)+q) /rhov c
(11) tau=l
t(O)= 0, temp( O)= 80 , tm(O)= 80
t(f)= 10
- This set o f equati ons will genera te the limit
cycle in the measured temperature us ing the
above method .
- To observe the response wi th proport ional
control when kc is set to the ultimate gain
cha nge equation s 5-12 as fo l lows:
(5) d(errsum) /d( t) =tr-tm
(6) kc= 8450
(7) t r=80
(8) kr =O
(9) q=1 0000+k c * ( tr- t m) +kr *errs um
(10) ti =60- 20
(11) d tempdt =( wc* (t i-temp)+q) /rhovc
(12) t au=l
Figure 4. Response of the temperature in the stirred tank
to -20Cstep change in f eed temperature.
(for a computer with a co- processor).
Fig ure 3 shows a display of part ial results which includes
a table of initial, mi nima l, max imal , and final val ues of all
the var iables. Obser ving this table shows immediately that
the model is unrealist ic since the heat input , q, becomes
negative at a particular point.
The bar chart near the bottom of the screen shown in
Spri ng / 994 / 33
Figure 5. Change of the manipulat ed variable and the
controlled variable in "ATV" tuning.
(I I)
t (min)
. " ~
81. 10
8 0.20 ~
79. 8 0
0.000 2.000 1. 000 6.000 8.000 10.000
1. 3 00
1.1 00
5a. Manipulated
(q" 1O4)
5b. Controlled
variable (Tn)
79. 20
T (DC)
78. 40
0.000 3.000 6.000 9.000 12.000 15.000
l (min )
Figure 6. Response of the heating tank with PI controller
and Zi egler-Nichols settins.
Chemical Engineering Education
80. 80
where R
= 2 h ~ / 2 / c .
Equa tions ( 10) and ( I I) ca n be introduced int o the
POLYMATH ODE solver wit h onl y slight modificati on.
The response to reduction of the inlet flow to 10 cfm is
shown in Figure 9.
We know that lineari zat ion is likel y to yield close ap-
proximat ion of the dynami cs of the system near the state
around which the linearization is done. Indeed, when there
is a 10% change in the inlet flow , responses of the nonl inear
and linearized systems are very si mi lar. The initi al slope is
the same, and the difference bet ween the process gains that
are calculated using the two model s is only 5%. But using
the linearized model far from the steady state may give very
unreasonable results. If, for exa mple, the tank's wall is much
higher than the steady-state level and one tries to predict the
maximal inlet flowrate that can be used wi thout tank over-
flow, the difference between the predi ctions by the two
model s can be considerable. An even more interesting result
occurs when the inlet flowrate is drasticall y reduced-the
lineari zed model may predi ct a negati ve level at the new
steady state, which is of course impossible. Such is the
3. Reset Windup
The model equat ions for the case where the output from
the heater is limit ed and there is a substantial drop in the
inlet temperature are very similar to the system shown in
Figure I, except that an equation similar to Eq. (7) has to be
added to limit the hea ter 's output.
The simulation results show that the PI contro ller on the
heatin g coil wi ll ca use the heat output to reach its maximal
value shor tly after the inlet temperature is reduced. Since
the heat output is not enough for reaching the set-point
temperature, the error term in the integral part of the con-
troll er continues to increase unt il the inlet temperature is
restored to its steady-state value. Becau se of this acc umu-
lated error term, the controller keeps the heat supply at its
maximum long after the restorati on of the inlet temperature.
Thi s cause s the out let temperature to reach a much higher
value than the set point , as shown in Fi gure 7a.
Many industria l controllers have anti-wi ndup provisions.
Th is feature can be demonstrated in thi s example by switch-
ing off the error accumulation when the required heat sup-
ply exceeds the bounds. The outl et temperature response is
shown in Figure 7b. In thi s cas e the outlet temperat ure will
rapidl y reach the set-point value, after the inlet temperature
is restored to the steady-sta te value.
Dynamics of a Nonlinear Liquid-Level System
The liquid-level control system is frequ ently used in pro-
cess control textbooks to demonstrate the differenc e be-
tween linear and nonlinear sys tems'!"..6.P.72) where emphas is
is put on linearizat ion of the nonlinear sys tem around the
steady state.
For this example, consider the sys tem, shown in Figure
8, which consis ts of a tank of constant cross sectional area ,
A, into which a valve wi th flow resistance characteristic s,
qo(t) = ch 1/2, is attac hed, where h is the liquid level in the
tank and c is a constant. The flow rate into the tank , q, varies
with time.
The foll owing numerical and steady-state values are ap-
A =I ft 2; C =20 ft
/ min; qs =60 cfm; h, = 9 ft
Using these numerical values, the response of the sys tem to
small and large (up to 90%) step changes in the inlet f1ow-
rate should be observed and the response using the non-
linear and lineari zed model should be compared.
The equation representing the liquid-level sys tem is
q- ch "
=A dh (10)
The equation can be linearized around the steady state
1. Edgar, T.F., "Process Cont rol Education in the Year 2000 ,"
Chem. Eng. Ed. , 24 , 72 (1990)
2. Koppel , L.B. , and G.R. Sullivan, "Use of IBM's Advanced
Control System in Undergraduate Process Control Educa-
tion," Chem. Eng. sa; 20 , 70 (1986)
3. Buxton, B., "Impact of Packaged Software for Process Con-
trol and Che mical Engineering Education and Research,"
Chem. Eng. Ed. , 19, 144 (1985)
4. Shacham, M., and M.B. Cutl ip, "A Simulation Package for
the PLATO Syst em," Computers and Chem. Eng., 6, 209
5. Foss, AS., "UC ONLINE: Berkeley's Multi loop Computer
Cont rol Program," Chem. Eng. Ed. , 21, 122 (1987)
6. Coughanowr, D.R. , Process Systems Analysis and Control ,
McGraw-Hill Book Co., New York (1991)
7. Hittner, P.M. , and D.B. Greenberg, "We Can Do Process
Simulation: UCAN-II ," Chem. Eng. Ed., 14, 138 (1980)
8. Astrorn and Hagglund, Proc eedings of th e 1983 IFAC Con-
fer ence, San Francisco, CA (1983)
9. Smit h, C.A, and AB. Cor ripio, Principl es and Practice of
Automatic Process Cont rol, J ohn Wiley & Sons, New York
(1985) 0
tern which ca n be represented by a linear model and linear-
ization of a nonl inear model. Lineariz ati on can represent
the sys tem well only near the point of linearization.
It is always advisabl e to compare results from the nonlin ear
and lineari zed model s in order to be able to appreci ate the
magnitude of error int rodu ced by lineari zati on.
Result s obtained from computer solution must always be
carefully checked. Equations used outside the bounds of
their validi ty, or numerical integ ration errors, may lead to
incorre ct or even absurd result s.
We have demonstr ated several interesti ng applications of
an interactive ODE simulation program in this paper. Expe-
rience has shown the foll owing important benefits of using
such programs in process control :
J. There are many aspects of dynamic process behavior
that can be studied only by using nonlinear models
that include, fo r example, limits on variables.
2. Interactive simulation complements analytical meth-
ods very nicely by ensuring better understanding and
allowing more reali stic problems to be considered.
3. The strengths and weaknesses of analytical solutions
and numerical simulation can be clearly demonstra ted.
This is important ill parti cular when lineari zing non-
linear equations where the restrictions of the linear-
ized model must be well understood.
The examples and exe rcises given in Figure I and Table I
can be put into immediate use in the cla ssroom. Additional
examples of app lying an ODE solver for comparing analy ti-
cal and numerical solutions and for more complex phenom-
enon could not be included in thi s paper because of space
limitations. Information on these exa mples can be obtained
from anyone of the authors.
1- Nonl inear model
2- Linearized model
nonli near
" qo(t)
2."00 3.000
t (min)
h (t)
0 .000 10 . 0 00
T ("C) 7 ' . 0 0
72. 00
0.000 0.600 1.200 1.800
t (min)
- 3. 00
q (t)
h (ft)
7b. Limiton e... . oo
integralerror 80.00
Figure 7. Outl et temperature in the heated tank with and
without limit on the in tegral error.
Figure 8. Liquid-level sys tem with nonlinear resist ence.
75. 00
7a. No limit on
integral error 93.00
87. 00
T ("C)
situation in Figure 9. The nonlinear model predi cts the new
steady-state level as 0.25 ft and the lineari zed model pre-
dicts -6 ft as the new level.
It should be noted that reducing the flowrate even further
may cause difficulties with even the nonlinear model. Be-
cause of integration errors, h may become a small negati ve
number, which makes it impo ssibl e to calculate the h
Thi s can be prevented by putting a limit on h by applying an
equation simil ar to Eq. (7) . The same method can be used
when the linearized model is solved by numerical simula-
tion, but not when it is solved anal yticall y.
A comparison of the nonlinear and linearized solutions by
students should reinforce the following concl usions:
It is important to remember the difference between a sys-
Figure 9. Response of liquid level to reduction of the inl et
flow rate to 10 cfm.
Spring 1994 135