Rapidly reverse polarity of electromagnet
Use a reasonably powerful audio amplifier, feed it with 20 Hz from a signal generator or something, and connect the magnet where the speaker would go.  If this blows the output fuse of the amplifier or it catches fire or something, try again with more turns of a thinner wire when making your electromagnet.