#Initialization of variables
import math
basis=100. #mol/s
ninAcv=66.9 #mol/s
noutAcv=3.35 #mol/s
noutAcl=63.55 #mol/s
ninN2=33.1 #mol/s
noutN2=ninN2
HinAcv=35.7 #Kj/mol
HoutAcv=32.0 #Kj/mol
HinN2=1.16 #Kj/mol
HoutN2= -0.10 #Kj/mol
#Calculations and printing:
deltaH=noutAcv*HoutAcv+ noutN2*HoutN2-ninN2*HinN2-ninAcv*HinAcv
Q=deltaH
print '%s %.2f' %("Heat transferred from condenser to achieve required cooling and condensation at the rate of (kW) ",Q)
raw_input('press enter key to exit')
#Initialization of variables
import math
import numpy
from numpy import linalg
import scipy
from scipy import integrate
mass=200.0 #kg
Ti=20.0 #C
Tf=150.0 #C
#Calculations and printing :
print(" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook \n ")
def Cv(T):
Cv=0.855+ T*9.42*math.pow(10,-4)
return Cv
Ucap, err= scipy.integrate.quad(Cv,Ti,Tf) #integrate.quad is an inbult function used for definite integration
Q=mass*Ucap
print '%s %.3f' %("Heat Required (KJ) = ",Q)
raw_input('press enter key to exit')
#Initialization of variables
import math
import numpy
from numpy import linalg
import scipy
from scipy import integrate
T1=20.0 #C
T2=100.0 #C
T3=90.0 #C
T4=30.0 #C
P=3.0 #bar
V=5.0 #L
R=0.08314 #L.bar/mol.K
T=363.0 #K
ndot=100.0 #mol/min
#Calculations and printing :
print(" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook \n ")
print("part 1")
def fun1(T):
fun1=0.02900+ T*0.2199*math.pow(10,-5) + math.pow(T,2) * 0.5723 *math.pow(10,-8) - math.pow(T,3) * 2.871 * math.pow(10,-12)
return fun1
deltaH, err=scipy.integrate.quad(fun1,T1,T2) #scipy.integrate.quad is an inbult function used for definite integration
Qdot=ndot*deltaH
print '%s %.3f' %("Heat Transferred (KJ/min) = ",Qdot)
print("part2")
def fun2(T):
fun2=0.02900+ T*0.2199*math.pow(10,-5) + math.pow(T,2) * 0.5723 *math.pow(10,-8) - math.pow(T,3) * 2.871 * math.pow(10,-12)-8.14* math.pow(10,-3)
return fun2
deltaU, err2=scipy.integrate.quad(fun2,T3,T4) #scipy.integrate.quad is an inbult function used for definite integration
n=P*V/(R*T)
Q=n*deltaU
print '%s %.3f' %("Heat transferred (KJ) = ",Q)
raw_input('press enter key to exit')
#Initialization of variables
import math
import numpy
from numpy import linalg
import scipy
from scipy import integrate
T1=430.0 #C
T2=100.0 #C
ndot=15.0 #Kmol/min
#Calculations and printing :
print(" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook \n ")
def fun(T):
fun=0.02894 + T* 0.4147 *math.pow(10,-5) + math.pow(T,2) * 0.3191 * math.pow(10,-8) - math.pow(T,3) * 1.965 * math.pow(10,-12)
return fun
deltaH, err=scipy.integrate.quad(fun,T1,T2) #scipy.integrate.quad is an inbult function used for definite integration
Qdot=ndot*deltaH*math.pow(10,3) /60.
print '%s %.3f' %(" \n Rate of heat removal (KW) = ",Qdot)
raw_input('press enter key to exit')
#Initialization of variables
import math
import numpy
from numpy import linalg
import scipy
from scipy import integrate
x=0.6
T1=0.0
T2=400.0
ndot=150.0 #mol/h
#Calculations and printing :
print(" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook \n ")
def fun1(T):
fun1=0.04937 + T*13.92*math.pow(10,-5) - math.pow(T,2) *5.816*math.pow(10,-8) + math.pow(T,3) *7.280 * math.pow(10,-12)
return fun1
def fun2(T):
fun2=0.06803 +T*22.59*math.pow(10,-5) - math.pow(T,2) *13.11*math.pow(10,-8) + math.pow(T,3) *31.71 * math.pow(10,-12)
return fun2
def fun(T):
fun=x*fun1(T)+ (1-x)*fun2(T)
return fun
deltaH , err=scipy.integrate.quad(fun,T1,T2) #scipy.integrate.quad is an inbult function used for definite integration
print '%s %.3f' %(" \n Heat capacity of Mixture (KJ/mol) = ",deltaH)
Qdot=ndot*deltaH
print '%s %.3f' %(" \n Heat Required (KJ/h) = ",Qdot)
raw_input('press enter key to exit')
#Initialization of variables
import math
import numpy
from numpy import linalg
import scipy
from scipy import integrate
x=0.1 #CH4
T1=20.0
T2=300.0
Vdot=2000.0 #L/min
#Calculations and printing :
print(" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook \n ")
ndot=Vdot/22.4
def fun(T):
fun=0.03431 + T*5.469*math.pow(10,-5) + math.pow(T,2) *0.3661*math.pow(10,-8) + math.pow(T,3) *11*math.pow(10,-12)
return fun
H1 ,err=scipy.integrate.quad(fun,T1,T2) #scipy.integrate.quad is an inbult function used for definite integration
print '%s %.3f' %("H1 (Kj/mol) = ",H1)
print("From Tables H2= -0.15 Kj/mol , H3=8.17 Kj/mol")
H2= -0.15
H3=8.17
Qdot=(ndot*x*H1+ ndot*(1-x)*(H3-H2))/60.
print '%s %.3f' %("Heat Input (KW) = ",Qdot)
raw_input('press enter key to exit')
#Initialization of variables
import math
import numpy
from numpy import linalg
mdot=1500.0 #g/min
M=32.0 #g/mol
deltaHv=35.3 #Kj/mol
#Calculations and printing :
print(" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook \n ")
Qdot=mdot*deltaHv/(M*60.)
print '%s %.3f' %("Rate of Heat transfer (KW) = ",Qdot)
raw_input('press enter key to exit')
#Initialization of variables
import math
import numpy
from numpy import linalg
import scipy
from scipy import integrate
deltaHv=28.85 #Kj/mol at 69 C
T1=25.0 #C
T2=69.0 #C
Cp=0.2163 #Kj/mol C
V=1.0 #L
P=7.0 #bar
D=0.659 #KG/L
M=86.17 #Kg
ndot=100.0 #mol/h
T3=300.0 #C
#Calculations and printing :
print(" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook")
print("We have deltaHv at 69C hence We follow path ADG")
deltaHA=Cp*(T2-T1) + V*(1.013-P)*M/(D*math.pow(10,4))
print '%s %.3f' %(" \n deltaHA (Kj/mol) =",deltaHA)
deltaHD=deltaHv
print '%s %.3f' %(" \n deltaHD (Kj/Kg) =",deltaHD)
def fun1(T):
fun1=0.13744 + T*40.85*math.pow(10,-5) - math.pow(T,2) *23.92*math.pow(10,-8) + math.pow(T,3) *57.66*math.pow(10,-12)
return fun1
deltaHG, err=scipy.integrate.quad(fun1,T2,T3) #scipy.integrate.quad is an inbult function used for definite integration
print '%s %.3f' %(" \n deltaHG (KJ/mol) = ",deltaHG)
Qdot=ndot*(deltaHA+deltaHD+deltaHG)/3600
print '%s %.3f' %(" \n rate of Heat supply (KJ/mol) = ",Qdot)
print(" \n In this problem we neglected V*deltaP as it is negligible ")
raw_input('press enter key to exit')
#Initialization of variables
import math
import numpy
from numpy import linalg
T1=337.9 #K
T2=473.0 #K
Tc=513.2 #K
#Calculations and printing :
print(" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook")
print("using Trouton rule,")
deltaHvT1=0.109*T1
print("In this case, trouton rule gives a better estimate")
print("using Watson correction")
deltaHvT2=36.8*math.pow(((Tc-T2)/(Tc-T1)),0.38)
print '%s %.3f' %("Estimated value using Trouton rule (Kj/mol) = ",deltaHvT1)
print '%s %.3f' %(" \n Estimated value using watson correction (Kj/mol) = ",deltaHvT2)
raw_input('press enter key to exit')
#Initialization of variables
import math
import numpy
from numpy import linalg
basis=1.0 #mol feed
x=0.684 #mole fraction Of B
y=0.4
#Calculations and printing :
print(" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook")
A=([[1, 1],[x ,y]])
b=([[basis],[basis/2]])
C=numpy.dot(linalg.inv(A),b)
#Here We solved two linear equations simultaneously
nV=C[0,0]
nL=C[1,0]
H1=5.332
H2=6.340
H3=37.52
H4=42.93
Q=nV*x*H1 + nV*(1-x)*H2 + nL*y*H3 + nL*(1-y)*H4
print '%s %.3f' %(" \n Heat transferred (KJ) = ",Q)
print("The answer for this problem in Text is wrong")
raw_input('press enter key to exit')
#Initialization of variables
import math
basis=1. #lbm dry air
Tin=80. #F Inlet temperature
Tout=51. #F Outlet temperature
#Calculations and printing:
print("For 80F and 80 percent RH, ha=0.018 lbm H20/lbm DA H1=38.8 Btu/lbm DA")
ha=0.018 #lbm H20/lbm DA
H1=38.8 #Btu/lbm DA
m1=basis*ha
print("\n For 51F and saturated, ha=0.0079 lbm H20/lbm DA H2=20.9 Btu/lbm DA")
ha2=0.0079 #lbm H20/lbm DA
H2=20.9 #Btu/lbm DA
m2=basis*ha2
print("\n Balance on H2O")
m3=m1-m2
Fraction=m3/m1
print '%s %.3f' %("\n Fraction H2O condensed = ",Fraction)
H3=basis*(Tout-32.)
Q=basis*H2+m3*H3-basis*H1
print("\n From psychrometric chart, Vh=13.0 ft^3/lbm DA")
Vbasis=basis*13.0
Qdot=Q*1000./Vbasis
print '%s %.2f' %("Rate at which heat must be removed (Btu/min) = ",Qdot)
raw_input('press enter key to exit')
#Initialization of variables
import math
import numpy
from numpy import linalg
import scipy
from scipy import integrate
M1=35.6 #g/mol
M2=18.0 #g/mol
x=0.2
mdot=1000.0 #kg/h
T1=25.0 #C
T2=100.0 #C
T3=40.0 #C
#Calculations and printing :
print(" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook")
nHCl=mdot*x*math.pow(10,3) /M1
nH2O=mdot*(1-x)*math.pow(10,3) /M2
def fun(T):
fun=29.13*math.pow(10,-3) - T*0.1341*math.pow(10,-5) +math.pow(T,2) *0.9715*math.pow(10,-8) - math.pow(T,3) *4.335*math.pow(10,-12)
return fun
H1, err=scipy.integrate.quad(fun,T1,T2) #scipy.integrate.quad is an inbult function used for definite integration
r=nH2O/nHCl
print("From table B.11, deltaHa= -67.4 Kj/mol HCl")
deltaHa= -67.4
y=nHCl/(nHCl+nH2O)
Cp=0.73*mdot*4.184/nHCl
deltaHb=Cp*(T3-T1)
H2=deltaHa+deltaHb
Qdot=nHCl*(H2-H1)
print '%s %.3E' %("Heat (kJ/h) = ",Qdot)
raw_input('press enter key to exit')
#Initialization of variables
import math
import numpy
from numpy import linalg
x=0.05
y=0.4
mdot=1000.0 #lbm/h
Hf=10.0 #Btu/lbm
Hl= -17 #Btu/lbm
Hv=1138.0 #Btu/lbm
#Calculations and printing :
print(" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook")
print("\n sulphuric acid balance")
m2=x*mdot/y
print("\n Total Mass balance")
m1=mdot-m2
Qdot=m1*Hv+m2*Hl-mdot*Hf
print '%s %.3f' %(" Rate of Heat transfer (Btu/h) = ",Qdot)
raw_input('press enter key to exit')
#Initialization of variables
import math
import numpy
from numpy import linalg
basis=100.0 #lbm/h
Hv=728.0 #Btu/lbm
Hl=45.0 #Btu/lbm
HF=100.0 #Btu/lbm
T=120.0 #F
xF=0.30
#Calculations and printing :
print(" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook")
print("From figure 8.5-2, ")
xL=0.185
xV=0.89
mL=basis*((xV-xF)/(xV-xL))
mV=basis-mL
Qdot=mV*Hv + mL*Hl - basis*HF
print '%s %.3f' %("Rate of heat transfer (Btu/h) =",Qdot)
raw_input('press enter key to exit')