summaryrefslogtreecommitdiff
path: root/389/CH9/EX9.1/Example9_1.sce
blob: 3a5f099fb338455f23d8f2a6a01e5b67b5fe815d (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
28
29
30
31
clear;
clc;

// Illustration 9.1
// Page: 349

printf('Illustration 9.1 - Page: 349\n\n');

// solution

//****Data****//
// a:n-heptane b:n-octane
Pt = 760; // [mm Hg]
//*****//

Tempa = 98.4;// [boiling point of A,OC]
Tempb = 125.6;// [boiling point of B,OC]
x = zeros(6);
y_star = zeros(6);
alpha = zeros(6);
// Data =  [Temp Pa (mm Hg) Pb(mm Hg)]
Data = [98.4 760 333;105 940 417;110 1050 484;115 1200 561;120 1350 650;125.6 1540 760];
for i = 1:6
    x(i) = (Pt-Data(i,3))/(Data(i,2)-Data(i,3));// [mole fraction of heptane in liquid]
    y_star(i) = (Data(i,2)/Pt)*x(i);
    alpha(i) = Data(i,2)/Data(i,3);
end
printf("T(OC)\t\t\t Pa(mm Hg)\t\t\t Pb(mm Hg)\t\t\t x\t\t\t\t y*\t\t\t alpha\n");
for i = 1:6
    printf("%f\t \t %d\t \t \t \t %d\t \t \t \t %f\t \t \t %3f\t \t %f\t \t\n",Data(i,1),Data(i,2),Data(i,3),x(i),y_star(i),alpha(i));
end