Chapter 11: Balances on Transient Processes

Example 11.1-2, page no. 547

In [1]:
#Initialization of variables
import math
import numpy
from numpy import linalg
import scipy
from scipy import integrate
v0=math.pow(10.,9)

#Calculations and printing :

print(" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook")
def dv(t):
    dv=math.pow(10,6)*math.exp(-t/100) -math.pow(10,7)
    return dv

vol, err=scipy.integrate.quad(dv,0,60) #integrate.quad is an inbult function used for definite integration
print '%s %.3E' %(" \n Volume at the end of 60 days=",vol+v0)
raw_input('press enter key to exit')
 All the values in the textbook are Approximated hence the values in this code differ from those of Textbook
 
 Volume at the end of 60 days= 4.451E+08
press enter key to exit
Out[1]:
''

Example 11.3-1, page no. 556

In [2]:
#Initialization of variables
import math
import numpy
from numpy import linalg

m1=1.50 #kg
m2=3.0 #kg
Cv1=0.9 #cal/g C
Cv2=0.12 #cal/g C
Qdot=500.0 #W
T1=250.0 #C
T2=25.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")
MCv=(m1*Cv1 + m2*Cv2)*1000*4.184
print(MCv)
tf=(T1-T2)*MCv/Qdot
print '%s %d %s %.3f' %(" \n Time required",tf+1," in sec and in min =",tf/60)
raw_input('press enter key to exit')
 All the values in the textbook are Approximated hence the values in this code differ from those of Textbook
7154.64
 
 Time required 3220  in sec and in min = 53.660
press enter key to exit
Out[2]:
''