Power System Platform  2026w10a-beta
Loading...
Searching...
No Matches
IndMotor.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#ifndef INDMOTOR_H
19#define INDMOTOR_H
20
21#include "Machines.h"
22
23class IndMotorForm;
24
26 wxString name;
27 double ratedPower = 100.0;
29 double activePower = 100.0;
31 double reactivePower = 0.0;
32 ElectricalUnit reactivePowerUnit = ElectricalUnit::UNIT_Mvar;
33
34 bool useMachinePowerAsBase = true;
35 bool calcQInPowerFlow = true;
36
37 // Power flow
38 double k1 = 0.0;
39 double k2 = 0.0;
40 double k3 = 0.0;
41 double k4 = 0.0;
42 double p0 = 0.0;
43 int busNum = 0;
44
45 double qValue = 0.0;
46
47 // Stability
48 bool plotIndMachine = false;
49 double inertia = 1.0; // Motor and load inertia
50 double s0; // Initial slip
51 double q0; // Initial reactive power
52 double r1 = 0.0; // Stator resistence data
53 double x1 = 1.0; // Stator reactance data
54 double r2 = 1.0; // Rotor resistence data
55 double x2 = 0.0; // Rotor reactance data
56 double xm = 100.0; // Magnetizing reactance data
57 double kf = 0.0; // Cage factor
58 bool useKf = false;
59
60 // Transient values
61 double xt = 1.0; // Transient reactance
62 double x0 = 1.0; // Open-circuit reactance
63 double r1t = 0.0; // Stator resistence in system power base
64 double x1t = 1.0; // Stator reactance in system power base
65 double r2t = 1.0; // Rotor resistence in system power base
66 double x2t = 0.0; // Rotor reactance in system power base
67 double xmt = 100.0; // Magnetizing reactance in system power base
68
69 double t0 = 1.0; // Open-circuit time constant
70
71 double aw = 1.0; // Velocity constant torque
72 double bw = 0.0; // Velocity linear dependent torque
73 double cw = 0.0; // Velocity quadratic dependent torque
74 double as = 0.0; // Slip constant torque
75 double bs = 0.0; // Slip linear dependent torque
76 double cs = 0.0; // Slip quadratic dependent torque
77 double aCalc = 0.0;
78 double bCalc = 0.0;
79 double cCalc = 0.0;
80
81 // Internal machine variables
82 double tranEr = 0.0;
83 double tranEm = 0.0;
84 double ir = 0.0;
85 double im = 0.0;
86
87 // Variables to extrapolate
88 double oldIr = 0.0;
89 double oldIm = 0.0;
90 double oldTe = 0.0;
91
92 // Integration constants
94 IntegrationConstant icTranEr;
95 IntegrationConstant icTranEm;
96
97 // Machine state variables
98 std::complex<double> terminalVoltage;
99 std::vector<double> terminalVoltageVector;
100 double slip = 1.0; // Machine slip
101 std::vector<double> slipVector;
102 double te;
103 std::vector<double> electricalTorqueVector;
104 std::vector<double> mechanicalTorqueVector;
105 std::vector<double> velocityVector;
106 std::vector<double> currentVector;
107 std::vector<double> activePowerVector;
108 std::vector<double> reactivePowerVector;
109};
110
118class IndMotor : public Machines
119{
120 public:
121 IndMotor();
122 IndMotor(wxString name);
123 ~IndMotor();
124
125 virtual Element* GetCopy();
126 //virtual void DrawSymbol() const;
127 virtual void DrawDCSymbol(wxGraphicsContext* gc) const;
128 virtual void DrawDCSymbol(wxDC& dc) const;
129 virtual bool GetContextMenu(wxMenu& menu);
130 virtual wxString GetTipText() const;
131 virtual bool ShowForm(wxWindow* parent, Element* element);
132 virtual IndMotorElectricalData GetElectricalData() { return m_electricalData; }
133 virtual IndMotorElectricalData GetPUElectricalData(double systemPowerBase);
134 virtual void SetElectricalData(IndMotorElectricalData electricalData) { m_electricalData = electricalData; }
135 virtual void InitPowerFlowMotor(double systemPowerBase, int busNumber);
136 virtual bool CalculateReactivePower(double voltage);
137
138 virtual bool GetPlotData(ElementPlotData& plotData, PlotStudy study = PlotStudy::STABILITY);
139
140 virtual rapidxml::xml_node<>* SaveElement(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementListNode);
141 virtual bool OpenElement(rapidxml::xml_node<>* elementNode, std::vector<Element*> parentList);
142
143 protected:
144 IndMotorElectricalData m_electricalData;
145};
146
147#endif // INDMOTOR_H
ElectricalUnit
Electrical units.
PlotStudy
Base class of all elements of the program. This class is responsible for manage graphical and his dat...
Definition Element.h:112
Form to edit the induction motor power data.
Induction motor power element.
Definition IndMotor.h:119
virtual bool GetContextMenu(wxMenu &menu)
Get the element contex menu.
Definition IndMotor.cpp:68
virtual Element * GetCopy()
Get a the element copy.
Definition IndMotor.cpp:134
virtual bool GetPlotData(ElementPlotData &plotData, PlotStudy study=PlotStudy::STABILITY)
Fill the plot data.
Definition IndMotor.cpp:291
virtual bool ShowForm(wxWindow *parent, Element *element)
Show element data form.
Definition IndMotor.cpp:84
virtual wxString GetTipText() const
Get the tip text.
Definition IndMotor.cpp:141
Abstract class for rotary machines power elements.
Definition Machines.h:34
Integration constants to calculate dynamic elements through trapezoidal integration method.