From ae9530685962e8d4d88c871ec7f5f896dd0b4a93 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Fri, 6 Oct 2017 22:23:09 -0300 Subject: Several new implementation, not working --- Project/ControlElementSolver.h | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to 'Project/ControlElementSolver.h') diff --git a/Project/ControlElementSolver.h b/Project/ControlElementSolver.h index 44925f5..786ae78 100644 --- a/Project/ControlElementSolver.h +++ b/Project/ControlElementSolver.h @@ -46,25 +46,29 @@ class ControlElementSolver { public: ControlElementSolver() {} - ControlElementSolver(ControlEditor* controlEditor, - double timeStep = 1e-3, - double integrationError = 1e-3, - bool startAllZero = true, - double input = 0.0); + ControlElementSolver(ControlEditor* controlEditor, double timeStep = 1e-3, double integrationError = 1e-3); ControlElementSolver(ControlElementContainer* ctrlContainer, double timeStep = 1e-3, double integrationError = 1e-3, - bool startAllZero = true, - double input = 0.0, wxWindow* parent = NULL); virtual ~ControlElementSolver() {} - virtual bool InitializeValues(double input, bool startAllZero); - virtual void SolveNextStep(double input); + virtual bool InitializeValues(bool startAllZero); + virtual void SolveNextStep(); virtual std::vector GetSolutions() { return m_solutions; } virtual double GetLastSolution() { return m_solutions[m_solutions.size() - 1]; } virtual bool IsOK() const { return m_isOK; } + virtual wxString GetErrorMessage() { return m_failMessage; } + void SetTerminalVoltage(double value) { m_terminalVoltage = value; } + void SetVelocity(double value) { m_velocity = value; } + void SetActivePower(double value) { m_activePower = value; } + void SetReactivePower(double value) { m_reactivePower = value; } + void SetInitialTerminalVoltage(double value) { m_initTerminalVoltage = value; } + void SetInitialMecPower(double value) { m_initMecPower = value; } + void SetInitialVelocity(double value) { m_initVelocity = value; } + double GetFieldVoltage() { return m_fieldVoltage; } + double GetMechanicalPower() { return m_mecPower; } protected: - void Initialize(wxWindow* parent, double timeStep, double integrationError, bool startAllZero, double input); + void Initialize(wxWindow* parent, double timeStep, double integrationError); void FillAllConnectedChildren(ConnectionLine* parent); ConnectionLine* SolveNextElement(ConnectionLine* currentLine); @@ -73,9 +77,21 @@ class ControlElementSolver double m_integrationError; std::vector m_solutions; bool m_isOK = false; + wxString m_failMessage = _("Unknown error."); - IOControl* m_inputControl = NULL; + IOControl* m_inputControl = NULL; /**< First input control to be solved */ IOControl* m_outputControl = NULL; + // Inputs + double m_terminalVoltage = 0.0; + double m_velocity = 0.0; + double m_activePower = 0.0; + double m_reactivePower = 0.0; + double m_initTerminalVoltage = 0.0; + double m_initMecPower = 0.0; + double m_initVelocity = 0.0; + // Outputs + double m_fieldVoltage = 0.0; + double m_mecPower = 0.0; }; #endif // CONTROLELEMENTSOLVER_H -- cgit From aa2378020ee0bbfd041681cfdbe62a8d028687f3 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Sun, 8 Oct 2017 22:49:52 -0300 Subject: Velocity variaton input implemented For PSS control on AVR --- Project/ControlElementSolver.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Project/ControlElementSolver.h') diff --git a/Project/ControlElementSolver.h b/Project/ControlElementSolver.h index 786ae78..fd27ad6 100644 --- a/Project/ControlElementSolver.h +++ b/Project/ControlElementSolver.h @@ -65,8 +65,10 @@ class ControlElementSolver void SetInitialTerminalVoltage(double value) { m_initTerminalVoltage = value; } void SetInitialMecPower(double value) { m_initMecPower = value; } void SetInitialVelocity(double value) { m_initVelocity = value; } + void SetDeltaVelocity(double value) { m_deltaVelocity = value; } double GetFieldVoltage() { return m_fieldVoltage; } double GetMechanicalPower() { return m_mecPower; } + double GetVelocity() { return m_velocity; } protected: void Initialize(wxWindow* parent, double timeStep, double integrationError); void FillAllConnectedChildren(ConnectionLine* parent); @@ -89,6 +91,7 @@ class ControlElementSolver double m_initTerminalVoltage = 0.0; double m_initMecPower = 0.0; double m_initVelocity = 0.0; + double m_deltaVelocity = 0.0; // Outputs double m_fieldVoltage = 0.0; double m_mecPower = 0.0; -- cgit From eea796f53f5d9dc1444a620713b3326f04b73339 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Mon, 9 Oct 2017 22:17:10 -0300 Subject: Divider control element implemented Abstract class math operations implemented Divider need to be redesigned Expor/import divider functions implemented but supressed --- Project/ControlElementSolver.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Project/ControlElementSolver.h') diff --git a/Project/ControlElementSolver.h b/Project/ControlElementSolver.h index fd27ad6..9bc54f7 100644 --- a/Project/ControlElementSolver.h +++ b/Project/ControlElementSolver.h @@ -66,9 +66,11 @@ class ControlElementSolver void SetInitialMecPower(double value) { m_initMecPower = value; } void SetInitialVelocity(double value) { m_initVelocity = value; } void SetDeltaVelocity(double value) { m_deltaVelocity = value; } + void SetDeltaActivePower(double value) { m_deltaPe = value; } double GetFieldVoltage() { return m_fieldVoltage; } double GetMechanicalPower() { return m_mecPower; } double GetVelocity() { return m_velocity; } + double GetActivePower() { return m_activePower; } protected: void Initialize(wxWindow* parent, double timeStep, double integrationError); void FillAllConnectedChildren(ConnectionLine* parent); @@ -92,6 +94,7 @@ class ControlElementSolver double m_initMecPower = 0.0; double m_initVelocity = 0.0; double m_deltaVelocity = 0.0; + double m_deltaPe = 0.0; // Outputs double m_fieldVoltage = 0.0; double m_mecPower = 0.0; -- cgit