Revista Mexicana de Física ISSN: 0035-001X [email protected] Sociedad Mexicana de Física A.C. México

Camacho, J. M.; Sosa, V. Alternative method to calculate the of permanent with azimuthal symmetry Revista Mexicana de Física, vol. 59, núm. 1, enero-junio, 2013, pp. 8-17 Sociedad Mexicana de Física A.C. Distrito Federal, México

Available in: http://www.redalyc.org/articulo.oa?id=57048158002

How to cite Complete issue Scientific Information System More information about this article Network of Scientific Journals from Latin America, the Caribbean, Spain and Portugal Journal's homepage in redalyc.org Non-profit academic project, developed under the open access initiative EDUCATION Revista Mexicana de F´ısica E 59 (2013) 8–17 JANUARY–JUNE 2013

Alternative method to calculate the magnetic field of permanent magnets with azimuthal symmetry

J. M. Camacho and V. Sosaa Facultad de Ingenier´ıa, Universidad Autonoma´ de Yucatan,´ Av. Industrias no contaminantes por Periferico´ Norte, A.P. 150 Cordemex, Merida,´ Yuc., Mexico.´ aPermanent address: Departamento de F´ısica Aplicada, CINVESTAV-IPN, Unidad Merida,´ A.P. 73 Cordemex, Merida,´ Yuc., C.P. 97310, Mexico.´ Phone: (+52-999) 9429445; Fax: (+52-999) 9812917. e-mail: [email protected]. Received 6 September 2012; accepted 8 January 2013

The magnetic field of a permanent is calculated analytically for different geometries. The cases of a sphere, cone, cylinder, ring and rectangular prism are studied. The calculation on the axis of symmetry is presented in every case. For magnets with cylindrical symmetry, we propose an approach based on an expansion in Legendre polynomials to obtain the field at points off the axis. The case of a cylinder magnet was analyzed with this method by calculating the between two magnets of this shape. Experimental results are presented too, showing a nice agreement with theory. Keywords: Permanent magnet; calculation; analytical; symmetry.

PACS: 75.50 Ww; 41.20 Gz.

1. Introduction develop an alternative method of calculation and find ana- lytical expressions for these fields. This will allow estima- tion of many important variables in certain applications, such Since ancient times, magnetism has captured the interest of as the force between magnets. We will see that the results human beings. The feeling of an unseen force (but no less obtained theoretically and experimentally are consistent with invisible than the force of gravity) acting with great inten- each other. sity, is often astonishing. The properties of magnetite, an iron mineral used as the needle in a , were known since the eleventh century A. D. Over years, knowledge of 2. Theory magnetic phenomena has opened new perspectives and has encouraged the development of new technologies. For ex- Typically, the magnetic field of a permanent magnet can be ample we now know that some living organisms have small calculated from the vector potential: B~ = ∇ × A~. For a amounts of magnetite in their tissues and use it to orient in the body whose is constant inside its volume and Earth’s magnetic field. Bees, salmons and some turtles are drops abruptly to zero outside it, as is the case of a magnet, a few examples of such species [1]. The effect of magnetic this potential at point ~x is given by the following surface in- fields on water is a topic of current research too [2-4]. For ex- tegral [9]: ample, it has been found that these fields inhibit scale forma- I µ M~ (x~0) × nˆ0 tion, by inducing changes in the crystal structure of carbonate A~(~x) = 0 da0 in the liquid. On the other hand, other researchers investi- 4π |~x − x~0| gate to what extent cell phones and magnetism from electric power lines affect living things. The development of technol- where M~ is the volume magnetization of the magnet, nˆ0 is 0 ogy has brought many important magnetic applications like the unit vector normal to the surface at point x~ , and µ0 is the electric motors, generators and storage of information. How- vacuum magnetic susceptibility. The is performed ever, it is not easy to find in the literature information about over the entire surface of the magnet. In this work we adopt the magnetic fields produced by these magnets. Generally, a different method. It is assumed that the magnet is a contin- these fields are calculated by numerical methods, such as the uous distribution of , which occupy a volume dV and finite-element method, [5,6] and it is rare to find analytical have a magnetic moment d~m = MdV~ . Again, here expressions. The most known cases are the spherical and the we assume that the magnetization is constant, and it remains rectangular prism magnets. The field of a ring-shaped mag- unchanged for any external magnetic field. That is, the mag- net has been discussed recently [7,8]. This paper is focused nets are supposed to be hard. To facilitate the calculations, on the analytical calculation of the field produced by perma- we always choose M~ = Mkˆ. As a starting point, we recall nent magnets with different shapes. We studied Nd2F e14B that the magnetic scalar potential and the induction field at permanent magnets with the following geometries: sphere, point ~x produced by a located at the origin cylinder, ring, cone and rectangular prism. The aim was to are given by: ALTERNATIVE METHOD TO CALCULATE THE MAGNETIC FIELD OF PERMANENT MAGNETS WITH AZIMUTHAL SYMMETRY 9 1 ~m · nˆ Φ (~x) = , 2.1. Sphere dipole 4π |~x|2 According to Fig. 1, we write the contribution of each in- ~ µ0 3ˆn(ˆn · ~m) − ~m Bdipole(~x) = (1) finitesimal dipole as: 4π |~x|3 1 dm · cos α where ~m is the magnetic dipole moment and nˆ is the unit vec- dΦaxis(z) = 4π |~r − r~0|2 tor in the direction of ~x. To calculate the magnetic field of the whole magnet, we integrate over its volume the contributions 1 MdV (z − z0) = from the infinitesimal dipoles, either of the scalar potential or 4π (z2 + r02 − 2zr0 cos θ0)3/2 of the field. In the first case, we take finally B~ = −µ0∇Φ. The decision of which way to go depends on the ease of cal- The total scalar potential on the z axis is then given by: culation in each case. In particular, the configurations with azimuthal symmetry offer the use of interesting mathemati- Z2π Zπ M cal properties. The basic idea is to find the scalar potential Φ (z) = dφ0 sin θ0dθ0 axis 4π on the symmetry axis (z axis in our case), which is relatively 0 0 easy to calculate, and from this function the solution is built ZR for off-axis points. For example, Jackson [10] used succes- r02(z − r0 cos θ0) × dr0 sive derivatives of the axial function to find the magnetic field (z2 + r02 − 2zr0 cos θ0)3/2 due to a solenoid. In this work we use a property of the solu- 0 tions of the Laplace equation. This property, which is often ZR Z1 used in the case of the electrostatic potential, [5,9] states that M z − r0x = r02dr0 dx if you have the solution on the symmetry axis expressed as a 2 (z2 + r02 − 2zr0x)3/2 series: 0 −1

∞ µ ¶ By using Mathematica, we find the indefinite integral in X V Φ (z) = U z` + ` (2) x results axis ` z`+1 `=0 −r0 + xz then the solution at any point in space (r, θ) is given by: z2(r02 − 2r0xz + z2)1/2

X∞ µ ¶ Evaluating in the limits and simplifying, we obtain 2/z2, V` Φ(r, θ) = U r` + P (cos θ) which does not depend on r0. Finally, performing the inte- ` r`+1 ` `=0 gration on this variable, we obtain

3 where P`(cos θ) is the Legendre polynomial of order `. MR 1 Φaxis(z) = (3) Therefore, all we have to do is to calculate Φaxis(z) and ex- 3 z2 pand it in powers of z. Now, we illustrate this approach with the case of a spherical magnet. The last expression is a particular case of Eq. (2), with 3 coefficients U` = 0 ∀` and V1 = MR /3, V` = 0 ∀` 6= 1. Applying the property described above, we see that the po- tential at any point in space is given by:

MR3 1 Φ(r, θ) = P (cos θ) 3 r2 1 MR3 cos θ 1 m cos θ = = 3 r2 4π r2

where m = 4πMR3/3 is the magnetic dipole moment of the sphere. This result is well known and is equiva- lent to that produced by a point dipole with moment m placed at the center of the sphere, as can be seen from Eq. (1). As mentioned above, the induction field is given by B~ (r, θ) = −µ0∇Φ(r, θ). Next, we present the results of the magnetic field on the axis of symmetry of the other magnets, FIGURE 1. Scheme for calculating the field produced by a spheri- and compare them with measurements made in the labora- cal magnet. tory.

Rev. Mex. Fis. E 59 (2013) 8–17 10 J. M. CAMACHO AND V. SOSA

The additive constant is irrelevant and can be suppressed. With the change of variable x = z − z0, we can write

zZ−h M xdx Φ (z) = axis 2 [Dx2 + Ex + F ]1/2 z

where

R2 2R2 ³ z ´ ³ z ´2 D = 1 + ,E = 1 − ,F = R2 1 − . h2 h h h

After integrating, evaluating in the limits and simplifying, we finally obtain:

Mh2 h p i Φ (z) = ±(z − h) − R2 + z2 axis 2(h2 + R2) FIGURE 2. Scheme for calculating the field produced by a conical MhR2(z − h) magnet. + 2(h2 + R2)3/2 √ 2.2. Cone (h ± h2 + R2)(z − h) × ln √ √ (4) According to Fig. 2, each infinitesimal dipole contributes to R2 + hz + h2 + R2 R2 + z2 the potential on the z axis with: 1 dm cos α 1 Mρ0dρ0dz0dφ0(z − z0) Then, the induction field has the following dependence dΦaxis(z) = = 4π |~r − r~0|2 4π [(z − z0)2 + ρ02]3/2 on the z axis: Therefore, the potential on the axis is given by " µ 2 ¶ Z2π Zh µ0Mh 1 zh−R M B(z)= √ ∓ h Φ (z) = dφ0 (z − z0)dz0 2 h2+R2 R2+z2 axis 4π √ # 0 0 R2 (h ± h2+R2)(z−h) ρ0 (z0) maxZ − ln √ √ (5) ρ0dρ0 (h2+R2)3/2 R2+hz+ h2+R2 R2+z2 × [(z − z0)2 + ρ02]3/2 0 0 R(1− z ) Zh Z h The double sign in the Eqs. (4) and (5) apply to the val- M ρ0dρ0 ues of z above the apex of the magnet (z > h, upper sign) = (z − z0)dz0 2 [(z − z0)2 + ρ02]3/2 or below the base (z < h, lower sign). Interestingly, the 0 0 model predicts that field diverges at the apex of the magnet. Zh Mh M (z − z0)dz0 This feature is the basis of the design of electromagnets with = − 2 2 0 2 2 z0 2 1/2 truncated conical poles, which produce high magnetic fields. [(z − z ) + R (1 − h ) ] 0 The variation of this field along the z axis was calculated by Kroon [11].

2.3. Cylinder

As shown in Fig. 3 (b), the potential on the z axis due to each infinitesimal dipole is given by: 0 0 0 1 cos θ 1 z − z M z − z 0 0 0 0 dΦaxis = dm = MdV = ρ dρ dz dφ 4π |~r − r~0|2 4π |~r − r~0|3 4π [(z − z0)2 + ρ02]3/2 Therefore, the total scalar potential on the axis is given by: Z ZL ZR M z − z0 M ρ0dρ0 Φ (z) = ρ0dρ0dz0dφ0 = (z − z0)dz0 axiz 4π [(z − z0)2 + ρ02]3/2 2 [(z − z0)2 + ρ02]3/2 cylinder 0 0

Rev. Mex. Fis. E 59 (2013) 8–17 ALTERNATIVE METHOD TO CALCULATE THE MAGNETIC FIELD OF PERMANENT MAGNETS WITH AZIMUTHAL SYMMETRY 11

à  0 !  0  0 ZL ρ =R z =Lρ =R M 1  M p   = (z − z0)dz0 − p  = (z − z0)2 + ρ02  2 (z − z0)2 + ρ02  2   0 ρ0=0 z0=0 ρ0=0

FIGURE 3. (a) Schematic of a cylindrical magnet. (b) Scheme for calculating the field produced by the magnet.

Ignoring additive constants, the resulting scalar potential is: M ³p p ´ Φ (z) = (z − L)2 + R2 − z2 + R2 (6) axiz 2 Finally, the field on the z axis is given by: Ã ! µ M z z − L B(z) = 0 √ − p (7) 2 z2 + R2 (z − L)2 + R2

2.4. Ring

The field produced by a ring magnet of outer radius R1 and inner radius R2 is obtained by the principle of superposition, adding the fields produced by a cylindrical magnet with mag- netization +Mzˆ and radius R1, and another cylinder with magnetization −Mzˆ and radius R2. In terms of Fig. 4, the scalar potential and the field on the axis are given by: FIGURE 4. Schematic of a ring magnet. "Ãq q ! M 2 2 2 2 Φaxiz(z) = (z − L) + R1 − z + R1 2 2.5. Rectangular prism Ãq q !# 2 2 2 2 Even though we cannot apply the theorem on magnets with − (z − L) + R2 − z + R2) (8) azimuthal symmetry in this case, we calculated the field on the z axis (defined in the direction of magnetization of the "Ã ! magnet, i.e. M~ = Mkˆ). According to Fig. 5, we have: µ M z z − L B(z) = 0 p − p 2 2 2 2 2 0 0 z + R1 (z − L) + R1 1 dm cos θ 1 z − z dΦaxis(z) = = MdV Ã !# 4π |~r − r~0|2 4π |~r − r~0|3 z z − L − p − p (9) 0 2 2 2 2 M z − z 0 0 0 z + R2 (z − L) + R2 = dx dy dz 4π [x02 + y02 + (z − z0)2]3/2

Rev. Mex. Fis. E 59 (2013) 8–17 12 J. M. CAMACHO AND V. SOSA

Finally, the field on the axis is given by: " µ M ab B(z) = 0 arctan p π (z − c) a2 + b2 + (z − c)2 # ab − arctan p (11) (z + c) a2 + b2 + (z + c)2

For completeness we reproduce here the results of Yang et al, [12] who calculated the magnetic field at any point in space. Adapting their results to the case of a magnetization directed along the z axis, we get:

FIGURE 5. Scheme for calculating the field of a prism-shaped mag- µ0M F2(−x, y, −z)F2(x, y, z) Bx(x, y, z) = ln net. 4π F2(x, y, −z)F2(−x, y, z)

µ0M F2(−y, x, −z)F2(y, x, z) Therefore,the potential on the z axis is given by: By(x, y, z) = ln 4π F2(y, x, −z)F2(−y, x, z) Zc Zb h M µ0M Φ (z) = dz0(z − z0) dy0 Bz(x, y, z) = − F1(−x, y, z) + F1(−x, y, −z) axis 4π 4π −c −b + F1(−x, −y, z) + F1(−x, −y, −z) Za dx0 + F (x, y, z) + F (x, y, −z) × 1 1 [x02 + y02 + (z − z0)2]3/2 i −a + F1(x, −y, z) + F1(x, −y, −z)

0 Integration on x gives The functions F1 and F2 are defined as:  a F (x, y, z) x0  1 p  [y02 + (z − z0)2] x02 + y02 + (z − z0)2  (x + a)(y + b) −a = arctan p (z + c) (x + a)2 + (y + b)2 + (z + c)2 2a = p [y02 + (z − z0)2] a2 + y02 + (z − z0)2 p (x + a)2 + (y − b)2 + (z + c)2 + b − y F2(x, y, z) = p Integration of this result on y0 gives (x + a)2 + (y + b)2 + (z + c)2 − b − y  We can easily check that the x and y field components b 2 ay0  vanish on the z axis, while the z component is reduced to the arctan p  z − z0 (z − z0) a2 + y02 + (z − z0)2  expression given in Eq. (11). −b 4 ab = arctan p 3. Results of magnetic fields on the z axis and z − z0 (z − z0) a2 + b2 + (z − z0)2 comparison with experiments

Then, we obtain: Now we compare the theoretical calculations of magnetic Zc fields on the symmetry axis with measurements made in the M ab 0 laboratory. First, from Eq. (3) we obtain the field for the Φaxis(z) = arctan p dz π (z − z0) a2 + b2 + (z − z0)2 sphere: −c 2µ MR3 B(z) = 0 (12) 3z3 Mathematica gives (except additive constants omitted We measured the magnetic field using a gaussmeter with here): an estimated accuracy of ±5%. From a linear fitting of " this field vs. 1/z3, we obtained a magnetization value M ab Φaxis(z) = (z + c) arctan p µ0M = (0.933 ± 0.044) T, which lies in the range expected π (z + c) a2 + b2 + (z + c)2 in these magnets. For example, A. Walther et. al. [13] re- # ported a value of 1.25 T for thin films of Nd2F e14B; in the ab − (z − c) arctan p (10) case of single crystals it has been reported [14,15] a value of (z − c) a2 + b2 + (z − c)2 1.6 T at room temperature. The magnetization of the other

Rev. Mex. Fis. E 59 (2013) 8–17 ALTERNATIVE METHOD TO CALCULATE THE MAGNETIC FIELD OF PERMANENT MAGNETS WITH AZIMUTHAL SYMMETRY 13

The ring magnet offers several particular aspects. The first is the possibility of measuring the field in a continuous manner through the magnet gap, resulting in a larger number of experimental points. The second is the existence of two points placed symmetrically on the shaft (at z = −1.80 cm and z = 3.55 cm) where the field becomes zero. To verify this, we placed a very small magnet (1 mm thick and 1 mm radius) in the vicinity of those positions and slid it along the z axis with care. It was very interesting to see the small magnet turning around due to the change of sign of the field. In general terms, we conclude that the agreement shown in Fig. 6 between theory and experiment is quite good. We can say that the method of calculation describes fairly well the field on the axis of permanent magnets with different ge- ometries. Next, we focus on the calculation of the field outside the symmetry axis for the case of the cylindrical magnet. This will illustrate the use of the series expansion given in Eq. (2).

4. Field of a cylindrical magnet for points out- side the axis of symmetry

4.1. Analytical calculation

We tried to calculate Φ(ρ, z) using Mathematica, but did not succeed. Then, we intented to perform the intergration with Maple but we failed too. Our next attempt was to calculate the vector potential, which has the form A~(ρ, z) = A(ρ, z)φˆ. Explicitly, we have: FIGURE 6. (a). Magnetic field measurements as a function of ax- ZL ial distance for a sphere (°), a cone (¨) and a prism (•). Solid µ0RM A(ρ, z) = dz0 lines correspond to theoretical calculations (Eqs. 12, 5 and 11, re- 4π spectively) using the values of magnetization shown in Table I. (b). 0 Magnetic field measurements as a function of axial distance for the Z2π ¤ ° cos φ0dφ0 case of a cylinder ( ) and a ring ( ). Solid lines correspond to the- × p oretical calculations (Eqs. 7 and 9, respectively) using the values ρ2 + R2 + (z − z0)2 − 2Rρ cos φ0 of magnetization shown in Table I. 0 In the first place, we calculated the component Bρ along the radius of the cylinder: TABLE I. Volumetric magnetization and dimensions of all magnets ∂A µ0RM used in this work. Bρ(ρ, z) = − = ∂z 4π ¯ 0 Magnet µ0M(T ) Dimensions (cm) Z2π ¯z =L cos φ0dφ0 ¯ Sphere 0.933 ± 0.044 R=1.5 × p ¯ ρ2 + R2 + (z − z0)2 − 2Rρ cos φ0 ¯ Cone 1.103 ± 0.027 R = 2.46, h = 4.80 0 z0=0 Cylinder 0.830 ± 0.031 R = 3.81,L = 1.27 By using Maple, we obtained: s " Ã ! Ring 1.086 ± 0.028 R1 = 5.35,R2 = 2.25,L = 1.75 µ0M R 1 Prism 0.870 ± 0.070 2a = 5.0, 2b = 2.5, 2c = 1.25 B (ρ, z) = F α(z0), ρ 2π ρ α(z0)

à !#¯ 0 magnets was obtained accordingly by scaling each theoreti- ¯z =L 1 ¯ cal function (Eqs. (5), (7), (9) and (11)) to its corresponding − 2E α(z0), ¯ α(z0) ¯ measured field. Table I shows the magnetization of all mag- z0=0 nets and their geometric dimensions. where Figure 6 shows the measured and calculated field as a s Rρ function of axial distance for (a) sphere, cone and prism, and α(z0) = 2 (b) cylinder and ring. (ρ + R)2 + (z − z0)2

Rev. Mex. Fis. E 59 (2013) 8–17 14 J. M. CAMACHO AND V. SOSA and F (x, y) and E(x, y) are the Incomplete Elliptical Inte- Akoun et. al [19]. Also, recently it has been possible to cal- grals of first and second class respectively. culate the between these magnets [20]. To calculate the vertical component of the field, we need To realize our study, we placed the two magnets coaxially to take as shown in Fig. 7. The vertical force was measured with a Pasco Scientific CI-6537 sensor mounted onto a homemade 1 ∂(Aρ) Bz(ρ, z) = universal base. The upper magnet was attached to the sen- ρ ∂ρ sor and the lower one was attached to a mobile stage which ◦ Unfortunately, none of the programs that we tried (Mathe- could be displaced vertically with a screw. Each 360 turn of matica and Maple) were able to provide an analytical result the screw produced a displacement of 1.49 mm. This way, in this case. As we can see, the magnetic induction field out- the distance between the magnets (a) could be varied with a side the cylinder axis is difficult to obtain. In several previ- high precision. The sensor has an accuracy of ±0.03 N. ous interesting works published in educational journals, the The force exerted by magnet 1 on magnet 2 is given by Z field of cylindrical magnets or solenoids has been calculated. ~ ~ For example, Labinac et al [16] calculated the field for a thin F = ∇(d~µ · B) solenoid and a thick coil using a series expansion of Gauss magnet−2 hypergeometric functions. Derby and Olbert [17] calculated ~ the field from a solenoid to study the speed of fall of perma- Here, B is the the field produced by the lower magnet. nent cylindrical magnets inside a copper tube. Lerner [18] an- More specifically, the vertical force is Z alyzed the role of the permeable core of a finite solenoid, by ∂Bz comparing its field with that produced by an infinite solenoid. F = M2 dV (13) magnet−2 ∂z In each case, the calculation involved elliptic , whose evaluation is difficult. This is where the expansion of Φaxis(z) The first step of the calculation is to expand the function proposed in the present work will exhibit its usefulness. given by Eq. (6) in powers of z. The terms to expand can be written in the form: 4.2. Force between two cylindrical magnets p 1 1 1 5 1 + x2 = 1 + x2 − x4 + x6 − x8 + ... 2 8 16 128 As we just showed, it is very difficult to obtain closed ex- |x| < 1 R > L pressions of the field for a cylindrical magnet. To illustrate This expansion is valid for . For this reason, if , L < z < R the method of approximation in power series, we decided three regions are defined: close ( ), intermediate R < z < L + R z > L + R L > R to calculate the force between two cylindrical magnets with ( ) and far ( ). If no close L < z < L + R uniform magnetization, and compare our results with experi- region exists; only the intermediate ( ) and far z > L+R R = 1.27 > 0.95 mental measurements. Before that, we want to mention that ( ) regions remain. Since 1 cm cm L similar calculations have been reported previously. The force = 1, we need to consider the three regions . between two cubic magnets was calculated analytically by The infinite series can be truncated by taking a finite num- ber of terms, up to a maximum power of z (`max). The approx- imation to the exact potential improves as more terms are in- cluded, but the calculation of the force becomes increasingly

FIGURE 8. Magnetic scalar potential on the axis of the magnet 1, FIGURE 7. Arrangement of two coaxial cylindrical magnets, whose normalized to the value M/2, for points outside the magnet (i. e. repulsive force was measured and calculated. The experimental pa- for z > L ). We show the finite series expansion, Eq. (2) with rameters are: µ0M1 = 0.89 T, R1 = 1.27 cm, L1 = 0.95 cm, coefficients given in the appendix (°), and the exact Eq. (6) (solid µ0M2 = 0.92 T, R2 = 0.635 cm, L2 = 0.485 cm line).

Rev. Mex. Fis. E 59 (2013) 8–17 ALTERNATIVE METHOD TO CALCULATE THE MAGNETIC FIELD OF PERMANENT MAGNETS WITH AZIMUTHAL SYMMETRY 15 elaborate. The choice of `max depends on these two factors. potential and goes like 1/r, the second term corresponds to The expansion coefficients for each zone are listed in the ap- the dipolar distribution and goes like 1/r2, the third term is pendix. The coefficients were taken up to the greatest value the quadrupole one and goes like 1/r3, the octupole term 4 the computer could handle (`max = 10, 9 or 8). goes like 1/r , and so on. Therefore, it is possible to identify Figure 8 shows the plots of the exact potential due to the Eq. (14) as the of the magnetic scalar magnet 1 on its axis, and the approximation of the finite se- potential produced by the permanent magnet. As expected, ries. As it can be seen, the approximation is quite good ex- the monople term vanishes because of the nonexistence of cept near the borders between neighbor zones (z − L1 = 0.58 magnetic monopoles. The leading term in this equation is and 0.93 cm), where convergence of the series is slower. As mentioned, one uses a certain number of terms to give a good MLR2 cos θ 1 m cos θ balance between accuracy and computation time. In Ref. 7, 2 = 2 , the author used up to 20 terms in the series he proposed, get- 4 r 4π r ting an excellent agreement with the exact calculation; how- ever, he found discrepancies of the order of 100% in certain i.e., the dipole contribution. In all the geometries studied regions. In our example, the maximum difference observed here, we expanded Φaxis(z) in a power series of 1/z around with respect to the exact value on the axis was about 15%. zero. We found in every case that the dipole contribution We just want to bring in the idea that in any finite series ap- given by Eq. (1) was the leading term, which makes a lot proximation, there will be regions of very slow convergence, of sense since at large distances the magnet “looks” like a in which there will be significant deviations from the exact point dipole. The similiarity between the electrostatic multi- function. pole expansion and the present one is not casual: it is easy to Now, it is interesting to take a close view at the explicit demonstrate [22] that the scalar potential due to a uniformly expression in the far region. The series expansion is: magnetized body of arbitrary form may be written in the form ~ µ ¶µ ¶ Φ = −M · ∇(²0ψ), where ψ is the electrostatic potential due M X∞ X∞ 1/2 2k − 2 + i 1 Φ (z) = LiR2k to a uniformly charged body (with ρe = 1) of the same form axis 2 k 2k − 2 z2k−1+i and dimensions. Indeed, the dipole term of the magnet ex- k=1 i=1 pansion (14) can be obtained by applying the latest formula Therefore, the scalar potential at any point of this region to the monople term of the expansion of Φρe (~x), with ρe = 1. is given by: The second term of Eq. (14) can be obtained from the sec- à 2 2 2 2 ond term of the electrostatic series, an so on. Therefore, there M LR cos θ L R 3 cos θ − 1 exists a tight connection between electrostatic and magneto- Φ(r, θ) = 2 + 3 2 2 r 4 r static potentials due to uniform sources, and the present cal- ! culation is a nice and educational manifestation of this char- 4L3R2 − 3LR4 5 cos3 θ − 3 cos θ + + ... (14) acteristic. 16 r4 Next, we calculated the vertical component of the mag- This expression resembles the multipole expansion of the netic induction field: electrostatic potential Φρe (~x) outside the region containing all source charges [9]: 1 ³q ~p · xˆ 1 X xˆ xˆ ´ Φ (~x) = + + Q i j + ··· ρe 4π² r r2 2 ij r3 0 i,j where Z 3 q = ρed x is the total charge, Z 3 ~p = ~xρed x is the dipole moment of the charge distribution, Z 2 3 Qij = (3xixj − r δij )ρed x is the traceless quadrupole moment tensor, ρe is the charge FIGURE 9. Force between the two cylindrical magnets as a func- density, ²0 is the vacuum permitivity and r =| ~x |. Grif- tion of their separation distance a. We show the measured values fiths [21] presents a nice graphic discussion of the latter ex- (°) and the calculated ones using the method described in the text pansion. The first term is the monopole contribution to the (solid line).

Rev. Mex. Fis. E 59 (2013) 8–17 16 J. M. CAMACHO AND V. SOSA

+ ` U` 2 4 6 8 10 ∂Φ(r, θ) 0 L − L + L − 5L + 7L Bz(r, θ) = −µ0 2R 8R3 16R5 128R7 256R9 ∂z L L3 3L5 5L7 35L9 1 − R + 2R3 − 8R5 + 16R7 − 128R9 3L2 15L4 35L6 315L8 and changed from spherical (r, θ) to cylindrical coordinates 2 − 4R3 + 16R5 − 32R7 + 256R9 (ρ, z) before performing the integral of Eq. (13) to obtain L 5L3 35L5 105L7 3 2R3 − 4R5 + 16R7 − 32R9 the vertical force between the two magnets. The expressions 15L2 175L4 735L6 4 16R5 − 64R7 + 128R9 are too large to be reproduced here, therefore we preferred to 3 5 5 − 3L + 35L − 441L present the results in a plot. The Mathematica file containing 8R5 16R7 16R9 35L2 735L4 the full expression of the force in the far region (the simplest 6 − 32R7 + 128R9 i 5L 105L3 case) can be downloaded freely at 7 16R7 − 32R9 Figure 9 shows the force F as a function of a. We can 315L2 8 256R9 see that the theoretical calculation describes fairly well the 35L 9 − 9 experimental behavior. Comparing Figs. 8 and 9, we see that 128R the largest differences between model and experiment occur near the boundaries between zones of the potential expan- 6.2. Intermediate region sion. Apart from these discrepancies, we can say that our + + method works adequately. This methodology was used to ` U` V` calculate the force between a cylinder magnet and a super- L2 L4 L6 5L8 7L10 R2 0 R + 2R − 8R3 + 16R5 − 128R7 + 256R9 − 2 conductor in the Meissner state [23]. The interaction between L L3 3L5 5L7 35L9 1 1 − R + 2R3 − 8R5 + 16R7 − 128R9 0 a ring magnet and any other magnet can be studied using the 2 4 6 8 4 2 1 − 3L + 15L − 35L + 315L R principle of superposition and a similar approach to the one 2R 4R3 16R5 32R7 256R9 8 L 5L3 35L5 105L7 followed in this section. The task of calculating with this 3 2R3 − 4R5 + 16R7 − 32R9 0 1 15L2 175L4 735L6 R6 method the field outside the axis of symmetry for the cone 4 − 8R3 + 16R5 − 64R7 + 128R9 − 16 magnet is left to smart challenge hunters. 3L 35L3 441L5 5 − 8R5 + 16R7 − 64R9 0 1 35L2 735L4 5R8 6 16R5 − 32R7 + 128R9 128 5L 105L3 7 16R7 − 32R9 0 5. Conclusions 5 315L2 7R10 8 − 128R7 + 256R9 − 256 35L An alternative method to calculate the magnetic field at any 9 − 128R9 0 7 21R12 point in space produced by a permanent magnet with az- 10 256R9 1024 imuthal symmetry is presented. The method is based on a power series expansion of the magnetic scalar potential value on the axis of symmetry. The resulting series can be identified 6.3. Far region as the multipole expansion of the potential. This approach + allowed us to obtain the force between cylindrical magnets U` = 0 ∀` without using the hard-to-manage exact solutions. The mag- ` V + netic fields on the axis of a sphere, rectangular prism, cone, ` cylinder and ring were calculated. The calculations showed 0 0 LR2 good agreement with the experiments. 1 2 L2R2 2 2 4L3R2−3LR4 3 8 6. Appendix 2L4R2−3L2R4 4 4 5 2 3 4 6 5 8L R −20L R +5LR Coefficients of the expansion of the scalar magnetic potential 16 8L6R2−30L4R4+15L2R6 on the symmetry axis for a cylindrical magnet. 6 16 64L7R2−336L5R4+280L3R6−35LR8 7 128 ∞ µ + ¶ 8 2 6 4 4 6 2 8 M X V 8 16L R −112L R +140L R −35L R Φ (z) = U +z` + ` 32 axis 2 ` z`+1 `=0

6.1. Close region Acknowledgments Authors thank M.C. Fidel Gamboa and Ing. Osvaldo Gomez´ + V` = 0 ∀` for their technical assistance.

Rev. Mex. Fis. E 59 (2013) 8–17 ALTERNATIVE METHOD TO CALCULATE THE MAGNETIC FIELD OF PERMANENT MAGNETS WITH AZIMUTHAL SYMMETRY 17

i. http://www.mda.cinvestav.mx/magnetic /force in the far 12. Z. J. Yang, T. Johansen, H. Bratsberg, G. Helgesen and A. T. region.nb. Skjeltorp, Supercond. Sci. Technol. 3 (1990) 591. 1. D. Castelvecchi, Sci. Amer. 306 (2012) 37-41. 13. A. Walther, C. Marcoux, B. Desloges, R. Grechishkin, D. 2. L. Holysz, A. Szczes, and E. Chibowski, J. Colloid Interface Givord, N. M. Dempsey, J. Magn. Magn. Mater. 321 (2009) Sci. 316 (2007) 996-1002. 590-594. 3. X. F. Pang and B. Deng, Physics Mechanics Astron. 51 (2008) 14. M. Sagawa, S. Fujimura, H. Yamamoto, Y. Matsuura, and S. 1621-1632. Hirosawa, J. Appl. Phys. 57 (1985) 4094-4098. 4. R. Cai, H. Yang, J. He, and W. Zhu, J. Mol. Struct. 938 (2009) 15. J. F. Herbst, Rev. Mod. Phys. 63 (1991) 819-898. 15-19. 5. Jr. Stanley Humphries, Finite-element methods for electromag- 16. V. Labinac, N. Erceg, and D. Kotnik-Karuza, Am. J. Phys. 74 netics (2010). Electronic document available at http://www. (2006) 621-627. fieldp.com/femethods.html 17. N. Derby and S. Olbert, Am. J. Phys. 78 (2010) 229-235. 6. P. Pao-la-or, A. Isaramongkolrak, and T. Kulworawanichpong, Engineering Lett. 18 (2010). Online document available at 18. L. Lerner, Am. J. Phys. 79 (2011) 1030-1035. http://www.engineeringletters.com/issues v18/issue 1/EL 18 1 19. G. Akoun and J.-P. Yonnet, IEEE Trans. Magn. 20 (1984) 1962- 01.pdf 1964. 7. R. Ravaud, G. Lemarquand, V. Lemarquand and C. Depollier, 20. H. Allag and J.-P. Yonnet, IEEE Trans. Magn. 45 (2009) 3969- IEEE Trans. Magn. 44 (2008) 1982-1989. 3972. 8. R. Ravaud, G. Lemarquand, V. Lemarquand and C. Depollier, PIER B 11 (2009) 281-297. 21. D. J. Griffiths, Introduction to Electrodynamics third edition, (Prentice Hall 1999). 9. J. D. Jackson, Classical Electrodynamics, third edition, (Wiley, 1998). 22. V. V. Batygin and I. N. Topygin, Problems in Electrodynamics 10. R. H. Jackson, IEEE Trans. Electr. Dev. 46 (1999) 1050-1062. (Academic Press, London 1964), see problem 287. 11. D. J. Kroon, Electromagnets (Boston Technical Publishers Inc., 23. E. Varguez-Villanueva,´ V. Rodr´ıguez-Zermeno,˜ and V. Sosa, Philips Technical Library, 1968). pp. 15-19. Rev. Mex. F´ıs. 54 (2008) 293-298.

Rev. Mex. Fis. E 59 (2013) 8–17