summaryrefslogtreecommitdiff
path: root/527/CH8/EX8.17/8_17exam.sce
blob: dbfe939068bac7873947a9c2e0282789e5bf7c69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//Engineering and Chemical Thermodynamics
//Example 8.17
//Page no :406
clear  ; clc;
//Given

T = 300 ; //[K]
A = 6235 ; //[J/mol] 
P_a_sat = 100 * 10^3 ; //[Pa]
P_b_sat = 50 * 10^3 ; //{Pa}
R = 8.314 ;
w = 1/(R * T) ;
function Z817 = f817(R)
    x_a_a = R(1) ;
    x_a_b = R(2) ;
    Z817(1) = x_a_b * exp(A * (1 - x_a_b) ^ 2 * w) - x_a_a * exp(A * (1 - x_a_a) ^ 2 * w) ; // E8.17A
    Z817(2) = (1 - x_a_b) * exp(A * ( x_a_b) ^ 2 * w) - (1 - x_a_a) * exp(A * (x_a_a) ^ 2 * w ) ; // E8.17B
endfunction
x0 = [0.75 ; 0.1] ;
[z,fxs,m] = fsolve(x0,f817) ;
disp(" Example: 8.17  Page no : 406") ;
printf("\n        The compositions are : x_a_a = %.3f and x_a_b = %.3f",z(1,1), z(2,1)) ;

P = z(1,1) * exp(A * z(2,1) ^ 2 * w) * P_a_sat + z(2,1) * exp(A * z(1,1) ^ 2 * w) * P_b_sat ;
printf("\n        Total pressure = %d kPa",P * 10^-3) ;
y_a = z(1,1) * exp(A * z(2,1) ^ 2 * w) * P_a_sat / P ;
printf("\n            y_a = %.3f" , y_a ) ;