def METHOD_NAME(self, pressure, temperature, params):
    """
    Helper function to compute volume iteratively by Brent's method using
    a function of the form pressure(volume, temperature).
    """
    def func(x):
        return self.pressure_function(x, temperature, params) - pressure
    try:
        sol = bracket(func, params["V_0"], 1.0e-2 * params["V_0"])
    except ValueError:
        raise ValueError(
            "Cannot find a volume, perhaps you are outside "
            "of the range of validity for the equation "
            "of state?"
        )
    return opt.brentq(func, sol[0], sol[1])