DyLab_3D_MOT/Coil_geometry/HH/04_Iterative_Testing.py

60 lines
1.6 KiB
Python
Raw Normal View History

2021-10-01 14:37:07 +02:00
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 24 16:24:52 2021
@author: Joschka
"""
import matplotlib.pyplot as plt
import numpy as np
from src import B_field_calculation as bf
from src import coil_class as BC
from IPython import get_ipython
get_ipython().run_line_magic('matplotlib', 'qt')
#get_ipython().run_line_magic('matplotlib', 'inline')
x = np.linspace(-1, 1, 11)
z = np.linspace(-1, 1, 11)
I_current = 5*16
HH_Coil = HH_Coil_comp = BC.BCoil(HH = 1, distance = 54 ,radius = 37,layers = 1, windings = 1,wire_width = 8, wire_height = 8)
HH_Coil.set_R_outer(49.3)
HH_Coil.set_d_min(49.8)
HH_Coil.print_info()
Bz, Bx = HH_Coil.B_field(I_current, x, z, raster = 50)
2021-10-01 14:37:07 +02:00
Bz_curv = BC.BCoil.curv(Bz, z)
HH_Coil.cooling(I_current,30)
print(f"B_z(0) = {Bz[1]:.2f} G")
print(f"B_z_curvature(0) = {Bz_curv[1]:.4f} G/cm^2")
B = []
Curv = []
array_width = np.arange(0.2,11,0.1)
#array_width = [5.7]
for width in array_width:
height = 20/width
HH_Coil = HH_Coil_comp = BC.BCoil(HH = 1, distance = 54 ,radius = 37,layers = 1, windings = 1,wire_width = width, wire_height = height)
HH_Coil.set_R_outer(49.3)
HH_Coil.set_d_min(49.8)
#HH_Coil.print_info()
Bz, Bx = HH_Coil.B_field(I_current, x, z, raster = 30)
2021-10-01 14:37:07 +02:00
Bz_curv = BC.BCoil.curv(Bz, z)
HH_Coil.cooling(I_current,30)
B.append(Bz[5])
Curv.append(Bz_curv[5])
print(f"width = {width}mm, height = {height}mm")
print(f"B_z(0) = {Bz[5]:.2f} G")
print(f"B_z_curvature(0) = {Bz_curv[5]:.4f} G/cm^2")
plt.plot(array_width,Curv)
#plt.plot(array_width,B)
plt.ylabel("curvature")
plt.xlabel("total width [mm]")
plt.show()