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

Abstract power converter with ABCD matrices, controllers, and filters. More...

#include <Converter.h>

Inheritance diagram for Converter:
Collaboration diagram for Converter:

Public Member Functions

 Converter (const std::string &symbol, const std::string &location)
 Construct a three-phase, two-terminal converter element.
 
virtual ~Converter ()
 
Eigen::MatrixXd getA () const
 
Eigen::MatrixXd getB () const
 
Eigen::MatrixXd getC () const
 
Eigen::MatrixXd getD () const
 
Eigen::MatrixXd getAd () const
 
Eigen::MatrixXd getBd () const
 
Eigen::MatrixXd getCd () const
 
Eigen::MatrixXd getDd () const
 
Eigen::VectorXd getEquilibriumState () const
 
VectorXcd getEigenvalues ()
 
VectorXcd getEigenvectors ()
 
string getACarea () const
 
string getDCarea () const
 
virtual void solveEquilibrium ()
 
virtual void computeABCD ()
 
virtual void discretize (double Ts)
 
virtual Eigen::MatrixXd computeStateDerivatives (const Eigen::VectorXd &x, const Eigen::VectorXd &u)
 
void computeEigenvalues ()
 
Eigen::MatrixXd computeParticipationFactors (const Eigen::MatrixXd &A_matrix)
 
virtual vector< MatrixXcd > simulateTimeStep (const vector< MatrixXcd > &input, double Ts, int nKeep1, int nKeep2)
 
void checkStability () const
 Check system stability by evaluating eigenvalues of the A matrix.
 
void printEigenvalues () const
 Print eigenvalues of the A matrix.
 
virtual void plotEigenvalues () override
 Plot eigenvalues in the complex plane.
 
virtual void plotParticipationFactors () override
 Plot participation factors (override in state-space elements).
 
- Public Member Functions inherited from Element
 Element (const std::string &symbol, const std::string &location, int inputPins, int outputPins)
 Construct an element with symbol, location, and pin counts.
 
virtual ~Element ()
 Virtual destructor for derived-class cleanup.
 
int getInputPins () const
 Get the number of input pins/phases.
 
int getOutputPins () const
 Get the number of output pins/phases.
 
void setInputPins (int pins)
 Set the number of input pins/phases.
 
void setOutputPins (int pins)
 Set the number of output pins/phases.
 
void setTransformation (bool flag)
 Enable or disable coordinate transformation for this element.
 
std::string getElementSymbol () const
 Get the element type symbol.
 
std::vector< Bus * > getBuses ()
 Collect all buses connected to this element.
 
int getBusIndex (Bus *bus)
 Find the terminal index associated with a given bus.
 
BusgetOtherBus (Bus *)
 Get the bus connected at the opposite terminal from a given bus.
 
const std::map< Bus *, int > & getConnections () const
 Const access to the bus-to-terminal connection map.
 
std::map< Bus *, int > getConnections ()
 Copy of the bus-to-terminal connection map.
 
string getElementLocation () const
 Get the element's grid or partition location label.
 
void attachBus (Bus *, int)
 Attach a bus to a specific element terminal.
 
void printElementInfo () const
 Print basic element metadata (symbol, input/output pin counts).
 
virtual void printElementValues ()
 Print extended element-specific values (override in derived classes).
 
void writeFile (double start_frequency, double end_frequency, int number_of_points)
 Write Y-parameter matrix samples over a frequency sweep to a file.
 
void plotYParameters (double start_frequency, double end_frequency, int number_of_points)
 Plot Y-parameter matrix entries versus frequency.
 
virtual std::vector< std::vector< complex< double > > > compute_y_parameters (double frequency)
 Compute complex Y-parameters at a single frequency.
 
virtual DenseMatrix get_y_parameters ()
 Get the symbolic or stored Y-parameter matrix.
 
virtual std::vector< std::vector< complex< double > > > apply_transformation (std::vector< std::vector< complex< double > > > &Y1, std::vector< std::vector< complex< double > > > &Y2)
 Apply a coordinate or coupling transformation to Y-parameter blocks.
 
virtual void writeMNAmatrix (SymEngine::DenseMatrix &, std::unordered_map< Bus *, int > &, int, std::map< Element *, std::vector< RCP< const Basic > > > &)
 Stamp this element into the symbolic MNA matrix (override in derived classes).
 
virtual int getNumberOfInternalStates () const
 Number of internal state variables for dynamic elements.
 
virtual int getNumberOfPlantStates () const
 Number of plant states exposed for simulation (may differ from internal states).
 
virtual std::vector< MatrixXcd > simulateInputStep (const std::vector< MatrixXcd > &states, int nKeep) const
 Simulate a step response given input states (override in dynamic elements).
 
virtual std::vector< RCP< const Basic > > getVirtualInputSymbols () const
 Return symbolic names for virtual inputs used in stamping.
 
virtual map_basic_basic getParameterSubstitutions () const
 Return parameter substitutions for symbolic evaluation.
 
virtual void computePowerFlow (std::map< std::string, double > &branchData, std::map< std::string, double > &globalParams) const
 Compute branch power-flow quantities (override in derived classes).
 
std::map< std::string, double > getOPFInfo () const
 Get stored OPF-related metadata for this element.
 
void setOPFInfo (std::map< std::string, double > &info)
 Store OPF-related metadata for this element.
 

Protected Attributes

double omega_0
 
double P
 
double Q
 
double P_dc
 
double P_min
 
double P_max
 
double Q_min
 
double Q_max
 
double theta
 
double V_m
 
double V_dc
 
double L_reactor
 
double R_reactor
 
double t_delay
 
MatrixXd A_matrix
 
MatrixXd B_matrix
 
MatrixXd C_matrix
 
MatrixXd D_matrix
 
MatrixXd Adelay
 
MatrixXd Bdelay
 
MatrixXd Cdelay
 
MatrixXd Ddelay
 
MatrixXd Ad_matrix
 
MatrixXd Bd_matrix
 
MatrixXd Cd_matrix
 
MatrixXd Dd_matrix
 
int pade_order = 2
 
VectorXd equilibrium_state
 
VectorXcd eigenvalues
 
VectorXcd eigenvectors
 
VectorXcd initial_state
 
std::map< std::string, Controller * > controls
 
std::map< std::string, Filter * > filters
 
const std::vector< std::string > controller_list
 
const std::vector< std::string > filter_list
 
- Protected Attributes inherited from Element
bool transformation = false
 
std::string element_symbol
 
std::string element_location
 
int input_pins
 
int output_pins
 
std::map< Bus *, int > connections
 
std::map< std::string, double > element_OPF_info = {}
 
DenseMatrix Y_matrix
 

Detailed Description

Abstract power converter with ABCD matrices, controllers, and filters.

Constructor & Destructor Documentation

◆ Converter()

Converter::Converter ( const std::string &  symbol,
const std::string &  location 
)
inline

Construct a three-phase, two-terminal converter element.

Parameters
symbolElement identifier.
locationNetwork area string encoding AC and DC areas (e.g. AC1_DC1).

◆ ~Converter()

Converter::~Converter ( )
virtual

References controls, and filters.

Member Function Documentation

◆ checkStability()

void Converter::checkStability ( ) const

Check system stability by evaluating eigenvalues of the A matrix.

Computes eigenvalues of the state matrix A_matrix and reports whether the linearized system around the operating point is stable, unstable, or marginally stable. A system is considered unstable if any eigenvalue has a positive real part. The function prints a short summary to stdout.

References A_matrix.

◆ computeABCD()

virtual void Converter::computeABCD ( )
inlinevirtual

Reimplemented in MMC.

◆ computeEigenvalues()

void Converter::computeEigenvalues ( )
inline

References A_matrix, eigenvalues, and eigenvectors.

◆ computeParticipationFactors()

Eigen::MatrixXd Converter::computeParticipationFactors ( const Eigen::MatrixXd &  A_matrix)
inline

References A_matrix, j, and P.

Referenced by plotParticipationFactors().

◆ computeStateDerivatives()

virtual Eigen::MatrixXd Converter::computeStateDerivatives ( const Eigen::VectorXd &  x,
const Eigen::VectorXd &  u 
)
inlinevirtual

Reimplemented in MMC.

◆ discretize()

virtual void Converter::discretize ( double  Ts)
inlinevirtual

◆ getA()

Eigen::MatrixXd Converter::getA ( ) const
inline

References A_matrix.

Referenced by example_MMC().

◆ getACarea()

string Converter::getACarea ( ) const
inline

◆ getAd()

Eigen::MatrixXd Converter::getAd ( ) const
inline

References Ad_matrix.

◆ getB()

Eigen::MatrixXd Converter::getB ( ) const
inline

References B_matrix.

Referenced by example_MMC().

◆ getBd()

Eigen::MatrixXd Converter::getBd ( ) const
inline

References Bd_matrix.

◆ getC()

Eigen::MatrixXd Converter::getC ( ) const
inline

References C_matrix.

Referenced by example_MMC().

◆ getCd()

Eigen::MatrixXd Converter::getCd ( ) const
inline

References Cd_matrix.

◆ getD()

Eigen::MatrixXd Converter::getD ( ) const
inline

References D_matrix.

◆ getDCarea()

string Converter::getDCarea ( ) const
inline

◆ getDd()

Eigen::MatrixXd Converter::getDd ( ) const
inline

References Dd_matrix.

◆ getEigenvalues()

VectorXcd Converter::getEigenvalues ( )
inline

References eigenvalues.

◆ getEigenvectors()

VectorXcd Converter::getEigenvectors ( )
inline

References eigenvectors.

◆ getEquilibriumState()

Eigen::VectorXd Converter::getEquilibriumState ( ) const
inline

References equilibrium_state.

Referenced by example_MMC().

◆ plotEigenvalues()

void Converter::plotEigenvalues ( )
overridevirtual

Plot eigenvalues in the complex plane.

Collects eigenvalues of A_matrix and calls the helper plot_eigenvalues to render them in a graphical or saved-output form. The plot title contains the converter symbol for identification.

Reimplemented from Element.

References A_matrix, Element::element_symbol, and plot_eigenvalues_implot().

Referenced by example_MMC().

◆ plotParticipationFactors()

void Converter::plotParticipationFactors ( )
overridevirtual

Plot participation factors (override in state-space elements).

Reimplemented from Element.

References A_matrix, computeParticipationFactors(), controls, Element::element_symbol, filters, matrixToVector(), P, pade_order, plot_participation_factors_implot(), and t_delay.

Referenced by example_MMC().

◆ printEigenvalues()

void Converter::printEigenvalues ( ) const

Print eigenvalues of the A matrix.

Calculates and prints the full set of eigenvalues of A_matrix to stdout.

References A_matrix.

Referenced by example_MMC().

◆ simulateTimeStep()

virtual vector< MatrixXcd > Converter::simulateTimeStep ( const vector< MatrixXcd > &  input,
double  Ts,
int  nKeep1,
int  nKeep2 
)
inlinevirtual

◆ solveEquilibrium()

virtual void Converter::solveEquilibrium ( )
inlinevirtual

Reimplemented in MMC.

Member Data Documentation

◆ A_matrix

◆ Ad_matrix

MatrixXd Converter::Ad_matrix
protected

Referenced by discretize(), and getAd().

◆ Adelay

MatrixXd Converter::Adelay
protected

◆ B_matrix

◆ Bd_matrix

MatrixXd Converter::Bd_matrix
protected

Referenced by discretize(), and getBd().

◆ Bdelay

MatrixXd Converter::Bdelay
protected

◆ C_matrix

◆ Cd_matrix

MatrixXd Converter::Cd_matrix
protected

Referenced by discretize(), and getCd().

◆ Cdelay

MatrixXd Converter::Cdelay
protected

◆ controller_list

const std::vector<std::string> Converter::controller_list
protected
Initial value:
= {
"pll", "dc_voltage", "active_power", "ac_voltage", "reactive_power", "energy", "zcc", "occ", "ccc",
"droop"
}

Referenced by MMC::init_Controller().

◆ controls

◆ D_matrix

◆ Dd_matrix

MatrixXd Converter::Dd_matrix
protected

Referenced by discretize(), and getDd().

◆ Ddelay

MatrixXd Converter::Ddelay
protected

◆ eigenvalues

VectorXcd Converter::eigenvalues
protected

◆ eigenvectors

VectorXcd Converter::eigenvectors
protected

◆ equilibrium_state

VectorXd Converter::equilibrium_state
protected

◆ filter_list

const std::vector<std::string> Converter::filter_list
protected
Initial value:
= {
"ac_voltage_dq", "ac_voltage", "active_power", "reactive_power", "dc_voltage"
}

Referenced by MMC::init_Filter().

◆ filters

std::map<std::string, Filter*> Converter::filters
protected

◆ initial_state

VectorXcd Converter::initial_state
protected

◆ L_reactor

◆ omega_0

◆ P

◆ P_dc

◆ P_max

double Converter::P_max
protected

Referenced by MMC::MMC(), and MMC::MMC().

◆ P_min

double Converter::P_min
protected

Referenced by MMC::MMC(), and MMC::MMC().

◆ pade_order

int Converter::pade_order = 2
protected

◆ Q

◆ Q_max

double Converter::Q_max
protected

Referenced by MMC::MMC(), and MMC::MMC().

◆ Q_min

double Converter::Q_min
protected

Referenced by MMC::MMC(), and MMC::MMC().

◆ R_reactor

◆ t_delay

◆ theta

◆ V_dc

◆ V_m


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