I'm trying to come up with an equation to graph defocus against distance for a typical lens given aperture, focal length, etc.

The thing that is giving me problems is working out how to combine the effects of diffraction and depth of field. Obviously diffraction doesn't just 'stop' once you get to a certain defocus based on depth of field and so you have to combine the two.

Now using MTF is the best way of combining the two but I don't want to jump in that deep immediately.

My current method of combining the two is using 1/(1/R + 1/R) using the circle of confusion but some of the articles I've read suggest a root mean square approach.

Any ideas which may be right?

Tim