How to create magnetic field to move magnet