This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: % Inputs: M - vector of molecular mass for different gases (kg/kmol) % T - scalar temperature for each gas (K) % m - scalar mass for each gas (kg) % Outputs: n - vector of number of moles for each gas (kmol) % P - vector of pressure for each gas (Pascal) % Given constants R = 8.3145*10^3; % Pa*m^3/K*kmol V = 0.013; % m^3 % Calculate moles (vector) from mass and molar mass of each gas n = m./M; % Calculate pressure (vector) for each ideal gas P = n*R*T/V; Command Window Output >> M = [28.966 31.999 4.020 28.0134 44.097]; % kg/kmol >> Temp = 297; % K >> mass = 0.4; % kg >> [n,P] = Gas_Tanks(M,Temp,mass) n = 0.013809 0.0125 0.099502 0.014279 0.0090709 P = 2.6231e+006 2.3745e+006 1.8901e+007 2.7123e+006 1.7231e+006...
View Full Document
- Fall '08