### The right size pipe for falling water

There are a lot of engineering calculators out there and when the problem I'm dealing with isn't a simple product of units (for which I use wolfram alpha) I make good use of them. However, I recently came across a problem for which I struggled to calculate an answer and for which I struggled to find calculators. Given a reservoir of height h how thick a pipe is required to extract P power. The energy in the water is a simple calculation that comes from mgh (mass times acceleration due to gravity (9.81m/s^2) times the height the mass is raised). However, we don't want to take the whole reservoir we simply want to power something. Water through a pipe travels as a result of pressure differences between the ends of the pipe. Water pressure at a depth is independent of the total volume of water and is the same at the sides of a given depth as it is forcing downwards. This can be calculated by working out the weight of the water atop an area at a depth. The wight of a volume of