Jecksin Ooi 1
Contents:
1. Introduction to MATLAB/Simulink
2. Modeling of Chemical Engineering Processes
(Simulink)
• Case Study 1: Mixing Process
• Case Study 2: Multiple Reactions Process
• Case Study 3: The effect of pulse input for CSTR
2
Introduction to Simulink
3
How to load Simulink
4
Simulink Start Page
5
Simulink Model
6
Simulink Library Browser
7
You can drag blocks into this
area from the Simulink
library. i.e.
1. Sources
2. Sinks
3. Continuous
4. Math Operations
5. and many more…
8
Simulink Sources
9
Simulink Sinks
10
Simulink Math Operations
11
Simulink Commonly Used Blocks
14
Running the simulation
15
Running the simulation
16
Display the result
18
Example:
Basic Mathematics: Solve 3 + 6 = ?
• 2+4 −5=?
• 4sin(0.17) = ?
• 5 − 2 sin 0.8 =?
• Answer : 1
• Answer : 0.6767
• Answer : 3.565
20
Example question on ODE (1)
21
• Use Simulink integrator block
dy(t) 1
y(t)
dt s
• Input – the value of the differential
• Output – gives the integrated form of the variable
Procedure:
• Select blocks from library browser to build the model
• Set Block Parameter. Use Help if needed.
• Change the way blocks are displayed if necessary, e.g. resize,
flip, rotate, show/ hide name, change foreground/ background
colours, etc.
• Run a simulation & view results via Scope, Display or To
Workspace blocks
22
Simulink model for ODE Q1
23
Example question on ODE (2)
𝑑𝑦
+ 2𝑦 = 3 sin 𝑡 + 1; 𝑦 0 =0
𝑑𝑡
24
Simulink model for ODE Q2
Save format
as array
Save format
as array
25
Answer for ODE Q2
26
Case Study 1: Mixing Process
𝑑𝐶 𝑄
= 𝐶𝑖𝑛 − 𝐶 ; 𝐶 0 = 10
𝑑𝑡 𝑉
27
Simulink Model for Case Study 1
28
Answer for Case Study 1
29
Case Study 2: Multiple Reactions Process
31
Answer for Case Study 2
32
Case Study 3: Reaction Process with Pulse Input Disturbance
Differential equations mole balance of A:
vin, CA0 𝑑𝐶𝐴 𝑣𝑖𝑛
= 𝐶𝐴0 − 𝐶𝐴 − 𝑘𝐶𝐴
𝑑𝑡 𝑉
0.20 + 0.05𝑡 ; 0 < 𝑡 ≤ 8
ν𝑖𝑛 𝑡 = ቐ0.25 − 0.05𝑡 ; 8 < 𝑡 ≤ 14
0.15 ; 𝑡 > 14
V vout, CA 𝑉 = 10𝐿
𝑘 = 0.005 𝑚𝑜 𝑙 Τ𝐿 𝑠
𝐶𝐴0 = 10 𝑚𝑜 𝑙 Τ𝐿
𝐶𝐴 0 = 0 𝑚𝑜 𝑙 Τ𝐿
34