Lesson 2 of 15

Blackbody Peak & Wien's Law

Blackbody Peak & Wien's Law

Stars emit radiation with a spectrum that closely follows a blackbody. The wavelength at which the spectrum peaks is inversely proportional to the surface temperature — this is Wien's displacement law:

λmax=bT\lambda_{\max} = \frac{b}{T}

where b=2.898×103b = 2.898 \times 10^{-3} m·K is Wien's displacement constant.

Stellar Colors

Star typeTT (K)λmax\lambda_{\max}Color
O-type30,000~97 nm (UV)Blue
Sun (G2)5,778~502 nmYellow-white
Red dwarf3,000~966 nm (near-IR)Red

The Sun peaks in green light — but it also emits strongly across the entire visible spectrum, which is why sunlight appears white.

Luminosity Ratio

For two stars of the same radius at temperatures T1T_1 and T2T_2, the Stefan-Boltzmann law gives:

L1L2=(T1T2)4\frac{L_1}{L_2} = \left(\frac{T_1}{T_2}\right)^4

A star at 30,000 K is over 700 times more luminous than a star of equal size at 5,778 K.

Inverse: Temperature from Peak

Given an observed peak wavelength, you can recover the temperature:

T=bλmaxT = \frac{b}{\lambda_{\max}}

This technique — spectrophotometry — is used to determine stellar temperatures from observed spectra.

Your Task

Implement three functions. All constants must be defined inside each function.

  • peak_wavelength_nm(T_K) — returns λmax\lambda_{\max} in nanometres
  • stellar_color_ratio(T1_K, T2_K) — returns L1/L2=(T1/T2)4L_1/L_2 = (T_1/T_2)^4 for equal-radius stars
  • temperature_from_peak(lambda_nm) — returns TT in Kelvin from peak wavelength in nm

Use b=2.898×103b = 2.898 \times 10^{-3} m·K.

Python runtime loading...
Loading...
Click "Run" to execute your code.