A two-time scale simulation for dynamic analysis of power systems