Harmony
HARMONic stabilitY assessment of PE-penetrated power systems
Loading...
Searching...
No Matches
StabilityEstimate Class Reference

Performs impedance-based stability assessment of network areas. More...

#include <Stability_estimate.h>

Public Member Functions

 StabilityEstimate ()=default
 Default constructor.
 
 ~StabilityEstimate ()=default
 Default destructor.
 
void add_areas (Network *net)
 Populates AC/DC area maps from the network hierarchy.
 
MatrixXcd compute_equivalent_admittance_parameters_num (SubNetwork *subnet, double frequency)
 Computes numeric equivalent admittance parameters for a subnetwork.
 
MatrixXcd compute_closing_impedance (SubNetwork *, string &, MatrixXcd &, MatrixXcd &)
 Computes the visible impedance when other subnetwork outputs are shorted.
 
MatrixXcd compute_transfer_function (string converter_name, string location, double frequency)
 Evaluates a converter transfer function at a single frequency.
 
void writeFileTF (string converter_name, string location, double start_frequency, double end_frequency, int number_of_points)
 Writes transfer function data to a file over a frequency sweep.
 
void bodeplotTF (string converter_name, string location, double start_frequency, double end_frequency, int number_of_points)
 Plots the transfer function as a Bode diagram over a frequency sweep.
 
void nyquistplotTF (string converter_name, string location, double start_frequency, double end_frequency, int number_of_points)
 Plots the transfer function as a Nyquist diagram over a frequency sweep.
 
void print_summary () const
 Prints a summary of identified AC/DC areas and converters.
 
std::unordered_map< std::string, SubNetwork * > & get_ac_grids ()
 Returns the map of AC grid subnetworks by name.
 
std::unordered_map< std::string, SubNetwork * > & get_dc_grids ()
 Returns the map of DC grid subnetworks by name.
 

Detailed Description

Performs impedance-based stability assessment of network areas.

Partitions a Network into AC grids, DC grids, and converter subnetworks, then evaluates equivalent admittance parameters and transfer functions at specified frequencies for stability margin analysis.

Constructor & Destructor Documentation

◆ StabilityEstimate()

StabilityEstimate::StabilityEstimate ( )
default

Default constructor.

◆ ~StabilityEstimate()

StabilityEstimate::~StabilityEstimate ( )
default

Default destructor.

Member Function Documentation

◆ add_areas()

void StabilityEstimate::add_areas ( Network net)

Populates AC/DC area maps from the network hierarchy.

Parameters
netNetwork whose area decomposition is used.

References Network::add_areas(), Network::get_ac_grid_names(), Network::get_ac_grids(), Network::get_converters(), Network::get_dc_grid_names(), Network::get_dc_grids(), and Network::is_area_empty().

Referenced by example_stability_check().

◆ bodeplotTF()

void StabilityEstimate::bodeplotTF ( string  converter_name,
string  location,
double  start_frequency,
double  end_frequency,
int  number_of_points 
)

Plots the transfer function as a Bode diagram over a frequency sweep.

Generates data and triggers a Bode plot for the Y-parameter matrix.

Parameters
converter_nameName of the converter element.
locationOutput port or bus identifier.
start_frequencySweep start frequency in Hz.
end_frequencySweep end frequency in Hz.
number_of_pointsNumber of frequency points.
start_frequencyThe starting frequency for the plot.
end_frequencyThe ending frequency for the plot.
number_of_pointsThe number of points to plot across the frequency range.

References bode_plot_implot(), compute_transfer_function(), and j.

Referenced by example_stability_check().

◆ compute_closing_impedance()

MatrixXcd StabilityEstimate::compute_closing_impedance ( SubNetwork sub,
string &  bus_name,
MatrixXcd &  Y_parameters,
MatrixXcd &  Y_closing 
)

Computes the visible impedance when other subnetwork outputs are shorted.

Computes the equivalent closing impedance for a subnetwork port.

Parameters
subnetSubnetwork under test.
locationOutput port identifier (modified in place if needed).
Y_paramAdmittance matrix of the subnetwork.
Z_paramImpedance matrix of the subnetwork.
Returns
Closing impedance seen at location.

This function calculates the equivalent impedance seen from a specific output port (connection_name) of a subnetwork, considering the loading effects of other connected converters represented by Z_closing.

Parameters
subPointer to the SubNetwork object.
connection_nameThe name of the output port for which to compute the impedance.
Y_parametersThe multi-port admittance matrix of the subnetwork.
Z_closingThe closing impedance matrix representing loads at other ports.
Returns
An Eigen::MatrixXcd representing the equivalent closing impedance.
Exceptions
std::runtime_errorif the connection_name is not found in the subnetwork's outputs.

References SubNetwork::getOutputs().

Referenced by compute_transfer_function().

◆ compute_equivalent_admittance_parameters_num()

MatrixXcd StabilityEstimate::compute_equivalent_admittance_parameters_num ( SubNetwork subnet,
double  frequency 
)

Computes numeric equivalent admittance parameters for a subnetwork.

Computes the numerical equivalent multi-port admittance parameters for a subnetwork.

Parameters
subnetSubnetwork whose Y-parameters are evaluated.
frequencyEvaluation frequency in Hz.
Returns
Complex admittance matrix at frequency.
Parameters
subnetPointer to the SubNetwork object.
frequencyThe frequency in Hz for the calculation.
Returns
An Eigen::MatrixXcd containing the computed Y-parameter matrix for the subnetwork's output ports.
Exceptions
std::invalid_argumentif the subnet pointer is null or the subnetwork name is invalid.

References Network::getBuses(), SubNetwork::getName(), SubNetwork::getOutputs(), SubNetwork::getTransformation(), Bus::isGround(), and j.

Referenced by compute_transfer_function().

◆ compute_transfer_function()

MatrixXcd StabilityEstimate::compute_transfer_function ( string  converter_name,
string  location,
double  frequency 
)

Evaluates a converter transfer function at a single frequency.

Computes the transfer function for stability analysis of a specific converter.

Parameters
converter_nameName of the converter element.
locationOutput port or bus identifier.
frequencyEvaluation frequency in Hz.
Returns
Complex transfer function value.
Parameters
converter_nameThe name of the converter under analysis.
locationThe side of the converter from which the analysis is performed (e.g., "AC1" or "DC1").
frequencyThe frequency in Hz for the calculation.
Returns
An Eigen::MatrixXcd representing the resulting transfer function matrix.

References compute_closing_impedance(), compute_equivalent_admittance_parameters_num(), Element::compute_y_parameters(), Converter::getACarea(), Bus::getBusLocation(), Bus::getBusName(), Element::getConnections(), Converter::getDCarea(), and vectorToMatrix().

Referenced by bodeplotTF(), example_stability_check(), nyquistplotTF(), and writeFileTF().

◆ get_ac_grids()

std::unordered_map< std::string, SubNetwork * > & StabilityEstimate::get_ac_grids ( )
inline

Returns the map of AC grid subnetworks by name.

Returns
Reference to the AC grids map.

◆ get_dc_grids()

std::unordered_map< std::string, SubNetwork * > & StabilityEstimate::get_dc_grids ( )
inline

Returns the map of DC grid subnetworks by name.

Returns
Reference to the DC grids map.

◆ nyquistplotTF()

void StabilityEstimate::nyquistplotTF ( string  converter_name,
string  location,
double  start_frequency,
double  end_frequency,
int  number_of_points 
)

Plots the transfer function as a Nyquist diagram over a frequency sweep.

Generates data and triggers a Nyquist plot for the Y-parameter matrix.

Parameters
converter_nameName of the converter element.
locationOutput port or bus identifier.
start_frequencySweep start frequency in Hz.
end_frequencySweep end frequency in Hz.
number_of_pointsNumber of frequency points.
start_frequencyThe starting frequency for the plot.
end_frequencyThe ending frequency for the plot.
number_of_pointsThe number of points to plot across the frequency range.

References compute_transfer_function(), j, and nyquist_plot_implot().

Referenced by example_stability_check().

◆ print_summary()

void StabilityEstimate::print_summary ( ) const

Prints a summary of identified AC/DC areas and converters.

◆ writeFileTF()

void StabilityEstimate::writeFileTF ( string  converter_name,
string  location,
double  start_frequency,
double  end_frequency,
int  number_of_points 
)

Writes transfer function data to a file over a frequency sweep.

Writes the Y-parameter matrix to a CSV file over a specified frequency range.

Parameters
converter_nameName of the converter element.
locationOutput port or bus identifier.
start_frequencySweep start frequency in Hz.
end_frequencySweep end frequency in Hz.
number_of_pointsNumber of logarithmically spaced frequency points.
start_frequencyThe starting frequency for the sweep.
end_frequencyThe ending frequency for the sweep.
number_of_pointsThe number of frequency points to compute and write.

References compute_transfer_function(), and j.


The documentation for this class was generated from the following files: