#You are asked to comment on an inventor's claim that he has an engine which
#delivers 25 Btu of work from an input if 100 Btu when it operates between
#140F and 0F. Is the claim valid?
#initialisation of variables
W= 25 #Btu
W1= 100 #Btu
T1= 140 #R
T2= 0 #R
#CALCULATIONS
Th= T1+460. #T hot in Rankine
Tl= T2+460. #T cold in Rankine
nt= (Th-Tl)/Th #Max. efficieny
n= nt*100.
#RESULTS
print '%s %.2f' % ('maximum theotrical efficiency (percentage)((Claim is not valid)) = ',n)
raw_input('press enter key to exit')
#Saturated steam in a rigid vessel is initially at 10 bar. heat is added
#until the steam s superheated at 38 bar and 310 C. What is the change in entropy?
#initialisation of variables
P= 10 #bar
P1= 38 #bar
T= 310 #C
v= 64.03 #cm^3/gm
s= 6.4415 #J/gm K
vf= 1.12773 #cm^3/gm
vg= 194.44 #cm^3/gm
sf= 2.1387 #J/gm K
sfg= 4.4478 #J/gm K
#CALCULATIONS
x= (v-vf)/(vg-vf) #x
sx= sf+x*sfg #Entropy
S= s-sx #Change in entropy
#RESULTS
print '%s %.3f' % ('Change in Entropy (J/gm K) = ',S)
raw_input('press enter key to exit')
#If heat must be pumped at the rate of 70k Btu/hr to keep a house at 72F when
#the outside temperature is 15 F, What is the minimum power required to drive
#the heat pump?
#initialisation of variables
Qh= 70000. #Btu/hr
T= 15. #F
T1= 72. #F
#CALCULATIONS
COP= (T1+460)/((T1+460)-(T+460)) #Carnot efficiency
W= Qh/COP #Work
#RESULTS
print '%s %.2f' % ('Minimum power required to drive the heat pump (Btu/hr) = ',W)
raw_input('press enter key to exit')
#Heat must be pumped at the rate of 26kW to maintain a temperature of 43F
#in an air stream while the outside temperature is 0C. Determine
#(a)the minimum electrical equipment in Kilowatts and
#(b)the electrical requirement if an electric heater is used.
#initialisation of variables
h= 26. #KW
T= 43. #C
To= 0 #C
#CALCULATIONS
COP= (T+273)/((T+273.)-(To+273.)) #Carnot efficiency
W= h/COP #Work
Qh=h #Heat
#RESULTS
print '%s %.2f' % ('Minimum electrical requirement (KW) = ',W)
print '%s %.2f' % (' \n Elctrical requirement if an electrical heater used (KW) = ',Qh)
raw_input('press enter key to exit')