Professional Documents
Culture Documents
MODULE 2:
Chemical Process Modeling
Energy
Chemical
Raw materials Process Finished Product
Energy
INPUT
Disturbances
Measured Unmeasured
Measured
OUTPUT
INPUT Chemical
Controlled
Manipulated Process Unmeasured Variables
Variables
Fig. 2.3.
𝑑3 𝑦 𝑑2 𝑦 𝑑𝑦
+ 32 + 60 = 45000𝑢 (2.6)
𝑑𝑡 3 𝑑𝑡 2 𝑑𝑡
where 𝑦 is the potentiometer output voltage and 𝑢 is the
amplifier input voltage.
Question: Express Eq.(2.6) as a system of first order and
obtain the state space matrices.
Solution
Let 𝑦 = 𝑥1
By successive differentiating wrt t, we have:
𝑑𝑦 𝑑𝑥1
= = 𝑥2 (2.7a)
𝑑𝑡 𝑑𝑡
𝑑2 𝑦 𝑑𝑥2
= = 𝑥3 (2.7b)
𝑑𝑡 2 𝑑𝑡
𝑑3 𝑦 𝑑𝑦 𝑑2 𝑦 𝑑𝑥3
= ( )= (2.7c)
𝑑𝑡 3 𝑑𝑡 𝑑𝑡 2 𝑑𝑡
𝑑𝑥1
= 𝑥2 (2.7d)
𝑑𝑡
𝑑𝑥2
= 𝑥3 (2.7e)
𝑑𝑡
𝑑𝑥3
= −60𝑥2 −32𝑥3 + 45000𝑢 (2.7f)
𝑑𝑡
Output equation
𝑦 = 𝑥1 (2.7g)
𝑑𝑓
NB: 𝐿 [ ] = 𝑠𝐹 (𝑠) − 𝑓(0) (2.8ci)
𝑑𝑡
𝐿[𝑓(𝑡)] = 𝐹(𝑠) (2.8cii)
𝑌 (𝑠 )
= 𝐺(𝑠) = 𝐶 (𝑠𝐼 − 𝐴)−1 𝐵 + 𝐷 (2.9f)
𝑈𝑠)
𝑌 (𝑠 ) 𝑎𝑑𝑗(𝑠𝐼−𝐴)
= 𝐺(𝑠) = 𝐶 𝐵+𝐷 (2.9g)
𝑈(𝑠) det(𝑠𝐼−𝐴)
|𝒔𝑰 − 𝑨| = 𝟎 (2.9h)
(𝑠 − 2)(3𝑠 + 2) = 0
Laplace Transforming
AB G(s)
CD State space realization
𝑥1 (𝑘)
𝑦 = [1 0 0] [𝑥2 (𝑘)] (2.14f)
𝑥3 (𝑘)
(𝑧 − 1)(3𝑧 + 2) = 0
Laplace Transforming
Ad Bd G(z)
CD State space realization
𝑇𝑚
𝑇 𝑇=Temperature of fluid
Questions
(1) Derive the dynamic equation governing temperature
change at the thermocouple junction.
(2) Find the transfer function model.
𝑑𝑇𝑚
𝑚𝑐 = ℎ𝐴(𝑇 − 𝑇𝑚 ) (2.16b)
𝑑𝑡
𝑚𝑐
Taking = 𝜏 and re-arranging, we have:
ℎ𝐴
𝛿𝑇𝑚 (𝑠) 1
= (2.16f)
𝛿𝑇 (𝑠) 𝜏𝑠+1
NB:
Eq.(2.16f) is referred to as the transfer function relating the
variation of the thermocouple temperature to the surrounding
fluid temperature.
Eq.(2.16f) is a first order transfer function with time constant
of 𝜏 and a gain of 1.
𝑞𝑖 Assumptions
Constant density
Outflow varies linearly with height
𝑞1 = 𝛽1 ℎ1
𝑞1 𝑞2 = 𝛽2 ℎ2
𝐴1 , ℎ1
𝐴2 , ℎ2 𝑞2
Questions:
[1] Derive the equations describing the variations of ℎ1 and ℎ2
with time.
𝛿ℎ1 𝛿ℎ2
[2] Determine the transfer functions: (a) and (b)
𝛿𝑞𝑖 𝛿𝑞𝑖
Solution
Recall,
Accumulation = IN – OUT (2.16a)
𝑑𝑚
= 𝑚̇𝑖𝑛 − 𝑚̇𝑜𝑢𝑡 (2.17a)
𝑑𝑡
𝑑
Tank1: (𝜌𝐴1 ℎ1 ) = 𝜌𝑞𝑖 − 𝜌𝑞1 = 𝜌𝑞𝑖 − 𝜌𝛽1 ℎ1 (2.17b)
𝑑𝑡
𝑑
Tank 2: (𝜌𝐴2 ℎ2 ) = 𝜌𝑞1 − 𝜌𝑞2 = 𝜌𝛽1 ℎ1 − 𝜌𝛽2 ℎ2 (2.17c)
𝑑𝑡
The two odes describing the states of the tanks can then be
written as:
𝑑ℎ1 −𝛽1 1
= ℎ1 + 𝑞𝑖 (2.17d)
𝑑𝑡 𝐴1 𝐴1
𝑑ℎ2 𝛽1 𝛽2
= ℎ1 − ℎ2 (2.17e)
𝑑𝑡 𝐴2 𝐴2
In vector form, this can be written as
−𝛽1
ℎ̇1 0 ℎ 1
𝐴1 1
[ ]=[𝛽 ] [ ] + [𝐴1 ] 𝑞𝑖 (2.17f)
ℎ̇2 1 −𝛽 2 ℎ2 0
𝐴2 𝐴2
𝑥 0 𝑠−𝑥 0
(𝑠𝐼 − 𝐴) = 𝑠 [1 0
]−[ ]=[ ] (2.17h)
0 1 𝑦 𝑧 −𝑦 𝑠−𝑧
+ − 𝑇
⏞
𝑠−𝑧 ⏞
−𝑦 𝑠−𝑧 𝑦 𝑇 𝑠−𝑧 0
=[ ] =[ ] =[ ] (2.17j)
+ 0 𝑠−𝑥 𝑦 𝑠−𝑥
0 ⏞
𝑠−𝑥
𝑠−𝑧 𝑦
𝑑𝑒𝑡(𝑠𝐼 − 𝐴) = | | = (𝑠 − 𝑥 )(𝑠 − 𝑧) (2.17k)
0 𝑠−𝑥
𝑠−𝑧 0
[ ] 1 𝑠 −𝑧 0
𝑦 𝑠−𝑥
(𝑠𝐼 − 𝐴)−1 = = [ ] (2.17l)
(𝑠−𝑥 )(𝑠−𝑧) (𝑠−𝑥 )(𝑠−𝑧) 𝑦 𝑠−𝑥
1
1 𝑠−𝑧 0
−1
(𝑠𝐼 − 𝐴) 𝐵 = [ ] [𝐴1] (2.17m)
(𝑠−𝑥)(𝑠−𝑧) 𝑦 𝑠−𝑥
0
1
𝐴1 (𝑠−𝑥)
= [ 𝑦 ] (2.17n)
𝐴1 (𝑠−𝑥)(𝑠−𝑧)
1 1
1 0 𝐴1 (𝑠−𝑥) 𝐴1 (𝑠−𝑥)
𝐶 (𝑠𝐼 − 𝐴)−1 𝐵 = [ ][ 𝑦 ] =[ 𝑦 ] (2.17o)
0 1
𝐴1 (𝑠−𝑥)(𝑠−𝑧) 𝐴1 (𝑠−𝑥)(𝑠−𝑧)
1
𝛿ℎ1 ( )
(2.17q)
𝛽2
=
𝛿𝑞𝑖 𝐴 𝐴
(( 1 )𝑠+1)(( 2 )𝑠+1)
𝛽1 𝛽2
Assumptions
Constant density
𝑞𝑖 Outflow varies directly as the square
root of the height
𝑞𝑜 = 𝑐 √ℎ
𝐴, ℎ
𝑞𝑜
Question:
[1] Derive the mathematical model relating change in level
with time.
[2] Find the steady state solution of the model.
[3] Obtain a linearized model of the system.
[4] Obtain the process transfer function.
[5] Obtain the equation for a change in the level of the tank
when there is:
(a) a step change of size b in the input variable 𝑞𝑖
(b) a unit step change in the input variable 𝑞𝑖
[6] Find the pole of the system and comment on the stability
of the system.
Obafemi Awolowo University 45
Chemical Engineering
Example 2.5: Single Nonlinear Tank
Solution
[1] Recall,
Accumulation = IN – OUT (2.18a)
𝑑𝑚
= 𝑚̇𝑖𝑛 − 𝑚̇𝑜𝑢𝑡 (2.18b)
𝑑𝑡
𝑑
(𝜌𝐴ℎ) = 𝜌𝑞𝑖 − 𝜌𝑞𝑜 = 𝜌𝑞𝑖 − 𝜌𝑐 √ℎ (2.18c)
𝑑𝑡
𝑑ℎ 1 𝑐
= 𝑞𝑖 − √ℎ (2.18d)
𝑑𝑡 𝐴 𝐴
𝑑ℎ
[2] At steady state, = 0, hence, 𝑞𝑖𝑠𝑠 = 𝑐√ℎ 𝑠𝑠
𝑑𝑡
[3] Note that the obtained model (Eq.2.18d) is nonlinear
because of the square root term.
𝑑𝛿𝑥 𝜕𝑓 𝜕𝑓
≈ | 𝛿𝑥 + | 𝛿𝑢 (iv)
𝑑𝑡 𝜕𝑥 𝑥𝑠𝑠 ,𝑢𝑠𝑠 𝜕𝑢 𝑥𝑠𝑠 ,𝑢𝑠𝑠
𝑑𝛿𝑥
≈ 𝑎𝛿𝑥 + 𝑏𝛿𝑢 (v)
𝑑𝑡
𝜕𝑓 𝜕𝑓
where 𝑎 = | and 𝑏 = | (vi)
𝜕𝑥 𝑥𝑠𝑠 ,𝑢𝑠𝑠 𝜕𝑢 𝑥𝑠𝑠 ,𝑢𝑠𝑠
If there is a single output equation that is a function of the
states and the input, then
𝑦 = 𝑔(𝑥, 𝑢) (vii)
𝜕𝑔
𝑦 = 𝑔(𝑥𝑠𝑠 , 𝑢𝑠𝑠 ) + | (𝑥 − 𝑥𝑠𝑠 ) + 𝑔|𝑥𝑠𝑠,𝑢𝑠𝑠 (𝑢 − 𝑢𝑠𝑠 ) + ⋯
𝜕𝑥 𝑥𝑠𝑠 ,𝑢𝑠𝑠
(viii)
Note that 𝑔(𝑥𝑠𝑠 , 𝑢𝑠𝑠 ) = 𝑦𝑠𝑠 , then
𝜕𝑔 𝜕𝑔
𝑦 − 𝑦𝑠𝑠 ≈ | (𝑥 − 𝑥𝑠𝑠 ) + | (𝑢 − 𝑢𝑠𝑠 ) (ix)
𝜕𝑥 𝑥𝑠𝑠 ,𝑢𝑠𝑠 𝜕𝑢 𝑥𝑠𝑠 ,𝑢𝑠𝑠
𝑑𝛿𝑦 𝜕𝑔 𝜕𝑔
≈ | 𝛿𝑥 + | 𝛿𝑢 (x)
𝑑𝑡 𝜕𝑥 𝑥𝑠𝑠 ,𝑢𝑠𝑠 𝜕𝑢 𝑥𝑠𝑠 ,𝑢𝑠𝑠
𝑑𝛿𝑦
≈ 𝑐𝛿𝑥 + 𝑑𝛿𝑢 (xi)
𝑑𝑡
𝜕𝑔 𝜕𝑔
where 𝑐 = | and 𝑑 = | (xii)
𝜕𝑥 𝑥𝑠𝑠 ,𝑢𝑠𝑠 𝜕𝑢 𝑥𝑠𝑠 ,𝑢𝑠𝑠
Questions:
[3] Obtain a linearized model of the system.
[4] Obtain the process transfer function.
[5] Obtain the equation for a change in the level of the tank
when there is:
(a) a step change of size b in the input variable 𝑞𝑖
(b) a unit step change in the input variable 𝑞𝑖
[6] Find the pole of the system and comment on the stability
of the system.
𝑑ℎ 1 𝑐
= 𝑓(ℎ, 𝑞𝑖 ) = 𝑞𝑖 − √ℎ (2.18d)
𝑑𝑡 𝐴 𝐴
𝑑𝛿𝑥 𝜕𝑓 𝜕𝑓
≈ | 𝛿𝑥 + | 𝛿𝑢 (iv)
𝑑𝑡 𝜕𝑥 𝑥𝑠𝑠 ,𝑢𝑠𝑠 𝜕𝑢 𝑥𝑠𝑠 ,𝑢𝑠𝑠
𝑑𝛿ℎ 𝜕𝑓 𝜕𝑓
≈ | 𝛿ℎ + | 𝛿𝑞𝑖 (2.18e)
𝑑𝑡 𝜕ℎ ℎ𝑠𝑠 ,𝑞 𝑠𝑠 𝜕𝑞𝑖 ℎ ,𝑞 𝑠𝑠
𝑖 𝑠𝑠 𝑖
𝑑𝛿ℎ 𝑐 1
≈− 𝛿ℎ + 𝛿𝑞𝑖 (2.18f)
𝑑𝑡 2𝐴√ℎ𝑠𝑠 𝐴
By comparing the tank system with an electrical system
Variables Analogous to
𝐴 Tank capacitance
2𝐴√ℎ𝑠𝑠 Tank resistance
=𝑅
𝑐
𝑅𝐴 Tank’s time constant, 𝜏
𝑑𝛿ℎ 1 1
= − 𝛿ℎ + 𝛿𝑞𝑖 (2.18g)
𝑑𝑡 𝜏 𝐴
[4] Obtain the process transfer function.
Taking the Laplace transform of (2.18g), we have
1 1
𝑠𝛿ℎ(𝑠) − 𝛿ℎ(0) = − 𝛿ℎ(𝑠) + 𝛿𝑞𝑖 (𝑠) (2.18h)
𝜏 𝐴
Setting 𝛿ℎ(0) to zero and re-arranging, gives
𝛿ℎ(𝑠) (𝜏/𝐴) 𝑅𝐴
= = (2.18i)
𝛿𝑞𝑖 (𝑠) 𝜏𝑠+1 𝑅𝐴𝑠+1
[5] Obtain the equation for a change in the level of the tank
when there is:
(a) a step change of size b in the input variable 𝑞𝑖
(b) a unit step change in the input variable 𝑞𝑖
Solution
(𝜏/𝐴)
𝛿ℎ(𝑠) = 𝛿𝑞𝑖 (𝑠) (2.18j)
𝜏𝑠+1
𝑏
Given that 𝛿𝑞𝑖 (𝑡) = 1, it implies 𝛿𝑞𝑖 (𝑠) =
𝑠
(𝜏/𝐴) 𝑏
𝛿ℎ(𝑠) = (2.18k)
𝜏𝑠+1 𝑠
𝑏 1 1
𝛿ℎ(𝑠) = ( ) (2.18l)
𝐴 𝑠 𝑠+1
𝜏
The expression inside the bracket can be split into partial
fractions thus:
1 1 𝑃 𝑄 𝜏 𝜏
( 1) = + 1 = − 1 (2.18m)
𝑠 𝑠+ 𝑠 𝑠+ 𝑠 𝑠+
𝜏 𝜏 𝜏
Thus, Eq.(2.18l) becomes
𝑏 𝜏 𝜏
𝛿ℎ(𝑠) = ( − 1 ) (2.18n)
𝐴 𝑠 𝑠+
𝜏
Taking the Inverse Laplace transform of (2.18m) gives
𝜏𝑏
𝛿ℎ(𝑡) = (1 − 𝑒 −𝑡/𝜏 ) (2.18o)
𝐴
Tank’s model
𝑞𝑖 𝑑ℎ 1 𝑐
= 𝑓(ℎ, 𝑞𝑖 ) = 𝑞𝑖 − √ℎ (2.18d)
𝑑𝑡 𝐴 𝐴
𝐴, ℎ
𝑞𝑜
Solution
Given that, ℎ𝑠𝑠 = 9𝑐𝑚, 𝑞𝑖𝑠𝑠 = 6𝑐𝑚3 /𝑠
Recall that at steady state:𝑞𝑖𝑠𝑠 = 𝑐√ℎ 𝑠𝑠 (2.18q)
Substituting gives, 𝑐 = 2
𝑑ℎ
10 = 7.5 − 2√ℎ (2.18r)
𝑑𝑡
−1
7.5 − 2𝑥 2𝑥
−7.5 + 2𝑥
7.5
Thus:
2𝑥 7.5 7 1
= −1 + analogous to =3+ (2.18)
7.5−2𝑥 7.5−2𝑥 2 2
Eq.(2.18t) thus becomes:
𝑥
7.5 𝑡
𝑑𝑡 (2.18u)
∫ (−1 + ) 𝑑𝑥 = ∫
𝑥=3 7.5 − 2𝑥 𝑡=0 10
Recall,
𝑎 𝑎 (2.18v)
∫( ) 𝑑𝑥 = ln(𝑏𝑥 + 𝑐)
𝑏𝑥 + 𝑐 𝑏
𝑡
[−𝑥 − 3.75ln(7.5 − 2𝑥)] − [−3 − 3.75ln(7.5 − 6)] = (2.18x)
10
But 𝑥 = √ℎ
𝑡
−[√ℎ + 3.75ln(7.5 − 2√ℎ)] + 4.5205 = (2.18y)
10
𝑡
− [√ℎ + 3.75 (ln(2(3.75 − √ℎ)))] + 4.5205 = (2.18z)
10
𝑡
−[√ℎ + 3.75(ln2 + ln(3.75 − √ℎ))] + 4.5205 = (2.18aa)
10
𝑡
−[√ℎ + 3.75ln(3.75 − √ℎ)] − 3.75ln2 + 4.5205 = (2.18ab)
10
𝑡−19.212
−[√ℎ + 3.75ln(3.75 − √ℎ)] = (2.18ac)
10
NB:
Eq.(2.18ac) is the general nonlinear solution of the tank model
As 𝑡 → ∞
−[√ℎ + 3.75ln(3.75 − √ℎ)] = ∞ (2.18ad)
[√ℎ + 3.75ln(3.75 − √ℎ)] = −∞ (2.18ae)
NB:
We are lucky here to be able to obtain analytical solution
because the problem at hand is not complex. In some
situations, analytical solution may not be feasible and so one
resolves to a computer simulation.
As 𝑡 → ∞, 𝛿ℎ(∞) = 4.5,
ℎ(∞) = ℎ 𝑠𝑠 + 𝛿ℎ(∞) = 9 + 4.5 = 13.5𝑐𝑚
t h(nonlinear) h(Linear)
0 9.00 9.00
10 10.28 10.28
20 11.22 11.19
30 11.91 11.84
40 12.43 12.31
50 12.82 12.65
60 13.12 12.89
70 13.34 13.06
80 13.51 13.19
90 13.64 13.28
100 13.74 13.34
t h(nonlinear) h(Linear)
110 13.82 13.39
120 13.87 13.42
130 13.92 13.44
140 13.95 13.46
150 13.98 13.47
160 14.00 13.48
170 14.01 13.48
180 14.02 13.49
190 14.03 13.49
200 14.04 13.49
Nonlinear model
𝑑ℎ 1 1
= 𝑞𝑖 − √ℎ (2.18d)
𝑑𝑡 10 5
Linearized model
𝑑𝛿ℎ 1 1
= 𝛿𝑞𝑖 − 𝛿ℎ (2.18f)
𝑑𝑡 10 30