You are on page 1of 11

INDIAN CHEMICAL ENGINEER Copyright 2009 Indian Institute of Chemical Engineers

Vol. 51 No. 4 October-December 2009, pp. 261-271


Print ISSN: 0019-4506, Online ISSN: 0975-007X, DOI: 10.1080/00194500903444334

Modelling of Non-Isothermal Batch


Reactor Using Fuzzy Logic

M.A. Hakeem,* Mohd. Masroor Ali, Richa Singhal and Syed Sadiq Ali
Department of Chemical Engineering, Aligarh Muslim University, Aligarh - 202 002, India

Abstract: In the present work, fuzzy logic (FL) has been used to model the performance
of a batch reactor system and, hence, the conversion profile at varying operating
conditions. The transient temperature vs. time data of exothermic reaction was taken from
open literature [1] for modelling with FL. The FL model with properly chosen fuzzy
sets, type of membership function and rule base relate time with temperature very well
in the reactor under experimental condition. The simulated result through FL model was
compared with experimental findings, mathematical model and artificial neural network
(ANN) model. The FL model predictions were found to be in very good agreement with
experimental findings with average absolute error less than 1%.

Keywords: Fuzzy logic, Batch reactor, Fuzzification, Defuzzification, Exothermic reaction,


ANN.

Introduction
Fuzzy logic (FL) is a comparatively new science that can be used to model and control
a wide range of operations. FL provides a simple way to arrive at a definite conclusion
based upon vague, ambiguous, imprecise, noisy, or missing input information. It is one
of the most innovative, active and fruitful areas of research for science and engineering
applications, especially in the field of industrial processes [2, 3]. It has a variety of
applications starting from household appliances like washing machines and refrigerators
to industrial automation and control [4-9]. A number of applications of FL in process
control and modelling can be found in the literature [10-15].
Batch reactors are widely used in the chemical industry. They are prefered when
relatively small amount of mass is to be processed with high product quality. However,
depending upon the reaction kinetics and its heat effect the performance equations are
highly nonlinear. The dynamic study of batch reactors helps in proper understanding of

*Author for Correspondence. E-mail: mahakeem63@yahoo.co.in, mahakeem@rediffmail.com


Paper received: 06/04/2008; Revised paper accepted: 25/10/2009
262 HAKEEM ET AL

temperature and concentration profiles in the reactor, which results in its smooth
functioning. Various modelling techniques aid in the comprehension of the system dynamics.
The primary approach can be the use of first principle model, which is based on mass
and energy balance around the system.
The data were taken from the experimental set-up [1], which consisted of a covered
cylindrical stainless steel (SS) vessel with magnetic stirrer and baffles, to maintain uniformity
of the condition inside the reactor. A SS tube, bent in the form of a helical coil, was
provided inside the vessel to facilitate cooling of the reaction media inside the vessel. The
cooling water, supplied from an overhead tank, was circulated through the helical coil
during the experiments to take out the exothermic reaction heat. The set-up was fitted with
valves to manipulate the cooling water flow-rate, whenever necessary. It was also equipped
with thermocouples (copper-constantan) to measure the temperature inside the reaction
vessel. Acid catalysed hydrolysis of acetic anhydride in the presence of solvent acetic
acid was chosen as the reaction system
H 2SO 4
(CH 3 CO) 2 O + H 2 O 2 CH 3 COOH
The reaction system was found to obey the pseudo-first order kinetics with respect to
acetic anhydride [1, 16]. The transient temperature vs. time data for step changes in
coolant flow rate for the above system was taken from open literature [1]. The reactor
details and operating data are shown in Tables 1 and 2.
The experimental result was compared with the artificial neural network (ANN) model
having network structure 1-3-3-3-1 first corresponding to input layer having one neuron
since time was an input. Three hidden layers each havd three neurons. The output layer
had one neuron related to temperature of reaction mixtures. The number of data chosen
for training and testing of the network was 35 [1]. In the present work, the above-
mentioned reaction system was modelled using FL. The FL model for batch reactor was
developed in MATLAB 7.0 using Fuzzy Logic Toolbox and the authors own source code
using C language. The results of FL model were compared with experimental results. The
fuzzy results obtained from MATLAB and C program were also compared.

Table 1. Dimensions of reaction vessel and helical coil

Item Material Height/length (mm) Inside diameter (mm) Thickness (mm)

Reactor vessel Stainless steel 110 90 0.5


Cooling coil Stainless steel 650 4 2

Table 2. Initial concentration of reactants

Chemical species Volume (ml) Concentration (g mole/l)

Acetic anhydride 150.00 5.0


Water 107.00 18.61
Acetic acid 60.00 0.3270
Sulphuric acid 01.00 0.057

INDIAN CHEMICAL ENGINEER Vol. 51 No. 4 October-December 2009


Modelling of Non-Isothermal Batch Reactor Using Fuzzy Logic 263

Mathematical Modelling
The mass and energy balance equations for a transient unsteady-state non-isothermal
batch reactor can be written as
dNA/dt = kNA = rA (1)
(VCp + Ws) dT/dt = ( H)rAV UA(T Tci) (2)
In the above model, the fluid properties are assumed to be constant. The heat transfer
to air is assumed to be negligible. The above equations were solved by RK method. RK stands for?

Fuzzy Logic Modelling


An FL system that implements a nonlinear mapping between its inputs and outputs was
used. Experimental variables were temperature T (output) and time t (input), i.e. if time is
fed to the model it will predict the corresponding temperature for the given system.
Figure 1 shows fuzzy sets t1 to t10 for time. The range of t1 is 0 to 2.5 min and that
of t2 is 0 to 5 min. Similarly, the range of values for other fuzzy sets can be ascertained.
The triangular shapes of the different fuzzy sets determine the degree of membership to
that particular value in the set, e.g. time t of 9 min belongs to the fuzzy set t4 and t5 with
the different intensity of the belongingness, quantified by the value of the membership
function. Fuzzy set t4 has the range (universe of discourse) 5 to 10 min while the universe
of discourse for t5 is 7.5 to 12.5 min. The fuzzy membership functions of t with the
remaining fuzzy sets namely t1, t2, t3, t6... are zero. Similarly, Fig. 2 shows fuzzy sets T1

t1 t2 t3 t4 t5 t6 t7 t8 t9 t10
1.0

0.5

0.0
0 5 10 15 20
Input variable time (min)
Fig. 1. Membership functions for time for positive step change in coolant flow.

T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11
1.0

0.5

0.0
295 300 305 310 315 320
Output variable temperature (K)
Fig. 2. Membership functions for temperature for positive step change in coolant flow.

INDIAN CHEMICAL ENGINEER Vol. 51 No. 4 October-December 2009


264 HAKEEM ET AL

to T11 for the output variable (temperature in the reactor), with positive step change in
the coolant flow rate. Universe of discourse for each fuzzy set is self evident. Figures 3
and 4 show how the variable can be converted into fuzzy format and fuzzy output into
the simple numeric variable.

Degree of
membership

x1 x2
5 7.5 10 12.5 min
9 min
Fig. 3. Fuzzification of time t = 9 min.

T7 T9

a2
Degree of
a1
membership
h1 = 0.4 h2 = 0.6

b1 b2

307.5 312.5 317.5


Fig. 4 Computation of centre of gravity (CG) for the required condition.

For time (t = 9), the qualifying fuzzy sets are t4 and t5.
Fuzzy membership function at t = 9 min for fuzzy set t4
X1 =95=4
X2 = 10 9 = 1
Slope 1 = 1/2.5 = 0.4
Slope 2 = 1/2.5 = 0.4

Value of membership function


t4 (t = 9) = min {4*0.4, 1*0.4, 1} = 0.4

INDIAN CHEMICAL ENGINEER Vol. 51 No. 4 October-December 2009


Modelling of Non-Isothermal Batch Reactor Using Fuzzy Logic 265

Fuzzy membership function at t = 9 min for fuzzy set t5


X1 = 9 7.5 = 1.5
X2 = 12.5 9 = 3.5
Slope 1 = 1/2.5 = 0.4
Slope 2 = 1/2.5= 0.4

Value of membership function


t5 (t = 9) = min {1.5*0.4, 3.5*0.4, 1} = 0.6
Hence, according to rule base 4 and 5 given in Table 3 the fuzzified output of t4 and t5
input fuzzy sets are the output fuzzy sets T7 and T9 with value of membership function
as 0.4 and 0.6, respectively. The computation of CG for the two competing outputs of rules
4 and 5 with strength of 0.4 and 0.6, respectively, is given as follows:
For fuzzy set T7
X-axis centroids point = 310
Rule strength applied to determine output area = 0.4
Shaded area = 1/2 h1 (a1 + b1)
= 1/2 (0.4) (5 + 3)
= 1.6
For fuzzy set T9
X-axis centroids point = 315
Rule strength applied to determine output area = 0.6
Shaded area = 1/2 h2 (a2 + b2)
= 1/2 0.6 (5 + 2)
= 2.1
Therefore
Weighted average CG = (1.6 310 + 2.1 315)/3.7 = 312.83.

Table 3. Rule base for positive step change

Rule Antecedent Consequent

Rule 1 If time is t1 then Temperature is T2


Rule 2 If time is t2 then Temperature is T4
Rule 3 If time is t3 then Temperature is T6
Rule 4 If time is t4 then Temperature is T7
Rule 5 If time is t5 then Temperature is T9
Rule 6 If time is t6 then Temperature is T10
Rule 7 If time is t7 then Temperature is T9
Rule 8: If time is t8 then Temperature is T7
Rule 9: If time is t9 then Temperature is T5
Rule 10: If time is t10 then Temperature is T4

INDIAN CHEMICAL ENGINEER Vol. 51 No. 4 October-December 2009


266 HAKEEM ET AL

Hence, if time is 9 min then reactor temperature is 312.83 K with positive step change in
the coolant flow rate.
Figures 5 and 6 show fuzzy sets for time and temperature in the reactor for negative
step change in the coolant flow rate. As before, at a particular value of time for negative
step input, fuzzified input and output can be determined from Figs. 5 and 6 and Table 4.

t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16


1.0

0.5

0.0
0 5 10 15
Input variable time (min)
Fig. 5. Membership functions for time for negative step change in coolant flow.

T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 T13 T14 T15 T16T17

1.0

0.5

0.0
300 305 310 315 320 325 330 335 340
Output variable temperature (K)
Fig. 6. Membership functions for temperature for negative step change in coolant flow.

Table 4. Rule base for negative step change

Rules Antecedent Consequent Rules Antecedent Consequent

Rule 1 If time is t1 then Temperature is T1 Rule 13 If time is t10 then Temperature is T12
Rule 2 If time is t2 then Temperature is T2 Rule 14 If time is t10 then Temperature is T14
Rule 3 If time is t3 then Temperature is T3 Rule 15 If time is t11 then Temperature is T7
Rule 4 If time is t4 then Temperature is T4 Rule 16 If time is t11 then Temperature is T9
Rule 5 If time is t5 then Temperature is T4 Rule 17 If time is t11 then Temperature is T12
Rule 6 If time is t6 then Temperature is T5 Rule 18 If time is t12 then Temperature is T6
Rule 7 If time is t7 then Temperature is T6 Rule 19 If time is t12 then Temperature is T8
Rule 8 If time is t7 then Temperature is T7 Rule 20 If time is t13 then Temperature is T5
Rule 9 If time is t8 then Temperature is T8 Rule 21 If time is t14 then Temperature is T4
Rule 10 If time is t8 then Temperature is T10 Rule 22 If time is t15 then Temperature is T3
Rule 11 If time is t8 then Temperature is T11 Rule 23 If time is t16 then Temperature is T2
Rule 12 If time is t9 then Temperature is T15

INDIAN CHEMICAL ENGINEER Vol. 51 No. 4 October-December 2009


Modelling of Non-Isothermal Batch Reactor Using Fuzzy Logic 267

The fuzzified output values were defuzzified using centroid method as discussed earlier.
For both positive and negative step changes, T values were obtained and compared with
experimental results. Also, error E was estimated by using

R R2
E = 2 100 (4)
R2
where R1 and R2 are results of T from experimental study and FL approach, respectively.

Results and Discussion


The FL model has been developed for a typical batch reactor system. The initial temperature
of the reaction was in the range of 27-30C and the inlet temperature of cooling water was
in the range of 26-27C. Figure 7 compares the simulated result from the mathematical
model (Eqs. (1) and (2)) and the experimental data. Temperature profile predicted through
ANN and experimental values is shown in Fig. 8. The comparisons between FL model
predicted temperature and actual temperature are shown in Figs. 9 and 10, respectively,
for positive and negative step change in the coolant flow rate. Table 5 also shows these
trends.
As can be seen, values of transient temperature predicted through FL model were in
close agreement with the experimental values with error ranging from 0.72 to 0.53% for
positive step change and 0.33 to 1.22% for negative step change. The MATLAB and
C program results were also in close agreement. The mathematical model was found to

340
Experimental

Simulated
330
Temperature (K)

320

310

300

290
0 5 10 15 20
Time (min)
Fig. 7. Experimental and simulated temperature profile for positive step
change in coolant flow at 313.16K.

INDIAN CHEMICAL ENGINEER Vol. 51 No. 4 October-December 2009


268 HAKEEM ET AL

325
Experimental
Simulated
320

315
Temperature (K)

310

305

300

295
0 5 10 15 20 25
Time (min)
Fig. 8. Experimental and ANN simulated temperature profile for negative step
change in coolant flow at 313.16 K.

320
Experimental
MATLAB
315 C program
Temperature (K)

310

305

300

295
0 5 10 15 20 25
Time (min)
Fig. 9. Experimental and FL simulated temperature profile for positive step
change in coolant flow rate from 110 to 120 cc/min at 313.6 K.

INDIAN CHEMICAL ENGINEER Vol. 51 No. 4 October-December 2009


Modelling of Non-Isothermal Batch Reactor Using Fuzzy Logic 269

340
Experimental
335
MATLAB
330 C program

325
Temperature (K)

320

315

310

305

305

300

295
0 5 10 15 20
Time (min)
Fig. 10. Experimental and FL simulated temperature profile for negative step
change in coolant flow rate from 120 to 110 cc/min at 313.6 K.

be under-predicting, which may be due to the assumptions made in the model. The ANN
predicted result did not exhibit perfect matching as that of Figs. 9 and 10. The mean
absolute deviarion (MAD) of the result shown in Fig. 9 were 0.28 and 0.34% for MATLAB
and C-code, respectively, while for Fig. 10 its values were 0.17 and 0.21%, respectively.

Conclusion
The fuzzy logic model developed for a batch reactor was successful as seen from
experimental results and had high accuracy levels. Therefore, this model can be used as
a reference model with various control strategies for the control of temperature in batch
reactor systems. Since both MATLAB and C program values were in close agreement with
experimental values, therefore, both techniques could be used in designing temperature
control depending on the ease and availability to the designer.

Nomenclature
( H) Heat of reaction, cals/g moles
A Area for heat transfer, m2
Cp Specific heat of reaction mixture, cals/g C
CG Centre of gravity
FL Fuzzy logic
k Pseudo first order rate constant, min1
NA Number of moles of component A at any time instant, g moles
rA Rate of reaction of component A, g moles/cm3 (time)

INDIAN CHEMICAL ENGINEER Vol. 51 No. 4 October-December 2009


270 HAKEEM ET AL

Table 5. Comparison between experimental data and the predicted result with FL
simulation on MATLAB platform and C program code

Positive step change (110-120 cc/min) Negative step change (120-110 cc/min)

Time (min) Temperature (K) Time (min) Temperature (K)

Experimental Simulated Experimental Simulated

Matlab C-code Matlab C-code

0 299.1 298 297.5 0 301.0 301 301.2


2.5 303.3 303 302.5 1 302.9 303 302.5
5 307.0 308 307.5 2 304.6 305 305
7.5 310.8 310 310 3 306.5 306 307.5
10 316.0 315 315 4 308.5 307 307.5
12.5 318.5 318 317.5 5 310.7 310 310
15 313.9 315 315 6 314.2 314 313.7
17.5 307.8 310 310 7 320.9 321 321.7
20 304.7 305 305 8 334.6 335 335
20.8 303.5 304 304.1 8.5 336.1 332 332.2
9 330.2 330 330
10 321.2 321 320.8
11 314.8 315 315
12 310.3 310 310
13 307.0 307 307.5
14 304.81 305 305
15 303.07 303 302.5

T Temperature, K
t Time, min
Tc Inlet coolant Temperature, K
Texp Temperature of the reaction mixture measured experimentally, K
TFL Temperature of the reaction mixture simulated through FL, K
U Heat transfer coefficient, cals/m2 C
V Volume of reactants, cm3
WS Wall capacitance, cals/C
i = N (T TFL ) *100
MAD Mean absolute deviation, i =1 exp
Texp

Greek Symbols
Density of reaction mixture
t5 (t) Membership of variable t in the fuzzy set t5

References
1. Purohit, J.L., Jayakumar, N.S. and Shah, V.A., Modelling of Non-isothermal Batch Reactor,
CHEMCON, Ankeleshwar, Gujarat, India (2006).

INDIAN CHEMICAL ENGINEER Vol. 51 No. 4 October-December 2009


Modelling of Non-Isothermal Batch Reactor Using Fuzzy Logic 271

2. Shekhan, S.R. and Pai, G.A.V., Neural Network, Fuzzy Logic and Genetic Algorithm: Synthesis
and Application, Prentice Hall of India (2003).
3. Driankow, D., Hellendoom, H. and Reinfrank, M., An Introduction to Fuzzy Control, Narosa
Publishing House, New Delhi, India (1996).
4. Juang, Y.T., Chang, Y.T. and Huang, C.P., Design of Fuzzy PID Controllers Using Modified
Triangular Membership Functions, Information Sciences, 178, pp. 1325-1333 (2008).
5. Vries, B.D., Steins, R.J., Assessing Working Condition Using Fuzzy Logic, Automation in
Construction, 17, pp. 584-591 (2008).
6. Chen, J., Roberts, C. and Weston, P., Fault Detection and Diagnostics for Railway Track
Circuits Using Neuro-Fuzzy Systems, Control Engineering Practice, 16, pp. 585-596 (2008).
7. Cheong, F. and Richard, L., Designing a Hierarchial Fuzzy Logic Controller Using the
Diffrential Evolution Approach, Applied Soft Computing, 7, pp. 481-490 (2007).
8. Unal, O. and Uygunoglu, T., A New Approach to Determination of Compressive Strength
of Fly Ash Concrete Using Fuzzy Logic, J. Scientific and Industrial Research, 65, pp. 894-
899 (2006).
9. Papageorgiou, E.I. and Groumpos, P.P., A New Hybrid Method Using Evolutionary Algorithms
to Train Fuzzy Cognitive Map, Applied Soft Computing, 5, pp. 409-431 (2005).
10. Tepeli, A. and Hortacsu, A., A Fuzzy Logic Approach for Regulation in Flux Balance
Analysis, Biochemical Engineering Journal, 39, pp. 137-148 (2008).
11. Guimaraes, A.C.F. and Lapa, C.M.F., Fuzzy FMEA Applied to PWR Chemical and Volume
Control System, Progress in Nuclear Energy, 44(3), pp. 191-213 (2004).
12. Tsekouras, G., Sarimveis, H., Raptis, C. and Bafas, G., A Fuzzy Logic Approach for the
Classification of Product Qualitative Characteristics, Computers and Chemical Engineering,
26, pp. 429-438 (2002).
13. Huang, H.J. and Wang, F.S., Fuzzy Decision Making Design of Chemical Plant Using Mixed
Integer Hybrid Differential Evolution, Computer and Chemical Engineering, 26, pp. 1649-
1660 (2002).
14. Uhrig, R.E. and Tsoukalas, L.H., Soft Computing Technologies in Nuclear Engineering
Applications, Progress in Nuclear Energy, 34(1), pp. 13-75 (1999).
15. Schmitz, G.P.J. and Aldrich, C., Neurofuzzy Modeling of Chemical Process Systems with
Ellipsoidal Radial Basis Function Networks and Genetic Algorithm, Computer and Chemical
Engineering, 22(Suppl.), pp. S1001-S1004 (1998).
16. Koskikallio, J., Pouli, D. and Whalley, E., Pressure Effect and Mechanism in Acid Catalysis
v. the Hydrolysis of Acetic Anhydride, Can. J. Chem., 37, pp. 1360-1366 (1959).

INDIAN CHEMICAL ENGINEER Vol. 51 No. 4 October-December 2009

You might also like