openPMD-beamphysics
openPMD-beamphysics copied to clipboard
Derby-Olbert Ideal Solenoid
This adds modeling of an ideal solenoid from the formulas in: Derby, N., & Olbert, S. (2010). Cylindrical magnets and ideal solenoids. American Journal of Physics, 78(3), 229–235. https://doi.org/10.1119/1.3256157
This adds:
- New
pmd_beamphysics.fields.solenoidwith:-
make_solenoid_fieldmeshto make a newFieldMeshobject -
fit_ideal_solenoidto fit the length and radius of on-axis solenoid data to the ideal model
-
- tests for the complete elliptic integral of the third kind
- stream plotting for cylindrical field maps
- label fixes
Examples:
FM = make_solenoid_fieldmesh(
radius=0.05,
L=0.2,
rmax=0.1,
zmin=-0.5,
zmax=0.5,
nr=51,
nz=100,
B0=1,
)
linewidth = 0.5 + np.random.normal(scale=0.3, size=(2*FM.shape[0]-1, FM.shape[2]))
FM.plot(stream=True, mirror='r', density=8, linewidth=linewidth, arrowsize=0, figsize=(8,8), aspect='equal',
cmap='copper')