Equation for heat loss over distance?
This is a heat transfer related problem. You can certainly do that. For solid medium heat transfer you need to use Fourier heat transfer equation
\[q=-k\cdot\nabla T\]
Here, k= material's conductivity and $\nabla T$ = 1st derivative of the Temp. along the driving force or heat
For Liquid and gas phase you should use law for thermal convection. And for vacuum medium you should use radiation law. There are lots of ways to do this but from your problem statement i think it's a numerical grid type problem. For your better understanding, i would suggest 'Engineering heat transfer' by william s janna (I may be biased here because i like this book) but you can certainly use any other standard heat transfer book or internet.