#ifndef ELECTROMECHANICAL_H #define ELECTROMECHANICAL_H #include "ElectricCalculation.h" class ControlElementSolver; class Electromechanical : public ElectricCalculation { public: Electromechanical(wxWindow* parent, std::vector elementList); ~Electromechanical(); bool RunStabilityCalculation(); wxString GetErrorMessage() const { return m_errorMsg; } std::vector GetTimeVector() const { return m_timeVector; } protected: void SetEventTimeList(); bool HasEvent(double currentTime); void SetEvent(double currentTime); inline bool EventTrigger(double eventTime, double currentTime); double GetPowerValue(double value, ElectricalUnit unit); void InsertSyncMachinesOnYBus(); std::complex GetSyncMachineAdmittance(SyncGenerator* generator); bool InitializeDynamicElements(); void CalculateMachinesCurrents(); void CalculateIntegrationConstants(SyncGenerator* syncGenerator, double id, double iq); bool SolveSynchronousMachines(bool saveValues = false); wxWindow* m_parent = NULL; wxString m_errorMsg = _("Unknown error"); double m_systemFreq = 60.0; std::vector > > m_yBus; std::vector > > m_yBusU; std::vector > > m_yBusL; std::vector > m_vBus; std::vector > m_iBus; double m_powerSystemBase = 100e6; double m_timeStep = 1e-3; double m_tolerance = 1e-3; int m_maxIterations = 100; std::vector m_eventTimeList; std::vector m_eventOccurrenceList; std::vector m_timeVector; }; #endif // ELECTROMECHANICAL_H