magnetic potential rectangular bar magnet