find volume at given pressure using brenth in scipy.optimize

    :param p: pressure in GPa
    :param v0: unit-cell volume in A^3 at 1 bar
    :param k0: bulk modulus at reference conditions
    :param k0p: pressure derivative of bulk modulus at reference conditions
    :param order: order of Kunc function
    :param min_strain: defining minimum v/v0 value to search volume for
    :return: unit-cell volume at high pressure in GPa

def kunc_v_single(p, v0, k0, k0p, order=5, min_strain=0.01):
    """
    find volume at given pressure using brenth in scipy.optimize

    :param p: pressure in GPa
    :param v0: unit-cell volume in A^3 at 1 bar
    :param k0: bulk modulus at reference conditions
    :param k0p: pressure derivative of bulk modulus at reference conditions
    :param order: order of Kunc function
    :param min_strain: defining minimum v/v0 value to search volume for
    :return: unit-cell volume at high pressure in GPa
    """
    if p <= 1.e-5:
        return v0

    def f_diff(v, v0, k0, k0p, p, order=order):
        return kunc_p(v, v0, k0, k0p, order=order) - p
    v = brenth(f_diff, v0, v0 * min_strain, args=(v0, k0, k0p, p, order))
    return v