Self-stabilizing magnetic bearings for flywheels