by hand, but let your computer do that for you; All that the computer program needs to know is the force between small magnets that are at great distance from each other. In such computations it is often assumed that each (same-size) small piece of magnetic material has an equally strong magnetism, but this is not always true: a magnet that is placed near another magnet can change the magnetization of that other magnet. For permanent magnets this is usually only a small change, but if you have an electromagnet that consists of a wire wound round an iron core, and you bring a permanent magnet near to that core, then the magnetization of that core can change drastically (for example, if there is no current in the wire, the electromagnet would not be magnetic, but when the permanent magnet is brought near, the core of the electromagnet becomes magnetic). Thus the Ampère model is suitable for computing the magnetic force-field of a permanent magnet, but for electromagnets it can be better to use a magnetic-circuit approach. Magnetic dipole–dipole interaction If two or more magnets are small enough or sufficiently distant that their shape and size is not important then both magnets can be modeled as being magnetic dipoles having a magnetic moments m1 and m2. In case of uniformly magnetized spherical magnets this model is precise even at finite size and distance, as the outside field of such magnets is exactly a dipole field. The magnetic field of a magnetic dipole in vector notation is: where B is the field r is the vector from the position of the dipole to the position where the field is being measured r is the absolute value of r: the distance from the dipole is the unit vector parallel to r; m is the (vector) dipole moment μ0 is the permeability of free space δ3 is the three-dimensional delta function. This is exactly the field of a point dipole, exactly the dipole term in the multipole expansion of an arbitrary field, and approximately the field of any dipole-like configuration at large distances. If the coordinate system is shifted to center it on m1 and rotated such that the x-axis points in the direction of m1 then the previous equation simplifies to where the variables r and θ are measured in a frame of reference with origin in m1 and oriented such that