- UNIVERSITAS SCIENTIARUM

Julio-diciembre de 2003

Revista de la Facultad de Ciencias

PONTIFICIA UNIVERSIDAD JAVERIANA

Vol. 8, N° 2: 43-50

THE USE OF SIMULINK BLOCK DIAGRAM TO SOLVE

MATHEMATICAL MODELS AND CONTROL EQUATIONS

N.M. Ghasem, M.A. Hussain, I.M. Mujtaba*

Department of Chemical Engineering University of Malaya,

50603 Kuala Lumpur, Malaysia

·

School of Engineering, Design and Technology, University of Bradford,

Bradford BD7 1DP, UK

nayef@um.edu.my

ABSTRACT

In this paper, the simulink block diagram is used to solve a model consists of a set of ordinary differential

and algebraic equations to control the temperature inside a simple stirred tank heater. The flexibility of

simulink block diagram gives students a better understanding of the control systems. The simulink also

allows solution of mathematical models and easy visualization of the system variables. A polyethylene

fluidized bed reactor is considered as an industrial example and the effect of the Proportional, Integral and

Derivative control policy is presented for comparison.

Key words: Simulink, block diagram, control systems, mathematical models.

RESUMEN

En este artículo, el diagrama de bloque de simulink es usado para resolver un modelo formado por un

conjunto de ecuaciones diferenciales ordinarias y de ecuaciones algebraicas para el control de la tempe-

ratura dentro de un tanque calentador con agitador. La flexibilidad del diagrama de bloque de simulink

da a los estudiantes una mejor comprensión de los sistemas de control. El simulink también permite

solucionar modelos matemáticos y facilita la visualización de sistemas de varias variables. Un reactor de

cama de polietileno fluido es considerado como un ejemplo industrial y el efecto en las políticas de control

es presentado comparativamente.

Palabras clave: Simulink, diagrama de bloque, sistemas de control, modelos matemáticos.

INTRODUCTION

plant and equipment should be such so

that any deviation, such as an increase in

Chemical plants must operate under

reactor pressure, will itself change

known and specified conditions. There are

operating conditions so that it is rapidly

several reasons why this is so, formal safety

removed. Plants are expensive and

and environmental constraints must not be

intended to make money. Final products

violated. Concern for safety is paramount

must meet customer specifications.

in designing a chemical plant and its con-

Otherwise, they will be unsaleable.

trol systems. Ideally a process design

Conversely the manufacture of products

should be ‘intrinsically safe’, that is, and

not meeting the specifications will involve

43 - Universitas Scientiarum Vol. 8, N° 2: 43-50

unnecessary cost. The majority of con-

should also handle simultaneous

trol loops in a plant control system are

changes in setpoint and disturbances.

associated with operability. Specific flow

rates have to be set, levels in vessels

maintained and chosen operating

Modeling and Control Equations

temperatures for reactors and other

equipment achieved. The top level of

The underlying principle of most process

process control, what we will refer to as

control, however, is already understood by

the strategic control level, is thus

anyone who has grasped the operation of

concerned with achieving the

the domestic hot water thermostat:

appropriate values principally of:

production rate, product quality, and

•

The quantity whose value is to be

energy economy.

maintained or regulated, e.g. the

temperature of the water in a cistern, is

A chemical plant might be thought of as a

measured.

collection of tanks in which materials are

heated, cooled and reacted, and of pipes

•

Comparison of the measured and

through which they flow. Such a system

required values provides an error, e.g.

will not, in general, naturally maintain

‘too hot’ or ‘too cold’.

itself in a state such that precisely the

temperature required by a reaction is

•

On the basis of the error, a control

achieved, a pressure in excess of the safe

algorithm decides what to do.

limits of all vessels be avoided, or a flow

rate just sufficient to achieve the

•

Such an algorithm might be:

economically optimum product

composition arise. Notice that this

•

If the temperature is too high then turn

extremely simple idea has a number of

the heater off. If it is too low then turn

very convenient properties. The feedback

the heater on.

control system seeks to bring the measured

quantity to its required value or setpoint.

•

The adjustment chosen by the control

The control system does not need to know

algorithm is applied to some adjustable

why the measured value is not currently

variable, such as the power input to the

what is required, only that this is so. There

water heater.

are two possible causes of such a disparity:

This summarizes the basic operation of a

•

The system has been disturbed. This is

feedback control system such as one would

the common situation for a chemical

expect to find carrying out nearly all con-

plant subject to all sorts of external

trol operations on chemical plants and

upsets. However, the control system

indeed in most other circumstances where

does not need to know what the source

control is required.

of the disturbance was.

•

The setpoint has been changed. In the

Simple stirred tank heater

absence of external disturbance, a

change in setpoint will introduce an

A continuous process system consisting of

error. The control system will act until

a well-stirred tank, heater and PID

the measured quantity reaches its new

temperature controller is depicted in figure

setpoint. A control system of this sort

(1).

44 - Julio-diciembre de 2003

The effect of dead time (τ ) may be

d

PID

Controller

calculated for this situation by the Padé

Heater

TC

Set point

approximation which is a first order

Tr

Feed

differential equation for the measured

W,T , ρ,C

i

p

temperature.

Measured

Tm

dT

τ

o

d

dT

2

W,T ,

ρ,C

V , T

o

p

= T −T

−

o

dt

2

dt

τ

d

Thermocouple

I. C. T = T at t = 0 (steady state)

(3)

o

r

FIGURE 1 Schematic diagram of heating tank

The above equation is used to generate the

temperature input to the thermocouple, T .

o

The thermocouple shielding and

The feed stream of liquid flows into the

electronics are modeled by a first order

heated tank at a constant rate of W in kg/

system for the input temperature T given

min and temperature T in °C. The volume

o

i

b y

of the tank is V in m3. It is desired to heat

this stream to a higher set point temperature

T in°C. The outlet temperature is measured

dT

T − T

r

m

o

m

=

by a thermocouple as T in °C, and the

τ

m

dt

m

required heater input q in kJ/min is adjusted

by a PID temperature controller. The con-

trol objective is to maintain the temperature

I. C. T = T at t = 0 (steady state) (4)

m

r

input to the thermocouple, T = T in the

o

r

presence of a change in inlet temperature T

where the thermocouple time constant τ is

m

i

which differs from the steady state design

known. The energy input to the tank, q, as

temperature of T .

manipulated by the proportional/integral

is

(PID) controller can be described by

An energy balance on the stirred tank yields

t

K

d

WC

T

(

−T ) + q

c

= +

−

+

−

+

−

dT

q q

K (T

T )

(T

T )dt K .t

(T

T )

∫

p

i

s

c

r

m

r

m

c d

r

m (5)

0

t

dt

=

(1)

I

dt

VC

ρ

p

where K is the proportional gain of the

c

controller, t is the integral time constant or

I

With initial condition T = T at t = 0 which

reset time and t is the derivative time

r

d

corresponds to steady state operation at the

constant. The q in the above equation is

s

set point temperature T . The thermocouple

the energy input required at steady state

r

for temperature sensing in the outlet stream

for the design conditions as calculated by

is described by a first order system plus the

dead time τ which is the time for the output

q = WC (T − T

d

)

s

p

r

is

(6)

flow to reach the measurement point. The

dead time expression is given by

The integral in Equation (5) can be

conveniently be calculated by defining a

T (t) = T (t −τ )

o

d

(2)

new variable as

45 - Universitas Scientiarum Vol. 8, N° 2: 43-50

RESULTS AND DISCUSSION

d (err) = T −T

r

m

dt

Detailed of model equations are shown in

the simulink block diagram of figure 2

I. C. err = 0 at t = 0 (steady state)

(7)

where detailed model equation is being

solved. The PID controller equations of fi-

Thus Equation (7) becomes

gure 2 are replaced by a PID simulink block

diagram and are shown in figure 3.

K

Operating parameters are listed in table 1.

d

q =q +K (T T

− )

c

+

(

)

err +K .t

(T

T

− )

s

c

r

m

c d

r

m (8)

t

dt

I

du/dt

Kd*(80-u)

q

f(u)

500

-K-

1

Ti

s

Kc*(80-u)

T

1/2

2/1

1

signal1

s

T0

1/5

signal2

1

s Tm

signal3

1

s

errorsum

80-u

FIGURE 2. Schematic diagram of simulink flowsheet of the model equations.

qs

q

10000

-K -

Sum 1

-K -

PID C ontroller Fcn1

Ti

Sum

G ain

G ain1

1

PID

80-u

s

T '

T

1/2

G ain4

1

2

s

G ain2

T0

Sum 3

1

1/5

s

Sum 4

G ain3

Tm

Scop e

FIGURE 3. Schematic diagram of SIMULINK flowsheet of the PID control tool box.

46 - Julio-diciembre de 2003

TABLE 1 Baseline system and opeating

certain disturbance of inlet feed

parameters

temperature, the heater temperature drops

from 80 to 60oC. Implementing a

VC

ρ

= 4000 kJ o

/ C

WCp = 500 kJ

o

/ min . C

p

Proportional controller where K =500 still

c

T

o

= 60 C

T

o

= 80 C

could not bring the well stirred tank heater

is

r

to its set point temperature (fig. 4b).

τ

τ

m = 5 min

d = 1 min

o

Addition of an integral action where the

K = 50 kJ / min C

t

t

I = 2 min,

d = 1 min

c

integral time constant, t =2 brings the

1

heater back to its set point (fig. 4c).

The controlled variable is the heat

Increasing t to 20 again took the tank

1

measured temperature T , while the

temperature away from the set point

m

manipulated variable is the power input q

temperature meaning that the increase in

to the heater. Values of K ,t , t should be

the integral time constant is not desired (fig.

c

1

d

given in the MATLAB workspace before

4d). An addition of derivative time constant

running the simulink block diagram. Figu-

t did not make much change (fig. 4e, f).

d

re 4a shows an open loop system; under a

9 0

9 0

kc=0

(a)

kc=500

(b)

e in C 8 0

e in C

8 0

atur

atur

7 0

7 0

emper

T

emper

6 0

T

6 0

0

5 0

100

150 200

0

5 0

100

150 200

9 0

9 0

kc=50,ti=2

(c)

kc=50,ti=20

(d)

e in C 8 0

e in C

8 0

atur

atur

7 0

7 0

emper

T

emper

6 0

T

6 0

0

5 0

100

150 200

0

5 0

100

150 200

9 0

0

9 0

0

kc=50,ti=2,td=2

(e)

kc=50, ti=2, td=20

(f)

e in C

8 0

0

e in C

8 0

0

atur

7 0

0

atur

7 0

0

emper

T

6 00

emper

6 0

0

00

50

5 0

100

100

150

150

20

T

200

00

50

5 0

100

100

150

150

20

200

Time in minutes

Time in minutes

FIGURE 4. Effect of controller gain on tank temperature.

47 - Universitas Scientiarum Vol. 8, N° 2: 43-50

The Industrial UNIPOL process for

industries due to a remarkable catalyst and

polyethylene production

gas-solid fluidized bed technology (Choi

and Ray 1985, Debling et al., 1994). In

Polyethylene is made in polymerization

addition, by employing the Ziegler-Natta

reactions in the presence of a catalyst. Both

catalyst, the process can operates at

the reactor technology and the catalyst

relatively low pressure and temperature (20

technology are patented, and both Dow and

atm and 100oC) compared to the

Carbide are leading developers of reactor

conventional process (2000 atm, 200oC).

technology. Carbide’s reactor technology,

However, improper control of the process

called Unipol (fig. 5), is the world’s most

parameters especially the catalyst injection

widely licensed polyethylene process

rate, raw material feed temperature and su-

technology. The other significant licensed

perficial gas velocity may lead to

LLDPE (Linear Low Density Polyethylene)

temperature runaway and clusters

process technology is Innovene, owned by

formation in the reactor. Subsequently

BP. Both UNIPOL and Innovene make

plant has to shut down for cleaning purpose.

polyethylene in a process in which ethylene

In addition, the situation becomes worse

is in a gaseous form during polymerization

when the reactor bed temperature exceeds

(gas phase). The large majority of LLDPE

the polyethylene softening point (~400 K),

reactor operates in gas phase rather than in

where the solid particles tends to

liquid phase. Polyethylene achieves its pre-

agglomerate and may form huge chunk in

eminent position in thermoplastic

the reactor.

Blower

Heat

C atalyst

Exchanger

Fluidized

Catalyst

bed

Feeder

Reactor

Ethylene &

Co - M onomer

Product

H ydrogen

N itrogen

Recycle

FIGURE 5. Schematic diagram of UNIPOL process

Modeling of polyethylene gas phase

McAuley et al., 1994). Solution of model

reactor (UNIPOL process)

equation using SIMULINK block diagram

is shown in figure 6.

Detail of the modeling equation can be

found elsewhere (Debling et al., 1994,

48 - Julio-diciembre de 2003

-1

Ad*exp(-Ed/(R*u))

-K-

-1

kd

u^0.5

1

s

Ap*exp(-Ep/(R*u))

t

I

kp

1

s

At*exp(-Et/(R*u))

2.0*f/u

I

M

kt

u^2

1

1/u

M

s

u

Tt

2.0*f*(1-v/2.0)

1

u^2

s

2+v

u2

Tc

1

s

(-DeltaH*u*V)

T

u/(V*ro*Cp/Mw)

376.15-u

x

1

s

Q0

A*u

Tc

PID

0

U

(Tci+u)/2.0

Display

u/(Vc*roc*Cpc/18.0)

mc*Cpc*(Tci-u)

U0-alfa*u

(M0-u)*100/M0

FIGURE 6. SIMULINK flowsheet to the well mixed model for polyethylene fluidized bed

reactor

RESULTS AND DISCUSSION

Implementing a proportional controller

where the control variable is the reactor bed

The effect of a step change in reactor feed

temperature and the manipulated variable

temperature on the dimensionless reactor

is the heat exchange cooling water

temperature. It is clear that the system was

temperature, the system regain its stability

stable before a step change in the feed

but still with some offset (fig. 7b). With an

temperature takes place. Once the step

introduction of an integral controller along

change in feed temperature occurs the

with proportional gain the reactor returns

temperature loses its stability and an

to its set point (fig. 7c).

oscillatory behavior above polymer

melting point occurs.

2

2

2

m1.9

1.9

1.9

1.8

1.8

1.8

(a)

(b)

(c)

r

s

1.7

1.7

1.7

r

m

1.6

1.6

1.6

1.5

1.5

1.5

1.4

1.4

1.4

1.3

1.3

1.3

1.2

1.2

1.2

85

86

87

88

89

90

91

92

93

94

95

85

86

87

88

89

90

91

92

93

94

95

Dimensionless time

Dimensionless time

85

86

87

88

89

90

91

92

93

94

95

Dimensionless time

(a) (K =0.0, K =0.0), (b) (K =0.50, K =0.0), (c) (K =0.50, K =0.10)

c

I

c

i

c

I

FIGURE 7. Effect of controller gain fluidized bed reactor temperature

49 - Universitas Scientiarum Vol. 8, N° 2: 43-50

CONCLUSION

for olefin polymerization proceses:

AIChE J. 1994, 40 (3).

•

At low values of integral action (reset)

MCAULEY, K.B., TALBOT, J.P. and HARRIS T.J.

time and low proportional bands, the

A comparison of two-phase and well-

system is prone to significant

mixed models for fluidized bed

oscillation. This large amount of

polyethylene reactors. Chem Eng Sci

oscillation means that the control tends

49(13) 2035-2045.

towards on/off control.

FOGLER, H.S. Elements of Chemical Reaction

•

As the proportional band is increased

Engineering, 2nd ed., Englewood

the oscillation in the system becomes

Cliffs, NJ: Prentice-Hall, 1992.

less and the process is successfully

PERRY, R.H., GREEN, D.W., and MALOREY, J.D.,

returned to the setpoint (recall with

Eds. Perry’s Chemical Engineers

proportional only control, there was an

Handbook. New York:McGraw-Hill,

“offset”). However, the process is away

1984.

from the setpoint for a relatively long

period of time.

SHACHAM, M., BRAUNER; N., and POZIN, M.

Computers Chem Engng., 20, Suppl.

•

As the integral action (reset) time is

S1329-S1334 (1996).

increased, so the system is returned to

the setpoint more quickly. However, at

Extracted for web site http://

high proportional bands and high inte-

www.polymath-software.com

gral action (reset) times the system

Introduction to Virtual Control Laboratory

again takes a long time to return (and in

fact it may not) to the setpoint as the

http://www.chemeng.ed.ac.uk/ecosse/con-

system is “over damped”.

trol/sample/map/intro.html

•

The main advantage of PI control is that

CHOI, K.Y. and RAY, W.H. The dynamic

offset is eliminated. The combination

behavior of fluidized bed reactors for

of correct proportional bands and a

solid catalyzed gas phase olefin

correct integral action (reset) time pro-

polymerization. Chem Eng Sci. 1985,

duces a quick response to a disturbance

40(12) 2261-2279.

in the process that returns the process

to the setpoint without offset.

GHASEM, N.M. Effect of Polymer Growth Rate

and Diffusion Resistance on the

Behavior of Industrial Polyethylene

LITERATURA CITADA

Fluidized Bed Reactor. Chem Eng and

Technol. 2001, 24(10) 1049-1057.

DEAN, A. (Ed.), Lange’s Handbook of

Chemistry, New York: McGraw-Hill,

1973.

DEBLING J.A., HAN, G.C., KUIJPERS, F., VERBURG,

Recibido: 30/04/2003

J., ZACCA J. and RAY, W.H. Dynamic

Aceptado: 5/09/2003

Modeling of product grade transitions

50