With this Instructable I'll show you a simple rig that can be used to experiment with electromechanical resonance.
Step 1: Forewords
Repulsive force for some reason is more entertaining than the attractive one. In this field, I mean.
We know that when a current flows through a metallic wire a magnetic field is generated; that's what electric motor are based upon.
The wire can be wound in the shape of a bobbing to make the field stronger and a metallic core can increase the strength of the field. The equations linking number of turns, coil diameter and current can be found here (http://en.wikipedia.org/wiki/Electromagnet) but it is not strictly necessary to understand the underlying principles.
A direct current, the one from batteries, generates a constant magnetic field. The direction of the magnetic field with respect to current is established conventionally by the so-called right hand rule : with reference to the picture, grabbing the coil with our right hand with the thumb pointing the same direction of the current, the magnetic field will have the direction of the other four fingers.
The direction of current is, again, conventionally fixed going from the + pole of the battery through the wire to the - pole.
Alternating current (a.c.), the one that comes out a regular wall socket, will have the same effect except that the intensity of the current flowing through the coil wire cyclically rises to a maximum then decreases to a minimum in the opposite direction passing through a zero current level. As a consequence, a.c. powering a coil generates an alternating magnetic field that cyclically rises to a maximum value then decreases to a minimum passing through a zero field value.
It is important to note that the field does not rotate in any direction. Simply rises and falls in intensity then reverse its verse and rises again.