Magnetic Field of a Cylindrical Bar Magnet

A bar magnet is often approximated simply as a magnetic dipole with north and south magnetic poles separated by a distance . This is not accurate when the magnet has a significant size, so that magnetic lines of force also emanate from the central portion of the magnet. In this Demonstration, we consider a cylindrical bar magnet of length , radius , and magnetization —the magnetic moment per unit volume, which is characteristic of the ferromagnetic material. The magnetization is assumed to be uniform throughout the volume of the magnet, which neglects slight inhomogeneities and possible deviations from the assumed relation .
The magnetic induction outside the magnet can conveniently be expressed as the negative gradient of a magnetostatic potential: . For a point magnetic dipole , . This is integrated over the volume of the magnet. It is most convenient to work in cylindrical coordinates: for the source and , , for the field point ( can arbitrarily be set equal to 0, in view of the anticipated cylindrical symmetry). The detailed computation is given in Details below. A simplifying feature is that integration over shows that the problem can be reduced to two magnetic monopolar disks separated by the distance .
For ease of visualization, only the field lines in the medial plane of the magnet are shown. The three-dimensional field can easily be pictured by virtue of the cylindrical symmetry about the axis. The lines of force originate from the north pole on the right and terminate on the south pole on the left. Magnetic-induction magnitudes are not emphasized in this Demonstration, only the geometry of field lines.
  • Contributed by: S. M. Blinder
  • with suggestions by Evangelos Matsinos


  • [Snapshot]
  • [Snapshot]
  • [Snapshot]


The magnetic scalar potential is given by a triple integral in cylindrical coordinates:
which can be interpreted as originating from two parallel, oppositely charged monopolar disks of radius separated by a perpendicular distance . The result can be expressed in terms of elliptic functions with complicated arguments and the expressions for the magnetic field components and are even more complicated. It is much easier to do the computations numerically, taking advantage of Mathematica's very efficient NIntegrate routines.
We thereby obtain:
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.

Mathematica »
The #1 tool for creating Demonstrations
and anything technical.
Wolfram|Alpha »
Explore anything with the first
computational knowledge engine.
MathWorld »
The web's most extensive
mathematics resource.
Course Assistant Apps »
An app for every course—
right in the palm of your hand.
Wolfram Blog »
Read our views on math,
science, and technology.
Computable Document Format »
The format that makes Demonstrations
(and any information) easy to share and
interact with.
STEM Initiative »
Programs & resources for
educators, schools & students.
Computerbasedmath.org »
Join the initiative for modernizing
math education.
Step-by-Step Solutions »
Walk through homework problems one step at a time, with hints to help along the way.
Wolfram Problem Generator »
Unlimited random practice problems and answers with built-in step-by-step solutions. Practice online or make a printable study sheet.
Wolfram Language »
Knowledge-based programming for everyone.
Powered by Wolfram Mathematica © 2018 Wolfram Demonstrations Project & Contributors  |  Terms of Use  |  Privacy Policy  |  RSS Give us your feedback
Note: To run this Demonstration you need Mathematica 7+ or the free Mathematica Player 7EX
Download or upgrade to Mathematica Player 7EX
I already have Mathematica Player or Mathematica 7+