CSC215,ScheduleSyllabus,
C++, Matlab
Guidelines,Evaluations

 

*

MATLAB (MATrix LABoratory) Chapter 2 Assignments


Assignment Chapter 2: Points: 6 points

Use the ideal gas law and Van der Waals' equation to calculate the temperature of water vapor. This is problem 2.7 from pp. 25 and 57 of your text.

The basic equation describing the properties of gases is the ideal gas law which is:

PV = nRT

Where

P = pressure in kPA
V = volume in m^3
n = number of kmoles of gas in the sample
R = ideal gas constant, 8.314 kPA m^3/kmol K
T = temperature, expressed in kelvins(K)


In addition, we know that the number of kmoles of a gas is equal to the mass of the gas divided by the molar gas (also known as the molecular weight):

n = m/MW

Where

m = mass in kg
MW = molar mass in kg/kmols


The ideal gas law is a good approximation of the behavior of gases when the pressure is low and the temperature is high. What constitutes low pressure and high temperature varies with different gases. In 1873, Johannes Diderik van der Waals proposed a modified version of the ideal gas law that better models the behavior of real gases over a wider range of temperature and pressure.

NOTE: This formula is better understood and read on p.57 in your text. Examine the formula on this page before typing it in.

( P +

 

n^2a
V^2

) (v - nb) = nRT

In this equation the additional variables a and b represent values characteristic of individual gases.

Use the ideal gas law and Van der Waals' eqautions to calculate the temperature of water vapor (steam)using the following data:
NOTE: You are being asked to show the results of both equations, the ideal gas law and Van der Waals'. Be sure to label your output so the meaning of the output can be clearly understood.

pressure,P
moles, n
volume,V
a
b
ideal gas constant,R

220 bar
2 mol
1 L
5.536 L^2bar/mol^2
0.03049L/mol
.08314472 L bar/k mol

See Example 2.1 on pages 25-28 as a model for solving this problem.

Use a .m file to save this project.

  1. Copy the output from the command window and paste after the code in your .m file. Show the output as comments.
  2. FTP the file into UNIX if you are using MATLAB on a MAC or PC, or paste the code into a text editor in UNIX and put it into the MATLABch2 folder in my account.
  3. Be sure to give me permission to see the file.
  4. It is very important that your name is found in the name of the file. For the name of the file do not use any spaces. Use underscores or start your last name with a capital letter. I can not give credit if I do not know who you are.

Back to top, Chapter 2 Lecture, Chapter 2 Homework