-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfr.py
69 lines (63 loc) · 1.46 KB
/
fr.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
from math import pi
u0 = 4.0*pi*10**-7
def P_cu(t_celsius):
return 67.078E-12*(t_celsius+273)-2.560E-9
def SkinDepth(f, t=20):
from math import sqrt
w = 2*pi*f
return sqrt(2*P_cu(t)/(w*u0))
def Fr(f, a, m, t=20, n=1):
import cmath
from math import sqrt
def N(nt, a, b):
'''
Nt = number of turns
a = bredth of conductor
b = bredth of winding
'''
return Nt*a/b
def Alpha(w, n, p):
'''
\sqrt{\frac{j\omega\mu_{0}\eta}{\rho}}
j = sqrt(-1)
w = angular frequency
u0 = permiability of free space
n = winding factor, n()
p = resistivity
'''
return cmath.sqrt(1j*w*u0*n/p)
def Coth(x):
return cmath.cosh(x)/cmath.sinh(x)
def M(alpha, h):
'''
alpha = alpha()
h = height of conductor
'''
return alpha*h*Coth(alpha*h)
def D(alpha, h):
'''
alpha = alpha()
h = height of conductor
'''
return 2.0*alpha*h*cmath.tanh(alpha*h/2.0)
def _Fr(M_real, D_real, m):
'''
M_real = real part of M()
D_real = real part of D()
m = number of whole layers in a winding portion
'''
return M_real+(m**2-1.0)*D_real/3.0
w = 2*pi*f
h = sqrt(pi)*a/2.0
p = P_cu(t)
alpha = Alpha(w, n, p)
M_complex = M(alpha, h)
D_complex = D(alpha, h)
M_real = M_complex.real
D_real = D_complex.real
fr = _Fr(M_real, D_real, m)
return fr
if __name__ == '__main__':
from engpy import si
print 'Fr =', si(Fr(20E3, 0.265E-3, 5.29, t=20, n=1))
print 'sd =', si(SkinDepth(20E3, t=20))