In [4]:

```
# initialization of variables
m=10; #mass of saturated water in kg
# All the necessary values are taken from table C.2
# part (a)
P=0.001; # Pressure in MPa
vf=0.001; #specific volume of saturated liquid at 0.001 Mpa in Kg/m^3
vg=129.2; # specific volume of saturated vapour at 0.001 Mpa in Kg/m^3
deltaV=m*(vg-vf) # by properties of pure substance
# result
print "The Volume change at pressure ",(P)," MPa is",round(deltaV)," m^3 \n"
# part (b)
P=0.26; # Pressure in MPa
vf=0.0011; # specific volume of saturated liquid at 0.26 MPa( it is same from at 0.2 and 0.3 MPa upto 4 decimals)
vg=(P-0.2)*(0.6058-0.8857)/(0.3-0.2)+0.8857; # specific volume of saturated vapour by interpolation of Values at 0.2 MPa and 0.3 MPa
deltaV=m*(vg-vf) # by properties of pure substance
# result
print "The Volume change at pressure ",(P)," MPa is",round(deltaV,2)," m^3 \n"
# part (c)
P=10; # Pressure in MPa
vf=0.00145; # specific volume of saturated liquid at 10 MPa
vg=0.01803; # specific volume of saturated vapour at 10 MPa
deltaV=m*(vg-vf) # by properties of pure substance
# result
print "The Volume change at pressure ",(P)," MPa is",round(deltaV,4)," m^3 \n"
```

In [8]:

```
# initialization of variables
m=4.0 # mass of water in kg
V=1.0 # volume in m^3
T=150 # temperature of water in degree centigrade
# TABLE C.1 is used for values in wet region
# Part (a)
P=475.8 # pressure in KPa in wet region at temperature of 150 *C
print " The pressure is",round(P,2)," kPa \n"
# Part (b)
#first we determine the dryness fraction
v=V/m # specific volume of water
vg=0.3928 # specific volume of saturated vapour @150 degree celsius
vf=0.00109 # specific volume of saturated liquid @150 degree celsius
x=(v-vf)/(vg-vf); # dryness fraction
mg=m*x; # mass of vapour
print " The mass of vapour present is",round(mg,3)," kg \n"
# Part(c)
Vg=mg*vg; # volume of vapour
print " The volume of vapour is",round(Vg,3)," m^3"
```

In [10]:

```
# initialization of variables
m=2 # mass of water in kg
P=220 # pressure in KPa
x=0.8 # quality of steam
# Table C.2 is used for values
vg=(P-200)*(0.6058-0.8857)/(300-200)+0.8857 # specific volume of saturated vapour @ given pressure by interpolating
vf=0.0011 # specific volume of saturated liquid @ 220 KPa
v=vf+x*(vg-vf)# property of pure substance
V=m*v # total volume
#result
print "The Total volume of the mixture is ",round(V,3)," m^3"
```

In [12]:

```
# initialization of variables
m=2 # mass of water in kg
P=2.2 # pressure in Mpa
T=800 # temperature in degree centigrade
# Table C.3 is used for values
v=0.2467+(P-2)*(0.1972-0.2467)/(2.5-2) # specific volue by interpolatin between 2 and 2.5 MPa
V=m*v # final volume
print "The Final Volume is",round(V,3)," m^3"
```

In [14]:

```
# initialization of variables
V=0.6 # volume of tyre in m^3
Pgauge=200 # gauge pressure in KPa
T=20+273 # temperature converted to kelvin
Patm=100 # atmospheric pressure in KPa
R=287 # gas constant in Nm/kg.K
Pabs=(Pgauge+Patm)*1000 # calculating absolute pressue in Pa
m=Pabs*V/(R*T)# mass from ideal gas equation
print "The Mass of air is",round(m,2)," Kg"
```

In [23]:

```
import math
# initialization of variables
T=500+273 # temperature of steam in kelvin
rho=24.0 # density in Kg/m^3
R=0.462 # gas constant from Table B.2
v=1/rho # specific volume and density relation
# PART (a)
P=rho*R*T # from Ideal gas equation
print " PART (a) The Pressure is ",int(P)," KPa \n"
# answer is approximated in textbook
# PART (b)
a=1.703 # van der Waal's constant a value from Table B.7
b=0.00169 # van der Waal's constant b value from Table B.7
P=(R*T/(v-b))-(a/v**2) # Pressure from van der Waal's equation
print " PART (b) The Pressure is ",int(P)," KPa \n"
# answer is approximated in textbook
# PART (c)
a=43.9 # van der Waal's constant a value from Table B.7
b=0.00117 # van der Waal's constant b value from Table B.7
P=(R*T/(v-b))-(a/(v*(v+b)*math.sqrt(T))) # Redlich-Kwong equation
print " PART (c) The Pressure is ",int(P)," KPa \n"
# answer is approximated in textbook
# PART (d)
Tcr=947.4 # compressibilty temperature from table B.3
Pcr=22100 # compressibility pressure from table B.3
TR=T/Tcr # reduced temperature
PR=P/Pcr # reduced pressure
Z=0.93 # from compressiblility chart
P=Z*R*T/v # Pressure in KPa
print " PART (d) The Pressure is ",int(P)," KPa \n"
# answer is approximated in textbook
# PART (e)
P=8000 # pressure from steam table @ 500*c and v= 0.0417 m^3
print " PART (e) The Pressure is ",int(P)," KPa \n"
# answer is approximated in textbook
```