Evaluates the objective function, gradient and Hessian for OPF.

def _costfcn(self, x):
        """ Evaluates the objective function, gradient and Hessian for OPF.
        """
        f = self._f(x)
        df = self._df(x)
        d2f = self._d2f(x)

        return f, df, d2f