please show matlab code (the entire function, the variables, etc) Find the speci
ID: 3863014 • Letter: P
Question
please show matlab code (the entire function, the variables, etc)
Find the specific volume v (m^3/kg) of methane (CH_4) at p = 8 MPa, T = 300 degree K using the Benedict-Webb-Rubin equation of state. Solve the equation using your Modified Regula Falsi program. p = RT/v + (BRT - A - C/T^2) 1/v^2 + (bRT - a)/v^3 + a alpha/v^6 + c/v^3 T^2 (1 + gamma/v^2) exp(-gamma/v^2) Note that: 1) Absolute temperature must be used (K = C + 273.15). p is in kPa and v is in m3/kmol. 2) The universal gas constant R = 8.31434 kJ/kmol- degree K and the molecular weight of methane is M = 16.043 kg/kmol. 3) With the above units, the eight constants in the Benedict-Webb-Rubin equation of state for methane are as follows: a = 5.00 A = 187.91 b = 0.003380 B = 0.04260 c = 2.578 times 10^5 C = 2.286 times 10^6 alpha = 1.244 times 10^-4 gamma = 0.0060Explanation / Answer
%matlab code
%variables
a = 5.00;
A = 187.91;
b = 0.003380;
B = 0.04260;
c = 2.57*10^5;
C = 2.268*10^6;
alpha = 1.244*10^(-4);
gama = 0.0060;
M = 16.043;
R = 8.31434;
v = 3;
temperature = input('Enter temperature in celsius: ');
%converting to kelvin
T = temperature + 273.15;
% using the modified equation
p = (R*T/v) + (B*R*T-A-(C/T*T))*(1/(v*v)) + (b*R*T-a)/(v*v*v) + (alpha*alpha)/(v^6) + (c/((v^3)*(T^3)))*(1+(gama/v^2))*exp(-1*gama/(v*v))
%{
output:
Enter temperature in celsius: 100
p = -2.5097e+05
%}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.