Question

ABE 303 Homework Project: FFF: Phases, Fugacity, Fun, and the Peng-Robinson EOS r methane. Use Isotherms in 10 degree increments starting at 75 degrees Kelvin until you are approximately 40 degrees above the critical point. (b) Calculate the vapor pressure of methane as a function of temperature. (c) Compare your computed results with the literature and describe the similarities and differences. (d) on the P-v diagram, use the limits of stability derived in class to construct the metastable regime in your computer code. (e) Use the requirement that fugacities are equal in the liquid and vapor states to construct the coexistence lines. Compare the envelope of coexistence curves with the result in part (d) Helpful Hints to find fugacity coefficient for Peng-Robinson EOS fv (T, P) (1) RT ZV (1 V2) B 1) ln (Z (2) 2 2B ZV (1 2) B fL (T, P) (3) 1 V2 B ZL 1) In (z (4) 2 2B ZL (1- 2 B MATLAB code needed! Can garentee lots of up votes. Any questions just comment
0 0
Add a comment Improve this question Transcribed image text
Answer #1
%
% function result = PengRobinson(T,P,Tc,Pc,w,MW,Liquido)
% Parameters: T,P,w,Tc,Pc,w,MW,Liquido
% T: Temperature [=] K                                          
% P: Presure [=] Pa                                             
% Tc: critical temperature [=] K                               
% Pc: critical presure [=] Pa                                   
% w: accentic factor
% MW: molar weigth [=] kg/mol
% Liquido:  if Liquido == 1, then calculates liquid fugacity;  
%           if Liquido == 0 then calculates vapor fugacity
% Example:
% [Z fhi density] = PengRobinson(273,2*1.013*1e5,304.21,7.382*1e6,0.225,0.044,1)

function [Z,fhi,density] = PengRobinson(T,P,Tc,Pc,w,MW,Liquido)

R = 8.314; % gas constant [=] J/(mol K)

% Reduced variables
Tr = T/Tc ;
Pr = P/Pc ;
% Parameters of the EOS for a pure component
m = 0.37464 + 1.54226*w - 0.26992*w^2;
alfa = (1 + m*(1 - sqrt(Tr)))^2;
a = 0.45724*(R*Tc)^2/Pc*alfa;
b = 0.0778*R*Tc/Pc;
A = a*P/(R*T)^2;
B = b*P/(R*T);

% Compressibility factor
Z = roots([1 -(1-B) (A-3*B^2-2*B) -(A*B-B^2-B^3)]);
ZR = [];
for i = 1:3
   if isreal(Z(i))
        ZR = [ZR Z(i)];   
   end
end

if Liquido == 1
    Z = min(ZR);   
else
    Z = max(ZR);
end

% Fugacity coefficient
fhi = exp(Z - 1 - log(Z-B) - A/(2*B*sqrt(2))*log((Z+(1+sqrt(2))*B)/(Z+(1-sqrt(2))*B)));
if isreal(fhi)
    density=P*MW/(Z*R*T);
    result = [Z fhi density];
else
    'No real solution for "fhi" is available in this phase'
    result=['N/A' 'N/A' 'N/A'];
end
Add a comment
Know the answer?
Add Answer to:
MATLAB code needed! Can garentee lots of up votes. Any questions just comment Using the Peng-Robinson...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • answere e and f RP Rinaldi Perez quiz.. AutoSave Off Home Insert Draw Design Layout Referen Mailing Review View Hel...

    answere e and f RP Rinaldi Perez quiz.. AutoSave Off Home Insert Draw Design Layout Referen Mailing Review View Help Design OSearch File ) Parameters a and b) RTe^(- The equation of state of Dieterici is P(ym- RTVm b of this equation they have the same physical meaning as the corresponding parameters of the van der Waals equation, but they differ in numerical values. Using the Taylor series of functions ex and (1/1-x) (with a procedure similar to the one...

  • . The data set below contains information about the gasoline mileage performance for 32 au- tomob...

    please answer the following using the r code provided . The data set below contains information about the gasoline mileage performance for 32 au- tomobiles. We are interested in developing a model to predict the miles per gallon () using related predictor variables. The variables in the study are Dependent variable: Miles per gallon (v) Independent variables: ri horsepower (ft-lb) ra: torque (ft-lb) r: horsepower+torque (ft-lb) rs: carburetor (barrels) (a) We first start by fitting a model using y and...

  • Consider a cylindrical capacitor like that shown in Fig. 24.6. Let d = rb − ra...

    Consider a cylindrical capacitor like that shown in Fig. 24.6. Let d = rb − ra be the spacing between the inner and outer conductors. (a) Let the radii of the two conductors be only slightly different, so that d << ra. Show that the result derived in Example 24.4 (Section 24.1) for the capacitance of a cylindrical capacitor then reduces to Eq. (24.2), the equation for the capacitance of a parallel-plate capacitor, with A being the surface area of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT