40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
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(2*24.075)
|
|
|
|
|
|
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)
|
|
|
|
AHH_Coil.set_R_inner(45.6)
|
|
AHH_Coil.set_d_min(HH_Coil.get_zmax()*2 * 1e3 + 4)
|
|
|
|
d = AHH_Coil.get_radius()
|
|
print(d)
|
|
AHH_Coil.set_d(d + 5)
|
|
|
|
# %%
|
|
|
|
z = np.linspace(-50,50,500)
|
|
I = 1
|
|
Bz, Bx = AHH_Coil.B_field(I,z,z)
|
|
Bz_grad = AHH_Coil.grad(Bz,z)
|
|
Bz_curv = AHH_Coil.grad(Bz_grad, z)
|
|
Bz_4 = BC.BCoil.grad(Bz_curv, z)
|
|
plt.plot(z,Bz)
|
|
plt.plot(z,Bz_grad)
|
|
plt.plot(z, Bz_curv)
|
|
plt.plot(z, Bz_4)
|
|
plt.show()
|