An apparatus comprising: an electrical power system simulator configured to generate impedance data from an electrical power system simulation model of an electrical power system comprising source elements and load elements, wherein the impedance data identifies an impedance of the electrical power system; wherein the electrical power system is characterized by a line frequency at an interface between the source elements and the load elements; wherein the electrical power system simulator is configured to inject, at the interface as a series voltage or a shunt current, perturbation signals at a plurality of perturbation frequencies in the electrical power system simulation model; wherein the plurality of perturbation frequencies are based on a selection of a plurality of initial perturbation frequencies; wherein the electrical power system simulator is configured to use a Fast Fourier transform to generate the impedance data, wherein the Fast Fourier transform is calculated over a window of time; wherein the plurality of perturbation frequencies are selected such that the line frequency and the plurality of perturbation frequencies are integer multiples of a frequency of the window; wherein the plurality of perturbation frequencies are selected by iteratively: identifying overlapping perturbation frequencies by checking if the sum of a first perturbation frequency and a second perturbation frequency of the plurality perturbation frequencies is a multiple of the line frequency; and adjusting the first perturbation frequency; and a stability analyzer in communication with the electrical power system simulator and configured to characterize a stability profile of the electrical power system as a function of the impedance data, wherein the stability profile identifies the source elements and the load elements to control power generation by the electrical power system to optimize stability of the electrical power system. an electrical power system simulator configured to generate impedance data from an electrical power system simulation model of an electrical power system comprising source elements and load elements, wherein the impedance data identifies an impedance of the electrical power system; wherein the electrical power system is characterized by a line frequency at an interface between the source elements and the load elements; wherein the electrical power system simulator is configured to inject, at the interface as a series voltage or a shunt current, perturbation signals at a plurality of perturbation frequencies in the electrical power system simulation model; wherein the plurality of perturbation frequencies are based on a selection of a plurality of initial perturbation frequencies; wherein the electrical power system simulator is configured to use a Fast Fourier transform to generate the impedance data, wherein the Fast Fourier transform is calculated over a window of time; wherein the plurality of perturbation frequencies are selected such that the line frequency and the plurality of perturbation frequencies are integer multiples of a frequency of the window; wherein the plurality of perturbation frequencies are selected by iteratively: identifying overlapping perturbation frequencies by checking if the sum of a first perturbation frequency and a second perturbation frequency of the plurality perturbation frequencies is a multiple of the line frequency; and adjusting the first perturbation frequency; and identifying overlapping perturbation frequencies by checking if the sum of a first perturbation frequency and a second perturbation frequency of the plurality perturbation frequencies is a multiple of the line frequency; and adjusting the first perturbation frequency; and a stability analyzer in communication with the electrical power system simulator and configured to characterize a stability profile of the electrical power system as a function of the impedance data, wherein the stability profile identifies the source elements and the load elements to control power generation by the electrical power system to optimize stability of the electrical power system.