def calculate_normalisation(slab_energy, slab_cations, bulk, area):
    """Normalises the slab energy relative to the bulk material.
    Thus allowing the different slab calculations to be compared.

    .. math::
        Energy = \\frac{1}{2A} \\Bigg( E_{MO}^{slab} -
        \\frac{nCat_{slab}}{nCat_{Bulk}} E_{MO}^{Bulk} \\Bigg)

    where Energy is the slab energy normalised to the
    bulk, :math:`E_{MO}^{slab}` is the DFT slab energy, :math:`nCat_{slab}`
     is the number of slab cations, :math:`nCat_{Bulk}` is the number of bulk
    cations, :math:`E_{MO}^{Bulk}` is the DFT bulk energy A is the surface
    area.

    Parameters
    ----------
    slab_energy : float
        Energy of the slab from DFT
    slab_cations : int
        Total number of cations in the slab
    bulk : dictionary
        Dictionary of bulk properties
    area : float
        Surface area

    Returns
    -------
    float:
        Constant normalising the slab energy to the bulk energy.
    """
    return (slab_energy - slab_cations / bulk['Cation'] * (bulk['Energy'] /
        bulk['F-Units'])) / (2 * area)
