From c7ef9a883031c68506357f9ef1b1a0b79c79f4da Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Thu, 25 Jul 2019 01:11:17 -0300 Subject: Motor integration with PF Newton bug fixed Newton inertia implemented Gauss-Newton implemented --- Project/PowerFlow.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'Project/PowerFlow.h') diff --git a/Project/PowerFlow.h b/Project/PowerFlow.h index 2f3419a..e8945c8 100644 --- a/Project/PowerFlow.h +++ b/Project/PowerFlow.h @@ -51,15 +51,18 @@ class PowerFlow : public ElectricCalculation virtual bool RunNewtonRaphson(double systemPowerBase = 100e6, int maxIteration = 5000, double error = 1e-6, - double initAngle = 0.0); + 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 = 10); + double gaussTol = 1e-2, + double inertia = 1.0); virtual wxString GetErrorMessage() { return m_errorMsg; } + virtual int GetIterations() { return m_iterations; } protected: void GetNumPVPQ(std::vector busType, int &numPQ, int &numPV); @@ -82,11 +85,15 @@ class PowerFlow : public ElectricCalculation std::vector > power, int numPV, int numPQ, - std::vector dPdQ); + std::vector dPdQ, + double inertia); + bool CalculateMotorsReactivePower(std::vector > voltage, + std::vector > &power); std::vector > > m_yBus; wxString m_errorMsg = ""; int m_numberOfBuses = 0; + int m_iterations = 0; }; #endif // POWERFLOW_H -- cgit