55. Assignment 6 solution#
Upload a pdf and a notebook for the following problems:
55.1. Q1 Planck wavenumber#
Planck’s law as a function of wavelength:
Use change of variables to rewrite (46.1) in terms of wavenumber \(\tilde{\nu} = 1/\lambda\) and show that it is:
55.1.1. Q1 solution#
We want to change variables for the definite integral:
where \(\lambda = 1/\tilde{\nu}\). We know that the two integrals are equal because they have to integrate to the same flux in \(W\,m^{-2}\).
First, make the substitution in \(B_\lambda\):
Now add \(d\tilde{\nu}\) given that:
So the integral become:
To get rid of the minus sign, recognize that if \(d\lambda > 0\), then \(d\tilde{\nu} < 0\) since \(\tilde{\nu_1} > \tilde{\nu_2}\) which means that we flip the limits of integration to proceed in a positive \(\tilde{\nu}\) direction and the integral is:
55.2. Q2 Stefan-Boltzman#
Integrate
to find the Stefan-Boltzman equation given that
i.e. show that:
where
55.2.1. Q2 Answer#
Make the following substitution:
so:
55.3. Q3 Wien’s law#
Show that the maximum value for
occurs at:
55.3.1. Q3 Answer#
As shown below, we are working with parameters for which \(e^u\), where \(u=h c /\left(\lambda k_B T\right ) \approx e^5 \approx 150 \gg 1\) so it’s safe to write:
We want to find \(\lambda_{max}\) the wavelength at which \(\frac{dB}{d\lambda} = 0\).
Use the chain rule on (55.6):
Simplify:
import numpy as np
#
#
#
#
# From the Planck notebook
#
c=2.99792458e+08 #m/s -- speed of light in vacuum
h=6.62606876e-34 #J s -- Planck's constant
kb=1.3806503e-23 # J/K -- Boltzman's constant
#
# Try T = 5800 K and the_lambda = 5.e-7 m (solar radiation, green light
#
T = 5800
the_lambda = 5.e-7
u = h*c/(the_lambda*kb*T)
print(f"shortwave {u=:8.2f}")
#
# Try T = 300 K and the_lambda = 10.e-6 m (earth radiation, longwave
#
T = 300
the_lambda = 10.e-6
u = h*c/(the_lambda*kb*T)
print(f"longwave {u=:8.2f}")
print(f"{np.exp(5)=:.1f}")
shortwave u= 4.96
longwave u= 4.80
np.exp(5)=148.4
55.4. Q4 Radar Rainrate#
55.4.1. Analytic#
Integrate \(Z=\int D^6 n(D) dD\) on paper, assuming a Marshall Palmer size distribution and show that it integrates to:
with Z in \(mm^6\,m^{-3}\) and RR in mm/hr. It’s helpful to know that:
55.4.2. Q4 Analytic Answer#
with \(n_0=8000\) in units of \(m^{-3}\,mm^{-1}\), D in mm, so that \(\Lambda=4.1 RR^{-0.21}\) has to have units of \(mm^{-1}\).
If we use this to integrate:
and use the hint that
with n=6, a=\(\Lambda\) we get:
with units of \(m^{-3}\,mm^{-1}/(mm^{-1})^7=mm^6\,m^{-3}\) as required. Since \(n_0=8000\,m^{-3}\,mm^{-1}\) and 6!=720, the numerical coeficient is \(8000x720/(4.1**7)=295.75\) and \((RR^{-0.21})^{-7} = RR^{1.47}\) so the final form is:
55.5. Q5 Radar Rainrate Python#
Repeat using numerical integration in python (i.e. np.diff and np.sum) and show that the result agrees.
import numpy as np
from matplotlib import pyplot as plt
#
# Marshall Palmer distribution
#
def calc_num_dist(Dvals,RR,n0=8000):
the_dist = n0*np.exp(-4.1*RR**(-0.21)*Dvals)
return the_dist
Dvals = np.linspace(0.01,5,1000)
dD = np.diff(Dvals)
#
# need the midpoint diameters for the rectangular integration
#
Dmid = (Dvals[1:] + Dvals[0:-1])/2.
#
# loop over 100 rain rates
#
RRvals = np.linspace(0.1,5,100)
#
# Brute force integration
#
Zvals = []
for the_RR in RRvals:
num_dist = calc_num_dist(Dvals,the_RR)
bin_heights = (num_dist[1:] + num_dist[0:-1])/2.
theZ = np.sum(Dmid**6.*bin_heights*dD)
Zvals.append(theZ)
fig, ax = plt.subplots(1,1)
ax.plot(RRvals,Zvals,'ro',alpha=0.4,label='numeric')
Z_math = 296*RRvals**1.47
ax.plot(RRvals,Z_math,'bx',label="math")
ax.set(xlabel="RR (mm/hour)",ylabel="Z mm^6/m^3")
ax.grid(True)
ax.legend(loc='best');