-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcommon_calcs.py
200 lines (151 loc) · 5.96 KB
/
common_calcs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Moto: Induction motor parameter estimation tool
Common Calculations Module
Author: Julius Susanto
Last edited: November 2014
"""
import numpy as np
"""
GET_TORQUE - Calculate double cage motor torque and stator current (without core loss component)
Usage: get_torque (slip,type,x)
Where slip is the motor slip (pu)
x is a vector of motor equivalent parameters:
x = [Rs Xs Xm Rr1 Xr1 Rr2 Xr2]
Rs = stator resistance
Rs = stator reactance
Xm = magnetising reactance
Rr1 = rotor / inner cage resistance
Xr1 = rotor / inner cage reactance
Rr2 = outer cage resistance
Xr2 = outer cage reactance
Returns: motor torque (pu) as a real number and stator current (as a
complex number and without core loss component)
"""
def get_torque(slip, x):
# Calculate admittances
Ys = 1 / np.complex(x[0], x[1])
Ym = 1 / np.complex(0, x[2])
Yr1 = 1 / np.complex(x[3] / slip, x[4])
Yr2 = 1 / np.complex(x[5] / slip, x[6])
# Calculate voltage and currents
u1 = Ys / (Ys + Ym + Yr1 + Yr2)
ir1 = np.abs (u1 * Yr1)
ir2 = np.abs (u1 * Yr2)
# Calculate torque and stator current
torque = x[3] / slip * (ir1 ** 2) + x[5] / slip * (ir2 ** 2);
ist = (1 - u1) * Ys
return torque, ist
"""
CALC_PQT - Calculates motor mechanical power, reactive power, breakdown
torque and efficiency from equivalent circuit parameters (used for double
cage model with core losses)
Usage: calc_pqt (sf,x)
Where sf is the full load slip (pu)
x is a 8 x 1 vector of motor equivalent parameters:
x = [Rs Xs Xm Rr1 Xr1 Rr2 Xr2 Rc]
x(0) = Rs = stator resistance
x(1) = Xs = stator reactance
x(2) = Xm = magnetising reactance
x(3) = Rr1 = rotor / inner cage resistance
x(4) = Xr1 = rotor / inner cage reactance
x(5) = Rr2 = outer cage resistance
x(6) = Xr2 = outer cage reactance
x(7) = Rc = core resistance
Returns: y is a vector [Pm Q Tb I_nl]
"""
def calc_pqt(sf, x):
x = np.abs(x)
# Calculate full-load torque and current
[T_fl, i_s] = get_torque(sf,x)
# Calculate mechanical power (at FL)
Pm = T_fl * (1 - sf)
Sn = np.complex(1,0) * np.conj(i_s)
# Calculate reactive power input (at FL)
Q_fl = np.abs(np.imag(Sn))
# Calculate core loss currents (at FL)
i_c = 1 / np.complex (x[7],0)
# Calculate total input current (at FL)
i_in = i_s + i_c
# Calculate input power (at FL)
p_in = np.real(np.complex(1,0) * np.conj(i_in))
# Calculate efficiency (at FL)
eff_fl = Pm / p_in
# Calculate breakdown torque with an interval search
T_b = 0
for n in range(1,101):
i = float(n) / 100
[T_i, I_i] = get_torque(i,x)
if T_i > T_b:
T_b = T_i # Calculated breakdown torque
[T_lr, i_lr] = get_torque(1,x);
y = [Pm, Q_fl, T_b, T_lr, np.abs(i_lr + i_c), eff_fl]
return y
"""
GET_TORQUE_SC - Calculate single cage motor torque and stator current (without core loss component)
Usage: get_torque_sc (slip,x)
Where slip is the motor slip (pu)
x is a vector of motor equivalent parameters:
x = [Rs Xs Xm Rr1 Xr1]
Rs = stator resistance
Rs = stator reactance
Xm = magnetising reactance
Rr1 = rotor resistance
Xr1 = rotor reactance
Returns: motor torque (pu) as a real number and stator current (as a
complex number and without core loss component)
"""
def get_torque_sc(slip, x):
# Calculate admittances
Ys = 1 / np.complex(x[0], x[1])
Ym = 1 / np.complex(0, x[2])
Yr1 = 1 / np.complex(x[3] / slip, x[5])
# Calculate voltage and currents
u1 = Ys / (Ys + Ym + Yr1)
# Calculate torque and stator current
torque = np.abs(x[3]/slip * (Yr1 * u1) ** 2)
ist = (1 - u1) * Ys
return torque, ist
"""
CALC_PQT_SC - Calculates motor mechanical power, reactive power, breakdown
torque and efficiency from equivalent circuit parameters (used for single
cage model with core losses)
Usage: calc_pqt_sc (sf,x)
Where sf is the full load slip (pu)
x is a 6 x 1 vector of motor equivalent parameters:
x = [Rs Xs Xm Rr1 Xr1 Rc]
x(0) = Rs = stator resistance
x(1) = Xs = stator reactance
x(2) = Xm = magnetising reactance
x(3) = Rr1 = rotor resistance
x(5) = Xr1 = rotor reactance
x(4) = Rc = core resistance
Returns: y is a vector [Pm Q Tb eff]
"""
def calc_pqt_sc(sf, x):
x = np.abs(x)
# Calculate full-load torque and current
[T_fl, i_s] = get_torque_sc(sf,x)
# Calculate mechanical power (at FL)
Pm = T_fl * (1 - sf)
Sn = np.complex(1,0) * np.conj(i_s)
# Calculate reactive power input (at FL)
Q_fl = np.abs(np.imag(Sn))
# Calculate core loss currents (at FL)
i_c = 1 / np.complex (x[4],0)
# Calculate total input current (at FL)
i_in = i_s + i_c
# Calculate input power (at FL)
p_in = np.real(np.complex(1,0) * np.conj(i_in))
# Calculate efficiency (at FL)
eff_fl = Pm / p_in
# Calculate breakdown torque with an interval search
T_b = 0
for n in range(1,101):
i = float(n) / 100
[T_i, I_i] = get_torque_sc(i,x)
if T_i > T_b:
T_b = T_i # Calculated breakdown torque
y = [Pm, Q_fl, T_b, eff_fl]
return y