Magnets exert forces and torques on each other due to the rules of electromagnetism. The forces of attraction field of magnets are due to microscopic currents of electrically charged electrons orbiting nuclei and the intrinsic magnetism of fundamental particles (such as electrons) that make up the material. Both of these are modeled quite well as tiny loops of current called magnetic dipoles that produce their own magnetic field and are affected by external magnetic fields. The most elementary force between magnets, therefore, is the magnetic dipole–dipole interaction. If all of the magnetic dipoles that make up two magnets are known then the net force on both magnets can be determined by summing up all these interactions between the dipoles of the first magnet and that of the second. Magnets exert forces and torques on each other due to the rules of electromagnetism. The forces of attraction field of magnets are due to microscopic currents of electrically charged electrons orbiting nuclei and the intrinsic magnetism of fundamental particles (such as electrons) that make up the material. Both of these are modeled quite well as tiny loops of current called magnetic dipoles that produce their own magnetic field and are affected by external magnetic fields. The most elementary force between magnets, therefore, is the magnetic dipole–dipole interaction. If all of the magnetic dipoles that make up two magnets are known then the net force on both magnets can be determined by summing up all these interactions between the dipoles of the first magnet and that of the second. It is often more convenient to model the force between two magnets as being due to forces between magnetic poles having magnetic charges 'smeared' over them. Positive and negative magnetic charge is always connected by a string of magnetized material, and isolated magnetic charge does not exist. This model works quite well in predicting the forces between simple magnets where good models of how the 'magnetic charge' is distributed are available. The field of a magnet is the sum of fields from all magnetized volume elements, which consist of small magnetic dipoles on an atomic level. The direct summation of all those dipole fields would require three-dimensional integration just to obtain the field of one magnet, which may be intricate. In case of a homogeneous magnetization, the problem can be simplified at least in two different ways, using Stokes' theorem. Upon integration along the direction of magnetization, all dipoles along the line of integration cancel each other, except at the magnet's end surface. The field then emerges only from those (mathematical) magnetic charges spread over the magnet's end facets. This is called Gilbert model. On the contrary, when integrating over a magnetized area orthogonal to the direction of magnetization, the dipoles within this area cancel each other, except at the magnet's outer surface, where they (mathematically) sum up to a ring current. This is called Ampère model. In both models, only two-dimensional distributions over the magnet's surface have to be considered, which is simpler than the original three-dimensional problem. Ampère model: In the Ampère model, all magnetization is due to the effect of microscopic, or atomic, circular bound currents, also called Ampèrian currents throughout the material. The net effect of these microscopic bound currents is to make the magnet behave as if there is a macroscopic electric current flowing in loops in the magnet with the magnetic field normal to the loops. The field due to such currents is then obtained through the Biot–Savart law. The Ampère model gives the correct magnetic flux density B both inside and outside the magnet. It is sometimes difficult to calculate the Ampèrian currents on the surface of a magnet. Gilbert model: In the Gilbert model, the pole surfaces of a permanent magnet are imagined to be covered with so-called magnetic charge, north pole particles on the north pole and south pole particles' on the south pole, that are the source of the magnetic field lines. The field due to magnetic charges is obtained through Coulomb's law with magnetic instead of electric charges. If the magnetic pole distribution is known, then the pole model gives the exact distribution of the magnetic field intensity H both inside and outside the magnet. The surface charge distribution is uniform, if the magnet is homogeneously magnetized and has flat end facets (such as a cylinder or prism). This pole model is also called the Gilbert model of a magnetic dipole. Far away from a magnet, its magnetic field is almost always described (to a good approximation) by a dipole field characterized by its total magnetic dipole moment, m. This is true regardless of the shape of the magnet, so long as the magnetic moment is non-zero. One characteristic of a dipole field is that the strength of the field falls off inversely with the cube of the distance from the magnet's center. The magnetic moment of a magnet is therefore a measure of its strength and orientation. A loop of electric current, a bar magnet, an electron, a molecule, and a planet all have magnetic moments. More precisely, the term magnetic moment normally refers to a system's magnetic dipole moment, which produces the first term in the multipole expansion of a general magnetic field. Both the torque and force exerted on a magnet by an external magnetic field are proportional to that magnet's magnetic moment. The magnetic moment is a vector: it has both a magnitude and direction. The direction of the magnetic moment points from the south to north pole of a magnet (inside the magnet). For example, the direction of the magnetic moment of a bar magnet, such as the one in a compass is the direction that the north poles points toward.