import matplotlib.pyplot as plt import numpy as np import matplotlib #matplotlib.use('Qt5Agg') from src import coil_class as BC HH_Coil = BC.BCoil(HH = 1, distance = 54, radius = 48, layers = 8, windings = 8, wire_height = 0.5, wire_width = 0.5, insulation_thickness = (0.546-0.5)/2, is_round = True, winding_scheme= 2) HH_Coil.set_R_inner(45.6) HH_Coil.set_d_min(47.4) HH_Coil.print_info() print(f"inductivity = {HH_Coil.induct_perry()*2} H") AHH_Coil = BC.BCoil(HH = -1, distance = 54, radius = 48, layers = HH_Coil.get_layers, windings=2 * HH_Coil.get_windings, wire_height = 0.5, wire_width=0.5, insulation_thickness=(0.546-0.5)/2, is_round = True, winding_scheme= 2, red_N=1) AHH_Coil.set_R_inner(45.6) AHH_Coil.set_d_max(77.6) AHH_Coil.print_info() R = HH_Coil.resistance(25) # %% AHH_Coil.plot_raster() print(AHH_Coil.get_N()) # %% I = 1 AHH_Coil.cooling(I, 22.5) AHH_Coil.max_gradient(I) I_2 = 0.92 HH_Coil.cooling(I_2,22.5) HH_Coil.max_field(I_2) # %% HH_Coil.print_info() AHH_Coil.print_info() print("All values for pair in series") print(f"inductivity AHH: {AHH_Coil.induct_perry()*2*1e3} mH" ) print(f"inductivity HH: {HH_Coil.induct_perry() * 2*1e3} mH" ) print(f"resistance AHH: {AHH_Coil.resistance(22) *2} Ω") print(f"resistance HH: {HH_Coil.resistance(22)*2} Ω") print(f"resistance HH: {HH_Coil.resistance(2)*2} Ω") print(f"rel change: {(HH_Coil.resistance(22)-HH_Coil.resistance(23))/HH_Coil.resistance(22)} Ω") print(f"res of 4 m copper wire: {BC.BCoil.resistivity_copper(22)*5*0.5**2 *np.pi *1e6} Ω") # %% I = 1 AHH_Coil.cooling(I,22) AHH_Coil.max_gradient(I) I_HH = 1 HH_Coil.cooling(I,22) HH_Coil.max_field(I) #%% # field quality HH_Coil.B_quality(z_pos=1) HH_Coil.B_quality(z_pos=19) # %% AHH_Coil.Grad_quality(z_pos=1) #%% gradient quality x = np.linspace(-20, 20, 40001) z = np.linspace(-20, 20, 40001) B_z, B_x_tot = AHH_Coil.B_field(1, x, z, raster = 7) Bz = BC.BCoil.grad(B_z, z) #AHH_Coil.cooling(I_current,28) print(f"Bz_grad(0) = {Bz[15000]} G") #print(f"B_z_curvature(0) = {Bz_curv[15000]:.10f} G/cm^2") #print(f"Bz(1 μm) = {Bz[15001]}") #print(f"Bz(1 mm) = {Bz[16000]}") print(f"Diff B +/- 1 μm: {Bz[15001] - Bz[15000]}, relative: {(Bz[15001] - Bz[15000])/Bz[15000]}") print(f"Diff B +/- 0.5 mm: {Bz[15500] - Bz[15000]}, relative: {(Bz[15500] - Bz[15000])/Bz[15000]}") print(f"0 = {z[20000]}, 1 = {z[21000]}, 19 = {z[39000]}") print(f"Diff Grad B +/- 1 mm: relative: {(Bz[20000] - Bz[21000])/Bz[20000]}") print(f"Diff Grad B +/- 19 mm: relative: {(Bz[20000] - Bz[39000])/Bz[20000]}") # %% plt.plot(z,Bz) plt.show() # %% rho = BC.BCoil.resistivity_copper(50) l = 48e-3*2*np.pi * 64 A = 0.25e-3**2 *np.pi R_22 = BC.BCoil.resistivity_copper(16) *l/A R_50 = BC.BCoil.resistivity_copper(50)*l/A print(R_22) print(R_50) print((R_50-R_22)/R_50) print(BC.BCoil.resistivity_copper(28)) # SF coil # %% SF_Coil = BC.BCoil(HH = 1, distance = 54, radius = 48, layers = 1, windings = 1, wire_height = 0.5, wire_width = 0.5, insulation_thickness = (0.546-0.5)/2, is_round = True, winding_scheme= 2) SF_Coil.set_R_inner(38.4) SF_Coil.set_d_min(47.4) SF_Coil.print_info() print(f"inductivity = {SF_Coil.induct_perry()*2} H") print(f"resistance SF: {SF_Coil.resistance(22.5)*2} Ω") SF_Coil.max_field(1) SF_Coil.B_quality() SF_Coil.B_quality( z_pos=19) SF_Coil.cooling(1, 22.5) print(SF_Coil.power(1, 22.5))