nts can be used to demonstrate[@golub_UCN_book; @pendlebury94] that a population of trapped UCN each of energy $\epsilon$ has a density distribution with height $h$ of the form $$\label{eqn:height_dist}
n(h) = \left(1-\frac{h}{\epsilon}\right)^{1/2}n(0).$$ Integration and inversion of this function shows that the height distribution of such UCN within a storage cell of height $H$ may be generated from numbers $X$ distributed uniformly between 0 and 1 via the equation $$\label{eqn:h_generator}
h = \epsilon\left[1-\left(1-kX\right)^{2/3}\right].$$ The constant $k=1$ when $\epsilon<H$, and $k=1-\left(1-H/\epsilon\right)^{3/2}$ otherwise. We note that the average height of the UCN within this population is $$\label{eqn:average_height}
\left<h\right> = -\frac{\epsilon}{k}\left[0.6-k-0.6\left(1-k\right)^{5/3}\right].$$

UCN may be generated by capturing the very low-energy tail of the Maxwell-Boltzmann distribution within a thermal source, or else by downscattering from e.g. liquid helium in a superthermal source. In either case, the energy distribution tends to be close to $$\label{eqn:energy_distn}
n(\epsilon)d\epsilon \propto \epsilon^{1/2}d\epsilon.$$ By the time the UCN are stored, this distribution can change: for example, allowing the UCN to fall under gravity will shift the entire energy distribution upwards; or passage through a polarising foil can remove those of low energy. The top of the energy distribution tends to have a fairly sharp cut-off, corresponding to the Fermi potential of the storage vessel. In the case of RT-nEDM, the UCN rose under gravity after passage through a polarising foil, and the bottom of the storage cell was positioned such that those with just enough energy to pass through the foil would also have just enough energy to reach the cell. Here, therefore, the energy distribution is modelled with the simple function of \[eqn:energy\_distn\], using the 93 cm equivalent height Fermi potential of the quartz walls of the vessel as the cutoff energy. As above, integration and inversion yield