openPMD-beamphysics icon indicating copy to clipboard operation
openPMD-beamphysics copied to clipboard

Derby-Olbert Ideal Solenoid

Open ChristopherMayes opened this issue 1 year ago • 0 comments

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.solenoid with:
    • make_solenoid_fieldmesh to make a new FieldMesh object
    • fit_ideal_solenoid to 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,
)
image image
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')
image

ChristopherMayes avatar Dec 23 '24 02:12 ChristopherMayes