|
Harmony
HARMONic stabilitY assessment of PE-penetrated power systems
|
Assembles and stores the linear state-space representation of a network. More...
#include <State_Space_Model.h>
Classes | |
| class | Tree |
| Spanning-tree node used during loop/cutset detection. More... | |
Public Member Functions | |
| StateSpaceModel ()=default | |
| Default constructor; matrices are populated by formState(). | |
| void | formState (Network *net, const std::vector< Bus * > &out, SSMMode mode=SSMMode::Standard) |
| Assembles state-space matrices from a network. | |
| const Eigen::MatrixXd & | getA () const |
| const Eigen::MatrixXd & | getB () const |
| const Eigen::MatrixXd & | getC () const |
| const Eigen::MatrixXd & | getD () const |
| const Eigen::MatrixXd & | getBRaw () const |
| SSMMode | getMode () const |
| const std::vector< InputMapping > & | getInputMap () const |
| const std::vector< StateMapping > & | getStateMap () const |
| const std::vector< OutputMapping > & | getOutputMap () const |
| const std::vector< InputGroup > & | getInputGroups () const |
| int | getInputIndex (const std::string &elementName, int pin=0) const |
| Looks up the B-matrix column index for an element input pin. | |
| int | getStateIndex (const std::string &elementName, int stateIdx=0) const |
| Looks up the A-matrix row index for an element state. | |
| MatrixXcd | buildInputVector (int nKeep, const std::map< std::string, std::vector< MatrixXcd > > &elementStates) const |
| Builds the input vector u from per-element state contributions. | |
| void | printMapping () const |
| Prints input, state, and output index mappings to stdout. | |
Static Public Member Functions | |
| static std::vector< std::vector< Bus * > > | form_cutset_nodes (const std::vector< Bus * > &, const std::vector< std::pair< Bus *, Bus * > > &) |
| Partitions buses into cutset node groups. | |
| static std::vector< std::vector< Element * > > | form_cutsets (const std::vector< std::vector< Bus * > > &, const std::map< Bus *, std::vector< Element * > > &) |
| Maps cutset node groups to the elements that form each cutset. | |
| static std::map< Bus *, std::vector< Element * > > | generateBusToElementsMap (const std::vector< Element * > &) |
| Builds a bus-to-elements adjacency map. | |
| static std::vector< std::vector< Element * > > | findLoops (const std::vector< Bus * > &, const std::map< Bus *, std::vector< Element * > > &) |
| Finds fundamental loops in the network graph. | |
Assembles and stores the linear state-space representation of a network.
Starting from the modified nodal admittance formulation, this class identifies state variables (inductor currents, capacitor voltages, converter plant states), independent sources, switches, and output buses, then constructs the A, B, C, and D matrices together with human-readable index mappings.
|
default |
Default constructor; matrices are populated by formState().
| MatrixXcd StateSpaceModel::buildInputVector | ( | int | nKeep, |
| const std::map< std::string, std::vector< MatrixXcd > > & | elementStates | ||
| ) | const |
Builds the input vector u from per-element state contributions.
In DQsym mode, rows are grouped in triplets and DC values are broadcast to all three phase rows.
| nKeep | Number of harmonic columns to retain per input group. |
| elementStates | Map from element name to its input coefficient matrices. |
References DQsym.
Referenced by DQsym::run().
|
static |
Finds fundamental loops in the network graph.
| buses | All network buses. |
| busToElements | Adjacency map from bus to incident elements. |
|
static |
Partitions buses into cutset node groups.
| buses | All network buses. |
| treeEdges | Spanning-tree edges as (parent, child) bus pairs. |
References j.
|
static |
Maps cutset node groups to the elements that form each cutset.
| cutsetNodes | Bus groups produced by form_cutset_nodes(). |
| busToElements | Adjacency map from bus to incident elements. |
| void StateSpaceModel::formState | ( | Network * | net, |
| const std::vector< Bus * > & | out, | ||
| SSMMode | mode = SSMMode::Standard |
||
| ) |
Assembles state-space matrices from a network.
| net | Network to linearize. |
| out | Output buses whose voltages form the C/D outputs. |
| mode | Column layout mode (Standard or DQsym). |
References createZeroMatrix(), DQsym, extractCoefficient(), Network::getElements(), Bus::getPinNumber(), getStateCount(), Bus::isGround(), and j.
Referenced by example_state_space(), and DQsym::run().
|
static |
Builds a bus-to-elements adjacency map.
| elements | All network elements. |
|
inline |
Referenced by example_state_space(), and DQsym::run().
|
inline |
References DQsym.
Referenced by example_state_space(), and DQsym::run().
|
inline |
|
inline |
Referenced by example_state_space().
|
inline |
References DQsym.
Referenced by example_state_space().
|
inline |
Referenced by DQsym::run().
|
inline |
Looks up the B-matrix column index for an element input pin.
| elementName | Element symbol/name. |
| pin | Pin index within the element (default 0). |
|
inline |
|
inline |
|
inline |
|
inline |
Looks up the A-matrix row index for an element state.
| elementName | Element symbol/name. |
| stateIdx | State index within the element (default 0). |
Referenced by DQsym::run().
|
inline |
| void StateSpaceModel::printMapping | ( | ) | const |
Prints input, state, and output index mappings to stdout.
References DQsym.