From 59c28b89bb2a4eb05a87bb28154442266c35b17d Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Tue, 22 Jan 2019 15:06:09 -0200 Subject: Some code stability optimization --- Project/Electromechanical.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Project/Electromechanical.h') diff --git a/Project/Electromechanical.h b/Project/Electromechanical.h index 573c0c2..65275e5 100644 --- a/Project/Electromechanical.h +++ b/Project/Electromechanical.h @@ -126,6 +126,8 @@ class Electromechanical : public ElectricCalculation double m_tolerance = 1e-8; int m_maxIterations = 100; double m_saturationTolerance = 1e-8; + + int m_currentPoint = 0; std::vector m_eventTimeList; std::vector m_eventOccurrenceList; -- cgit From f54297e08079fe1954920ca2742b0bed19f86181 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Wed, 10 Jul 2019 14:14:30 -0300 Subject: Induction motor implementation start Machine initialization implemented. It seems that it's working. Check a OMIB with the motor. --- Project/Electromechanical.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Project/Electromechanical.h') diff --git a/Project/Electromechanical.h b/Project/Electromechanical.h index 65275e5..90d3ebd 100644 --- a/Project/Electromechanical.h +++ b/Project/Electromechanical.h @@ -70,7 +70,10 @@ class Electromechanical : public ElectricCalculation // double GetPowerValue(double value, ElectricalUnit unit); void InsertSyncMachinesOnYBus(); + bool InsertIndMachinesOnYBus(); + bool CalculateIndMachinesTransientValues(IndMotor* motor); std::complex GetSyncMachineAdmittance(SyncGenerator* generator); + std::complex GetIndMachineAdmittance(IndMotor* motor); bool InitializeDynamicElements(); bool CalculateInjectedCurrents(); void CalculateIntegrationConstants(SyncGenerator* syncGenerator, double id, double iq, double k = 1.0); -- cgit From ec20e2ac95f8a5013f2293a7a2a96016fb805581 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Thu, 11 Jul 2019 18:06:08 -0300 Subject: Induction motor DAE implemented Need some testing Check inertia --- Project/Electromechanical.h | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) (limited to 'Project/Electromechanical.h') diff --git a/Project/Electromechanical.h b/Project/Electromechanical.h index 90d3ebd..a9888af 100644 --- a/Project/Electromechanical.h +++ b/Project/Electromechanical.h @@ -20,8 +20,8 @@ #include "ElectricCalculation.h" -#include #include +#include class ControlElementSolver; @@ -57,7 +57,7 @@ class Electromechanical : public ElectricCalculation bool RunStabilityCalculation(); wxString GetErrorMessage() const { return m_errorMsg; } std::vector GetTimeVector() const { return m_timeVector; } - + // For tests std::vector GetIterationVector() const { return m_iterationsNumVector; } @@ -77,23 +77,26 @@ class Electromechanical : public ElectricCalculation bool InitializeDynamicElements(); bool CalculateInjectedCurrents(); void CalculateIntegrationConstants(SyncGenerator* syncGenerator, double id, double iq, double k = 1.0); - bool SolveSynchronousMachines(); + void CalculateIntegrationConstants(IndMotor* indMotor, double ir, double im, double k = 1.0); + bool SolveMachines(); void SetSyncMachinesModel(); SyncMachineModelData GetSyncMachineModelData(SyncGenerator* syncMachine); - double CalculateSyncMachineIntVariables(SyncGenerator* syncGenerator, - double id, - double iq, - double sd, - double sq, - double pe, - double k = 1.0); - bool CalculateSyncMachineNonIntVariables(SyncGenerator* syncGenerator, - double& id, - double& iq, - double& sd, - double& sq, - double& pe, - double k = 1.0); + double CalculateIntVariables(SyncGenerator* syncGenerator, + double id, + double iq, + double sd, + double sq, + double pe, + double k = 1.0); + double CalculateIntVariables(IndMotor* indMotor, double ir, double im, double te, double k = 1.0); + bool CalculateNonIntVariables(SyncGenerator* syncGenerator, + double& id, + double& iq, + double& sd, + double& sq, + double& pe, + double k = 1.0); + bool CalculateNonIntVariables(IndMotor* indMotor, double& ir, double& im, double& te, double k = 1.0); void CalculateReferenceSpeed(); bool CalculateSyncMachineSaturation(SyncGenerator* syncMachine, double& id, @@ -129,14 +132,14 @@ class Electromechanical : public ElectricCalculation double m_tolerance = 1e-8; int m_maxIterations = 100; double m_saturationTolerance = 1e-8; - + int m_currentPoint = 0; std::vector m_eventTimeList; std::vector m_eventOccurrenceList; std::vector m_timeVector; - + // For tests int m_iterationsNum = 0.0; std::vector m_iterationsNumVector; -- cgit