Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

function s=mv(v,Tr,pr)

R = 82.06; %gas constant (cm^3*atm)/(mol*k)


Tc = 304; %critical temperature in kelvin
Pc = 72.9; % critical pressure in atm
a = (27/64)*((R^2)*(Tc^2)/Pc);
b = (R*Tc)/(8*Pc);
T = (Tc*Tr);
P = (Pc*pr);
s = (((P+(a/v^2))*(v-b))-(R*T));

clear all
clc
tr = [1.1 1.3 2];
h = 0;
for pr = 0.1:0.1:10
h = h+1;
pr_list(h,1) = pr;
Pc = 72.9; % critical pressure in atm
R=82.06;
for i = 1:3
Tc = 304; %critical temperature in kelvin
T = (Tc*tr(i));
P = (Pc*pr);
v=100;
vsolve=fzero(@mv,v,[],tr(i),pr);
v=vsolve;
Z(h,i) = (P*v)/(R*T);
end
end
disp(' compressibility factor for')
disp(' pr Tr=1.1 Tr=1.3 Tr=2.0')
disp([pr_list Z])
plot(pr_list,Z(:,1),'ko',pr_list,Z(:,2),'rx',pr_list,Z(:,3),'bd')
xlabel('reduced pressure')
ylabel('compressibility factor')
title('variation of compressibilty with varying Tr and Pr')
legend('Tr =1.1','Tr =1.3','Tr=2.0')

compressibility factor for

pr Tr=1.1 Tr=1.3 Tr=2.0

0.1000 0.9761 0.9845 0.9957

0.2000 0.9512 0.9687 0.9915

0.3000 0.9252 0.9526 0.9873

0.4000 0.8980 0.9362 0.9832

0.5000 0.8694 0.9194 0.9791


0.6000 0.8391 0.9023 0.9751

0.7000 0.8069 0.8848 0.9712

0.8000 0.7722 0.8670 0.9673

0.9000 0.7346 0.8488 0.9635

1.0000 0.6930 0.8303 0.9598

1.1000 0.6464 0.8115 0.9561

1.2000 0.5932 0.7924 0.9526

1.3000 0.5331 0.7731 0.9492

1.4000 0.4773 0.7538 0.9458

1.5000 0.4460 0.7346 0.9426

1.6000 0.4358 0.7158 0.9395

1.7000 0.4361 0.6977 0.9365

1.8000 0.4417 0.6809 0.9337

1.9000 0.4501 0.6658 0.9310

2.0000 0.4603 0.6528 0.9284

2.1000 0.4717 0.6424 0.9260

2.2000 0.4838 0.6346 0.9237

2.3000 0.4965 0.6295 0.9216

2.4000 0.5095 0.6269 0.9197

2.5000 0.5228 0.6264 0.9179

2.6000 0.5363 0.6279 0.9163

2.7000 0.5500 0.6309 0.9149

2.8000 0.5638 0.6353 0.9137

2.9000 0.5777 0.6407 0.9127

3.0000 0.5917 0.6470 0.9119

3.1000 0.6057 0.6541 0.9112

3.2000 0.6197 0.6619 0.9108

3.3000 0.6338 0.6701 0.9106

3.4000 0.6478 0.6788 0.9106


3.5000 0.6619 0.6878 0.9108

3.6000 0.6760 0.6971 0.9112

3.7000 0.6901 0.7068 0.9118

3.8000 0.7041 0.7166 0.9126

3.9000 0.7182 0.7266 0.9137

4.0000 0.7322 0.7368 0.9149

4.1000 0.7463 0.7472 0.9163

4.2000 0.7603 0.7576 0.9179

4.3000 0.7743 0.7682 0.9197

4.4000 0.7883 0.7789 0.9217

4.5000 0.8023 0.7896 0.9239

4.6000 0.8162 0.8004 0.9263

4.7000 0.8301 0.8113 0.9289

4.8000 0.8440 0.8223 0.9316

4.9000 0.8579 0.8332 0.9345

5.0000 0.8718 0.8443 0.9375

5.1000 0.8856 0.8553 0.9407

5.2000 0.8995 0.8664 0.9441

5.3000 0.9133 0.8775 0.9476

5.4000 0.9270 0.8886 0.9512

5.5000 0.9408 0.8998 0.9550

5.6000 0.9545 0.9110 0.9589

5.7000 0.9683 0.9221 0.9629

5.8000 0.9820 0.9333 0.9671

5.9000 0.9956 0.9445 0.9713

6.0000 1.0093 0.9558 0.9757

6.1000 1.0229 0.9670 0.9802

6.2000 1.0366 0.9782 0.9848

6.3000 1.0502 0.9894 0.9894


6.4000 1.0638 1.0007 0.9942

6.5000 1.0773 1.0119 0.9991

6.6000 1.0909 1.0231 1.0040

6.7000 1.1044 1.0344 1.0091

6.8000 1.1179 1.0456 1.0142

6.9000 1.1314 1.0568 1.0194

7.0000 1.1449 1.0680 1.0246

7.1000 1.1583 1.0793 1.0299

7.2000 1.1717 1.0905 1.0353

7.3000 1.1852 1.1017 1.0408

7.4000 1.1986 1.1129 1.0463

7.5000 1.2119 1.1241 1.0519

7.6000 1.2253 1.1353 1.0575

7.7000 1.2387 1.1465 1.0632

7.8000 1.2520 1.1577 1.0689

7.9000 1.2653 1.1689 1.0746

8.0000 1.2786 1.1801 1.0805

8.1000 1.2919 1.1912 1.0863

8.2000 1.3052 1.2024 1.0922

8.3000 1.3185 1.2136 1.0982

8.4000 1.3317 1.2247 1.1041

8.5000 1.3449 1.2358 1.1102

8.6000 1.3581 1.2470 1.1162

8.7000 1.3713 1.2581 1.1223

8.8000 1.3845 1.2692 1.1284

8.9000 1.3977 1.2803 1.1345

9.0000 1.4109 1.2915 1.1407

9.1000 1.4240 1.3026 1.1469

9.2000 1.4371 1.3136 1.1531


9.3000 1.4503 1.3247 1.1594

9.4000 1.4634 1.3358 1.1657

9.5000 1.4765 1.3469 1.1719

9.6000 1.4895 1.3579 1.1783

9.7000 1.5026 1.3690 1.1846

9.8000 1.5157 1.3800 1.1910

9.9000 1.5287 1.3911 1.1973

10.0000 1.5417 1.4021 1.2037

>>

You might also like