Integration questions
The Stefan-Boltzmann constant
The quantum theory of modern physics was born with Planck’s law. Up until this point, an outstanding problem in physics was the ultra-violet catastrophe, a prediction from classical physics that a black body at thermal equilibrium would emit an unbounded quantity of energy as wavelength decreased into the ultraviolet range. This was in stark contrast to what was being measured experimentally. To resolve this, Planck assumed that electromagnetic radiation can only be absorbed or emitted in discrete packets (quanta) and from this derived Planck’s law.
Planck’s law tells us that in the angular frequency interval \(\omega\) to \(\omega+\mathrm{d}\omega\), a black-body at temperature \(T\) radiates electromagnetically an amount of thermal energy per second and per unit area (\(W\)) according to \(W = I(\omega)\mathrm{d}\omega\), where
\[I(\omega) = \frac{\hbar}{4\pi^2\mathrm{c}^2}\frac{\omega^3}{(\mathrm{e}^{\frac{\hbar\omega}{k_\mathrm{B}T}}-1)}.\]
Einstein later postulated that the discrete quanta are real, physical particles (photons) and used this to explain the photoelectric effect. This research resulted in Einstein receiving the Nobel prize for physics in 1921.
By substituting \(x = \frac{\hbar\omega}{k_\mathrm{B}T}\) we can deduce that the total rate of energy radiation by a black body per unit area, over all frequencies, is
\[W = \frac{k_\mathrm{B}^4T^4}{4\pi^2\mathrm{c}^2\hbar^3}\int_0^\infty\frac{x^3}{(\mathrm{e}^x-1)}\mathrm{d}x.\]
This makes Planck’s law in agreement with experimental results and the Stefan-Boltzmann law, which states:
\[W = \sigma T^4\]
where \(\sigma\) is the Stefan-Boltzmann constant and \(W\) is the total energy radiated per unit surface area per unit time.
We will approximate the exact expression, an integral from 0 to \(\infty\), using an integral with finite limits. Plot the integrand as a function of \(x\) to justify your choice of limits.
Use the rectangular slice method to evaluate the integral in the expression for \(W\)
Use your value for the integral above to compute a value for the Stefan-Boltzmann constant to three significant figures. Check your result against the known value (available in the
scipy.constants
library).Show that the error of your estimate scales linearly with the width \(h\) of the rectangular slices used to approximate the integral.
Volume of a sphere
We have seen that performing an integral over one variable requires us to take samples across a one-dimensional grid. Similarly, integration over two variables requires us to take samples on a two-dimensional grid, and so on. The number of grid points required scales exponentially with the number of variables, so that integrals over three or more dimensions can quickly become unmanageable. In this case, Monte Carlo integration can be very useful.
The volume of a sphere with unit radius in three dimensions is given by:
\[V = \int\int\int_{-1}^1f(x,y,z)\mathrm{d}x\mathrm{d}y\mathrm{d}z\]
where \(f(x,y,z)=1\) everywhere inside the sphere and zero everywhere outside.
Use Monte Carlo integration to estimate the volume of this sphere using 100 random points.
Increase the number of random points until you reach an estimate that is exact to three significant figures.
By considering how many points would need to be sampled, estimate the length of time it would take to reach the same level of accuracy using a Riemann slice type method.
The Stefan-Boltzmann constant re-visited
In the Riemann sums tutorial question we use rectangular slices to estimate the Stefan-Boltzmann constant to three significant figures. The trapezoidal rule is a neat extension to rectangular slices, where the value at the start and end of each segment is considered. It can be expressed as
\[\int^b_af(x)\mathrm{d}x = h\left[\frac{1}{2}f(a)+\frac{1}{2}f(b)+\sum_{k=1}^{N-1}f(a+kh)\right]\]
Use the trapezoidal rule to re-calculate the Stefan-Boltzmann constant to three significant figures
Demonstrate that the error scales quadratically with \(h^2\), and that the trapezoidal rule is more computationally efficient than using rectangular slices
The error \(\epsilon_n\) on the nth estimate of an integral is given by \(\epsilon_n = \frac{1}{3}(I_n-I_{n-1})\). Using this expression, write a programme that calculates the Stefan-Boltzmann with a maximum absolute error of 1E-5.