On The Magnetic Field of A Finite Solenoid
On The Magnetic Field of A Finite Solenoid
On The Magnetic Field of A Finite Solenoid
The magnetostatic field of a finite solenoid with infinitely thin walls carrying a dc current oriented in the azimuthal direction
is calculated everywhere in space in terms of complete elliptic integrals by direct integration of the Biot–Savart law. The solution
is particularized near the solenoid axis and in the midplane perpendicular to the axis obtaining expressions that agree with some
typical approximations that are made in introductory courses of electromagnetism or in the technical literature. The range of validity
of these approximations has been studied comparing them with the obtained general expression.
Index Terms— Elliptic integrals, finite solenoid, magnetostatics.
I. I NTRODUCTION
SOLENOID is often used in electron microscopes [1] or
A in RF photoinjector guns [2] to reduce the beam emit-
tance increase that occurs in the early stages of acceleration
since its magnetic field can be used to focus charged particle
beams [3], [4]. Solenoids can also be used to mitigate the
multipactor effect in coaxial waveguides [5], [6] and in the
traditional engine valve train in combustion engines [7], [8],
[9], [10].
The magnetic field on the axis of symmetry of a finite
solenoid is calculated [11], [12], [13], [14], [15] or proposed
as an exercise [16], [17], [18], [19], [20] in many textbooks
on electromagnetics and classical electrodynamics. However,
the general solution for points that do not lie on the axis of
symmetry cannot be found even in advanced textbooks [21],
[22], [23], [24] or journals. Fig. 1. Scheme of the considered finite solenoid.
It can be found in the technical literature that this magne-
tostatic problem was solved by Callaghan and Maslen [25] in
1960 in a NASA technical note. Nevertheless, as we will see in 2001 an elliptic integral-based solution for a generalized
in Section II, there is a sign error in the final expression of axisymmetric current distribution.
the radial component of the magnetic field obtained in that Thus, the aim of this article is the derivation of the correct
NASA report. And, moreover, the solution is given in terms general expression of the magnetic field of a finite solenoid in
of the Heuman Lambda function (and elliptic integrals), which terms only of complete elliptic integrals and its comparison
is not directly implemented in some numeric commercial with well-known expressions and approximations in some
computing software as MATLAB [26] or Mathematica [27] interesting cases. This document is organized as follows.
(although the Heuman Lambda function can be expressed in In Section II, we derive the expression of the magnetic field
terms of complete and incomplete elliptic integrals of the first everywhere in space. In Sections III and IV, we obtain some
and second kind [28]). Furthermore, Brick and Snyder [29] approximations of the magnetic field near the solenoid axis and
investigated in 1965 the external dc field of a long solenoid in the median plane comparing them with the real magnetic
obtaining an exact solution in terms of an infinite series and field. We conclude the article with final remarks in Section V.
using their results, Joseph [30] obtained the exact result for the
magnetic field in the median plane in terms of complete elliptic II. M AGNETIC F IELD OF A F INITE S OLENOID
integrals the next year. More recently, Conway [31] presented We are going to consider a finite solenoid that consists of
a cylindrical tube with radius r0 and length h with N turns
Manuscript received 25 November 2022; revised 7 February 2023; accepted
27 February 2023. Date of publication 1 March 2023; date of current carrying a dc current I around its surface (see Fig. 1).
version 24 March 2023. Corresponding author: P. Martín-Luna (e-mail: Because of the symmetry and considering the conventional
Pablo.Martin@uv.es). cylindrical coordinates (r, ϕ, z), the solution does not depend
Color versions of one or more figures in this article are available at
https://doi.org/10.1109/TMAG.2023.3250837. on the azimuthal coordinate ϕ. The magnetic field of a finite
Digital Object Identifier 10.1109/TMAG.2023.3250837 solenoid with n = N / h number of turns per unit length and
0018-9464 © 2023 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.
See https://www.ieee.org/publications/rights/index.html for more information.
Authorized licensed use limited to: UNIVERSIDADE ESTADUAL DE MARINGA. Downloaded on February 16,2024 at 17:29:40 UTC from IEEE Xplore. Restrictions apply.
7000106 IEEE TRANSACTIONS ON MAGNETICS, VOL. 59, NO. 4, APRIL 2023
r0 E(k± ) 2
r
a constant dc current I at an arbitrary point r⃗ is given by the 1 k±
= −4 − 1− K (k± ) (9)
Biot–Savart law [16], [17] r k± k± 2
Z π
r0 + r 1 − 2 sin2 u du
⃗ r ) = µ0
Z ⃗
K × R⃗ ′ ′
I± = 4r0
2
B(⃗ dS (1)
(r + r0 )2 1 − σ sin2 u
4π S R 3 0
z ± h/2
where K⃗ = n I ϕ̂ ′ (the symbol ˆ denotes unit vector) is the ×q
surface current and R⃗ = r⃗ − r⃗′ , where the primed coordinates
2
(r + r0 )2 − 4r0r sin2 u + z ± h2
denote the position of the current distribution: r⃗′ = (r0 , ϕ ′ , z ′ ) r
and evidently the range of the variables is ϕ ′ ∈ [0, 2π [, r0 z h
= +
z ′ ∈ [−h/2, h/2]. Thus, the magnetic field can be written r r0 2r0
as follows:
1 − r/r0
× k± 5(σ, k± ) + K (k± ) (10)
⃗ r ) = Br (r, z)r̂ + Bz (r, z)ẑ
B(⃗ (2) 1 + r/r0
Z 2π
B0 where we have defined the parameters
Br (r, z) = dϕ ′
4π 0 s v
4rr0 u 4r/r0
r0 z − z ′ cos ϕ ′
Z h/2
′
k± = 2
=u 2 2
(r + r0 )2 + z ± h2
t
× 3/2 dz
r
−h/2 r + r − 2r 0 r cos ϕ + (z − z )
2 2 ′ ′ 2 1+ r0
+ rz0 ± h
2r0
0
(3) (11)
B0 2π ′
Z 4rr0 4r/r0
Bz (r, z) = dϕ σ = = (12)
4π 0 (r + r0 )2
(1 + r/r0 )2
r0 r0 − r cos ϕ ′
Z h/2
′ and K (k), E(k), and 5(σ, k) are the complete elliptic integrals
× 3/2 dz of the first, second, and third kind [32], respectively,
−h/2 r 2 + r 2 − 2r 0 r cos ϕ ′ + (z − z ′ )2
0
(4) Z π/2
dt
K (k) = p (13)
where we have taken into account that it cannot depend on 0 1 − k 2 sin2 t
Z π/2 p
the azimuthal angle ϕ because of the symmetry of revolution
E(k) = 1 − k 2 sin2 tdt (14)
and B0 = µ0 n I has been defined. Using the integrals 0
Z π/2
Z
x 1 dt
3/2 d x = − √ 5(σ, k) = p . (15)
b+x 2 b + x2 0 1 − σ sin t 1 − k 2 sin2 t
2
Z
dx x On the one hand, if (9) is substituted into (5), it can be easily
3/2 = √
b + x2 b b + x2 checked that the expression obtained by Callaghan and Maslen
[25, eq. (9)] for the radial magnetic field is missing a global
the integration in the variable z ′ can be easily performed, sign. On the other hand, the magnetic field of the solenoid
obtaining can be rewritten in a dimensionless form with the distances
B0 given in units of the solenoid radius r0 . Consequently, the
Br (r, z) = (I− − I+ ) (5) magnetic field of a finite solenoid can be studied varying the
4π
B0 ′ ratio h/r0 . Fig. 2 shows the magnetic field lines and Fig. 3
Bz (r, z) = I+ − I−′
(6) shows the components of the magnetic field for h/r0 = 2 and
4π
r0 cos ϕ ′ dϕ ′ h/r0 = 10, respectively, obtaining the expected behavior: the
Z 2π
I± = q 2 (7) axial component is very strong inside the solenoid and the
0
r 2 + r02 − 2r0r cos ϕ ′ + z ± h2 radial component is also significant at the end of the solenoid
r0 − r cos ϕ ′ and near its surface. It can be seen that the axial component
Z 2π
′
I± = r 0 dϕ ′ 2 tends to a constant value B0 inside the solenoid when the ratio
0 r + r02 − 2r0r cos ϕ ′
h/r0 increases.
z ± h/2
×q 2 . (8)
r 2 + r02 − 2r0r cos ϕ ′ + z ± h2 III. M AGNETIC F IELD N EAR THE z- AXIS
These integrals in ϕ can be easily expressed in terms of
′
The magnetic field on the z-axis (r = 0) simplifies to the
complete elliptic integrals [28], [32] introducing the new well-known expression as follows:
integration variable u = π/2 − ϕ ′ /2 and using the identity
cos(2u) = 1 − 2 sin2 (u); now we find Br (0, z) = 0,
Z π
1 − 2 sin2 u du
k± 2 B0 z + h/2 z − h/2
I± = − 4r0 √ q Bz (0, z) = q −q 2
(16)
4rr0 0 1 − k±2
sin2 u 2 2 h 2 h 2
r0 + z + 2 r0 + z − 2
Authorized licensed use limited to: UNIVERSIDADE ESTADUAL DE MARINGA. Downloaded on February 16,2024 at 17:29:40 UTC from IEEE Xplore. Restrictions apply.
MARTÍN-LUNA et al.: ON THE MAGNETIC FIELD OF A FINITE SOLENOID 7000106
Fig. 2. Magnetic field lines in the x z-plane of a finite solenoid with (a) h/r0 = 2 and (b) h/r0 = 10. Thick lines indicate the surface of the solenoid.
∞ (2n−1)
where it has been used that K (0) = E(0) = 5(0, 0) = π/2. X (−1)n Bz0 r 2n−1
Br (r, z) =
The magnetic field near the axis (r ≪ r0 ) is given by the n!(n − 1)! 2
n=1
following equation: 3
r (1) r (3)
= − B + B + ··· (23)
2 z0 16 z0
B0 rr02 rr02
Br (r, z) = − where the exponent between parentheses represents the order
4 3 3
2
r0 + z − 2h 2 2 2
r0 + z + 2h 2 2 of derivation with respect to z and Bz0 = Bz (r = 0, z). Fig. 4
shows the radial magnetic field near the z-axis showing that
+ O(r 3 ) (17) (17) is a good approximation up to r/r0 = 0.3.
Bz (r, z) = Bz (r = 0, z) + O(r ) 2
(18)
IV. M AGNETIC F IELD IN THE x y-P LANE
where we have used the following expansions of the complete
elliptic integrals [28], [32] In the x y-plane, it is satisfied that
s
4r/r0
∞
!
π (2n − 1)!! 2 2n
K (k) = 1+
X
k k ≡ k± =
2 (2n)!! (1 + r/r0 )2 + (h/(2r0 ))2
n=1
π
1 2 9 4
since z = 0. Consequently, Br (r, z = 0) = 0 and the axial
= 1 + k + k + ··· (19) component is given by the following equation:
2 4 64 r
∞
π X (2n)! 2 k 2n
B0 r0 h
E(k) = Bz (r, z = 0) = k
2 n=0 22n (n!)2 1 − 2n 4π r r0
1 − r/r0
π 5(σ, k) + K (k) .
1 2 3 4 × (24)
= 1 − k − k − ··· (20) 1 + r/r0
2 4 64
It has been checked that this expression is analogous to the
π X X (2m)!(2 j)!k 2 j σ (m− j)
∞ m
5(σ, k) = exact result obtained by Joseph [30].
2 m=0 j=0 4m 4 j (m!)2 ( j!)2 First, in the limit r ≪ r0 , it can be easily checked that the
π
1 1 3 1 9
expansion of Bz (r, z = 0) is
= 1 + σ + k 2 + σ 2 + k 2 σ + k 4 +· · · 4 !
2 2 4 8 16 64 r 2 (2) r
Bz (r, z = 0) = Bz (0, 0) − Bz (r, 0) + O (25)
(21) 4 r0
which will be also used in Section IV. as it was predicted by (22). Fig. 5 shows the real magnetic
Equations (17) and (18) coincide with the first nonvanishing field (24) compared with the approximation (25) for different
term of the expansions of the magnetic field near the axis in values of h/r0 showing a good agreement up to r/r0 = 0.3.
rotationally symmetrical systems [33] Second, we are going to expand the expression for Bz (r →
∞ (2n)
r0− , z = 0) in powers of r0 / h in order to study the effect of the
X (−1)n Bz0 r 2n length of the solenoid near the surface of the solenoid. In this
Bz (r, z) =
n=0
(n!)2 2 case, we have to be careful with the following expansion:
π
r (2) r 4 (4)
2 1 − r/r0 r 2
0 r0 4
= Bz0 − B + B + ··· (22) 5(σ, k) = − − 4π +O (26)
4 z0 64 z0 1 + r/r0 2 h h
Authorized licensed use limited to: UNIVERSIDADE ESTADUAL DE MARINGA. Downloaded on February 16,2024 at 17:29:40 UTC from IEEE Xplore. Restrictions apply.
7000106 IEEE TRANSACTIONS ON MAGNETICS, VOL. 59, NO. 4, APRIL 2023
Fig. 3. Magnetic field components in the x z-plane (a) Bz , (b) Bx of a finite solenoid with h/r0 = 2, (c) Bz , and (d) Bx for h/r0 = 10. Black lines indicate
constant magnetic component field lines.
Fig. 4. (a) Radial component Br of the magnetic field near the z-axis for different values of h/r0 at (a) z = 0.25h (inside the solenoid) and (b) z = 0.7h
(outside the solenoid). Dashed lines show the approximation (17).
since it has the opposite sign if r → r0+ and it is responsible Fig. 6 compares the approximation (27) with the real value
for the discontinuity of the magnetic field in r = r0 . Thus, the calculated making numerically the limit r → r0− in (24). It can
following expansion is obtained: be seen that the approximation agrees very well for high values
of h/r0 and the error decreases as (r0 / h)4 as it is expected.
r 2
0
r0 4 Similarly, in the limit r → r0+ , the obtained expansion as
Bz (r → r0− , z = 0) = B0 1−2 +O . follows:
h h
r 2 r0 4
0
Bz (r → r0 , z = 0) = −2B0
+
+O (28)
(27) h h
Authorized licensed use limited to: UNIVERSIDADE ESTADUAL DE MARINGA. Downloaded on February 16,2024 at 17:29:40 UTC from IEEE Xplore. Restrictions apply.
MARTÍN-LUNA et al.: ON THE MAGNETIC FIELD OF A FINITE SOLENOID 7000106
Fig. 5. Magnetic field for z = 0 inside the solenoid for different values of Fig. 7. Absolute value of the magnetic field outside the solenoid calculated
h/r0 . Dashed lines indicate the approximation (25). using (24) for different values of h/r0 . Dashed lines show the dipolar
approximation (31), the horizontal lines show the approximation just outside
the solenoid (28), and the dotted lines show the approximation (29).
Bz r → r0+ , z = 0
r 2 r 2 r 2
0 0
= −2B0 1−3 −6 + ··· . (29)
h h h
It is interesting to note that
V. C ONCLUSION
A general solution for the magnetic field generated by
a finite solenoid of length h and radius r0 carrying a dc
current in the azimuthal direction has been obtained by direct
Fig. 6. (a) Magnetic field Bz (r → r0− , z = 0)/B0 calculated using (24) integration of the Biot–Savart law. This general solution has
compared with the approximation (27) as a function of h/r0 . (b) Error between
the real value and the approximation (27) in units of B0 . been expressed in terms of the complete elliptic integrals.
Additionally, we have obtained simplified approximate expres-
sions for the magnetic field in the solenoid axis vicinity and
agrees with the expression obtained by Farley and Price [34] in the median plane comparing their validity with the general
using simple arguments involving magnetic flux and with the solution.
Authorized licensed use limited to: UNIVERSIDADE ESTADUAL DE MARINGA. Downloaded on February 16,2024 at 17:29:40 UTC from IEEE Xplore. Restrictions apply.
7000106 IEEE TRANSACTIONS ON MAGNETICS, VOL. 59, NO. 4, APRIL 2023
ACKNOWLEDGMENT [15] J. A. Stratton, Electromagnetic Theory. Hoboken, NJ, USA: Wiley, 2007.
[16] D. J. Griffiths, Introduction to Electrodynamics. New York, NY, USA:
This work was supported by the Ministerio de Universidades Pearson Education, 2013.
(Gobierno de España) under Grant FPU20/04958. [17] J. D. Jackson, Classical Electrodynamics. New York, NY, USA: Wiley,
1999.
R EFERENCES [18] J. Vanderlinde, Classical Electromagnetic Theory. New York, NY, USA:
Kluwer Academic Publishers, 2004.
[1] D. B. Williams and C. B. Carter, Transmission Electron Microscopy. [19] R. H. Good and T. J. Nelson, Classical Theory of Electric and Magnetic
New York, NY, USA: Plenum, 1996. Fields. New York, NY, USA: Academic Press, 1974.
[2] D. H. Dowell, “Sources of emittance in RF photocathode injec- [20] E. J. Konopinski, Electromagnetic Fields and Relativistic Particles. New
tors: Intrinsic emittance, space charge forces due to non-uniformities, York, NY, USA: McGraw-Hill, 1981.
RF and solenoid effects,” SLAC Nat. Accel. Lab., Menlo Park, [21] W. Greiner, Classical Electrodynamics. New York, NY, USA: Springer,
CA, USA, Tech. Rep. SLAC-PUB-16895, 1999. [Online]. Available: 1998.
https://www.slac.stanford.edu/pubs/slacpubs/16750/slac-pub-16895.pdf [22] A. Zangwill, Modern Electrodynamics. Cambridge, U.K.: Cambridge
[3] A. Chao and M. Tigner, Handbook of Accelerator Physics and Engi- Univ. Press, 2012.
neering. Singapore: World Scientific, 1998. [23] W. K. H. Panofsky and M. Phillips, Classical Electricity and Magnetism.
[4] V. Kumar, “Understanding the focusing of charged particle beams in a Reading, MA, USA: Addison-Wesley, 1966.
solenoid magnetic field,” Amer. J. Phys., vol. 77, no. 8, pp. 737–741, [24] L. Eyges, The Classical Electromagnetic Field. New York, NY, USA:
Aug. 2009. Dover, 1972.
[5] D. González-Iglesias et al., “Multipactor mitigation in coaxial lines by [25] E. E. Callaghan and S. H. Maslen, “The magnetic field of a finite
means of permanent magnets,” IEEE Trans. Electron Devices, vol. 61, solenoid,” Nat. Aeronaut. Space Admin., Washington, DC, USA,
no. 12, pp. 4224–4231, Dec. 2014. Tech. Rep. D-465, 1960. [Online]. Available: https://books.google.es/
[6] D. Gonzalez-Iglesias et al., “Multipactor in a coaxial line under the books?hl=es&lr=&id=2DkkAQAAIAAJ&oi=fnd&pg=PA2&dq=THE+
presence of an axial DC magnetic field,” IEEE Trans. Electron Devices, MAGNETIC+FIELD+OF+A+FINITE+SOLENOID&ots=lzy54EOdGV
vol. 33, no. 5, pp. 727–729, May 2012. &sig=DkqHg6IsXar8jM5Jg-O-WbPQPGY#v=onepage&q=THE%20
[7] J. Kim and J. Chang, “A new electromagnetic linear actuator for MAGNETIC%20FIELD%20OF%20A%20FINITE%20SOLENOID&
quick latching,” IEEE Trans. Magn., vol. 43, no. 4, pp. 1849–1852, f=false
Apr. 2007. [26] MATLAB, Version 9.12.0 (R2022a), The MathWorks Natick, MA, USA,
[8] R. E. Clark, G. W. Jewell, S. J. Forrest, J. Rens, and C. Maerky, 2022.
“Design features for enhancing the performance of electromagnetic valve [27] Mathematica, Version 13.1, Wolfram Research, Champaign, IL, USA,
actuation systems,” IEEE Trans. Magn., vol. 41, no. 3, pp. 1163–1168, 2022.
Mar. 2005. [28] M. Abramowitz and I. A. Stegun, Handbook of Mathematical Functions
[9] W. S. Chang, T. A. Parlikar, M. D. Seeman, D. J. Perreault, With Formulas, Graphs, and Mathematical Tables. New York, NY, USA:
J. G. Kassakian, and T. A. Keim, “A new electromagnetic valve actua- Dover, 1972.
tor,” in Proc. Power Electron. Transp., 2002, pp. 109–118. [29] D. B. Brick and A. W. Snyder, “External DC field of a long solenoid,”
[10] J.-J. Liu, Y.-P. Yang, and J.-H. Xu, “Electromechanical valve actu- Amer. J. Phys., vol. 33, no. 11, pp. 905–909, Nov. 1965.
ator with hybrid MMF for camless engine,” IFAC Proc. Vol- [30] R. I. Joseph, “Comments on ‘external DC field of a long solenoid,”’
umes, vol. 41, no. 2, pp. 10698–10703, 2008. [Online]. Available: Amer. J. Phys., vol. 34, no. 9, pp. 817–818, 1966.
https://www.sciencedirect.com/science/article/pii/S147466701640683X [31] J. T. Conway, “Exact solutions for the magnetic fields of axisymmetric
[11] E. M. Purcell and D. J. Morin, Electricity and Magnetism. Cambridge, solenoids and current distributions,” IEEE Trans. Magn., vol. 37, no. 4,
U.K.: Cambridge Univ. Press, 2013. pp. 2977–2988, Jul. 2001.
[12] J. Franklin, Classical Electromagnetism. New York, NY, USA: Dover, [32] P. F. Byrd and M. D. Friedman, Handbook of Elliptic Integrals for
2017. Engineers and Scientists. Berlin, Germany: Springer, 1971.
[13] H. C. Ohanian, Classical Electrodynamics. Boston, MA, USA: Allyn [33] A. B. El-Kareh and J. C. J. El-Kareh, Electron Beams, Lenses, and
and Bacon, 1988. Optics. Orlando, Florida: Academic Press, 2012.
[14] M. Schwartz, Principles of Electrodynamics. New York, NY, USA: [34] J. Farley and R. H. Price, “Field just outside a long solenoid,” Amer. J.
Dover, 1972. Phys., vol. 69, no. 7, pp. 751–754, Jul. 2001.
Authorized licensed use limited to: UNIVERSIDADE ESTADUAL DE MARINGA. Downloaded on February 16,2024 at 17:29:40 UTC from IEEE Xplore. Restrictions apply.