Figure 2 shows a soft iron bar AB placed in a coil near a freely suspended magnet. Explain the observation made when the switch is closed.