#### qwr

##### Member

Not surprisingly, the math is much more complicated for magnets, even for large distances. Now I am far from a physicist and the main info I could find is https://en.wikipedia.org/wiki/Force_between_magnets#Force_between_two_cylindrical_magnets, which references Vokoun, David; Beleggia, Marco; Heller, Ludek; Sittner, Petr (2009). "Magnetostatic interactions and forces between cylindrical permanent magnets".

*Journal of Magnetism and Magnetic Materials*.

**321**(22): 3758–3763.

http://jontalle.web.engr.illinois.edu/Public/Allen/Noori-pdf/VokounBeleggiaHellerSittner.09.pdf The result is in a fully analytic form with elliptic integrals. For large distances, the force is something on the order of \( 1 / x^2 \), but my layperson skimming of the paper tells me the force would be a sigmoidal shape like arrangement (i) in the figure from the paper

Hopefully a real physicist can come along and actually numerically compute the integrals for cube magnets.