Professional Documents
Culture Documents
solution
1. DoF:
Independent stream variables 13
Independent component balances 4
Independent compositions 7
Streams relations 1
Basis 1
DF 0
For component B:
B1+40=0.2*N2+B4 B1=0.25*((C1+D1)/0.55))
Then B balance: 0.25*((C1+D1)/0.55))+40-0.2*N2-B4=0
For component C:
C balance: C1+140-0.05N2=0
For component D:
D balance: D1-D4=0
Stream Relations:
N1=0.3*N3 N1= (C1+D1)/0.55 (C1+D1)/0.55=0.3*200
0.3*(C1+D1)-110=0
Command window:
Question(2):
Number of variables 12
Number of independent compositions 5
Relations 1
Splitter relation -
Basis 1
Number of material balance equations
5
DF 0
Selection:
Stream 1 2 3 4 5 6 total
No. 0 2 1 1 1 1 6
selection - S2,W2 N3 N4 N5 N6
Independent equations =6
Mixer:
9690+0.9475*N6-W2=0
Reverses osmosis:
For S:
S2-5*10-4*N3-0.0525*N4=0 For w:
W2-0.9995*N3-0.9475*N4=0
Splitter:
For W:
0.9475*N4-0.9475*N5-0.9475*N6=0
Relation:
N6-0.5*N5=0
Code
Function: function f=reverses(x)
S2=x(1);W2=x(2);N3=x(3);N4=x(4);N5=x(5);N6=x(6);
f(1)=N6-0.5*N5;
f(2)= 310+0.0525*N6-S2;
f(3)= -W2+9690+0.9475*N6;
f(4)= S2-0.0525*N4-((5*10^-4)*N3);
f(5)= W2-0.9995*N3-0.9475*N4;
f(6)=0.9475*N4-0.9475*N5-0.9475*N6;
end
Script :
x0=10*ones(1,6);
x =fsolve(@reverses,x0);
xS2=x(1)/(x(1)+x(2));
xW2=x(2)/(x(1)+x(2));
xW4=(x(4)-0.0525*x(4))/x(4);
xW5=(x(5)-0.0525*x(5))/x(5);
xW6=(x(6)-0.0525*x(6))/x(6);
xW3=(x(3)-0.0005*x(3))/x(3);
fprintf('the value of xS2=%7.4f\n',xS2)
fprintf('the value of xW2=%7.4f\n',xW2)
fprintf('the value of xW3=%7.4f\n',xW3)
fprintf('the value of xW4=%7.4f\n',xW4)
fprintf('the value of xW5=%7.4f\n',xW5)
fprintf('the value of xW6=%7.4f\n',xW6)
>>
Question(3):
Hadeel Mamoun solutions:
A balance
B balance
• Mixer:
A balance
𝑁𝐴3 + 𝑁𝐴4 = 𝑁𝐴5 , but
𝑁𝐴4 = 0.3𝑁4 𝑁𝐴4 = 0.3(60) = 18 kg/h
∴ 𝑁𝐴3 + 18 = 𝑁𝐴5
After rearrangement,
𝑁𝐴3 − 𝑁𝐴5 + 18 = 0 − −3
B balance
𝑁𝐵3 + 𝑁𝐵4 = 𝑁𝐵5 , but
𝑁𝐵4 = 0.7𝑁4 𝑁𝐵4 = 0.7(60) = 42 kg/h
∴ 𝑁𝐵3 + 42 = 𝑁𝐵5
After rearrangement,
𝑁𝐵3 − 𝑁𝐵5 + 42 = 0 − −4
• Tower 2:
A balance
B balance
4. MATLAB Code:
𝐴3 − 28 = 0 − −1
𝐵3 − 92 = 0 − −2
𝐴3 − A5 + 18 = 0 − −3 𝐵3 − B5
+ 42 = 0 − −4
𝐴5 − A7 − 36 = 0 − −5
𝐵5 − B7 − 24 = 0 − −6
Function M-File:
% This is a function that return the values of flow rates in three
streams in terms of A3,B2,A5, B5,A7 and B7
function f=HW_2(x)
%Define indep. set of variables
A3=x(1);
B3=x(2);
A5=x(3);
B5=x(4);
A7=x(5);
B7=x(6);
Script M-File:
% Define intial guess
x0=10*ones(1,6);
x=fsolve(@HW_2,x0);
%Define the relations of the total flow rate in streams 3,5, and 7
N3= A3+B3;
N5=A5+B5;
N7=A7+B7;
%Define the relation to find the compositions of A and B in streams 3,5, and
7
Comp_A3=(A3/N3)*100;
Comp_B3=(B3/N3)*100;
Comp_A5=(A5/N5)*100;
Comp_B5=(B5/N5)*100;
Comp_A7=(A7/N7)*100;
Comp_B7=(B7/N7)*100;
fprintf('The compositions (Percent) of stream 3 are: A= %2.2f and B=
%2.2f \n',Comp_A3,Comp_B3)
fprintf('The compositions (Percent) of stream 5 are: A= %2.2f and B=
%2.2f \n',Comp_A5,Comp_B5)
fprintf('The compositions (Percent) of stream 7 are: A= %2.2f and B=
%2.2f \n',Comp_A7,Comp_B7)