summaryrefslogtreecommitdiffstats
path: root/Project/PowerFlow.h
diff options
context:
space:
mode:
Diffstat (limited to 'Project/PowerFlow.h')
-rw-r--r--Project/PowerFlow.h45
1 files changed, 43 insertions, 2 deletions
diff --git a/Project/PowerFlow.h b/Project/PowerFlow.h
index 54780b4..2f3419a 100644
--- a/Project/PowerFlow.h
+++ b/Project/PowerFlow.h
@@ -20,8 +20,8 @@
#include "ElectricCalculation.h"
-#include <wx/string.h>
#include <wx/intl.h> //_()
+#include <wx/string.h>
/**
* @class PowerFlow
@@ -34,18 +34,59 @@ class PowerFlow : public ElectricCalculation
{
public:
PowerFlow();
- PowerFlow(std::vector<Element*> elementList);
+ PowerFlow(std::vector<Element *> elementList);
~PowerFlow();
+ 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);
+ virtual bool RunGaussNewton(double systemPowerBase = 100e6,
+ int maxIteration = 5000,
+ double error = 1e-6,
+ double initAngle = 0.0,
+ double accFactor = 1.0,
+ double gaussTol = 10);
virtual wxString GetErrorMessage() { return m_errorMsg; }
+
protected:
+ void GetNumPVPQ(std::vector<BusType> busType, int &numPQ, int &numPV);
+ std::vector<std::vector<double> > CalculateJacobianMatrix(std::vector<std::complex<double> > voltage,
+ 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);
+
std::vector<std::vector<std::complex<double> > > m_yBus;
wxString m_errorMsg = "";
+ int m_numberOfBuses = 0;
};
#endif // POWERFLOW_H