-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.m
47 lines (40 loc) · 1.15 KB
/
main.m
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
% input:
% Ae: Area fraction of ethanol from GC - in order from feed, distillate,
% and bottom
% T: Temperature of the feed
% R: Reflux ratio
% F: Feed flowrate (mol/time)
% D: Distillate flowrate (mol/time)
function main(Ae,T,R,F,D)
% Find paths
Project_Folder = pwd;
VLE = sprintf('%s/VLE Data',Project_Folder);
% Add dependencies
addpath(genpath(VLE))
% find ethanol-water equilibrium data
load_vle_data(200)
% plot xy and Txy diagrams
plot_xy()
plot_txy()
% McCabe Thiele
temp = gc2frac(Ae);
x = temp(:,2)';
temp = find_q(x(1),T);
q = temp(3);
lewis_sorel(x, R, q, F, D)
% remove files created in load_vle_data()
cleanup()
end
function load_vle_data(n)
% find liquid-vapour equilibrium ethanol concentration
vle = generate_vle_data(n);
xEtoh=vle(:,1); yEtoh=vle(:,2); T_eqlm =vle(:,3);
x=linspace(0,1,n)'; y=x;
save('base_xy_diagram.mat','x','y','xEtoh','yEtoh','T_eqlm')
eqlm_boiling = [vle(:,1) vle(:,3)];
save('eqlm_boiling.mat','eqlm_boiling')
end
function cleanup()
delete('base_xy_diagram.mat')
delete('eqlm_boiling.mat')
end