When there is a math somewhere, i would love to know it. For now and for me at least, its a lot of experimenting. After some time you will get a idea and know what and where to add.
The problem with the most render software is, that you see the full result only after the render. The light is calculated in the render progress. In the setup and posing, its possible that it looks perfect, but in the final render it can be totally screwed.