![]() |
Power System Platform
2026w34a-beta
|
Calculate the power flow (including OLTC tap adjustment). More...
#include <PowerFlow.h>


Public Member Functions | |
| PowerFlow (std::vector< Element * > elementList) | |
| virtual bool | InitPowerFlow (std::vector< BusType > &busType, std::vector< std::complex< double > > &voltage, std::vector< std::complex< double > > &power, std::vector< std::complex< double > > &loadPower, std::vector< ReactiveLimits > &reactiveLimit, double systemPowerBase=100e6, double initAngle=0.0) |
| virtual bool | RunGaussSeidel (double systemPowerBase=100e6, int maxIteration=5000, double error=1e-6, double initAngle=0.0, double accFactor=1.0) |
| virtual bool | RunNewtonRaphson (double systemPowerBase=100e6, int maxIteration=5000, double error=1e-6, double initAngle=0.0, double inertia=1.0) |
| virtual bool | RunGaussNewton (double systemPowerBase=100e6, int maxIteration=5000, double error=1e-6, double initAngle=0.0, double accFactor=1.0, double gaussTol=1e-2, double inertia=1.0) |
| virtual wxString | GetErrorMessage () |
| virtual int | GetIterations () |
| virtual void | ResetVoltages () |
Public Member Functions inherited from ElectricCalculation | |
| ElectricCalculation () | |
| Constructor. | |
| ~ElectricCalculation () | |
| Destructor. | |
| virtual void | GetElementsFromList (std::vector< Element * > elementList) |
| Separate the power elements from a generic list. | |
| virtual bool | GetYBus (std::vector< std::vector< std::complex< double > > > &yBus, double systemPowerBase, YBusSequence sequence=POSITIVE_SEQ, bool includeSyncMachines=false, bool allLoadsAsImpedances=false, bool usePowerFlowVoltagesOnImpedances=false) |
| Get the admittance matrix from the list of elements (use GetElementsFromList first). | |
| virtual bool | InvertMatrix (std::vector< std::vector< std::complex< double > > > matrix, std::vector< std::vector< std::complex< double > > > &inverse) |
| Invert a matrix. | |
| virtual void | UpdateElementsPowerFlow (std::vector< std::complex< double > > voltage, std::vector< std::complex< double > > power, std::vector< BusType > busType, std::vector< ReactiveLimits > reactiveLimit, double systemPowerBase) |
| Update the elements after the power flow calculation. | |
| void | ABCtoDQ0 (std::complex< double > complexValue, double angle, double &dValue, double &qValue) |
| Convert a complex phasor in ABC representation to DQ components. | |
| void | DQ0toABC (double dValue, double qValue, double angle, std::complex< double > &complexValue) |
| Convert DQ components to a complex phasor in ABC representation. | |
| std::vector< std::complex< double > > | GaussianElimination (std::vector< std::vector< std::complex< double > > > matrix, std::vector< std::complex< double > > array) |
| Solve a linear system using Gaussian elimination (complex version). | |
| std::vector< double > | GaussianElimination (std::vector< std::vector< double > > matrix, std::vector< double > array) |
| Solve a linear system using Gaussian elimination (real version). | |
| Machines::SyncMachineModel | GetMachineModel (SyncGenerator *generator) |
| Get the synchronous machine model used by the generator based on user-defined parameters. | |
| std::vector< std::complex< double > > | ComplexMatrixTimesVector (std::vector< std::vector< std::complex< double > > > matrix, std::vector< std::complex< double > > vector) |
| Multiply a complex matrix by a complex vector. | |
| void | GetLUDecomposition (std::vector< std::vector< std::complex< double > > > matrix, std::vector< std::vector< std::complex< double > > > &matrixL, std::vector< std::vector< std::complex< double > > > &matrixU) |
| Compute the LU decomposition of a matrix. | |
| std::vector< std::complex< double > > | LUEvaluate (std::vector< std::vector< std::complex< double > > > u, std::vector< std::vector< std::complex< double > > > l, std::vector< std::complex< double > > b) |
| Solve a linear system using LU decomposition. | |
| bool | GetParentBus (Element *childElement, Bus *&parentBus) |
| Get the parent bus of a given shunt element. | |
| bool | GetParentBus (Element *childElement, Bus *&parentBus1, Bus *&parentBus2) |
| Get the parent buses of a two-terminal element (branch). | |
| bool | CalculateEMTElementsAdmittance (const double &basePower, wxString &errorMsg) |
| Calculate the admittance of EMT elements. | |
| bool | CalculateEMTElementsPower (const double &basePower, wxString &errorMsg, bool updateCurrent=true) |
| Calculate the power of EMT elements. | |
| double | CalculateEMTPowerError (const std::vector< std::complex< double > > &voltage, std::vector< std::complex< double > > &power, const double &basePower, wxString &errorMsg) |
| Calculate the power mismatch error for EMT simulation. | |
| const std::vector< PowerElement * > | GetPowerElementList () const |
| Get the power elements of the system (use GetElementsFromList first). | |
| const std::vector< Bus * > | GetBusList () const |
| Get the buses of the system (use GetElementsFromList first). | |
| const std::vector< Capacitor * > | GetCapacitorList () const |
| Get the capacitors of the system (use GetElementsFromList first). | |
| const std::vector< IndMotor * > | GetIndMotorList () const |
| Get the induction motors of the system (use GetElementsFromList first). | |
| const std::vector< Inductor * > | GetInductorList () const |
| Get the inductors of the system (use GetElementsFromList first). | |
| const std::vector< Line * > | GetLineList () const |
| Get the lines of the system (use GetElementsFromList first). | |
| const std::vector< Load * > | GetLoadList () const |
| Get the loads of the system (use GetElementsFromList first). | |
| const std::vector< SyncGenerator * > | GetSyncGeneratorList () const |
| Get the synchronous generators of the system (use GetElementsFromList first). | |
| const std::vector< SyncMotor * > | GetSyncMotorList () const |
| Get the synchronous motors of the system (use GetElementsFromList first). | |
| const std::vector< Transformer * > | GetTransformerList () const |
| Get the transformers of the system (use GetElementsFromList first). | |
| const std::vector< HarmCurrent * > | GetHarmCurrentList () const |
| Get the harmonic current source of the system (use GetElementsFromList first). | |
| const std::vector< EMTElement * > | GetEMTElementList () const |
| Get the electromagnetic element list of the system (use GetElementsFromList first). | |
Protected Member Functions | |
| void | GetNumPVPQ (std::vector< BusType > busType, int &numPQ, int &numPV) |
| std::vector< std::vector< double > > | CalculateJacobianMatrix (const std::vector< std::complex< double > > &voltage, const std::vector< std::complex< double > > &power, const std::vector< BusType > &busType, int numPV, int numPQ) |
| bool | CheckReactiveLimits (std::vector< BusType > &busType, std::vector< ReactiveLimits > &reactiveLimit, std::vector< std::complex< double > > &power, std::vector< std::complex< double > > loadPower) |
| double | GaussSeidel (std::vector< BusType > busType, std::vector< std::complex< double > > &voltage, std::vector< std::complex< double > > oldVoltage, std::vector< std::complex< double > > &power, double accFactor) |
| void | NewtonRaphson (std::vector< BusType > busType, std::vector< std::complex< double > > &voltage, std::vector< std::complex< double > > power, int numPV, int numPQ, std::vector< double > dPdQ, double inertia) |
| bool | CalculateMotorsReactivePower (std::vector< std::complex< double > > voltage, std::vector< std::complex< double > > &power) |
| bool | HasInvalidValue (const std::vector< std::complex< double > > &voltage) |
| bool | AdjustTapChangers (const std::vector< std::complex< double > > &voltage, double systemPowerBase) |
Protected Member Functions inherited from ElectricCalculation | |
| void | GetNextConnection (const unsigned int &checkBusNumber, const std::vector< std::vector< std::complex< double > > > &yBus, std::vector< bool > &connToSlack) |
| Recursively check if a bus is electrically connected to the slack bus. | |
| void | DistributeReactivePower (std::vector< ReactiveMachine > &machines, double qTotal) |
| Distribute reactive power among synchronous machines connected to the same bus. | |
Protected Attributes | |
| std::vector< std::vector< std::complex< double > > > | m_yBus |
| wxString | m_errorMsg = "" |
| int | m_numberOfBuses = 0 |
| int | m_iterations = 0 |
| int | m_tapAdjustmentsCount = 0 |
Protected Attributes inherited from ElectricCalculation | |
| std::vector< PowerElement * > | m_powerElementList |
| List of power elements in the system. | |
| std::vector< Bus * > | m_busList |
| List of buses in the system. | |
| std::vector< Capacitor * > | m_capacitorList |
| List of capacitor elements in the system. | |
| std::vector< IndMotor * > | m_indMotorList |
| List of induction motors in the system. | |
| std::vector< Inductor * > | m_inductorList |
| List of inductors in the system. | |
| std::vector< Line * > | m_lineList |
| List of transmission lines in the system. | |
| std::vector< Load * > | m_loadList |
| List of load elements in the system. | |
| std::vector< SyncGenerator * > | m_syncGeneratorList |
| List of synchronous generators in the system. | |
| std::vector< SyncMotor * > | m_syncMotorList |
| List of synchronous motors in the system. | |
| std::vector< Transformer * > | m_transformerList |
| List of transformers in the system. | |
| std::vector< HarmCurrent * > | m_harmCurrentList |
| List of harmonic current sources in the system. | |
| std::vector< EMTElement * > | m_emtElementList |
| List of electromagnetic transient (EMT) elements in the system. | |
Calculate the power flow (including OLTC tap adjustment).
Definition at line 36 of file PowerFlow.h.
| PowerFlow::PowerFlow | ( | ) |
Definition at line 20 of file PowerFlow.cpp.
| PowerFlow::PowerFlow | ( | std::vector< Element * > | elementList | ) |
Definition at line 21 of file PowerFlow.cpp.
| PowerFlow::~PowerFlow | ( | ) |
Definition at line 22 of file PowerFlow.cpp.
|
protected |
Definition at line 930 of file PowerFlow.cpp.
|
protected |
Definition at line 759 of file PowerFlow.cpp.
|
protected |
Definition at line 914 of file PowerFlow.cpp.
|
protected |
Definition at line 885 of file PowerFlow.cpp.
|
protected |
Definition at line 657 of file PowerFlow.cpp.
|
inlinevirtual |
Definition at line 67 of file PowerFlow.h.
|
inlinevirtual |
Definition at line 68 of file PowerFlow.h.
|
protected |
Definition at line 645 of file PowerFlow.cpp.
|
protected |
Definition at line 338 of file PowerFlow.cpp.
|
virtual |
Definition at line 23 of file PowerFlow.cpp.
|
protected |
Definition at line 718 of file PowerFlow.cpp.
|
virtual |
Definition at line 619 of file PowerFlow.cpp.
|
virtual |
Definition at line 479 of file PowerFlow.cpp.
|
virtual |
Definition at line 250 of file PowerFlow.cpp.
|
virtual |
Definition at line 351 of file PowerFlow.cpp.
|
protected |
Definition at line 111 of file PowerFlow.h.
|
protected |
Definition at line 113 of file PowerFlow.h.
|
protected |
Definition at line 112 of file PowerFlow.h.
|
protected |
Definition at line 114 of file PowerFlow.h.
|
protected |
Definition at line 110 of file PowerFlow.h.