import math
T1 = 800 # Source temperature in degree Celsius
T2 = 30 # Sink temperature in degree Celsius
e_max = 1-((T2+273)/(T1+273)) # maximum possible efficiency
Wnet = 1 # in kW
Q1 = Wnet/e_max # Least rate of heat required in kJ/s
Q2 = Q1-Wnet # Least rate of heat rejection kJ/s
print "\n Example 6.1"
print "\n Least rate of heat rejection is ",Q2," kW"
#The answers vary due to round off error
import math
T1 = -15 # Source temperature in degree Celsius
T2 = 30 # Sink temperature in degree Celsius
Q2 = 1.75 # in kJ/sec
print "\n Example 6.2"
W= Q2*((T2+273)-(T1+273))/(T1+273) # Least Power necessary to pump the heat out
print "\n Least Power necessary to pump the heat out is ",round(W,2),"kW"
#The answers vary due to round off error
import math
#Given
T1 = 600 # Source temperature of heat engine in degree Celsius
T2 = 40 # Sink temperature of heat engine in degree Celsius
T3 = -20 # Source temperature of refrigerator in degree Celsius
Q1 = 2000 # Heat transfer to heat engine in kJ
W = 360 # Net work output of plant in kJ
# Part (a)
e_max = 1.0-((T2+273)/(T1+273)) # maximum efficiency
W1 = e_max*Q1 # maximum work output
COP = (T3+273)/((T2-273)-(T3-273)) # coefficient of performance of refrigerator
W2 = W1-W # work done to drive refrigerator
Q4 = COP*W2 # Heat extracted by refrigerator
Q3 = Q4+W2 # Heat rejected by refrigerator
Q2 = Q1-W1 # Heat rejected by heat engine
Qt = Q2+Q3 # combined heat rejection by heat engine and refrigerator
print "\n Example 6.3"
print "\n\n Part A:"
print "\n The heat transfer to refrigerant is ",round(Q2,3) ," kJ"
print "\n The heat rejection to the 40 degree reservoir is ",round(Qt,3) ," kJ"
# Part (b)
print "\n\n Part B:"
e_max_ = 0.4*e_max # maximum efficiency
W1_ = e_max_*Q1 # maximum work output
W2_ = W1_-W # work done to drive refrigerator
COP_ = 0.4*COP # coefficient of performance of refrigerator
Q4_ = COP_*W2_ # Heat extracted by refrigerator
Q3_ = Q4_+W2_ # Heat rejected by refrigerator
Q2_ = Q1-W1_ # Heat rejected by heat engine
QT = Q2_+Q3_# combined heat rejection by heat engine and refrigerator
print "\n The heat transfer to refrigerant is ",round(Q2_,3) ," kJ"
print "\n The heat rejection to the 40 degree reservoir is ",round(QT,3) ," kJ"
#The answers vary due to round off error
import math
T1 = 473 # Boiler temperature in K
T2 = 293 # Home temperature in K
T3 = 273 # Outside temperature in K
print "\n Example 6.5"
MF = (T2*(T1-T3))/(T1*(T2-T3))
print "\n The multiplication factor is ",MF
#The answers vary due to round off error
import math
T1 = 90.0 # Operating temperature of power plant in degree Celsius
T2 = 20.0 # Atmospheric temperature in degree Celsius
W = 1.0 # Power production from power plant in kW
E = 1880 # Capability of energy collection in kJ/m**2 h
print "\n Example 6.6"
e_max = 1.0-((T2+273.0)/(T1+273.0)) # maximum efficiency
Qmin = W/e_max # Minimum heat requirement per second
Qmin_ = Qmin*3600.0 # Minimum heat requirement per hour
Amin = Qmin_/E # Minimum area requirement
print "\n Minimum area required for the collector plate is ",math. ceil(Amin) ," m**2"
import math
T1 = 1000 # Temperature of hot reservoir in K
W = 1000 # Power requirement in kW
K = 5.67e-08 # constant
print "\n Example 6.7"
Amin = (256*W)/(27*K*T1**4) # minimum area required
print "\n Area of the panel ",Amin ," m**2"