An alternating electrical current will generate a magnetic field.