4_Quarterman_Patrick_LabExam2_Problem2

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

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

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

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: 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

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern