This page contains interactive Sage widgets - edit and re-evaluate them!
The hot filament of an incandescent bulb emits blackbody radiation according to Planck's Law.
xxxxxxxxxx
k = 1.281*(10^-23) # J/K, Boltzmann constant
h = 6.626*(10^-34) # J•s, Planck Constant
c = 3*10^8 # m/s, speed of light
var('T l'); B(T,l) = ((2*h*c**2)/(l**5))*1/(exp(h*c/(l*k*T))-1)
Temperatures = [1000,2000,3000,4000,5000]
col = rainbow(len(Temperatures)+3)
plotTitle = 'Blackbody Radiation, '+str(min(Temperatures))+'K to '+str(max(Temperatures))+'K'
g = plot([],title=plotTitle,frame=True,axes_labels=['wavelength, m','spectral radiance'])
for temps in Temperatures:
legend = str(temps) + ' K'
g += plot(B(T=temps),l,0,3*10**-6,color=col.pop(),legend_label=legend)
show(g)