2021-10-29 18:37:36 +02:00
|
|
|
import matplotlib.pyplot as plt
|
|
|
|
import numpy as np
|
|
|
|
import matplotlib
|
|
|
|
#matplotlib.use('Qt5Agg')
|
|
|
|
from src import coil_class as BC
|
|
|
|
|
|
|
|
scale = 1000
|
|
|
|
lim = 1
|
|
|
|
nr_points = (2 * lim) * scale + 1
|
|
|
|
x = np.linspace(-lim,lim,nr_points)
|
|
|
|
z = np.linspace(-lim,lim,nr_points)
|
|
|
|
|
|
|
|
def mu_it(x_pos):
|
|
|
|
it = nr_points//2 + x_pos
|
|
|
|
return it
|
|
|
|
|
|
|
|
|
|
|
|
Wires = [[0.45, 0.514],[0.475, 0.543],[0.5, 0.568]]
|
|
|
|
|
2021-11-02 10:02:55 +01:00
|
|
|
Wire_1 = Wires[2]
|
2021-10-29 18:37:36 +02:00
|
|
|
|
|
|
|
#I_current = 0.94
|
2021-11-02 10:02:55 +01:00
|
|
|
HH_Coil = BC.BCoil(HH = 1, distance = 54, radius = 48, layers = 8, windings = 8, wire_height = Wire_1[0],
|
2021-10-29 18:37:36 +02:00
|
|
|
wire_width = Wire_1[0], insulation_thickness=(Wire_1[1] - Wire_1[0]) / 2, is_round = True,
|
|
|
|
winding_scheme= 2)
|
|
|
|
|
2021-11-02 10:02:55 +01:00
|
|
|
|
|
|
|
print(f"HH N = {HH_Coil.get_N()}")
|
2021-10-29 18:37:36 +02:00
|
|
|
I = 64 / HH_Coil.get_N() * 1.25
|
2021-11-02 10:02:55 +01:00
|
|
|
|
2021-10-29 18:37:36 +02:00
|
|
|
# set radius plus distance
|
2022-01-07 15:03:10 +01:00
|
|
|
#HH_Coil.set_R_outer(50.5 - HH_Coil.get_tot_wire_width()*1e3)
|
|
|
|
HH_Coil.set_R_inner(45.6)
|
|
|
|
|
2022-01-17 14:02:25 +01:00
|
|
|
HH_Coil.set_d_min(45.8+2*0.8)
|
2021-10-29 18:37:36 +02:00
|
|
|
|
2021-11-02 10:02:55 +01:00
|
|
|
# HH_Coil.B_quick_plot(I)
|
|
|
|
# HH_Coil.B_curv_quick_plot(I)
|
|
|
|
# HH_Coil.plot_raster()
|
2021-10-29 18:37:36 +02:00
|
|
|
HH_Coil.print_info()
|
|
|
|
|
2022-01-17 14:02:25 +01:00
|
|
|
D_max = 2 * (HH_Coil.get_R_inner()*1e3 - 1) * np.tan(np.radians(41.11))
|
2021-10-29 18:37:36 +02:00
|
|
|
print(D_max)
|
|
|
|
|
2021-11-02 10:02:55 +01:00
|
|
|
AHH_Coil = BC.BCoil(HH = -1, distance = 54, radius = 48, layers = HH_Coil.get_layers, windings=2 * HH_Coil.get_windings,
|
2021-10-29 18:37:36 +02:00
|
|
|
wire_height = Wire_1[0], wire_width=Wire_1[0], insulation_thickness=(Wire_1[1] - Wire_1[0]) / 2,
|
|
|
|
is_round = True, winding_scheme= 2)
|
|
|
|
|
|
|
|
AHH_Coil.set_R_inner(HH_Coil.get_R_inner() * 1e3)
|
|
|
|
AHH_Coil.set_d_max(D_max)
|
|
|
|
|
|
|
|
AHH_Coil.print_info()
|
2021-11-02 10:02:55 +01:00
|
|
|
print(f"AHH N = {AHH_Coil.get_N()}")
|
|
|
|
I_grad = I - 0.128 # 8 x 9#128 / AHH_Coil.get_N() * I
|
|
|
|
|
|
|
|
I_grad = I - 0.15 # 8 x 8
|
2021-10-29 18:37:36 +02:00
|
|
|
|
2021-11-02 10:02:55 +01:00
|
|
|
print(f"current @ 6G/cm: {I_grad} A")
|
|
|
|
AHH_Coil.B_grad_quick_plot(I_grad)
|
2021-10-29 18:37:36 +02:00
|
|
|
#Bz, Bx = AHH_Coil.B_field(I)
|
2021-11-02 10:02:55 +01:00
|
|
|
AHH_Coil.cooling(I_grad, 22.5)
|
|
|
|
|
|
|
|
#Bz, Bx = AHH_Coil.B_field(I_grad, x, z, raster = 7)
|
|
|
|
# Bz_grad = BC.BCoil.grad(Bz,z)
|
|
|
|
# Bx_grad = BC.BCoil.grad(Bx,x)
|
|
|
|
|
|
|
|
#AHH_Coil.B_quick_plot(I_grad)
|
|
|
|
#AHH_Coil.B_grad_quick_plot(I_grad)
|
|
|
|
AHH_Coil.plot_raster(raster_value= 11)
|
2021-11-12 16:38:25 +01:00
|
|
|
AHH_Coil.plot_3d(I,50,50)
|
2021-11-02 10:02:55 +01:00
|
|
|
|
|
|
|
# zero = mu_it(0)
|
|
|
|
# print(f"Bz_grad({z[zero]}) = {Bz_grad[zero]} G/cm")
|
|
|
|
# mu = mu_it(1)
|
|
|
|
# mm = mu_it(1000)
|
|
|
|
# mid = mu_it(5000)
|
|
|
|
# outer = mu_it(15000)
|
|
|
|
# # Bz0 = Bz_grad[zero]
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# print(f"Bz_grad({z[mu]} mm) - Bz_grad (0) = {Bz0 - Bz_grad[mu]}, relative = {(Bz0 - Bz_grad[mu])/Bz0}")
|
|
|
|
# print(f"Bz_grad({z[mm]} mm) - Bz_grad (0) = {Bz0 - Bz_grad[mm]}, relative = {(Bz0 - Bz_grad[mm])/Bz0}")
|
|
|
|
# print(f"Bz_grad({z[mid]} mm) - Bz_grad (0) = {Bz0 - Bz_grad[mid]}, relative = {(Bz0 - Bz_grad[mid])/Bz0}")
|
|
|
|
# print(f"Bz_grad({z[outer]} mm) - Bz_grad (0) = {Bz0 - Bz_grad[outer]}, relative = {(Bz0 - Bz_grad[outer])/Bz0}")
|