#initilisation
Tr = 540.0 #R
Te = 2000.0 #R
m = 200.0 #B/lbm
#calculation
eta = 1-(Tr/Te)
Qr = m*(1-eta)
#result
print "Thermal efficiency is ", eta*100, "%"
print "Heat rejected = %d B/lbm" %Qr
import scipy.integrate
#initilisation
cv=0.171 #B/lbm F
T2=580 #F
T1=520 #F
#calculation
def fun(T):
cp=cv/T
return cp
ds = scipy.integrate.quadrature(fun, T1, T2)[0]
#result
print "Change in entropy = %.4f B/lbm R" %ds
import scipy.integrate
#initilisation
Q = 100.0 #B/lbm
Cp = 0.24 #B/lbm F
T1 = 70.0+460.0 #R
T2 = 550.0+460.0 #R
Ts = 50.0+460.0 #R
#calculation
def fun(T):
cp = Cp/T
return cp
ds1 = scipy.integrate.quadrature(fun, T1, T2)[0]
Tf = Q/Cp + T1
ds2 = scipy.integrate.quadrature(fun, T1, Tf)[0]
Qr = Ts*(ds2)
Qa = Q-Qr
Qun = Ts*(ds1)
Qa2 = Q-Qun
#result
print "Case 1"
print "Change in entropy = %.4f B/lbm R" %ds1
print "case 2"
print "Entropy change = %.4f B/lbm R" %ds2
print "Available energy = %.1f B/lbm" %Qa
print "case 3"
print "Available energy = %.1f B/lbm" %Qa2