You are on page 1of 5

NIRMA UNIVERSITTY JOURNAL OF ENGINEERING AND TECHNOLOGY, VOL.1, NO.

1, JAN-JUN 2010 45

Application of MATLAB in Process Control: Case


Study for First Order Reaction in a CSTR
R Oza, N Shah, D G Tadse and M H Joshipura

Abstract—Since the last three decades, structure of the chem- III. M ATLAB AND S IMULINK
ical processes has become increasingly complex, due to better
management of energy and raw materials. As a consequence, MATLAB is an interactive system for doing numerical com-
the design of control systems has become the focal point in putations. It has evolved into a successful commercial software
industries today. Any chemical process needs to be controlled package. MATLAB relieves you of a lot of the mundane tasks
for various purposes, such as environmental regulations, safety,
economic considerations; product quality etc. in the present work, associated with solving problems numerically.[4] SIMULINK,
isothermal continuous stirred tank reactor (CSTR) is modeled a companion program to MATLAB, is an interactive system
for first order reactions. The non linear equations so obtained for simulating nonlinear dynamic systems. It is a graphical
were linearized and converted in to the transfer function. These mouse-driven program that allows you to model a system by
model equations were solved at steady and dynamic mode, and drawing a block diagram on the screen and manipulating it
the concentration is obtained as a function of time. The transfer
function developed was used to tune the system. The tuning dynamically.
parameters were then determined by a trial and error method.
Index Terms—Feedback control system, isothermal continuous IV. C ONTROL SYSTEM BASICS [1], [5]
stirred tank reactor, first order reactions, tuning parameters
The different components constituting a control system are
represented by means of a block diagram to develop the
I. I NTRODUCTION functional relationship between the input and output variables
for each component of a control system. The block diagram
Structure of chemical process has seen a major change in of feedback control system is shown in Fig. 1.
the last decade. The change has been due to environmental
legislation, safety considerations, energy and raw material
minimization, product quality to name a few. During its
operation, a chemical plant must satisfy several requirements
imposed by the designers and the general technical, social and
economic conditions in the presence of ever-changing external
disturbances. As a consequence, the design of control systems
Fig. 1. Block diagram of a feedback control system
has become the focal point in industries today [1]. Tuning
of a controller is done by a trial and error method. This can
be very tedious if done manually as the optimum values of
the parameters of the same controller might be different for
V. I NTRODUCTION TO CHEMICAL REACTORS
different processes. Hence, we can use some computer aided
techniques to speed-up the controller tuning. SIMULIK is one Chemical reactors are generally the most important unit
such widely used software provided by Mathworks Inc., which operations in a chemical plant. Chemical reactors come in
is an add on tool of MATLAB. many forms, but two of the most common idealizations are
the continuous stirred tank reactor (CSTR) and the plug flow
reactor (PFR). These two types serve as ’limiting bounds’
II. I NTRODUCTION TO MODELING AND SIMULATION for the behavior of many operating reactors. The CSTR is
Process Simulation includes description of the part of the often used in dynamic modeling studies, because it can be
real world that needs to be simulated, representation of this modeled as a lumped parameter system. A dynamic model of
part of the real world in terms of a model (modeling), and a plug flow reactor consists of partial differential equations
solution of the mathematical model to obtain numbers or (also known as a distributed parameter system).
symbols - Simulation[2], [3]. Consider the continuous stirred tank reactor. We will assume
that the reactor is operating at a constant temperature (it is
Rachit Oza is with Anil Products Limited e-mail:rachitoza@gmail.com, isothermal), so we do not need an energy balance (and can
N.Shah is with Unimark Remedies Limited e-mail:nikhilbk87@yahoo.com, also assume that the reaction rate parameters are constant).
D. G. Tadse is with Hamon Shriram Cottrell Pvt. Ltd.e- In addition, we will assume that the volume is constant.
mail:deepak.tadse@gmail.com and M.H. joshipura is with Department
of Chemical Engineering, Institute of Technology, Nirma University The first order reaction scheme with a number of interesting
e-mail:milind.joshipura@nirmauni.ac.in characteristics is presented below.
46 NIRMA UNIVERSITTY JOURNAL OF ENGINEERING AND TECHNOLOGY, VOL.1, NO.1, JAN-JUN 2010

VI. F IRST-O RDER I RREVERSIBLE R EACTION


k Fs
Consider a single irreversible reaction A −
→B V CAf
CAs = (3)
Assume that the rate of reaction per unit volume is first- Fs
V +k
order with respect to the concentration of A: Molar rate of Equation (1.3) indicates that CAs is a monotonic function of
disappearance of A per unit volume is first-order with respect Fs
As FVs gets large (→∝), then CAs approaches CAf s . That
V .
to the concentration of A: Molar rate of disappearance of A is, the fluid is flowing so fast through the reactor that there is
per unit volume is −rA = kCA Molar rate of formation of B no time for any conversion of A to B. As VF gets very small
per unit volume rB = kCA (→ 0), then CAs approaches 0, indicating complete conversion
to B. this is shown in fig 2 below.
VII. C OMPONENT M ATERIAL BALANCE ON A
Our first step is to write the dynamic modeling equations
for the reacting component, A:

rate of accumulation = (rate) in by flow - (rate) out by flow


- rate out by reaction

dCA F
dt = V CAf − ( VF + k)CA
where k is the reaction rate constant. Since V is constant:

Fig. 2. Concentration of A as a function of space velocity


dCA F F
dt = V CAf − V CA + kCA
Also from fig. 2, to react most of A we need a large
which we can write as:
volume/feed ratio (residence time), which would require large
vessels for a given f1owrate. This indicates that economics
must be used to guide the reactor design, and a trade-off must
dCA F F be made between the capital cost of the reactor versus the
= CAf − ( + k)CA (1) operating cost (which includes the difference in values of the
dt V V
reactants and products). The residence time is also related to
the process time constant, which ultimately affects the quality
VIII. C OMPONENT M ATERIAL BALANCE ON B
of control that is possible.
It is natural to assume that there is no B in the feedstream, a) : Solving 2 for the steady-state value of B we find
which yields the following modeling equation:
kCAs
CBs = Fs
(4)
dV CB
dt = −F CB + V kCA V

where again, k is the reaction rate constant. Since V is


constant:

dCb F
= − CB + kCA (2)
dt V
The two dynamic modeling equations are 1 and 2. Notice
that the concentration of B does not play a role in equation
1, so equation 1 can be solved independently of 2. Before
analyzing the dynamics of this system, it is important to
understand the steady-state behavior. Fig. 3. Concentration of B as a function of space velocity

Equation 4 indicates that the concentration of B is also a


IX. S TEADY-S TATE B EHAVIOR
monotonic function of the space velocity. As FVs gets large
Fs
vis known as the space velocity. The term VF is known (→∝) then CBs approaches 0. That is, the fluid is flowing so
as the ”residence time” or ”space time,” that is, the amount fast through the reactor that there is no time for any conversion
of time that it takes for the reactor volume to be ”swept out” A to B. As VF gets very small (→ 0)
by the flow. Equation 1 in steady-state form can be arranged then CBs approaches CAf s indicating complete conversion
to solve for the steady-state concentration (the subscript s of A to B (see Figure 3).
indicates steady-state value): The following are the results of solving the dynamic equa-
tions 1 and 2. These were solved using the inbuilt function
NIRMA UNIVERSITTY JOURNAL OF ENGINEERING AND TECHNOLOGY, VOL.1,NO.1, JAN-JUN 2010 47

in MATLAB - ode45. This basically uses the Runge-Kutta The main task is to determine the tuning parameters. For this
method of the 4th order. The concentration of A is also first we adopt a trial and error method (the Ziegler-Nichols closed
order with respect to CAf , but a second order transfer function loop method [6]). We shall consider tuning the PI controller
relates CAf , to the concentration of B. The transfer function and not the PID controller since the first order process has a
was obtained by first obtaining the state space models4,5 and good speed of response. A PID control is normally used to
then using the inbuilt function ’ss2tf’ in MATLAB to convert increase the speed of closed-loop response.[8]
the state-space form into the transfer function form.As seen The graph obtained for the values mentioned in Table I is
in fig 4 and 5, the response of B to a change in the feed shown in Fig. 7. This shows an unstable nature of the given
composition of A is slower than the response of A for the system.
same change.

Fig. 4. Transient response to initial conditions perturbed from the steady


state value of CA(0) = 2.5
Fig. 7. Response obtained for step change to set point for First Order System

TABLE I
PARAMETERS ASSUMED FOR PI C ONTROLLER FOR THE GIVEN SYSTEM

Parameters Value
Proportional 13.9
Integral 5

To make it stable we assumed some new values of the tuning


parameters as shown in Table II. The nature of the response
obtained is shown in Fig. 8.
Fig. 5. Transient response to initial conditions perturbed from the steady
state value of CB(0) = 5

X. PROCESS CONTROL OF FIRST ORDER SYSTEM


The following feed-back system (fig 6) for a servo-type
problem is developed using SIMULINK.

Fig. 8. Response obtained for step change to set point for First Order System

According to Ziegler Nichols method the value of controller


proportional gain that causes the continuous oscillations is
Kcu = 13.8575. The response obtained is shown below in
Fig. 6. Feedback Control System for First Order System Fig. 9.
48 NIRMA UNIVERSITTY JOURNAL OF ENGINEERING AND TECHNOLOGY, VOL.1, NO.1, JAN-JUN 2010

TABLE II
PARAMETERS ASSUMED FOR PI C ONTROLLER FOR THE GIVEN SYSTEM

Parameters Value
Proportional 13.5
Integral 5

Fig. 11. Response obtained for step change to set point for First Order
System for the Tyreus-Luyben tuning parameters

XI. C ONCLUSION

From Fig. 10 and Fig. 11 we can conclude that for a unit


Fig. 9. Response obtained for step change to set point for First Order System
step change in the set point, the response curve shows the
concentration approaching towards unity which indicates that
the derived model equation for the process is correct and also
From the above figure the peak to peak period also called
the tuning parameters for the same are obtained using Ziegler
the ”Critical Period”, is Pu = 0.24 (i.e. distance between two
Nichols Method and the Tyreus-Luyben method. It can also be
successive peaks).
seen that the tuning parameters determined using the Tyreus-
According to Ziegler Nichols Closed-Loop Oscillation Luyben method result in less oscillatory responses and are
Method [6] and Tyreus-Luyben method [6], tuning parameters less sensitive to changes in process conditions as compared to
for a PI controller are as shown below in Table III : Ziegler-Nichols method.

TABLE III
T UNING PARAMETERS FOR THE SYSTEM XII. F UTURE W ORK

Method kc τI For more accuracy, the system can be checked with different
Ziegler- Nichols Kcu ∗ 0.5 = 6.235875 Pu
1.2
= 0.2 tuning methods and the a comparison can be carried out with
Tyreus-Luyben Kcu
3.2
= 4.33 Pu ∗ 2.2 = 0.528 respect to stability testing.

Using the above mentioned parameters the closed loop R EFERENCES


response for the first order reaction is shown in Fig. [?] and
fig 11 below. [1] George Stephanopoulos, ”Chemical Process Control”, Eastern Economy
Edition, pp. 3-20, 55-87.
[2] J.Ingham, I.J.Dunn, ”Chemical Engineering Dynamics - An introduction
to modeling and computer simulation”, 2nd Edition, Wiley VCH, pp.1-6,
19
[3] Brian Roffel & Ben Betlam, ”Process dynamics and control - Modeling
for prediction and control”, John Wiley and Sons,P. 169-178. c udra
Pratap, ”Getting started with MATLAB 7 - A quick introduction for
scientists and engineers”, Oxford University Press.
[4] Rudra Pratap, ”Getting started with MATLAB 7 - A quick introduction
for scientists and engineers”, Oxford University Press.
[5] R.P. Vyas, ”Process Instrumentation and Control”, Dennett and Co., P.99-
105.
[6] B.Wayne Bequette, ”Process Control - Modeling, design and Simulation”,
Prentice Hall of India, pp.80-83,195-199, 573-578
[7] B.Wayne Bequette, ”Process Dynamics - Modeling, analysis and Simu-
lation”, Prentice Hall of India, pp.3-6, 108-110, 506-527
[8] Pao C. Chau, ”Process Control: A First Course with MATLAB”, Cam-
bridge University Press, pp.103-105.
[9] Bruce. A Finlayson,”Introduction to Chemical Engineering Computing”,
Wiley Interscience, pp.111-119.
Fig. 10. Response obtained for step change to set point for First Order [10] W.L.Luyben, ”Process Modeling, Simulation and Control for Chemical
System for the Ziegler -Nichols tuning parameters Engineers”, Mc-Graw Hill, pp. 14-38.
[11] W.L.Luyben, M.L.Luyben, ”Essentials of Process Control”, Mc-Graw
Hill, pp. 1-5.
NIRMA UNIVERSITTY JOURNAL OF ENGINEERING AND TECHNOLOGY, VOL.1,NO.1, JAN-JUN 2010 49

Rachit Oza has obtained his B.Tech in Chemical Deepak Tadse has obtained his B.Tech and M.Tech
Chemical Engineering from Nirma University in in Chemical Chemical technology from Nagpur Uni-
2009. versity. His research interest include polymer sci-
ence,process equipment design and polymerization
reaction engineering. He is life member of ISTE.

Nikhil Shah has obtained his B.Tech Chemi- Milind H. Joshipura is working as an Assistant
cal ChemicalEngineering from Nirma Universityin Professor in Chemical Engineering Department of
2009. Institute of Technology in Nirma University, Ahmed-
abad. He has obtained his B.E. in Chemical En-
gineering from D.D.I.T ,Nadiad (Autonomous Uni-
versity) in the year 2000 and Masters in Chemical
Engineering from The M S University, Baroda in
year 2002. His research interest also includes Phase
equilibria studies and Modeling and Simulation. He
is a Life member of ISTE and Associate member of
Indian Institute of Chemical Engineers (IIChE).

You might also like