Modeling two-stage failure mechanism of cascading in cyber-physical power systems