Stability constrained optimal rescheduling of generation