EGR_102_Lab_04B_Solution

# EGR_102_Lab_04B_Solution - Inputs M vector of molecular...

This preview shows pages 1–2. Sign up to view the full content.

Lab 04B Homework Name: Solution Section 1 Spring 2012 Part 1 The function was saved as Pressure.m function [Pa]=Pressure(psi) % Name, Section # % This function will convert pressure from pounds per square inch to % pascals % Input: psi - scalar pressure value in PSI (pounds per square inch) % Output: Pa - scalar pressure value in Pascal (Newton per square meter) Pa=psi*4.448*39.370^2; % Pascals (N/m^2) Command Window Output >> [pascal] = Pressure(1800) % pressure washer pascal = 1.241e+007 >> [pascal] = Pressure(195) % internal combustion engine pascal = 1.3444e+006 Part 2 The function was saved as Gas_Tanks.m function [n,P] = Gas_Tanks(M,T,m) % Name, Section # % The function calculates the number of moles and pressure for multiple % containers of ideal gases.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the 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

{[ snackBarMessage ]}

### Page1 / 2

EGR_102_Lab_04B_Solution - Inputs M vector of molecular...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online