You are on page 1of 2

‫محمد ياسر‬

162047
Degree of freedom analysis
Number of var 20+1
Number of independent var 4
Splitter relations 2
Basis 1
Number of material balance equations 14
DF Zero

Unknown var analysis


Stream 1 2 3 4 5 6 7 TOTAL
No of 0 2 4 1 2 3 3 15+1
unknown
Selection - N2,G2 A3,H3,N3,G3 A4 N5,G5 N6,G6,H6 N7,H7,G7

NUMBER of Independent equations =16

Equations
Mixer:
75.15+H7-((79.52/20.48)*(N2+G2))=0
24.58+N7-N2=0
0.27+G7-G2=0
Reactor:
((79.52/20.48)*(N2+G2))-3*r1-H3=0
N2-N3-r1=0
2*r1-A3=0
G2-G3=0
Separator:
A3-A4=0
H3-((80.01/19.99)*(N5+G5))=0
N3-N5=0
G3-G5=0
Splitter:
N5-N6-N7=0
G5-G6-G7=0
((80.01/19.99)*(N5+G5))-H6-H7=0
(N6/(N6+G6+H6))-(N7/(N7+G7+H7))=0(H6/(H6+G6+N6))-(H7/(N7+G7+H7))=0
Code
Function:
function f=reactor1(x)
N2=x(1);G2=x(2);A3=x(3);H3=x(4);N3=x(5);G3=x(6);A4=x(7);
N5=x(8);G5=x(9);N6=x(10);G6=x(11);H6=x(12);N7=x(13);G7=x(14);H7=x(15)
;r1=x(16);
f(1)=75.15+H7-((79.52/20.48)*(N2+G2));
f(2)=24.58+N7-N2;
f(3)=0.27+G7-G2;
f(4)=((79.52/20.48)*(N2+G2))-3*r1-H3;
f(5)=N2-N3-r1;
f(6)=2*r1-A3;
f(7)=G2-G3;
f(8)=A3-A4;
f(9)=H3-((80.01/19.99)*(N5+G5));
f(10)=N3-N5;
f(11)=G3-G5;
f(12)=N5-N6-N7;
f(13)=G5-G6-G7;
f(14)=((80.01/19.99)*(N5+G5))-H6-H7;
f(15)=(N6/(N6+G6+H6))-(N7/(N7+G7+H7));
f(16)=(H6/(H6+G6+N6))-(H7/(N7+G7+H7));
end
Script:
x0=10*ones(1,16);
x=fsolve(@reactor1,x0);
N6=x(10)+x(11)+x(12);
N7=x(13)+x(14)+x(15);
fprintf('the flowrate of purge=%7.4f\n',N6)
fprintf('the flowrate of recycle=%7.4f\n',N7)

You might also like