4_Quarterman_Patrick_LabExam2_Problem2

4_Quarterman_Patrick_LabExam2_Problem2 - for i=1:10 %set...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Patrick Quarterman Section 4 Exam 2 problem 2 Script: %script 'Gas_Tanks.m' %Patrick Quarterman, Section 4 %determine the gases in each tank %Given information Snum= [8594 5267 5269 8475 4358 4459 8475 5978 4857 8484]; %serial numbers P= [167 110 124 152 229 358 208 111 360 141]; %Pressure (kPa) m= [65.7 75.6 85.2 59.8 22.5 35.2 81.5 76.1 35.4 55.2]; %mass (kg) R=8.314; %gas law constant (L*kPa/kmol*K) V=60; %volume (L) T=294; %Temperature (K) %calculate the molar mass of gas in each tank M=m*R*T./(P*V); %determine type of gas in each tank from molar mass
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: for i=1:10 %set loop to run through each tank in vectors if M(i)<=5 display(Snum(i)) display( 'Helium' ) elseif M(i)<=20 display(Snum(i)) display( 'Methane' ) else display(Snum(i)) display( 'Nitrogen' ) end end matlab results >> run Gas_tanks ans = 8594 Methane ans = 5267 Nitrogen ans = 5269 Nitrogen ans = 8475 Methane ans = 4358 Helium ans = 4459 Helium ans = 8475 Methane ans = 5978 Nitrogen ans = 4857 Helium ans = 8484 Methane...
View Full Document

This note was uploaded on 11/16/2010 for the course EGR 102 taught by Professor Hinds during the Spring '09 term at Michigan State University.

Page1 / 3

4_Quarterman_Patrick_LabExam2_Problem2 - for i=1:10 %set...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online