You are on page 1of 4

Muhab Abduladheem Mohammed Ahmed-162051

Tut[3]

Question 2 :
Degree of freedom:

Number of variables 14+2


Number of independent compositions -
Relations 2
Basis/flows 2
Number of material balance equations 12
DF 0

Stream 1 2 3 4 5 6 TOTAL
No. 2 0 5 2 1 2 12+2
selection A.O - A,O,P,C,H H,C P A.O

Material balance:

A = flowrate of C2H4 , O= flowrate of O2 , P= flowrate of our product (C2H4O)


C= flow rate of CO2 , H= flowrate of H2O
Also notice the number near the flowrate indicates the number of stream
Example; A1= the flowrate of C2H4 in stream 1

Total number of independent variables = 14

Total number of independent equation :

MB= 12
Relations=2

Independent equations =14

MB for mixer:

A1+A6-75=0 (1)

O1+O6-25=0 (2)
MB for reactor:

75-A3-2*r1-r2=0 (3)

25-O3-r1-3*r2=0 (4)

2*r1-P3=0 (5) 2*r2-C3=0 (6)

2*r2-H3=0 (7)

MB for separator:

A3-A6=0 (8)
O3-O6=0 (8)
O3-O6=0 (9)
P3-P5=0 (10)
C3-C4=0 (11)
H3-H4=0 (12)

(P3/75)-(90/100)=0 (13)

75-A3-0.2*75=0( 14)

Computer Code

Function file:

function f = peter(x)

A1= x(1); O1 =x(2);A3=x(3);O3=x(4); P3=x(5);C3=x(6); H3=x(7); H4=x(8);


C4=x(9);P5=x(10); A6=x(11); O6=x(12); r1=x(13); r2=x(14); %MB for unit 1 : %C2H4
balance: f(1)=A1+A6-75; %O2 balance f(2)=O1+O6-25; %MB for unit 2:%C2H4
balance:

f(3)=75-A3-2*r1-r2; %O2

balance :

f(4)=25-O3-r1-3*r2; %C2H4O

balance: f(5)=2*r1-P3; %CO2


balance : f(6)=2*r2-C3; %H2O

balance: f(7)=2*r2-H3; %MB

for unit 3: %C2H4 balance:

f(8)=A3-A6; %O2 balance

f(9)=O3-O6; %C2H4O balance:

f(10)=P3-P5; %CO2 balance:

f(11)=C3-C4; %H2O balance:

f(12)=H3-H4; %Given

relations: f(13)=(P3/75) –

(90/100); f(14)=((75-A3)/75)-

(20/100); end

Script file:

%initial guess of 10 for all 14 variables:

x0=10*ones(1,14); x=fsolve(@peter,x0); FLOWRATE_4=x(8)+x(9);


FLOWRATE_5=x(10);
FLOWRATE_1=x(1)+x(2); CON=(x(1))/x(1);
fprintf('The flowrate in stream- 4=%6.2f\n',FLOWRATE_4) fprintf('The flowrate in
stream-5=%6.2f\n',FLOWRATE_5) fprintf('FEED STREAM
FLOWRATE=%6.2f\n',FLOWRATE_1) fprintf('R1=%6.2f\n',x(13))
fprintf('R2=%6.2f\n',x(14))
fprintf('Total conversion=%6.2f\n',CON)

Command window:

The flowrate in stream-4=-210.00


The flowrate in stream-5= 67.50
FEED STREAM FLOWRATE=-108.75

R1= 33.75

R2=-52.50

Total conversion=1.00

You might also like