def coefficient_of_performance(delta_T, source='air'):
    """
    COP is function of temp difference source to sink.
    The quadratic regression is based on Staffell et al. (2012)
    https://doi.org/10.1039/C2EE22653G.
    """
    if source == 'air':
        return 6.81 - 0.121 * delta_T + 0.000630 * delta_T**2
    elif source == 'soil':
        return 8.77 - 0.150 * delta_T + 0.000734 * delta_T**2
    else:
        raise NotImplementedError("'source' must be one of  ['air', 'soil']")