a coil can be used to produce a magnetic field