Computational issue with Planck function

61 Views Asked by At

I have the following formula for a function in Fortran 90 used to find the spectral radiance at a given wavelength and temperature. I've expressed it as:

intensity = (2.0d0*h*nu**(3.0d0))/c**(2.0d0) * 1d0 / (EXP((h*nu)/(k*T))-1d0)

Where I take wavelength as an argument, which is then converted to nu. As my wavelengths tend to infinity, Fortran begins to say that the intensity is infinite, returning Inf. However, the Planck function converges to 0 as the wavelength tends to infinity. Why is this?

My theory is that perhaps, since nu = c/lambda, as lambda tends to infinity, a part of the function is divided by 0, so this tends it to infinity. However, there is also a -5 power law on wavelength as well, which is meant to overall keep the function converging at 0, but this doesn't seem to be the case by Fortran's computation. Why is this? What's going wrong? It's essentially saying zero times Inf is Inf.

For the record, I didn't think submitting blocks of my code was important here -- this is part of an exercise where this problem is meant to arise, so I know my code isn't malfunctioning.

Is this merely an issue with Fortran, or is there some other underlying mathematical reason for this?