def richardson_extrapolate(value_1, value_2, ratio_21, p):
    """ Estimate the zero grid spacing value using richardsons extrapolation and
    two grids of reducing resolution (ie grid_1 is finest). The refinement ratio
    is needed. The order of convergence, p, is also required.
    """
    f_exact = (ratio_21 ** p * value_1 - value_2) / (ratio_21 ** p - 1.0)
    return f_exact
