Plotting with different isotherms
Afficher commentaires plus anciens
%Tc = input('PLease enter the critical temperature'); %Critical Temp. in Kelvins
Tc = 154.6;
%Pc = input('Please enter the critical pressure'); %Critical Pressure in MPa
Pc = 5.046;
%omega = input('Please enter the omega value of the Peng_robinson EOS');
omega = 0.021;
k = 0.37464 + (1.54226 - 0.26992*omega)*omega;
R = 0.000008314; %gas constant in MPa*m3/mol*K
%v = input('Please enter a vector of pressure');
v = [0.1 0.2 0.5 1 2 3 4 5 6 7 8 9 10];
%n = input('Please enter a vector of temperature');
n = [173 198 223 248 273 298 323 348 373 398 423];
b = 0.077796074*R*Tc/Pc;
for P = v
for T = n
alpha = (1 + k*(1-sqrt((T/Tc))))^2;
a = 0.457235529*(R*Tc)^2/Pc*alpha;
B = b*P/(R*T);
A = a*P/((R*T)^2);
ZZ = ZZroot(A,B);
ZZ = max(ZZ);
V = ZZ*R*T/P;
x = [V];
y = [P];
[X,Y] = meshgrid(x,y)
end
end
ZZroot is a user defined function to find the roots of the polynomial. These are my data for example: at T = 173: with P= 0.1 we have V = 0.0143 P= 0.2 -> V = 0.007 and so on. Then comes another Temperature(isotherm): with a similar manner.
My question is how to plot these isotherms in one graph with X axis as the volume and Y as the pressure(which is the range given as a vector above).
Any help is appreciated.
Réponses (0)
Catégories
En savoir plus sur Polar Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!