% Extension of example 3.4 in Espinola (page 62)
% L. Strow, 9/11/94

t_sun=5800;
r_earth=6.37E6;
r_sun=6.95E8;
l_earth_sun=1.5E11;
sigma=5.67E-8;

% Stefan-Boltzmann law gives total power emitted by the sun by just
% multiplying by surface area of the sun

total_sun=sigma*(t_sun)^4*4*pi*(r_sun)^2;

% pi*r_earth^2/(4*pi*l_earth_sun^2) is that fraction of the 4 pi steradians
% of sun-emitted radiation that the earth absorbs

total_sun_hits_earth=total_sun*pi*r_earth^2/(4*pi*l_earth_sun^2);

% total_sun_hits_earth must 
% equal what the earth emits under equilibrium conditions
%  
% total_earth_emit=sigma*(t_earth)^4*4*pi*(r_earth)^2;
%
% Equate these two and solve for t_earth

t_earth_4th=total_sun_hits_earth/(sigma*4*pi*r_earth^2);
t_earth=(t_earth_4th)^(0.25)

%  If we do the math analytically, we get

t_earth_easy=t_sun*sqrt(0.5*r_sun/l_earth_sun)