4

I was reading Wikipedia article about Planck's Law and I wanted to make the same graph as here. I took this equation $$ B(\nu,T)=\frac{2h\nu^3}{c^2}\frac{1}{e^{\frac{h\nu}{kT}}-1}$$

but I got different graphs. Maximum is shifted. For example, in Wikipedia maximum for 5000K is around 0.5-0.6$\mu m$, but I got maximum for 5000K at 1$\mu m$. My graph is below: enter image description here I used this Wolfram Mathematic program below to build this graph.

kV = 1.380649*10^(-23);
hV = 6.62607015*10^(-34);
cV = 299792458;
f[l_] = cV/l/10^(-6);(*Convert Wave Length to Frequency*)
Bf[f_, T_] = 2*hV*f^3/cV^2*1/(Exp[(hV*f)/(kV*T)] - 1);

Plot[{Bf[f[l], 5000], Bf[f[l], 4000], Bf[f[l], 3000]}, {l, 0.3, 2}, PlotStyle -> {Blue, Green, Red}, PlotLegends -> {"5000K", "4000K", "3000K"}, ImageSize -> 800]

My question is what am I doing wrong and why I am getting a different maximum?

UPDATE 1.

I removed $\mu m$ conversion to have everything in the same SI units.

Graph and program below. enter image description here

kV = 1.380649*10^(-23);
hV = 6.62607015*10^(-34);
cV = 299792458;
f[l_] = cV/l;
Bf[f_, T_] = 2*hV*f^3/cV^2*1/(Exp[(hV*f)/(kV*T)] - 1)

Plot[{Bf[f[l], 5000], Bf[f[l], 4000], Bf[f[l], 3000]}, {l, 0.310^(-6), 210^(-6)}, PlotStyle -> {Blue, Green, Red}, PlotLegends -> {"5000K", "4000K", "3000K"}, ImageSize -> 800]

Charlie
  • 6,955
Zlelik
  • 778
  • I think this is not really the place for this question, but I think you multiply by 10^6 in your f[l] function because you want to get into microns as your length unit, but you don't do the same for your other constants, so there's a unit mismatch. Boltzmann's constant and Planck's constant will be different by some orders of magnitude. – flevinBombastus May 21 '21 at 20:39
  • @flevinBombastus If I remove microns results is the same. See UPDATE 1. – Zlelik May 21 '21 at 20:42
  • Possible duplicates: https://physics.stackexchange.com/q/91192/2451 , https://physics.stackexchange.com/q/13611/2451 and links therein. – Qmechanic May 21 '21 at 21:09

2 Answers2

6

Ah you got caught by something subtle! Planck's law gives a probability density function in terms of the frequency $B(\nu,T)$. To convert to the probability density function in terms of $\lambda$ (let's call it $\tilde{B}(\lambda,T)$), you can't just set $\nu=c/\lambda$. You need to include a Jacobian factor.

In more detail:

What remains invariant under a change in variables is the probability $dp=B(\nu,T)d\nu=\tilde{B}(\lambda,T)d\lambda$. As a result... \begin{equation} \tilde{B}(\lambda,T) = \left|\frac{d \nu}{d\lambda}\right| B(\nu,T) = \frac{c}{\lambda^2} B\left(\frac{c}{\lambda},T\right) \end{equation} I bet if you include the $c/\lambda^2$ factor in your plot, you will get the same result as wikipedia. Let me know how it goes!

Andrew
  • 48,573
5

You are comparing the spectral radiance in frequency $B(f,T)$ with the spectral radiance in wavelength $B(\lambda,T)$. Because these are differential distributions, you cannot simply replace $f=c/\lambda$ to go from one to another. You must take into account the Jacobian of transformation.

$$d\Omega=B(f,T)df = B(\lambda,T)d\lambda$$

$$\begin{align} \implies B(\lambda,T)&=\overset{\color{red}{[1]}}{-}B(f(\lambda),T)\frac{df}{d\lambda}\\ &=+\frac{c}{\lambda^2}B(f(\lambda),T)\\ &=+\frac{f^2}{c}B(f(\lambda),T) \end{align}$$

If you change that definition it should work fine.

Edit: The $\color{red}{[1]}$ marker above is in reference to @rob's comment, which is a minus sign I forgot to write. One must take into account limits of integration in the above relation between $B(\lambda,T)$ and $B(f,T)$. If $f_1<f_2$, then $\lambda_1>\lambda_2$, and therefore:

$$\begin{align} \int_{\lambda_2}^{\lambda_1} B(\lambda,T)d\lambda &= \int_{f_1}^{f_2} B(f,T)df\\ &=\int_{\lambda(f_1)=\lambda_1}^{\lambda(f_2)=\lambda_2} B(f(\lambda),T) \frac{df}{d\lambda}\,d\lambda \\ &=\int_{\lambda_2}^{\lambda_1} -B(f(\lambda),T) \frac{df}{d\lambda}\,d\lambda \\ &\\ & \implies \boxed{B(\lambda,T)=-B(f(\lambda),T)\frac{df}{d\lambda}} \end{align} $$

  • 3
    Because it took me too long to figure it out on my own fifteen years ago, I’ll mention it here: the meaning of the negative sign is not that the distribution $B$ goes negative, but that a small increase in frequency $df$ corresponds to a small decrease in wavelength $d\lambda$. It’s all about keeping the integral the same, down to the order of the limits of integration. – rob May 21 '21 at 20:56
  • Just to add to @rob's comment -- you will find different conventions used often without explanation. To keep the order of the limits of integration the same, indeed you need the minus sign. However, sometimes people implicitly require that the limits of integration are always increasing, even if that means the sense of the measure changes sign, in which case you will see the Jacobian transformation rule written with an absolute value sign. It's just a different convention for the same (subtle!) point. – Andrew May 21 '21 at 21:09
  • @rob I've addressed the concern in my answer with an edit. It was a silly mistake that I didn't even catch! – Arturo don Juan May 21 '21 at 21:14
  • 1
    Thanks a lot. Now it works fine. I just needed to read half a page more in Wikipedia and there is a proper formula for wave length there $\Large B(\lambda,T)=\frac{2hc^2}{\lambda^5}\frac{1}{e^{\frac{hc}{\lambda kT}}-1}$ – Zlelik May 22 '21 at 20:08
  • The only question is if Sun is green (500 nm for 5778K) or infrared ($3.4\times10^{14}Hz$ or 883 nm for 5778K) :) – Zlelik May 22 '21 at 20:45
  • Actually the answer is clear from here https://physics.stackexchange.com/questions/91192/the-strange-thing-about-the-maximum-in-plancks-law – Zlelik May 22 '21 at 20:46
  • @Zlelik the lesson learned here is actually quite valuable. The same logic applies when trying to express any probability/differential density function in one variable (e.g. $\rho(x)$), to the same density function but in another variable (e.g. $\rho (y)$). It's not as simple as saying $\rho(y)=\rho(y(x))$. One must also take into account the integration measure, and region of integration. This shows up in statistics a lot. – Arturo don Juan May 22 '21 at 22:12