Levitating magnets

Levitating magnets are positioned on the stick in a way that poles of the same sign are close by (NS-SN-NS) - these magnets are donut-like, with upper and lower side different (opposite poles). So they repel each other. The repulsive force increases if the distance between magnets decreases. It is easy to check it - try to push one of them down: the resistance force rises when the magnets get closer. On the other hand, when you remove No 1 (the upper magnet), No. 2 will rise somewhat up - since No. 1 is not hovering over No. 2 any more. In the static conditions the distance between magnets is such that the repulsive magnetic force acting upwards equals the gravitational force. In other words, the lowest level magnet No. 3 has to push up both No. 1 and 2 magnets, while No. 2 one pushes up only No. 1.

This observation allows us for the evaluation of the forces in a semi-quantitative way. The total force acting downwards on the magnet in the middle is mg coming from its own weight and another mg coming from the weight of the uppermost magnet. So this force is double the force acting on the uppermost magnet. The interaction force between magnets changes similarly to Coulomb's force (it is inversely proportional to the square of distance, even if we do not formulate this dependence in such wording). Therefore, the distance between the lowest and middle magnets is approximately smaller by a factor of square root of 2 than the distance between the middle one and the uppermost magnet.

F12 = F21, F32 = F23,
F13 = F31 = 0
F21 - mg = 0; F21 = mg;
F12 + mg - F32 = 0; F32 = mg + F12

So

F23 = 2F21
k/r232 = 2k/r122
r23/r12 = 1/√2

The plastic stick is very important: it prevents magnets from sliding apart and sticking together. We say that such a stick is a 2D constraint.

In the levitation pen the configuration of magnets is more complicated, but the constraints consist in just one reaction point. In the levitron no constraints are visible, but the vertical orientation of the spinning top is preserved thanks to its rotation.