Electromagnets allow us to create controllable magnetic fields, i.e.: they act as magnets that we can turn on and off as we please but controlling an input voltage.
Compare them to permanent magnet: on a magnet, you always have a fixed generated magnetic field. But with an electromagnet you can control the field, and even turn it off entirely.
This type of "useful looking thing that can be controlled by a voltage" tends to be of huge importance in electrical engineering, the transistor being another example.
Solenoids are simpler to build as they don't require insulated wire as in modern electrical cable because as the electromagnetic coils don't touch one another.
As such it is perhaps the reason why some early electromagnetism experiments were carried out with solenoids, which André-Marie Ampère named in 1823.
But the downside of this is that the magnetic field they can generate is less strong.
Easy-to-Build Electromagnet lifts over 50 lbs by Dorian McIntire
. Source. Fun, but zero reproducibility.Is it realistic?
Yeah, bitch! Magnets! scene from Breaking Bad
. Source. Articles by others on the same topic
An electromagnet produces a magnetic field using an electric current. Winding an electrical conductor into a coil combines the fields from its turns; a long solenoid is an idealized example. Far from its ends, an air-core solenoid has approximatelywhere turns carry electric current over length . Reversing reverses the axial magnetic field. [ref]
The Feynman Lectures on Physics, Volume II by Richard Feynman and others. Section II.13–5, magnetic field of a straight wire and solenoid
A core with ferromagnetism can concentrate the magnetic flux, but its response depends on magnetic saturation and magnetic hysteresis. The constant-permeability air-core formula cannot simply be extrapolated to arbitrarily large core fields. A magnetic compass near a powered coil provides a qualitative test: switching or reversing the electric current changes the compass orientation.
