From 8595507a07869e4eee5b253f6609a275d6206e1a Mon Sep 17 00:00:00 2001 From: schoener Date: Wed, 27 Oct 2021 16:50:17 +0200 Subject: [PATCH] Calculations on wire decision --- Coil_geometry/14_new_HH_coil_wire_decision.py | 29 ++++++++++++++----- src/coil_class.py | 2 ++ untitled0.py | 13 ++++++++- 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/Coil_geometry/14_new_HH_coil_wire_decision.py b/Coil_geometry/14_new_HH_coil_wire_decision.py index 8bac1bb..c10c71f 100644 --- a/Coil_geometry/14_new_HH_coil_wire_decision.py +++ b/Coil_geometry/14_new_HH_coil_wire_decision.py @@ -11,25 +11,38 @@ import matplotlib #matplotlib.use('Qt5Agg') from src import coil_class as BC +scale = 1000 +lim = 5 +nr_points = (2 * lim) * scale + 1 +x = np.linspace(-lim,lim,nr_points) +z = np.linspace(-lim,lim,nr_points) -I = 10/8 -print(I) +def mu_it(x_pos): + it = nr_points//2 + x_pos + return it -Wire_1 = BC.BCoil(HH = 1, distance = 54, radius = 48, layers = 8, windings = 8, wire_height = 0.5, wire_width = 0.5, insulation_thickness= 0.06, is_round = True, winding_scheme= 2) + +wire_radius = 0.475 + +Wire_1 = BC.BCoil(HH = 1, distance = 54, radius = 48, layers = 8, windings = 8, wire_height = wire_radius, wire_width = wire_radius, insulation_thickness= 0.068, is_round = True, winding_scheme= 2) Wire_1.set_R_outer(49.8) Wire_1.set_d_min(49.8) Wire_1.print_info() print(Wire_1.get_coil_width() * 1e3 * Wire_1.get_coil_height() * 1e3) print(f"H = {Wire_1.get_coil_height() * 1e3}, W = {Wire_1.get_coil_width()*1e3}") - - +I = 64/Wire_1.get_N() *1.25 +print(f"I = {I} A") Wire_1.cooling(I,22.5) Wire_1.plot_raster(30) - -Wire_1.B_quick_plot(I) -Wire_1.B_curv_quick_plot(I,nr_points= 1000) +Bz, Bx = Wire_1.B_field(I,x,z, raster = 10) +Bz_curv = BC.BCoil.curv(Bz,z) +zero = mu_it(0) +print(z[zero]) +print(f"Curvature = {Bz_curv[zero]}") +#Wire_1.B_quick_plot(I) +#Wire_1.B_curv_quick_plot(I,nr_points= 1000) diff --git a/src/coil_class.py b/src/coil_class.py index 6f88b7b..695864b 100644 --- a/src/coil_class.py +++ b/src/coil_class.py @@ -478,9 +478,11 @@ class BCoil: plt.ylabel("z-axis [mm]") plt.show() + @staticmethod def curv(B_f, z): return np.gradient(np.gradient(B_f, z), z) * 1e2 + @staticmethod def grad(B_f, z): return np.gradient(B_f, z) * 1e1 diff --git a/untitled0.py b/untitled0.py index fa5a5c1..c5c5c29 100644 --- a/untitled0.py +++ b/untitled0.py @@ -22,4 +22,15 @@ print(10e-3/13.7) a = 7 if (a == (7 or 3)): - print("true") \ No newline at end of file + print("true") + +print(40*1e-3*np.pi) +print(4/0.127) + +print(30/0.3) + +print(30/400) + +print(4.3*4.8/(60*(0.475/2)**2 *np.pi)) + +print(1/1.94) \ No newline at end of file