# Given data:
T1=500+273.0 #source temp in kelvin
T2=100+273.0 #sink temperature in kelvin
W=1 # output power in kW
nth=1-(T2/T1) # thermal efficiency
Q1=1/nth # heat supplied in kW
Q2=Q1-W # heat rejected in kW
print " The heat rejected is ",Q2,"kW"
# the answer in book is wrong due to incorrect value of T1
# Given data:
T1=40+273.0 # ambient temp in kelvin
T2=-10+273.0 # freezer temp in kelvin
Q2=2 # heat loss rate for freezer in kJ/s
Q1=T1*(Q2/T2) # heat transfer rate in kJ/s
W=Q1-Q2 # work in kW
print "The least power required is ",round(W,2),"kW"
# Given data:
Q1=3e4 # heat required in kJ/h
W=2e3 # work required in kJ/h
Q2=Q1-W # heat abstracted from outside in kJ/h
COP=Q1/(Q1-Q2) # COP of heat pump
print "Heat abstracted from outside air is ",Q2,"kJ/h"
print "COP heat pump is ",COP
# Given data:
T11=320+273.0 # temp at source 1 in kelvin
Q1=10000.0 # heat transfer rate at source 1 in kJ/min
T12=65+273.0 # temp at source 2 in kelvin
Q2=120000.0 # heat transfer rate at source 2 in kJ/min
T2=35+273.0 # temp of surrounding in kelvin
n1=1-(T2/T11) # efficiency by source 1
n2=1-(T2/T12) # efficiency by source 2
W1=Q1*n1 # work at source 1 in kJ/min
W2=Q2*n2 # work at source 2 in kJ/min
print "The work done at two sources is W1=",W1," kJ/min W2=",W2,"kJ/min"
print "The larger power is provided by source 2"