This document describes the mathematics used in a computer program that calculates water hammer, and is very helpful for anyone interested in the field.