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