Particle accelerators use powerful and complex magnetic fields to turn, shape, and eventually collide beams of near-light-speed particles, yet the fundamental magnetic principles behind the accelerator magnets can be understood by undergraduate students. In this paper, we use small-scale accelerator magnet analogs in a multi-faceted, low-cost exploration of the magnetic field exterior to accelerator magnets. These fields are best understood using the multipole expansion of the field. If we assume that the magnetic field is created by ideal magnetic dipoles, we can derive a theoretical model that shows that each accelerator magnet configuration is dominated by a single multipole moment and obeys B 1 / r l + 2, where l is the multipole order (with l = 1 , 2 , 3 , and 4 for the dipole, quadrupole, octopole, and hexadecapole moments, respectively). Using commercially available NdFeB magnets and the magnetic field sensor inside a smartphone, we experimentally verify the power-law dependence of the accelerator magnet configurations. Finally, we use the open-source Python library Magpylib to simulate the magnetic field of the permanent magnet configurations, showing good agreement among theory, experiment, and simulation.

1.
R.
Appleby
,
G.
Burt
,
J.
Clarke
, and
H.
Owen
, “
The science and technology of particle accelerators
,” in
The Science and Technology of Particle Accelerators
, 1st ed. (
CRC Press
,
Boca Raton, FL
,
2020
), pp.
112
162
.
2.
A.
Milanese
, “
An introduction to magnets for accelerators
,” <https://indico.cern.ch/event/1101643/contributions/> (
2022
), accessed on April 06, 2022.
3.
Dipole magnet
,” <https://en.wikipedia.org/wiki/Dipole_magnet> (
2022
), accessed on May 13, 2022.
4.
Quadrupole magnet
,” <https://en.wikipedia.org/wiki/Quadrupole_magnet> (
2022
), accessed on May 13, 2022.
5.
Sextupole magnet
,” <https://en.wikipedia.org/wiki/Sextupole_magnet> (
2022
), accessed on May 13, 2022.
6.
C. G.
Gray
,
G.
Karl
, and
V. A.
Novikov
, “
Quadrupolar contact fields: Theory and applications
,”
Am. J. Phys.
77
,
807
817
(
2009
).
7.
C. G.
Gray
,
G.
Karl
, and
V. A.
Novikov
, “
Magnetic multipolar contact fields: The anapole and related moments
,”
Am. J. Phys.
78
,
936
948
(
2010
).
8.
M.
Monteiro
and
A. C.
Martí
, “
Resource letter MDS-1: Mobile devices and sensors for physics teaching
,”
Am. J. Phys.
90
,
328
343
(
2022
).
9.
D. J.
O'Brien
, “
A guide for incorporating e-teaching of physics in a post-covid world
,”
Am. J. Phys.
89
,
403
412
(
2021
).
10.
See Ref. 8 (and references therein) for additional references.
11.
U.
Pili
and
R.
Violanda
, “
Measuring average angular velocity with a smartphone magnetic field sensor
,”
Phys. Teach.
56
,
114
115
(
2018
).
12.
S.
Arabasi
and
H.
Al-Taani
, “
Measuring the earth's magnetic field dip angle using a smartphone-aided setup: A simple experiment for introductory physics laboratories
,”
Eur. J. Phys.
38
,
025201
(
2016
).
13.
J.
Tronicke
and
M. H.
Trauth
, “
Classroom-sized geophysical experiments: Magnetic surveying using modern smartphone devices
,”
Eur. J. Phys.
39
,
035806
(
2018
).
14.
Y.
Ogawara
,
S.
Bhari
, and
S.
Mahrley
, “
Observation of the magnetic field using a smartphone
,”
Phys. Teach.
55
,
184
185
(
2017
).
15.
A.
Shakur
and
B.
Valliant
, “
Flyby measurement of the magnetic field of a helmholtz coil with a smart cart
,”
Phys. Teach.
58
,
15
17
(
2020
).
16.
E.
Arribas
,
I.
Escobar
,
C. P.
Suarez
,
A.
Najera
, and
A.
Beléndez
, “
Measurement of the magnetic field of small magnets with a smartphone: A very economical laboratory practice for introductory physics courses
,”
Eur. J. Phys.
36
,
065002
(
2015
).
17.
E.
Arribas
,
I.
Escobar
,
R.
Ramirez-Vazquez
,
C.
del Pilar Suarez Rodriguez
,
J.
Gonzalez-Rubio
, and
A.
Beléndez
, “
Linear quadrupole magnetic field measured with a smartphone
,”
Phys. Teach.
58
,
182
185
(
2020
).
18.
M.
Ortner
and
L. G.
Coliado Bandeira
, “
Magpylib: A free python package for magnetic field computation
,”
SoftwareX
11
,
100466
(
2020
).
19.
D. J.
Griffiths
, “
Electrodynamics
,” in
Introduction to Electrodynamics
, 4th ed. (
Cambridge U. P
.,
Cambridge
,
2017
), pp.
151
158
, 252–266.
20.
J. E.
McMurry
and
R. C.
Fay
,
General Chemistry: Atoms First
, 2nd ed. (
Pearson Education
,
London
,
2014
), Chap. 10.
21.
The CAD drawings and Magpylib simulation code are available for download from Github at github.com/matthew-c-sullivan/MagneticMultipoleExpt.
22.
See the supplementary material at https://www.scitation.org/doi/suppl/10.1119/5.0068701 for CAD files, simulation code in python, experimental details, and a derivation of the analytical solution leading to Eq. (1).
23.
A dipole is a current loop of area A and current I with dipole moment m = IA. An ideal dipole is a loop of infinitesimal area A and infinite current I, where the product m = IA remains constant (Ref. 19).
24.
We are using the spelling that is most common in the different fields. “Octupole” magnet is the spelling used in accelerator physics for the accelerator magnet configuration with eight magnets on an octagon. “Octopole” moment is the spelling used in electrodynamics for the l = 3 order in the field expansion that varies as 1 / r 5.
25.
R.
Raab
and
O.
de Lange
,
Multipole Theory in Electromagnetism: Classical, Quantum, and Symmetry Aspects, with Applications
(
Oxford U. P
.,
Oxford
,
2004
).
26.
A.
Wolski
, “
Maxwell's equations for magnets
,” e-print arXiv:1103.0713 [physics.acc-ph] (
2019
).
27.
C. G.
Gray
, “
Multipole expansions of electromagnetic fields using Debye potentials
,”
Am. J. Phys.
46
,
169
179
(
1978
).
28.
C. G.
Gray
, “
Simplified derivation of the magnetostatic multipole expansion using the scalar potential
,”
Am. J. Phys.
46
,
582
583
(
1978
).
29.
C. G.
Gray
, “
Magnetic multipole expansions using the scalar potential
,”
Am. J. Phys.
47
,
457
459
(
1979
).
30.
C. G.
Gray
, “
Definition of the magnetic quadrupole moment
,”
Am. J. Phys.
48
,
984
985
(
1980
).
31.
H.
González
,
S. R.
Juárez
,
P.
Kielanowski
, and
M.
Loewe
, “
Multipole expansion in magnetostatics
,”
Am. J. Phys.
66
,
228
231
(
1998
).
32.
See <https://cmsmagnetics.com/> to purchase permanent magnets, accessed on August 9,
2021
.
33.
See <https://www.shapeways.com/> to order 3-D printed parts, accessed on August 9,
2021
.
34.
See <https://phyphox.org/> for further information about the Phyphox app, accessed on August 9,
2021
.
35.
Generally, care must be taken when using log-log plots, and the results are usually only valid over many decades of data.
36.
We are indebted to our editors and anonymous reviewers for many of these suggestions.

Supplementary Material

AAPT members receive access to the American Journal of Physics and The Physics Teacher as a member benefit. To learn more about this member benefit and becoming an AAPT member, visit the Joining AAPT page.