by changing the polarity of the magnetic field