40 PowerFlow(std::vector<Element*> elementList);
42 virtual bool InitPowerFlow(std::vector<BusType>& busType,
43 std::vector<std::complex<double> >& voltage,
44 std::vector<std::complex<double> >& power,
45 std::vector<std::complex<double> >& loadPower,
46 std::vector<ReactiveLimits>& reactiveLimit,
47 double systemPowerBase = 100e6,
48 double initAngle = 0.0);
49 virtual bool RunGaussSeidel(
double systemPowerBase = 100e6,
50 int maxIteration = 5000,
52 double initAngle = 0.0,
53 double accFactor = 1.0);
54 virtual bool RunNewtonRaphson(
double systemPowerBase = 100e6,
55 int maxIteration = 5000,
57 double initAngle = 0.0,
58 double inertia = 1.0);
59 virtual bool RunGaussNewton(
double systemPowerBase = 100e6,
60 int maxIteration = 5000,
62 double initAngle = 0.0,
63 double accFactor = 1.0,
64 double gaussTol = 1e-2,
65 double inertia = 1.0);
67 virtual wxString GetErrorMessage() {
return m_errorMsg; }
68 virtual int GetIterations() {
return m_iterations; }
69 virtual void ResetVoltages();
72 void GetNumPVPQ(std::vector<BusType> busType,
int& numPQ,
int& numPV);
80 std::vector<std::vector<double>> CalculateJacobianMatrix(
81 const std::vector<std::complex<double>>& voltage,
82 const std::vector<std::complex<double>>& power,
83 const std::vector<BusType>& busType,
87 bool CheckReactiveLimits(std::vector<BusType>& busType,
88 std::vector<ReactiveLimits>& reactiveLimit,
89 std::vector<std::complex<double> >& power,
90 std::vector<std::complex<double> > loadPower);
92 double GaussSeidel(std::vector<BusType> busType,
93 std::vector<std::complex<double> >& voltage,
94 std::vector<std::complex<double> > oldVoltage,
95 std::vector<std::complex<double> >& power,
97 void NewtonRaphson(std::vector<BusType> busType,
98 std::vector<std::complex<double> >& voltage,
99 std::vector<std::complex<double> > power,
102 std::vector<double> dPdQ,
104 bool CalculateMotorsReactivePower(std::vector<std::complex<double> > voltage,
105 std::vector<std::complex<double> >& power);
107 bool HasInvalidValue(
const std::vector< std::complex<double> >& voltage);
108 bool AdjustTapChangers(
const std::vector<std::complex<double> >& voltage,
double systemPowerBase);
110 std::vector<std::vector<std::complex<double> > > m_yBus;
111 wxString m_errorMsg =
"";
112 int m_numberOfBuses = 0;
113 int m_iterations = 0;
114 int m_tapAdjustmentsCount = 0;