The stray- and demagnetizing field from a homogeneously magnetized tetrahedron

04/15/2020 ∙ by Kaspar K. Nielsen, et al. ∙ 0

The stray- and demagnetization tensor field for a homogeneously magnetized tetrahedron is found analytically. The tetrahedron is a special case of four triangular faces with constant magnetization-charge surface density, for which we also determine the tensor field. The tensor field is implemented in the open source micromagnetic and magnetostatic simulation framework MagTense and compared with the obtained magnetic field from an FEM solution, showing excellent agreement. This result is important for modeling magnetostatics in general and for micromagnetism in particular as the demagnetizing field of an arbitrary body discretized using conventional meshing techniques is significantly simplified with this approach.



There are no comments yet.


This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

The stray- and demagnetization field tensor of a uniformly magnetized body is a fast and possibly analytical approach to calculate the magnetic field generated by a magnetized body at any point in space. The stray- and demagnetization tensor field from uniformly magnetized primitives has been derived for rectangular prisms Joseph_1965 ; Smith_2010 , finite cylinders Kraus_1973 ; Caciagli_2018 , hollow spheres Prat-Camps2016 , ellipsoids Tejedor1995 , powder samples Bleaney_1941 ; Bjoerk_2013 ; Arzbacher_2015 and an equilateral triangluar prism Tang2005 . Several such tensor fields for primitives have also been found through the Fourier space approach Beleggia2003 . Here, we present the magnetic field produced by a general triangular face with uniform magnetization and give, as a special case, the total stray- and demagnetization tensor field for a general tetrahedron, i.e. a polygon defined by four triangles that share four non-coplanar vertices. We note that the stray-field is defined as the magnetic field outside the magnetized body while the demagnetizing field is the magnetic field inside the body, both produced by the body’s magnetization. The results presented in this paper are valid both inside and outside the homogeneously magnetized body.

2 Model

Magentostatics systems are governed by Gauss’s law for magnetism and Ampere’s law. Gauss’s law for magnetism states that the flux density

is a solenoidal vector field:


The magnetization is defined as the volume density of magnetic dipoles. The magnetic field is defined from and according to the following relation:


Here is the vacuum permeability. Ampere’s law is then expressed in terms of and the free current density :


In absence of free currents, the magnetic field is an irrotational vector field, i.e. its curl is zero. In these conditions it is always possible to express as the gradient of a scalar field, thus guaranteeing that is irrotational. We can then introduce the magnetic scalar potential :


Combining Eqs. 1,  2 and  4 we obtain the following equation, which is analogous to Poisson’s equation:


The quantity is interpreted as the magnetic charge volume-density. The formal solution to Eq. 5 for a homogeneously magnetized body with enclosing surface is given by Jackson :


Note that there are two sets of coordinates. The coordinates marked with a are the coordinates of the face that creates the magnetic field, whereas the non-marked coordinates are to the point at which the field is evaluated. The quantity is interpreted as the magnetic charge surface-density. The magnetic field is obtained by combining Eq. 4 and Eq. 6:


Here it is worth noting that the gradient operator and the integration are with respect to different sets of coordinates: the gradient operator is with respect to the unprimed coordinates, while the integration is with respect to the primed coordinates. The order is thus interchangable.

In the following we will first derive the contribution to the magnetic field from a face shaped as a right triangle. Then we exploit that any triangle can be divided into two right triangles and apply the superposition principle to get the solution for a general triangle. We then provide a transformation necessary for obtaining the field from an arbitrarily positioned and rotated triangle from our basic solution. This, in turn, yields the contribution to the components of the stray- and demagnetization tensor field from an arbitrarily positioned and oriented triangle. Finally, we provide the details of building up a tetrahedron consisting of such four triangles and provide the total tensor field describing the stray- and demagnetizing fields from a homogeneously magnetized tetrahedron. This result has been build into the open source micromagnetic and magnetostatic simulation framework MagTense MagTense .

2.1 The contribution to the field from a right triangle

Figure 1: General triangle in the local (primed) coordinate system. The triangle given by is the first triangle considered in the text. Please note that the lengths , and are all .

We consider a right triangle positioned in the -plane at with the vertices , and as shown in blue in Fig. 1. Only the -component of the magnetization contributes to the magnetic field and the normal vector is . The primes on the field and magnetization components emphasize that the field and magnetization are evaluated in the local coordinate system of the triangle as defined in Fig. 1. The length of the triangle along the axis is denoted . The component of the magnetic field is then




The component of the magnetic field is:




The component of the field becomes:




Some of these integrals were evaluated using the Rule-based integrator Rich2018 . In order to get the contribution from an entire triangle, which can always be decomposed into two right triangles, as shown in Fig. 1, the tensor components of these right triangles are added such that , and . The length along for the right triangle in Fig. 1 is denoted , where it is noted that the integration limits on the integrals over are switched. The lower limit is thus when the integral over is the outer integral and when this integral is the inner. It is further noted that . As an example, for the triangle in the second quadrant in Fig. 1 we have:


2.2 Numerical Singularities

The closed expressions given above for the local coordinate system demagnetization tensor field components contain some numerical singularities. It is clear that it is a requirement that otherwise the triangular face assumption breaks down. Furthermore, the solutions for , and are numerically singular along the and axes for and , respectively, in the local system as well as right on the lines and . However, both field components can be obtained on these axes and lines by chosing a suitably small value for the result to be numerically stable. At the local demagnetization tensor component is zero as the functions and given above cancel out even though the arguments to the atan function are infinite since the function arguments approach infinity at the same rate.

2.3 Arbitrarily positioned and oriented triangular face

Figure 2: General triangle in the global coordinate system. Note that the unit vector in the direction points out of the plane.

We now consider a general triangular face in Euclidian geometry characterized by three points, and in the global coordinate system, G. It is a requirement that the three vertices are not collinear.

The goal is to find the linear transformation from this general triangle to a local coordinate system, L, with the triangle placed as shown in Fig.

1. This transformation is represented by the matrix . Its inverse, , is the matrix representing the transformation from the local to the global coordinate system and this consists of the three column unit vectors that form the orthonormal basis of the local coordinate system in terms of global coordinates:


As is orthogonal then . Before applying this transformation the triangle is shifted such that the point on the triangle (see Fig. 2) coincides with in the local coordinate system, i.e.


Without a loss of generality, we assume that is the point with the largest angle in the general triangle, i.e. . In this way we ensure in the local coordinate system that the triangle may always be split in two right triangles as per Fig. 1. Assuming that the normal vector to the triangular face is and defining the first unit vector as the second unit vector becomes ; see Fig. 2. All that remains now is to find the point , which may be done via trigonometry: .

With the point determined, the translation and transformation can be fully calculated, and the magnetic field from a triangular face as defined above and assuming a magnetization vector is thus given by:


The partial demagnetization tensor field in the local coordinate system is given by:


2.4 The field from a homogeneously magnetized tetrahedron

Given four vertices , that are not co-planar (and thus also not collinear), we can define the four triangles that make up a tetrahedron with these four vertices. The total field is then the sum of the contributions of each triangular face as may be found above. The only remaining point is to ensure the normal vector of each triangle to point outwards and this is done as follows. Assume the vertices where form a triangular face and that they are ordered such that is the vertex at the largest angle in the triangle. It is also assumed that corresponds to as above, to and to . Then if

where is the tetrahedron vertex that is not part of the triangular face considered, the sign of the normal should be changed, which amounts to interchanging and .

The change-of-basis transformation matrix, , may be written in terms of , assuming the vertices to be ordered, as:


The total field at the point is then found through summation over the contributions from four triangles given by Eq. 18 with

The contributions from the remaining three triangles are found through cyclic permutation of the indices (including, of course, in order to obtain and etc.).

3 Verification

The above calculations of the stray- and demagnetization tensor field can be verified by comparison with a finite element method computation of the magnetic flux density from a tetrahedron. The magnetic field is here computed using the finite element software Comsol, which in a finite element framework solves Eq. 5 with respect to for given magnetization .

Figure 3: The tetrahedron used for the numerical verification. The magnetization vector and the field lines of are shown. The field profiles of Fig. 4 correspond to the Cartesian axes shown here, i.e. through the point . The ticks shown on the axes are spaced by  mm intervals.

We consider the tetrahedron shown in Fig. 3 with the following four vertices: , , , and  mm. The tetrahedron has a magnetization of  Am. The norm of the magnetic field is calculated along each of the Cartesian axes through the point  mm inside the tetrahedron and is shown in Fig. 4. As can be seen form the figure there is an excellent agreement between Comsol and the demagnetization tensor approach discussed here. This example is part of the verification examples for MagTense and is available online MagTense .

Figure 4: The norm of the magnetic field as calculated using the components of the tensor field given in the text using MagTense and as calculated using the FEM framework Comsol, for the example geometry shown in Fig. 3 along each of the Cartesian axes through the point .

4 Conclusion

The stray- and demagnetization tensor field was found for a right triangle in the plane followed by the tensor field for a general triangle arbitrarily positioned and oriented in space. With the proper change of basis, the total stray- and demagnetization tensor field for a homogeneously magnetized tetrahedron was obtained from the right triangle solution. The code for numerically evaluating this tensor field for an arbitrary tetrahedron is published in the micromagnetism and magnetostatics framework MagTense and is available online as Open Source in both a Matlab and a Fortran version MagTense . As the computations involved are very fast ( on a normal PC per tetrahedron in the Fortran implementation) the solution provided here has a great potential if used in combination with conventional meshing techniques for enabling fast and consistent computation of the stray- and demagnetizing field of a magnetized body with locally varying magnetization. In such a computation each tetrahedron in the mesh would be assumed to be homogeneously magnetized but not with the same magnetization. The geometrical part of the problem, i.e. finding the tensor field as described above, needs only to be done once for a given problem / geometry. Subsequently, finding the self-consistent solution, i.e. the set of magnetization vectors that satisfy the constitutive relation between magnetic field and magnetization assumed, may be done very fast.

The special case of the tetrahedron may of course be extended directly to the case of a general polygon that may always be split into triangles and to any homogeneously magnetized body who’s enclosing surface is approximated by such a polygon.


This work was financed partly by the Energy Technology Development and Demonstration Program (EUDP) under the Danish Energy Agency, project no. 64016-0058, partly by the Danish Research Council for Independent Research, Technology and Production Sciences projects no. 7017-00034 and 8022-00038 and partly by the Poul Due Jensen Foundation project on Browns paradox in permanent magnets, project no. 2018-016.


  • [1] R. I. Joseph, E. Schloman, J. Appl. Phys. 36, 1579 (1965).
  • [2] A. Smith, K.K. Nielsen, D. Christensen, C.R.H. Bahl, R. Bjørk, J.H. Hattel, J. Appl. Phys. 107, 103910 (2010).
  • [3] A. Caciagli, R.J. Baars, A.P. Philipse, B.W.M. Kuipers, J. Magn. Magn. Mater. 456, 523-532 (2018).
  • [4] L. Kraus, Czech J. Phys. B 23, 512-519 (1973).
  • [5] J. Prat-Camps, C. Navau,A. Sanchez and D. Chen, IEEE Magn. Lett 7, 1300104 (2016)
  • [6] M. Tejedor, H. Rubio, L. Elbaile, R. Iglesias, IEEE Trans. Magn. 31 (1), 830-836 (1995)
  • [7] G. Breit. Commun. Phys. Lab. Univ. Leiden Suppl. no. 46. (1922).
  • [8] B. Bleaney and R. A. Hull, Proc. R. Soc. London, Ser. A 178(972), 86-92 (1941).
  • [9] R. Bjørk, C. R. H. Bahl, Appl. Phys. Lett. 103, 102403 (2013).
  • [10] S. Arzbacher, P. Amann, B. Weidenfeller, T. Loerting, A. Ostermann, J. Petrasch, J. Appl. Phys. 117, 163905 (2015).
  • [11] K. Tang, H.W. Zhang, Q.Y. Wen, Z.Y. Zhong, “Demagnetization field of ferromagnetic equilateral triangluar prism” Physica B, 363, pp. 96-101, 2005.
  • [12] M. Beleggia, M. De Graef, J. Magn. Magn. Mater., 263, pp. L1-L9, 2003.
  • [13] J. D. Jackson, “Classical Electrodynamics 3rd ed.”, Wiley, 1999.
  • [14] R. Bjørk, & K. K. Nielsen, (2019). MagTense. Technical University of Denmark, DTU Energy, Department of Energy Conversion and Storage.,
  • [15] Rich, A., Scheibe, P., Abbasi, N., “Rule-based integration: An extensive system of symbolic integration rules” Journal of Open Source Software, vol. 3, pp. 1073, 2018.