Chapter17-Ideal solutions

Ex1-pg 480

In [4]:
#intilization variables
x=0.25
pa=40
pb=50
ya=0.25
alpha=1.25
#calculation
P=x *pa+(1-x)*pb
y=x*pa/P
yb=(1-y)
xa=alpha*y/(1+(alpha-1)*y)
xb=(1-x)
#results
print'%s %.2f %s'%('total pressure of an ideal solution',P,'kpa')
print'%s %.2f %s  %.2f %s '%('composition of the gaseous phase',y,'' and ' ',yb,'')
print'%s %.2f %s  %.2f %s '%('the composition of last drop',xa,' ' and ' ',xb,'')                   
total pressure of an ideal solution 47.50 kpa
composition of the gaseous phase 0.21   0.79  
the composition of last drop 0.25    0.75  

Example2-pg484

In [3]:
import math
##initialisation of variables
T= 290 ##K
xa= 0.4
xb= 0.6
P= 600 ##kPa
V= 60 ##L
R= 8.314 ##J/mol K
Mp= 44 ##kg/kmol
Mb= 58.12 ##kg/kmol
vp= 0.00171 ##m**3/kg
vb= 0.00166 ##m**3/kg
na= 0.1 ##kmol
nb= 0.15 ##kmol
V1= 0.04000 ##m**3
xa= 0.4 
np= 2
Vc= 0.1 ##m**3
##CALCULATIONS
Pasat= math.e**(14.435-(2255/T))
Pbsat= math.e**(14.795-(2770/T))
P1= xa*Pasat+xb*Pbsat
Na1= P*V/(100*R*T)
Vp= vp*Mp
Vb= vb*Mb
V= na*Vp+nb*Vb
Vv= V1-V
nv= P1*Vv/(R*T)
ya= xa*Pasat/P
yb=1-ya
Na= na+ya*nv
Nb= nb+yb*nv
##RESULTS
print'%s %.2f %s'% (' initial pressure= ',P1,' kPa')
print'%s %.2f %s'% ('  moles of propane= ',Na1,' kmol')
print'%s %.2f %s'% ('  initial mole of propane= ',Na,' kmol')
print'%s %.2f %s'% ('  initial mole of butane= ',Nb,' kmol')
print'%s %.2f %s'% ('  numbar of phases= ',np,'')
print'%s %.2f %s'% ('  volume in final state=',Vc,' m^3')
 initial pressure=  874.89  kPa
  moles of propane=  0.15  kmol
  initial mole of propane=  0.11  kmol
  initial mole of butane=  0.15  kmol
  numbar of phases=  2.00 
  volume in final state= 0.10  m^3

Example3-pg489

In [3]:
import math	
#calculate pressure of the phase of pure A
##initialisation of variables
p0= 10. ##Mpa
R= 8.314 ##J/mol K
T= 30. ##C
va= 0.02 ##m^3/kmol
xa= 0.98
##CALCULATIONS
p= p0+(R*(273.15+T)*math.log(xa)/(va*1000.))
##RESULTS
print'%s %.2f %s'%('Pressure of the phase of pure A=',p,'Mpa')
Pressure of the phase of pure A= 7.45 Mpa

Example4-pg491

In [4]:
import math
#calculate the boiling point elevation
##initialisation of variables
hfg= 2257.0 ##kJ/kg
Tb= 100 ##C
R= 8.314 ##J/mol K
m2= 10 ##gms
M2= 58.5 ##gms
m1= 90. ##gms
M1= 18. ##gms
##CALCULATIONS
x2= (m2/M2)/((m2/M2)+(m1/M1))
dT= R*math.pow(273.15+Tb,2)*x2/(M1*hfg)
##RESULTS
print'%s %.3f %s'%(' Boiling point elevation=',dT,'C')
 Boiling point elevation= 0.942 C

Example5-pg494

In [5]:
import math
#calculate Osomatic pressures
##initialisation of variables
M1= 18.02 ##gms
m1= 0.965 ##gms
m2= 0.035 ##gms
M2= 58.5 ##gms
R= 8.314 ##J/mol K
M= 18.02 ##kg
T= 20. ##C
vf= 0.001002 ##m^3
x21= 0.021856 ##m^3
##CALCULATIONS
n1= m1/M1
n2= m2/M2
x1= n1/(n1+n2)
x2= n2/(n2+n1)
P= R*(273.15+T)*x2/(M*vf)
P1=  R*(273.15+T)*x21/(M*vf)
##RESULTS
print'%s %.1f %s'%('Osmotic pressure=',P,'kpa')
print'%s %.1f %s'%('Osmotic pressure=',P1,'kpa')
Osmotic pressure= 1491.4 kpa
Osmotic pressure= 2950.2 kpa

Example6-pg495

In [8]:
import math
#what is useful work in the process and heat interaction and maximum work and irreversibility
##initialisation of variables
W= 0.
Q= 0.
R= 8.314 ##J/mol K
T0= 300. ##K
x= 5./13.
n1= 0.5 ##kmol/s
n2= 0.8 ##kmol/s
##CALCULATIONS
W1= (n1+n2)*R*T0*(x*math.log(1/x)+(1-x)*math.log(1./(1.-x)))+470
I= W1
##RESULTS
print'%s %.f %s'%('useful work of the process=',W,'kW') 
print'%s %.f %s'%('heat interaction=',Q,'kW') 
print'%s %.1f %s'%('maximum work=',W1,'kW') 
print'%s %.1f %s'%('irreversibility=',I,'kW')
useful work of the process= 0 kW
heat interaction= 0 kW
maximum work= 2630.4 kW
irreversibility= 2630.4 kW