Peng-Robinson 3 equations of state to find the number of moles

10 views (last 30 days)
It is proposed to use a steel tank to store carbon dioxide at 300 K. The tank is 2.5 m3 in volume (V) and the maximum pressure (p) it can safely withstand is 100 atm.
Determine the maximum number of moles (n) of CO2 that can be stored in the tank using the Peng-Robinson (PR) equations given below (each uses the molar volume Vm = V/n).
use: R = 0.08205616 L atm/mol K, Tc = 304.2 K, Pc = 72.9 atm, and w = 0.225.
Need help solving for Vm
My code:
% Peng-Robinson (PR)
T = 300; % Temp in K
V = 2.5; % Volume in m^3
p = 100; % Max Pressure in atm
R = 0.08205616; % Gas constant in L*atm/mol*K
Tc = 304.2; % Crictial Temp in K
Pc = 72.9; % Crictial Pressure in atm
w = 0.225;
% Define Equations
alpha = (1+(0.37464+1.54226*w-0.26992*w^2)*(1-(T/Tc)^0.5))^2;
a = (0.45724*R^2*Tc^2)/Pc;
b = (0.07780*R*Tc)/Pc;
% Define Function (set p equation = 0)
syms Vm
F = ((R*T)/(Vm-b))-((a*alpha)/(Vm^2+2*b*Vm-b^2))-p == 0;
n = V/Vm

Answers (1)

Torsten
Torsten on 15 Feb 2022
Edited: Torsten on 15 Feb 2022
syms Vm
F = ((R*T)/(Vm-b))-((a*alpha)/(Vm^2+2*b*Vm-b^2))-p == 0;
Vmzero= double(solve(F));
Vmzero = Vmzero(abs(imag(Vmzero))<eps);
n = V./Vmzero

Categories

Find more on Thermal Analysis in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!