import math
# Radiation Emission from a Black Ball
# Variables
T = 800 #Temperature of suspended ball[K]
D = 0.2 #Diameter[m]
C1 = 3.74177*10**8 #[(micrometer**4)/m**2]
C2 = 1.43878*10**4 #[micrometer.K]
lambda_ = 3 #[micrometer]
# Calculations and Results
Eb = (5.67*10**(-8))*(T**4) #[W/m**2]
print "The ball emits",Eb/1000,"kJ","of energy in the form of energy in the form of electromagnetic radiation per second per m**2"
As = math.pi*(D**2) #[m**2]
print "The total Surface area of the ball is",As,"m**2"
del_t = 5*60. #[seconds]
Q_rad = Eb*As*del_t #[J]
print "The total amount of radiation energy emitted from the entire ball is",Q_rad/1000,"kJ"
#Solution (c)
Eb_lambda = C1/((lambda_**5)*((math.exp(C2/(lambda_*T)))-1)) #[W/m**2.micrometer]
print "The spectral blackbody emissive power",round(Eb_lambda),"W/m**2.micrometer"
import math
# Emission of Radiation from a Lightbulb
# Variables
T = 2500 #Temp of the filament[K]
lambda1 = 0.4
lambda2 = 0.76 #Visible ranfe[micrometer]
f1 = 0.000321
f2 = 0.053035 #The black body radiation functions corresponding to lamda1*T and lambda2*T
# Calculations and Results
f3 = f2-f1;
print "Fraction of radiation emitted between the two given wavelengths is",f3
lambda_max = 2897.8/T #[micrometer]
print "The wavelength at which the emission of radiation from the filament peaks is",lambda_max,"micron"
import math
# Radiation Incident on a small surface
# Variables
A1 = 3**10.**(-4) #[m**2]
T1 = 600. #[k]
A2 = 5*10.**(-4) #[m**2]
theta1 = math.pi*55./180
theta2 = math.pi*40./180 #[Radian]
r = 0.75 #[m]
# Calculations and Results
w_2_1 = (A2*math.cos(theta2))/(r**2) #[Steradian]
print "The solid angle subtended by a2 when viewed from A1 is",w_2_1,"sr"
I1 = (5.67*10**(-8))*(T1**4)/(math.pi) #[W/m**2.sr]
print "The Intensity of radiation emitted by A1 is",I1,"W/m**2.sr"
Q1_2 = I1*(A1*math.cos(theta1))*w_2_1 #[W]
print "The rate of radiation energy emitted by A1 in the direction of"\
,theta1,"radians","through the solid angle",w_2_1,"Steradian","is ",Q1_2,"W"
import math
# Emissivity of a surface and emissive Power
# Variables
e1 = 0.3 #For 0< = lambda < = 3micron
e2 = 0.8 #3micron< = lambda< = 7micron
e3 = 0.1 #7micron< = lamda<infinity
lambda1 = 3
lambda2 = 7 #[micron]
T = 800 #[K]
# Calculations and Results
p = lambda1*T #[micron.K]
q = lambda2*T #[micron.K]
#Hence blackbody radiation functions are
f1 = 0.140256;
f2 = 0.701046;
f0_1 = f1-0;
f2_inf = 1-f2;
e_T = e1*f1+e2*(f2-f1)+e3*(1-f2);
print "Average emissivity of the surface is",e_T
E = e_T*(5.67*10**(-8))*(T**4) #[W/m**2]
print "The Emissive Power of the surface is",E,"W/m**2"
import math
# Selective Absorber and Reflective Surfaces
# Variables
G_D = 400
G_d = 300 #Direct and diffuse components of solar radiation[W/m**2]
Ts = 320
T_sky = 260 #[K]
theta = 20*math.pi/180
# Calculations and Results
G_solar = (G_D*math.cos(theta))+G_d
#(a)
ab_a = 0.9
e_a = 0.9 #Grey absorber surface
q_net_rad_a = ab_a*G_solar+e_a*(5.67*10**(-8))*((T_sky**4)-(Ts**4)) #[W/m**2]
print "(a) The net radiation heat transfer is",round(q_net_rad_a),"W/m**2"
#(b)
ab_b = 0.1
e_b = 0.1 #Grey reflector surface
q_net_rad_b = ab_b*G_solar+e_b*(5.67*10**(-8))*((T_sky**4)-(Ts**4)) #[W/m**2]
print "The net radiation heat transfer is",round(q_net_rad_b),"W/m**2"
#(c)
ab_c = 0.9
e_c = 0.1 #Selective Absorber surface
q_net_rad_c = ab_c*G_solar+e_c*(5.67*10**(-8))*((T_sky**4)-(Ts**4)) #[W/m**2]
print "The net radiation heat transfer is",round(q_net_rad_c),"W/m**2"
#(d)
ab_d = 0.1
e_d = 0.9 #Selective reflector surface
q_net_rad_d = ab_d*G_solar+e_d*(5.67*10**(-8))*((T_sky**4)-(Ts**4)) #[W/m**2]
print "The net radiation heat transfer is",round(q_net_rad_d),"W/m**2"
import math
# Installing Reflective Films on Windows
# Variables
A_glazing = 40 #[m**2]
SHGC_wof = 0.766
SHGC_wf = 0.261 #[kWh/year]
unit_c_e = 0.08 #[$/kWh]
unit_c_f = 0.5 #[$/therm]
COP = 2.5
neta = 0.80;
# Calculations and Results
#For the months of June,July,August and Sepetember
Q_summer = 5.31*30+4.31*31+3.93*31+3.28*30 #[kWh/year]
#For the months oct,Nov,Dec,Jan,Feb,Mar,Apr
Q_winter = 2.80*31+1.84*30+1.54*31+1.86*31+2.66*28+3.43*31+4.00*30 #[kWh/year]
c_l_d = Q_summer*A_glazing*(SHGC_wof-SHGC_wf) #[kWh/year]
print "The decrease in the annual cooling load is",c_l_d,"kWh/year"
h_l_i = Q_winter*A_glazing*(SHGC_wof-SHGC_wf) #[kWh/year]
print "The increase in annual heating load is",h_l_i,"kWh/year"
d_c_c = c_l_d*(unit_c_e)/COP #[$/year]
i_h_c = h_l_i*(unit_c_f/29.31)/neta #[$/year]
print "The corresponding decrease in cooling math.costs and the increase in heating math.costs are $"\
,d_c_c,"and $",i_h_c,"per year"
Cost_s = d_c_c-i_h_c #[$/year]
print "The net annual math.cost savings due to the reflective film is $",Cost_s,"per year"
I_cost = 20*A_glazing #[$]
print "The implementation Cost of installing films is $",I_cost
pp = I_cost/Cost_s #[years]
print "Payback Period is",pp,"years"