You are on page 1of 6

CHE 692

PROCESS MODELLING AND SIMULATION

ASSIGNMENT MATLAB

PREPARED FOR:
MADAM ASDARINA YAHYA
PREPARED BY:
SAUFI BIN SAFINGI

(2013252856)

AZNIL BIN AMRAN

(2013625492)

AQMAL BUDRIZ BIN MUSTAKIM (2013425846)

GROUP:
EH221/6B
DATE SUBMITTED

19th MAY 2016

a) Develop the total continuity equation for Tank 1 and Tank 2.


General equation:
[Mass in] - [Mass out] = [Time rate of change in system]
Tank 1:

F1 +F 4F 3=

dM 1
dt

1+12=0

dM 1
=0 , M 1=20 kg
dt
Tank 2:

F2 F 4 F5 =

dM 2
dt

210=1
dM 2
=1 , M 2=40+t
dt
dM 2= 1
M 2=t+ c
When t = 0, M2 = 40, thus c = 40

M 2=t+ 40

b) If we define X1 and X2 as the mass fraction of salt in Tank1 and Tank2, respectively. Develop
the dynamic equation for mass fraction of salt in Tank1 and Tank2.
General equation:
[Mass component in] - [Mass component out] + [rate of formation]
= [Time rate of change in system]
Tank 1:

F1 x 1+ F 4 x 2F3 x 1=
1+x 22 x 1=20
Tank 2:

d x1
dt

dM 1 x 1
dt

F2 x 2F 4 x 2F 5 x 2=
x 2=40

dM 2 x 2
dt

d x2
dt

Product rule (Tank 2):

d M 2 x2
d M2
dx
=x 2
+M2 2
dt
dt
dt

x2

d M2
dx
+ M 2 2 =x 2
dt
dt

x 2(1)+(40+t)
(40+ t)

d x2
=x 2
dt

d x2
=2 x 2
dt

d x 2 2 x2
=
dt
40+t

12

d x2
dt
=
x2
40+t
1/ 2

[ ] [ ]
x
ln 2
0.4

40
40=t

=ln

[ ]

40
x 2=0.4
40+ t

Product rule (Tank 1):

d M 1 x1
d M1
dx
=x 1
+ M1 1
dt
dt
dt

x1

dM 1
dx
+ M 1 1 =1+ x2 2 x 1
dt
dt

( 20 )

dx 1
=1+ x 22 x1
dt

dx1
=0.05+ 0.05 x 20.1 x 1
dt

x 2=0.4

Substitute X2 with

40
40+t

2
dx1
40
=0.05+ 0.02
0.1 x 1
dt
40+t

dx1
40
+0.1 x 1=0.05+0.02
dt
40+t

c) Using the same initial conditions, use MATLAB to stimulate the mass fraction of salt in
Tank1 by using the develop model. Run your model from t=0 to t=60 minutes with step size
of 1 minutes. Make a plot of your answer.

Matlab Output:
t
0.0000
1.0000
2.0000
3.0000
4.0000
5.0000
6.0000
7.0000
8.0000
9.0000
10.0000
11.0000
12.0000
13.0000
14.0000
15.0000
16.0000
17.0000
18.0000
19.0000
20.0000
21.0000
22.0000
23.0000
24.0000
25.0000
26.0000
27.0000
28.0000
29.0000
30.0000

x1
0
0.0661
0.1251
0.1776
0.2244
0.2660
0.3030
0.3358
0.3649
0.3907
0.4136
0.4337
0.4515
0.4672
0.4809
0.4930
0.5035
0.5127
0.5207
0.5277
0.5336
0.5387
0.5431
0.5468
0.5499
0.5525
0.5546
0.5563
0.5576
0.5586
0.5593

31.0000
32.0000
33.0000
34.0000
35.0000
36.0000
37.0000
38.0000
39.0000
40.0000
41.0000
42.0000
43.0000
44.0000
45.0000
46.0000
47.0000
48.0000
49.0000
50.0000
51.0000
52.0000
53.0000
54.0000
55.0000
56.0000
57.0000
58.0000
59.0000
60.0000

0.5598
0.5601
0.5601
0.5601
0.5598
0.5595
0.5590
0.5585
0.5578
0.5572
0.5564
0.5556
0.5548
0.5540
0.5531
0.5522
0.5513
0.5504
0.5495
0.5486
0.5477
0.5468
0.5459
0.5450
0.5441
0.5433
0.5424
0.5416
0.5408
0.5400

*notes : these value are copied and paste from Matlab software

You might also like