質問編集履歴
2
該当コードの修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
ファイルを扱う部分に問題があるのではないかと考えたのですが、原因を見つけることに難航しています。
|
18
18
|
|
19
|
-
|
19
|
+
|
20
20
|
|
21
21
|
|
22
22
|
|
@@ -28,121 +28,333 @@
|
|
28
28
|
|
29
29
|
```Python
|
30
30
|
|
31
|
+
def inductor_design(specification, line_1, line_2, thickness, result):
|
32
|
+
|
33
|
+
#設計仕様の値を変数に代入
|
34
|
+
|
31
|
-
|
35
|
+
f = float(specification[0])
|
36
|
+
|
32
|
-
|
37
|
+
SC_Rated = float(specification[1])
|
33
|
-
|
34
|
-
|
38
|
+
|
35
|
-
t
|
39
|
+
L_init = float(specification[2])
|
40
|
+
|
36
|
-
|
41
|
+
L_Rated = float(specification[3])
|
42
|
+
|
37
|
-
|
43
|
+
Max_tmp = float(specification[4])
|
44
|
+
|
38
|
-
|
45
|
+
Ku = float(specification[5])
|
46
|
+
|
39
|
-
|
47
|
+
Jmax = float(specification[6])
|
48
|
+
|
49
|
+
|
50
|
+
|
40
|
-
|
51
|
+
#コアデータベースの値を変数に代入
|
52
|
+
|
53
|
+
perm = float(line_1[4])
|
54
|
+
|
55
|
+
a = float(line_1[5])
|
56
|
+
|
57
|
+
b = float(line_1[6])
|
58
|
+
|
59
|
+
c = float(line_1[7])
|
60
|
+
|
61
|
+
A = float(line_1[8])
|
62
|
+
|
63
|
+
B = float(line_1[9])
|
64
|
+
|
65
|
+
C = float(line_1[10])
|
66
|
+
|
67
|
+
D = float(line_1[11])
|
68
|
+
|
69
|
+
Bsat = float(line_1[12])
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
OD = float(line_2[1])
|
74
|
+
|
75
|
+
ID = float(line_2[2])
|
76
|
+
|
77
|
+
HT = float(line_2[3])
|
78
|
+
|
79
|
+
Le = float(line_2[4])
|
80
|
+
|
41
|
-
t
|
81
|
+
Limit_Wire_Dia = float(line_2[5])
|
82
|
+
|
83
|
+
S = float(line_2[6])
|
84
|
+
|
85
|
+
Ae = float(line_2[7])
|
86
|
+
|
87
|
+
Ve = float(line_2[8])
|
88
|
+
|
89
|
+
W = float(line_2[9])
|
90
|
+
|
91
|
+
MP = float(line_2[11])
|
92
|
+
|
93
|
+
HF = float(line_2[12])
|
94
|
+
|
95
|
+
MF = float(line_2[13])
|
96
|
+
|
97
|
+
SD = float(line_2[14])
|
98
|
+
|
99
|
+
HS = float(line_2[15])
|
100
|
+
|
101
|
+
SG = float(line_2[16])
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
N = int(math.ceil(math.sqrt((L_init*Le*pow(10,3))/(4.0*math.pi*perm*(Ae*thickness)))))
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
N_11 = 0
|
110
|
+
|
111
|
+
N_21 = 0
|
112
|
+
|
113
|
+
N_22 = 0
|
114
|
+
|
115
|
+
N_31 = 0
|
116
|
+
|
117
|
+
N_32 = 0
|
118
|
+
|
119
|
+
N_33 = 0
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
N_init = N
|
126
|
+
|
127
|
+
current = int(SC_Rated)
|
128
|
+
|
129
|
+
diff_max = 1.25
|
130
|
+
|
131
|
+
diff_min = 0.97
|
132
|
+
|
133
|
+
flag_1 = 1
|
134
|
+
|
135
|
+
flag_2 = 1
|
42
136
|
|
43
137
|
count = 0
|
44
138
|
|
45
139
|
i = 0
|
46
140
|
|
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
|
-
|
141
|
+
|
142
|
+
|
143
|
+
#定格インダクタンスを得るように初期インダクタンスを動かしている
|
144
|
+
|
145
|
+
while flag_1 != 0:
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
L_at0A = 4.0*math.pi*perm*(Ae*thickness)*math.pow(N,2)/(Le*math.pow(10,3))
|
150
|
+
|
151
|
+
H = N*current*math.pow(10,2)/(Le*79.577)
|
152
|
+
|
153
|
+
per_mu = 100/(a + b*math.pow(H,c))
|
154
|
+
|
155
|
+
inductance.insert(current, L_at0A*per_mu/100)
|
156
|
+
|
157
|
+
if inductance[current] >= L_Rated*diff_min and inductance[current] <= L_Rated*diff_max:
|
158
|
+
|
159
|
+
Ldc = inductance[current]
|
160
|
+
|
161
|
+
flag_1 = 0
|
162
|
+
|
163
|
+
break
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
elif flag_2 == 1:
|
168
|
+
|
169
|
+
N += 1
|
170
|
+
|
171
|
+
if N > 3*N_init:
|
172
|
+
|
173
|
+
flag_2 = 2
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
elif flag_2 == 2:
|
178
|
+
|
179
|
+
N -= 1
|
180
|
+
|
181
|
+
if N < 1:
|
182
|
+
|
183
|
+
return(3)
|
184
|
+
|
185
|
+
Ku = Ku/100
|
186
|
+
|
187
|
+
input_Ku = Ku
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
while True:
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
Aw = (Ku*W*math.pow(10,2))/float(N)
|
198
|
+
|
199
|
+
if Aw <= 6.733:
|
200
|
+
|
201
|
+
N_wire = 1
|
202
|
+
|
203
|
+
Aw = (Ku*W*math.pow(10,2))/float(N*N_wire)
|
204
|
+
|
205
|
+
elif Aw > 6.733 and Aw <= 13.466:
|
206
|
+
|
207
|
+
N_wire = 2
|
208
|
+
|
209
|
+
Aw = (Ku*W*math.pow(10,2))/float(N*N_wire)
|
210
|
+
|
211
|
+
else:
|
212
|
+
|
213
|
+
N_wire = 1
|
214
|
+
|
215
|
+
Aw = Aw
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
out_wire = getwire(Aw,wire)
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
#膨らみ率
|
228
|
+
|
229
|
+
if float(wire[0]) < 1.0:
|
230
|
+
|
231
|
+
kp = 1.0
|
232
|
+
|
233
|
+
else:
|
234
|
+
|
235
|
+
kp = float(wire[0])
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
Ku_real = (float(wire[10])*N*N_wire*100)/(W*math.pow(10,2))*kp
|
244
|
+
|
245
|
+
if out_wire == 1 or out_wire == 2:
|
246
|
+
|
247
|
+
Ku_real = 100
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
if Ku_real >= (input_Ku*100-5.0) and Ku_real <= (input_Ku*100+5.0):
|
252
|
+
|
253
|
+
break
|
254
|
+
|
255
|
+
else:
|
256
|
+
|
257
|
+
Ku = Ku - 0.01
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
if Ku <= 0:
|
262
|
+
|
263
|
+
return (5)
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
############中略################
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
#結果出力
|
276
|
+
|
277
|
+
result.insert(0, L_at0A)
|
278
|
+
|
279
|
+
result.insert(1, Ldc)
|
280
|
+
|
281
|
+
result.insert(2, N)
|
282
|
+
|
283
|
+
result.insert(3, float(wire[0]))
|
284
|
+
|
285
|
+
result.insert(4, wire_Weight + core_Weight)
|
286
|
+
|
287
|
+
result.insert(5, delta_T)
|
288
|
+
|
289
|
+
result.insert(6, Fin_Ve)
|
290
|
+
|
291
|
+
result.insert(7, Bm)
|
292
|
+
|
293
|
+
result.insert(8, Jm)
|
294
|
+
|
295
|
+
result.insert(9, Pi)
|
296
|
+
|
297
|
+
result.insert(10, Pwdc)
|
298
|
+
|
299
|
+
result.insert(11,Rwdc)
|
300
|
+
|
301
|
+
result.insert(12,Ku_real)
|
302
|
+
|
303
|
+
result.insert(13,OD)
|
304
|
+
|
305
|
+
result.insert(14,ID)
|
306
|
+
|
307
|
+
result.insert(15,HT)
|
308
|
+
|
309
|
+
result.insert(16,N_wire)
|
310
|
+
|
311
|
+
result.insert(18,N1)
|
312
|
+
|
313
|
+
result.insert(19,N2)
|
314
|
+
|
315
|
+
result.insert(20,N3)
|
316
|
+
|
317
|
+
result.insert(21,Fin_OD)
|
318
|
+
|
319
|
+
result.insert(22,Fin_HT)
|
320
|
+
|
321
|
+
result.insert(23,wire_Weight)
|
322
|
+
|
323
|
+
result.insert(24,core_Weight)
|
324
|
+
|
325
|
+
result.insert(25,f)
|
326
|
+
|
327
|
+
result.insert(26,SC_Rated)
|
328
|
+
|
329
|
+
result.insert(27,Ae)
|
330
|
+
|
331
|
+
result.insert(28,Ve)
|
332
|
+
|
333
|
+
result.insert(29,W)
|
334
|
+
|
335
|
+
result.insert(30, float(wire[1]))
|
336
|
+
|
337
|
+
result.insert(31, float(wire[2]))
|
338
|
+
|
339
|
+
result.insert(32,wire_Length)
|
340
|
+
|
341
|
+
result.insert(33,kp)
|
342
|
+
|
343
|
+
result.insert(34,Le)
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
return (0)
|
146
358
|
|
147
359
|
|
148
360
|
|
@@ -156,7 +368,7 @@
|
|
156
368
|
|
157
369
|
|
158
370
|
|
159
|
-
|
371
|
+
|
160
372
|
|
161
373
|
|
162
374
|
|
1
該当コードの修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -23,6 +23,10 @@
|
|
23
23
|
|
24
24
|
|
25
25
|
### 該当のソースコード
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
```Python
|
26
30
|
|
27
31
|
def design(specification, output):
|
28
32
|
|
@@ -144,7 +148,7 @@
|
|
144
148
|
|
145
149
|
|
146
150
|
|
147
|
-
|
151
|
+
```
|
148
152
|
|
149
153
|
|
150
154
|
|