Anda di halaman 1dari 34

EP 314/ EP 328

Process Dynamic Control

Laboratory Session 1- Part 2


The effect of pulse input for CSTR (Open Loop)

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

➢SIMULINK is a part of MATLAB that can be used to simulate


dynamic systems.

➢Provides a graphical user interface (GUI) to simulate


dynamic (time-dependent) systems

➢To facilitate model definition, SIMULINK adds a new class


of windows called block diagram windows.

➢In these windows, models are created and edited primarily


by mouse-driven drag and drop commands.

3
How to load Simulink

Click Simulink Library icon


OR type “simulink” in
command window

4
Simulink Start Page

Click ‘Blank Model’ to start


Simulink simulation

5
Simulink Model

Click ‘Library Browser’

6
Simulink Library Browser

The window contains a


library of blocks that are
available for putting into
the model block
diagram.

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

and many more…


12
Connecting the block
Drag a signal line from the output of a block to the input of
another block.

from Source Library from Sinks Library

*Easier method (automatically connect):


Select Constant block →Hold Ctrl → Click Display block
132
Running the simulation

You can change the


default simulation
configuration by click
this link

14
Running the simulation

Set the start and stop


simulation time here

15
Running the simulation

Once the parameters are all set,


click the play button to run the
simulation

16
Display the result

Note: Constant block send a signal with value of 1


and then, Display block receives and display the
signal equal to 1
17
Example:
Use sine-wave source block and Scope from Sinks library. Run
and obverse the result by double-clicking the scope block.

18
Example:
Basic Mathematics: Solve 3 + 6 = ?

Left hand Side: 3 + 6 equal Right hand Side: ?


Run Simulation
and Result is 9
19
Questions:
Use Simulink to compute the following questions:

• 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)

Use Simulink to solve the following problem for 0  t  15


𝑑𝑦
= 8 sin 𝑡 ; 𝑦 0 =0
𝑑𝑡

Compare the Simulink simulation result with the analytical


solution, 𝑦 𝑡 = 8(1 − cos 𝑡)

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)

Construct a Simulink model to solve the following problem


for 0  t  15

𝑑𝑦
+ 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

Consider the CSTR, where Cin=50 g/m3, Q=5m3/min, V=100m3,


C(0)=10 g/m3. Construct a Simulink model to solve the
following problem for 0  t  200.
The explicit ODE form;

𝑑𝐶 𝑄
= 𝐶𝑖𝑛 − 𝐶 ; 𝐶 0 = 10
𝑑𝑡 𝑉
27
Simulink Model for Case Study 1

28
Answer for Case Study 1

29
Case Study 2: Multiple Reactions Process

Ca(0)= 5 mol; Cb (0) = Cc (0) = 0 mol

Solve the system of equations and plot the change in


concentration of each species for 0  t  5.
30
Simulink Model for Case Study 2

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 𝑚𝑜 𝑙 Τ𝐿

Plot the CA(t) profile for 0  t  150 .


33
Simulink Model for Case Study 3

34

Anda mungkin juga menyukai