Vapour - Liquid equilibrium tie line
14 ビュー (過去 30 日間)
古いコメントを表示
Hi, I am pretty new to MATLAB and have an exam coming up, I could not figure out how to add tie line (line) to the Vapour-liquid equilibrium plot.
So I know that I have to add line at y= 80 and x= 0.25. The line should start from the blue curve and end at the red curve. Is there any option to add line between the curves by using these two data?
Also if there is any option, how can I code to get the values at the point the line intersects with the curves ?
In advance thank you very much for help
Kind regards,
Baris Kara
4 件のコメント
Star Strider
2020 年 6 月 9 日
‘So I know that I have to add line at y= 80 and x= 0.25.’
That point does not appear to be close to the curves.
採用された回答
Star Strider
2020 年 6 月 10 日
The code you posted still does not work with 0.25 and 80.
This uses 110 instead of 80 to illustrate the approach. Make the appropriate changes to the plot call with the correct parameters and data.
Add these lines to calculate the ‘x’ and ‘y’ values for the ‘vertical line’ and ‘horizontal line’:
x110 = interp1(T,x,110); % ‘x’ At 110
y110 = interp1(T,y,110); % ‘y’ At 110
and these after the plot call:
plot([x110 y110], [1 1]*110, '.-r') % ‘Horizontal Line’
plot([1 1]*0.25, [min(ylim) 110], '--r') % ‘Vertical Line’
so the entire revised code is now:
P = 101; % P in kPa
%--------------Constants----------
NC = 2;
% Antoine parameters in the order of A-B-C
Antoine = [14.8950,15.0717;3413.10,3580.80;250.523,224.650];
T = CalcT(P, NC, Antoine);
%Tvec = [T(1):1:T(2)];
T = T(1):((T(2)-T(1))/100):T(2);
% Compute the liquid and vapor phase mole fractions for benzene
for i = 1:length(T)
Psat1(i) = exp(Antoine(1,1)-(Antoine(2,1)/(T(i)+Antoine(3,1))));
Psat2(i) = exp(Antoine(1,2)-(Antoine(2,2)/(T(i)+Antoine(3,2))));
end
x = (P-Psat2)./(Psat1-Psat2);
y = x.*Psat1/P;
x110 = interp1(T,x,110); % ‘x’ At 110
y110 = interp1(T,y,110); % ‘y’ At 110
% Plot the results
figure
plot(x,T,y,T);
hold on
plot([x110 y110], [1 1]*110, '.-r') % ‘Horizontal Line’
plot([1 1]*0.25, [min(ylim) 110], '--r') % ‘Vertical Line’
hold off
grid
title('Txy diagram: acetonitrile/acetone');
xlabel('Mole fraction acetonitrile');
ylabel('Temperature [deg C]');
legend('Bubble Point','Dew Point');
%--------------FUNCTIONS--------------------%
%--------------Psat calculation----------------
function T = CalcT(P,NC,Antoine)
for i = 1:NC
T(i) = (Antoine(2,i)/(Antoine(1,i)-log(P)))-Antoine(3,i);
%T(i) =((Antoine(2,i)/((Antoine(1,i)-ln(P)))))-Antoine(3,i);
end
end
That should get you started.
.
1 件のコメント
Joseph Sabu
2021 年 5 月 27 日
I think there's something wrong in the Antoine Coefficient. Isn't it true when molefraction of Acetonitrile is 1, it actually shows the Boiling point of acetonitrile which is 81C,but its showing somwhere above 40C in the matlab output, but its correct in the excel sheet.
Also the boiling point of acetone is near 51C ,so when molefracton of acetonitrile approches 0,isn't is supposed it to show 51C in the output graph,but its showing somwhere above 100C?
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Thermal Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!