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

Info icon This 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
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern