MATLAB code needed! Can garentee lots of up votes. Any questions
just comment% % 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
MATLAB code needed! Can garentee lots of up votes. Any questions just comment Using the Peng-Robinson...
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...
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 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...