A computer-implemented method and system for modeling and predicting failure of a power grid configuration