A generalized energy function for transient stability analysis of power systems | Synapse