-
Notifications
You must be signed in to change notification settings - Fork 0
/
SupportingFunctions.py
90 lines (82 loc) · 1.84 KB
/
SupportingFunctions.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
def double(data):
return '{0:.2f}'.format(data)
def AWG_Diameter(Amps):
AWG=[ #AWG Designation "Gauge"
'0000 (4/0)',
'000 (3/0)',
'00 (2/0)',
'0 (1/0)',
'1',
'2',
'3',
'4',
'6',
'8',
'10',
'12',
'14',
'16',
'18',
'20',
'22',
'24',
'26',
'28',
'30',
'32',
'34'
]
Diameters=[ #mm
11.684,
10.405,
9.266,
8.251,
7.348,
6.544,
5.827,
5.189,
4.115,
3.264,
2.588,
2.053,
1.628,
1.291,
1.024,
0.812,
0.644,
0.511,
0.405,
0.321,
0.255,
0.202,
0.16
]
Ampacity=[ #A
195,
165,
145,
125,
110,
95,
85,
70,
55,
40,
30,
20,
15,
22,
10,
11,
7,
3.5,
2.2,
1.4,
0.86,
0.53,
0.3
]
nums = len(Ampacity) #number of entries in database
for i in range(0,nums):
if Ampacity[(nums-1)-i]>Amps: # count from bottom UP to avoid undersizing
return Diameters[(nums-1)-i],AWG[(nums-1)-i] # return when proper size found