Merge remote-tracking branch 'origin/main'

This commit is contained in:
schoener 2021-10-07 11:03:01 +02:00
commit fa832b8187

View File

@ -6,6 +6,7 @@ Created on Tue Aug 17 15:17:44 2021
""" """
import numpy as np import numpy as np
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import logging as log
from scipy import special as sp from scipy import special as sp
from src import physical_constants as cs from src import physical_constants as cs
@ -14,7 +15,10 @@ from src import coil_class_add_functions as cf
class BCoil: class BCoil:
def __init__(self, HH, distance, radius, layers, windings, wire_width, wire_height, layers_spacing=0, def __init__(self, HH, distance, radius, layers, windings, wire_width, wire_height, layers_spacing=0,
windings_spacing=0): windings_spacing=0, is_round = False):
if is_round:
if wire_width != wire_height:
log.error('Wire is round but width != height')
self.HH = HH self.HH = HH
self.distance = distance * 1e-3 self.distance = distance * 1e-3
self.radius = radius * 1e-3 self.radius = radius * 1e-3
@ -24,8 +28,11 @@ class BCoil:
self.wire_height = wire_height * 1e-3 self.wire_height = wire_height * 1e-3
self.layers_spacing = layers_spacing * 1e-3 self.layers_spacing = layers_spacing * 1e-3
self.windings_spacing = windings_spacing * 1e-3 self.windings_spacing = windings_spacing * 1e-3
self.is_round = is_round
def get_wire_area(self): def get_wire_area(self):
if self.is_round:
return np.pi * (self.wire_width/2)**2
return self.wire_width * self.wire_height return self.wire_width * self.wire_height
def get_N(self): def get_N(self):
@ -432,12 +439,11 @@ class BCoil:
return 2 * cf.resistivity_copper(T) * self.get_wire_length() / self.get_wire_area() return 2 * cf.resistivity_copper(T) * self.get_wire_length() / self.get_wire_area()
HH_Coil = BCoil(HH=1, distance=54, radius=48, layers=4, windings=4, wire_height=1, wire_width=1, windings_spacing=0.25, HH_Coil = BCoil(HH=1, distance=54, radius=48, layers=8, windings=8, wire_height=0.4,wire_width=0.4, windings_spacing=0.2,
layers_spacing=0.25) layers_spacing=0.2,is_round= False)
HH_Coil.set_R_outer(49.3) HH_Coil.set_R_outer(49.3)
HH_Coil.set_d_min(49.8) HH_Coil.set_d_min(49.8)
L = HH_Coil.induct_perry() print(HH_Coil.get_wire_area()*1e6)
print(HH_Coil.get_wire_length())
HH_Coil.print_info() print(HH_Coil.get_coil_height())
print(L)