Chapter 3 - Temperature and Heat

Example 1 - Pg 33

In [1]:
#Calculate the mass of water required per pound of iron 
import math
#Initialization of variables
T1=500 #F
T2=100 #F
Tf=75 #F
cpi=0.120 #B/lb F
cpw=1.0 #B/lb F
#calculations
Qw=1*cpw*(T2-Tf)
Qi=-1*cpi*(T2-T1)
mw=Qi/Qw
#results
print '%s %.2f %s' %("Mass of water = ",mw,"lb water/lb iron")
Mass of water =  1.92 lb water/lb iron

Example 2 - Pg 34

In [1]:
#Calculate the net heat transferred
import math
import scipy
from scipy import integrate
#Initialization of variables
m=5 #lb
T1=1540+460  #R
T2=540+460  #R
#calculations
def q(T):
	cp=m*(0.248+0.448*math.pow(10,-8) *T*T)
	return cp;

Q=scipy.integrate.quad(q,T1,T2)
#results
print '%s %d %s' %("Heat transferred =",Q[0],"Btu")
print '%s' %("The answer is a bit different due to rounding off error in textbook")
Heat transferred = -1292 Btu
The answer is a bit different due to rounding off error in textbook

Example 3 - Pg 36

In [2]:
#Calculate the heat required for the process
#Initialization of variables
Tm=235 #F
Tb=832 #F
T=70 #F
cps=0.18 #B/lb F
cpl=0.235 #B/lb F
Lf=15.8 #B/lb
Lv=120 #B/lb
m=10 #lb
#calculations
Qa=m*cps*(Tm-T)
Qb=m*Lf
Qc=m*cpl*(Tb-Tm)
Qd=m*Lv
Q=Qa+Qb+Qc+Qd
#results
print '%s %.1f %s' %("Heat required =",Q,"Btu")
Heat required = 3057.9 Btu

Example 4 - Pg 36

In [5]:
#Calculate the mass of ice required for the process
#Initialization of variables
T1=22 #F
T2=32 #F
T3=40 #F
T4=70 #F
cps=0.501 #B/lb F
cpw=1 #B/lb F
Lf=143.3 #B/lb
m=40 #lb
#calculations
Qa=cps*(T2-T1)
Qb=Lf
Qc=cpw*(T3-T2)
Qd=m*cpw*(T3-T4)
mi=-Qd/(Qa+Qb+Qc)
#results
print '%s %.2f %s' %("Mass of ice required  =",mi,"lb ice")
Mass of ice required  = 7.68 lb ice

Example 5 - Pg 37

In [6]:
#Calculate the extra mass of ice required
#Initialization of variables
T1=22 #F
T2=32 #F
T3=40 #F
T4=70 #F
cps=0.501 #B/lb F
cpw=1 #B/lb F
Lf=143.3 #B/lb
m=40 #lb
cp=0.092
mc=10
#calculations
Qa=cps*(T2-T1)
Qb=Lf
Qc=cpw*(T3-T2)
Qe=mc*cp*(T3-T4)
mi=-Qe/(Qa+Qb+Qc)
#results
print '%s %.3f %s' %("Extra Mass of ice required  =",mi,"lb ice")
Extra Mass of ice required  = 0.177 lb ice