Use both the ideal gas law and the Van der Waals’ equation to calculate the temperature of water vapor (steam) for the following conditions: P = 220 bar, n = 2 mol, V = 1 L,  a = 5.536 L2 bar/mol2, b = 0.03049 L/mol and R = 0.08314472 L bar/K mol.

Matlab:

p = 220

n = 2

v = 1

a = 5.536

b = 0.03049

R = 0.08314472

T1=(p*v)/(n*R)

%T1 is the temperature measure using Ideal gas law

T2= ((p+((n^2*a)/v^2))*(v-(n*b)))/(n*R)

%T2 is the temperature using Van der waals correction

p =

220

n =

2

v =

1

a =

5.5360

b =

0.0305

R =

0.0831

T1 =

1.3230e+003

T2 =

1.3674e+003

Part b)

Find the value of temperature (T), for 11 values of pressure from 0 bar to 400 bar for volume of 1 L using the ideal gas law and then using the Van der Waals’ modification.  Use the values of a, b, n, R, and V given in part (b) above.  Present your results as a table of “Pressure, Temp_ideal, Temp_real

Matlab:

p = linspace(0,400,11)

T1=(v.*p)/(n*R)

%T1 is the temperature measure using Ideal gas law

T2=((((n^2*a)/v^2)+p)*(v-(n*b)))/(n*R)

%T2 is the temperature using Van der waals correction

p =

Columns 1 through 7

0    40    80   120   160   200   240

Columns 8 through 11

280   320   360   400

T1 =

1.0e+003 *

Columns 1 through 4

0    0.2405    0.4811    0.7216

Columns 5 through 8

0.9622    1.2027    1.4433    1.6838

Columns 9 through 11

1.9244    2.1649    2.4054

T2 =

1.0e+003 *

Columns 1 through 4

0.1250    0.3509    0.5768    0.8027

Columns 5 through 8

1.0285    1.2544    1.4803    1.7062

Columns 9 through 11

1.9321    2.1579    2.3838