import math
dA2=(1*1)/144.0
Beta1=40*math.pi/180.0
r=4
dw2_1=dA2*math.cos(Beta1)/r**2
dA3=dA2
Beta2=0
dw3_1=dA3*cos(Beta2)/r**2
theta2=math.pi*50/180.0
theta3=math.pi*60/180.0
I_theta2=2000*(1-0.4*(sin(theta2))**2)
I_theta3=2000*(1-0.4*(sin(theta3))**2)
dA1=1/144.0
dq1_2=I_theta2*dA1*math.cos(theta2)*dw2_1 #In book calculation mistake
dq1_3=I_theta3*dA1*math.cos(theta2)*dw3_1
print"(a)The solid angle subtended by area dA2 with respect to dA1 is ",round(dw2_1,4),"sr"
print" The solid angle subtended by area dA3 with respect to dA1 is ",round(dw3_1,4),"sr"
print"(b) The intensity of radiation emitted from dA1 in the direction of dA2 is ",round(I_theta2,0),"BTU/(hr.sq.ft.sr)"
print" The intensity of radiation emitted from dA1 in the direction of dA3 is",round(I_theta3,0),"BTU/(hr.sq.ft.sr)"
print"(c)The rate at which radiation emitted by dA1 is intercepted by dA2 is ",round(dq1_2,4),"BTU/hr"
print" The rate at which radiation emitted by dA1 is intercepted by dA3 is ",round(dq1_3,4),"BTU/hr"
dA2=0.02*0.02
Beta=0
r=1
import math
dw2_1=dA2*math.cos(Beta)/r**2
dA1=dA2
theta=math.pi*30/180.0
I_theta=1000# The intensity of radiation leaving dA1 in any direction is 1 000 W/(m**2.sr
dq1_2=I_theta*dA1*cos(theta)*dw2_1
dQ1_2=dq1_2/dA2
print"(a)The solid angle subtended by area dA2 with respect to dA1 is ",round(dw2_1,4),"sr"
print"(b)The rate at which radiation emitted by dA1 is intercepted by dA2 is",round(dq1_2,5),"W"
print"(c)The irradiation associated with dA2 is ",round(dQ1_2,3),"W/sq.m"
D=2.5/12.0 # diameter in ft
L=4.5/12.0 # length in ft
import math
A=(2*math.pi*D**2/4)+(math.pi*D*L)
A_hole=math.pi*(1/(8.0*12.0))**2/4.0
f=A_hole/A # fraction of area removed
emissivity=0.039
emissivity_hole=emissivity/(emissivity+(1-emissivity)*f)
sigma=0.1714e-8 # stefan Boltzmann constant in BTU/(hr~ft**2 degree R)
T=150+460 # temperature in degree R
qe=emissivity_hole*sigma*T**4
Qe=A_hole*qe
print"(a)The emissivity of the hole is %.4f",round(emissivity_hole,4)
print"(b)The heat lost by the hole is ",round(Qe,4),"BTU/hr"
T=2800 #Temprature
lambda1=4e-7 #Wavelength
lambda2=7e-7
hT=lambda1*T
lambdaT=lambda2*T
I1=0.0051 #Fraction of Total Radiation Emitted for lower Wavelength-Temperature Product from Table 11.1
I2=0.065 #Fraction of Total Radiation Emitted for upper Wavelength-Temperature Product from Table 11.1
dI=I2-I1
print"The percentage of total emitted energy that lies in the visible range is",round(dI*100,0),"percant"
lambda_max=0.5e-6 # maximum wavelength in m
T=2.898e-3/lambda_max
sigma=5.675e-8 # value of Stefan-Boltzmann constant in W/(m**2.K**4)
q=sigma*T**4
print"The Surface Temperature of the Sun is ",round(T,2),"K"
print"The heat flux emitted is ",round(q,0),"W/sq.m"
lambda1=300e-9 # lower limit of wavelength
lambda2=380e-9 # upper limit of wavelength
T=5800
lambda1_T=lambda1*T
lambda2_T=lambda2*T
I1=0.101 #Fraction of Total Radiation Emitted for lower Wavelength-Temperature Product from Table 11.1
I2=0.0334 #Fraction of Total Radiation Emitted for upper Wavelength-Temperature Product from Table 11.1
dI=abs(I2-I1)
t=dI*0.68 # transmissivity
q=1100 # radiation received by car in W/sq.m
q_in=t*q # energy transmitted from the sun through the glass
Tb=311 # temperature of black body source in K
lambda1_Tb=lambda1*Tb
lambda2_Tb=lambda2*Tb
dI_b=0 # Table 11.1 gives negligibly small values of the corresponding integrals.
t_b=dI_b*0.68 # transmissivity
q_out=t_b*q
print"(a)The energy transmitted from the sun through the glass is ",round(q_in,1),"W/sq.m"
print"(b)the rate at which radiant energy from the car interior is transmitted through the glass windshield is",q_out,"W/sq.m"