# Electromagnet

An electromagnet is a type of magnet in which the magnetic field is produced by an electric current. Electromagnets usually consist of wire (likely copper) wound into a coil. A current through the wire creates a magnetic field which is concentrated along the center of the coil. The magnetic field disappears when the current is turned off. The wire turns are often wound around a magnetic core made from a ferromagnetic or ferrimagnetic material such as iron; the magnetic core concentrates the magnetic flux and makes a more powerful magnet.
The main advantage of an electromagnet over a permanent magnet is that the magnetic field can be quickly changed by controlling the amount of electric current in the winding. Wilson Mugwe. However, unlike a permanent magnet, which needs no power, an electromagnet requires a continuous supply of current to maintain the magnetic field.
Electromagnets are widely used as components of other electrical devices, such as motors, generators, electromechanical solenoids, relays, loudspeakers, hard disks, MRI machines, scientific instruments, and magnetic separation equipment. Electromagnets are also employed in industry for picking up and moving heavy iron objects such as scrap iron and steel.

## History

Danish scientist Hans Christian Ørsted discovered in 1820 that electric currents create magnetic fields. In the same year, the French scientist André-Marie Ampère showed that iron can be magnetized by inserting it into an electrically fed solenoid.
British scientist William Sturgeon invented the electromagnet in 1824. His first electromagnet was a horseshoe-shaped piece of iron that was wrapped with about 18 turns of bare copper wire. (Insulated wire did not then exist.) The iron was varnished to insulate it from the windings. When a current was passed through the coil, the iron became magnetized and attracted other pieces of iron; when the current was stopped, it lost magnetization. Sturgeon displayed its power by showing that although it only weighed seven ounces (roughly 200 grams), it could lift nine pounds (roughly 4 kilos) when the current of a single-cell power supply was applied. However, Sturgeon's magnets were weak because the uninsulated wire he used could only be wrapped in a single spaced-out layer around the core, limiting the number of turns.
Beginning in 1830, US scientist Joseph Henry systematically improved and popularised the electromagnet. By using wire insulated by silk thread and inspired by Schweigger's use of multiple turns of wire to make a galvanometer, he was able to wind multiple layers of wire onto cores, creating powerful magnets with thousands of turns of wire, including one that could support 2,063 lb (936 kg). The first major use for electromagnets was in telegraph sounders.
The magnetic domain theory of how ferromagnetic cores work was first proposed in 1906 by French physicist Pierre-Ernest Weiss, and the detailed modern quantum mechanical theory of ferromagnetism was worked out in the 1920s by Werner Heisenberg, Lev Landau, Felix Bloch, and others.

## Applications of electromagnets

A portative electromagnet is one designed to just hold material in place; an example is a lifting magnet. A tractive electromagnet applies a force and moves something.
Electromagnets are very widely used in electric and electromechanical devices, including:
* Motors and generators
* Transformers
* Relays
* Electric bells and buzzers
* Loudspeakers and headphones
* Actuators such as valves
* Magnetic recording and data storage equipment: tape recorders, VCRs, hard disks
* MRI machines
* Scientific equipment such as mass spectrometers
* Particle accelerators
* Magnetic locks
* Magnetic separation equipment used for separating magnetic from nonmagnetic material; for example, separating ferrous metal in scrap
* Industrial lifting magnets
* Magnetic levitation, used in maglev trains
* Induction heating for cooking, manufacturing, and hyperthermia therapy

## Simple solenoid

A common tractive electromagnet is a uniformly wound solenoid and plunger. The solenoid is a coil of wire, and the plunger is made of a material such as soft iron. Applying a current to the solenoid applies a force to the plunger and may make it move. The plunger stops moving when the forces upon it are balanced. For example, the forces are balanced when the plunger is centered in the solenoid.
The maximum uniform pull happens when one end of the plunger is at the middle of the solenoid. An approximation for the force F is
where C is a proportionality constant, A is the cross-sectional area of the plunger, N is the number of turns in the solenoid, I is the current through the solenoid wire, and ℓ is the length of the solenoid. For long, slender, solenoids (in units using inches, pounds force, and amperes), the value of C is around 0.009 to 0.010 psi (maximum pull pounds per square inch of plunger cross-sectional area). For example, a 12-inch-long coil (ℓ = 12 in) with a long plunger with a cross section of one inch square (A = 1 in$^2$) and 11,200 ampere-turns (N I = 11,200 Aturn) had a maximum pull of 8.75 pounds (corresponding to C = 0.0094 psi).
The maximum pull is increased when a magnetic stop is inserted into the solenoid. The stop becomes a magnet that will attract the plunger; it adds little to the solenoid pull when the plunger is far away but dramatically increases the pull when the plunger is close. An approximation for the pull P is
    $P=ANI\left[{\frac {NI}{(\ell _{\mathrm {a} })^{2}(C_{1})^{2}}}+{\frac {C}{\ell }}\right]={\frac {AN^{2}I^{2}}{(\ell _{\mathrm {a} })^{2}(C_{1})^{2}}}+{\frac {CANI}{\ell }}$
Here ℓ$_a$ is the distance between the end of the stop and the end of the plunger. The additional constant C$_1$ for units of inches, pounds, and amperes with slender solenoids is about 2660. The first term inside the bracket represents the attraction between the stop and the plunger; the second term represents the same force as the solenoid without a stop (Eq. 1).
Some improvements can be made on this basic design. The ends of the stop and plunger are often conical. For example, the plunger may have a pointed end that fits into a matching recess in the stop. The shape makes the solenoid's pull more uniform as a function of separation. Another improvement is to add a magnetic return path around the outside of the solenoid (an "iron-clad solenoid"). The magnetic return path, just as the stop, has little impact until the air gap is small.

## Physics

An electric current flowing in a wire creates a magnetic field around the wire, due to Ampere's law (see drawing of wire with magnetic field). To concentrate the magnetic field in an electromagnet, the wire is wound into a coil with many turns of wire lying side-by-side. The magnetic field of all the turns of wire passes through the center of the coil, creating a strong magnetic field there. A coil forming the shape of a straight tube (a helix) is called a solenoid.
The direction of the magnetic field through a coil of wire can be determined by the right-hand rule. If the fingers of the right hand are curled around the coil in the direction of current flow (conventional current, flow of positive charge) through the windings, the thumb points in the direction of the field inside the coil. The side of the magnet that the field lines emerge from is defined to be the north pole.

### Magnetic core

For definitions of the variables below, see box at end of article.
Much stronger magnetic fields can be produced if a magnetic core, made of a soft ferromagnetic (or ferrimagnetic) material such as iron, is placed inside the coil. A core can increase the magnetic field to thousands of times the strength of the field of the coil alone, due to the high magnetic permeability $\mu$ of the material. Not all electromagnets use cores, so this is called a ferromagnetic-core or iron-core electromagnet.
This phenomenon occurs because the magnetic core's material (often iron or steel) is composed of small regions called magnetic domains that act like tiny magnets (see ferromagnetism). Before the current in the electromagnet is turned on, these domains point in random directions, so their tiny magnetic fields cancel each other out, and the core has no large-scale magnetic field. When a current passes through the wire wrapped around the core, its magnetic field penetrates the core and turns the domains to align in parallel with the field. As they align, all their tiny magnetic fields add to the wire's field, which creates a large magnetic field that extends into the space around the magnet. The core concentrates the field, and the magnetic field passes through the core in lower reluctance than it would when passing through air.
The larger the current passed through the wire coil, the more the domains align, and the stronger the magnetic field is. Once all the domains are aligned, any additional current only causes a slight increase in the strength of the magnetic field. Eventually, the field strength levels off and becomes nearly constant, regardless of how much current is sent through the windings. This phenomenon is called saturation, and is the main nonlinear feature of ferromagnetic materials. For most high-permeability core steels, the maximum possible strength of the magnetic field is around 1.6 to 2 teslas (T). This is why the very strongest electromagnets, such as superconducting and very high current electromagnets, cannot use cores.
When the current in the coil is turned off, most of the domains in the core material lose alignment and return to a random state, and the electromagnetic field disappears. However, some of the alignment persists because the domains resist turning their direction of magnetization, which leaves the core magnetized as a weak permanent magnet. This phenomenon is called hysteresis and the remaining magnetic field is called remanent magnetism. The residual magnetization of the core can be removed by degaussing. In alternating current electromagnets, such as those used in motors, the core's magnetization is constantly reversed, and the remanence contributes to the motor's losses.

### Ampere's law

The magnetic field of electromagnets in the general case is given by Ampere's Law:
    $\int \mathbf {J} \cdot d\mathbf {A} =\oint \mathbf {H} \cdot d{\boldsymbol {\ell }}$
which says that the integral of the magnetizing field $\mathbf {H}$ around any closed loop is equal to the sum of the current flowing through the loop. A related equation is the Biot–Savart law, which gives the magnetic field due to each small segment of current.

### Force exerted by magnetic field

Likewise, on the solenoid, the force exerted by an electromagnet on a conductor located at a section of core material is:
This equation can be derived from the energy stored in a magnetic field. Energy is force times distance. Rearranging terms yields the equation above.
The 1.6 T limit on the field previously mentioned sets a limit on the maximum force per unit core area, or magnetic pressure, an iron-core electromagnet can exert; roughly:
    ${\frac {F}{A}}={\frac {(B_{\text{sat}})^{2}}{2\mu _{0}}}\approx 1000\ \mathrm {kPa} =10^{6}\mathrm {N/m^{2}} =145\ \mathrm {lbf/in^{2}}$
for the core's saturation limit, $B_{sat}$. In more intuitive units, it is useful to remember that at 1 T the magnetic pressure is approximately 4 standard atmospheres (4.1 kg/cm$^2$).
Given a core geometry, the magnetic field needed for a given force can be calculated from (Eq. 2); if the result is much more than 1.6 T, a larger core must be used.
However, computing the magnetic field and force exerted by ferromagnetic materials in general is difficult for two reasons. First, the strength of the field varies from point to point in a complicated way, particularly outside the core and in air gaps, where fringing fields and leakage flux must be considered. Second, the magnetic field and force are nonlinear functions of the current, depending on the nonlinear relation between $B$ and $\mathbf {H}$ for the particular core material used. For precise calculations, computer programs that can produce a model of the magnetic field using the finite element method are employed.

### Magnetic circuit

In many practical applications of electromagnets, such as motors, generators, transformers, lifting magnets, and loudspeakers, the iron core is in the form of a loop or magnetic circuit, possibly broken by a few narrow air gaps. Iron presents much less "resistance" (reluctance) to the magnetic field than air, so a stronger field can be obtained if most of the magnetic field's path is within the core. Since the magnetic field lines are closed loops, the core is usually made in the form of a loop.
Since most of the magnetic field is confined within the outlines of the core loop, this allows a simplification of the mathematical analysis. A common simplifying assumption satisfied by many electromagnets, which will be used in this section, is that the magnetic field strength $B$ is constant around the magnetic circuit (within the core and air gaps) and zero outside it. Most of the magnetic field will be concentrated in the core material (C) (see Fig. 1). Within the core, the magnetic field (B) will be approximately uniform across any cross-section; if the core also has roughly constant area throughout its length, the field in the core will be constant.
At any air gaps (G) between core sections, the magnetic field lines are no longer confined by the core. Here, they bulge out beyond the core geometry over the length of the gap, reducing the field strength in the gap. The "bulges" (B$_F$) are called fringing fields. However, as long as the length of the gap is smaller than the cross-section dimensions of the core, the field in the gap will be approximately the same as in the core.
In addition, some of the magnetic field lines (B$_L$) will take "short cuts" and not pass through the entire core circuit, and thus will not contribute to the force exerted by the magnet. This also includes field lines that encircle the wire windings but do not enter the core. This is called leakage flux.
The equations in this section are valid for electromagnets for which:
* the magnetic circuit is a single loop of core material, possibly broken by a few air gaps;
* the core has roughly the same cross-sectional area throughout its length;
* any air gaps between sections of core material are not large compared with the cross-sectional dimensions of the core;
* there is negligible leakage flux.

#### Magnetic field in magnetic circuit

The magnetic field created by an electromagnet is proportional to both $N$ and $I$; their product, $NI$, is magnetomotive force. For an electromagnet with a single magnetic circuit, Ampere's Law reduces to:
    $NI=H_{\mathrm {core} }L_{\mathrm {core} }+H_{\mathrm {gap} }L_{\mathrm {gap} }$
This is a nonlinear equation, because the permeability of the core $\mu$ varies with $B$. For an exact solution, $\mu (B)$ must be obtained from the core material hysteresis curve. If $B$ is unknown, the equation must be solved by numerical methods.
However, if the magnetomotive force is well above saturation (so the core material is in saturation), the magnetic field will be approximately the material's saturation value $B_{sat}$, and will not vary much with changes in $NI$. For a closed magnetic circuit (no air gap), most core materials saturate at a magnetomotive force of roughly 800 ampere-turns per meter of flux path.
For most core materials, the relative permeability $\mu _{r}\approx 2000{\text{–}}6000\,$. So in (Eq. 3), the second term dominates. Therefore, in magnetic circuits with an air gap, $B$ depends strongly on the length of the air gap, and the length of the flux path in the core does not matter much. Given an air gap of 1mm, a magnetomotive force of about 796 ampere-turns is required to produce a magnetic field of 1 T.

#### Closed magnetic circuit

For a closed magnetic circuit (no air gap), such as would be found in an electromagnet lifting a piece of iron bridged across its poles, equation (Eq. 3) becomes:
Substituting into (Eq. 2), the force is:
To maximize the force, a core with a short flux path $L$ and a wide cross-sectional area $A$ is preferred (this also applies to magnets with an air gap). To achieve this, in applications like lifting magnets and loudspeakers, a flat cylindrical design is often used. The winding is wrapped around a short wide cylindrical core that forms one pole, and a thick metal housing that wraps around the outside of the windings forms the other part of the magnetic circuit, bringing the magnetic field to the front to form the other pole.

### Force between electromagnets

The previous methods are applicable to electromagnets with a magnetic circuit; however, they do not apply when a large part of the magnetic field path is outside the core. (A non-circuit example would be a magnet with a straight cylindrical core.) To determine the force between two electromagnets (or permanent magnets) in these cases, a special analogy called a magnetic-charge model can be used. In this model, it is assumed that the magnets have well-defined "poles" where the field lines emerge from the core, and that the magnetic field is produced by fictitious "magnetic charges" on the surface of the poles. This model assumes point-like poles (instead of surfaces), and thus it only yields a good approximation when the distance between the magnets is much larger than their diameter; thus, it is useful just for determining a force between them.
The magnetic pole strength $m$ of an electromagnet is given by $m={\frac {NIA}{L}}$ and thus the force between two poles is $F={\frac {\mu _{0}m_{1}m_{2}}{4\pi r^{2}}}.$ Each electromagnet has two poles, so the total force on magnet 1 from magnet 2 is equal to the vector sum of the forces of magnet 2's poles acting on each pole of magnet 1.

## Side effects

There are several side effects which occur in electromagnets, which must be considered in their design. These effects generally become more significant in larger electromagnets.

### Ohmic heating

The only power consumed in a direct current (DC) electromagnet under steady-state conditions is due to the resistance of the windings, and is dissipated as heat. Some large electromagnets require water cooling systems in the windings to carry off the waste heat.
Since the magnetic field is proportional to the product $NI$, the number of turns in the windings $N$ and the current $I$ can be chosen to minimize heat losses, as long as their product is constant. Since the power dissipation, $P=I^{2}R$, increases with the square of the current but only increases approximately linearly with the number of windings, the power lost in the windings can be minimized by reducing $I$ and proportionally increasing the number of turns $N$, or using thicker wire to reduce the resistance. For example, halving $I$ and doubling $N$ halves the power loss, as does doubling the area of the wire. In either case, increasing the amount of wire reduces the ohmic losses. For this reason, electromagnet windings often have a significant thickness.
However, the limit to increasing $N$ or lowering the resistance is that the windings take up more space between the magnet's core pieces. If the area available for windings is filled up, adding more turns requires a smaller diameter of wire, which has higher resistance, and thus cancels the advantage of using more turns. So, in large magnets there is a minimum amount of heat loss that cannot be reduced. This increases with the square of the magnetic flux, $B^{2}$.

### Inductive voltage spikes

An electromagnet has significant inductance, and resists changes in the current through its windings. Any sudden changes in the winding current cause large voltage spikes across the windings. This is because when the current through the magnet is increased, such as when it is turned on, energy from the circuit must be stored in the magnetic field. When it is turned off, the energy in the field is returned to the circuit.
If an ordinary switch is used to control the winding current, this can cause sparks at the terminals of the switch. This does not occur when the magnet is switched on, because the limited supply voltage causes the current through the magnet and the field energy to increase slowly. But when it is switched off, the energy in the magnetic field is suddenly returned to the circuit, causing a large voltage spike and an arc across the switch contacts, which can damage them. With small electromagnets, a capacitor is sometimes used across the contacts, which reduces arcing by temporarily storing the current. More often, a diode is used to prevent voltage spikes by providing a path for the current to recirculate through the winding until the energy is dissipated as heat. The diode is connected across the winding, oriented so it is reverse-biased during steady state operation and does not conduct. When the supply voltage is removed, the voltage spike forward-biases the diode and the reactive current continues to flow through the winding, through the diode, and back into the winding. A diode used in this way is called a freewheeling diode or flyback diode.
Large electromagnets are usually powered by variable current electronic power supplies, controlled by a microprocessor, which prevent voltage spikes by accomplishing current changes slowly, in gentle ramps. It may take several minutes to energize or deenergize a large magnet.

### Lorentz forces

In powerful electromagnets, the magnetic field exerts a force on each turn of the windings, due to the Lorentz force $q\mathbf {v} \times \mathbf {B}$ acting on the moving charges within the wire. The Lorentz force is perpendicular to both the axis of the wire and the magnetic field. It can be visualized as a pressure between the magnetic field lines, pushing them apart. It has two effects on an electromagnet's windings:
* The field lines within the axis of the coil exert a radial force on each turn of the windings, tending to push them outward in all directions. This causes a tensile stress in the wire.
* The leakage field lines between each turn of the coil exert an attractive force between adjacent turns, tending to pull them together.
The Lorentz forces increase with $B^{2}$. In large electromagnets the windings must be firmly clamped in place, to prevent motion on power-up and power-down from causing metal fatigue in the windings. In the Bitter electromagnet design (Fig. 2), used in very high-field research magnets, the windings are constructed as flat disks to resist the radial forces, and clamped in an axial direction to resist the axial ones.

### Core losses

In alternating current (AC) electromagnets, used in transformers, inductors, and AC motors and generators, the magnetic field is constantly changing. This causes energy losses in their magnetic cores, which is dissipated as heat in the core. The losses stem from two processes: eddy currents and hysteresis losses.
Eddy currents: From Faraday's law of induction, a changing magnetic field induces circulating electric currents (eddy currents) inside nearby conductors. The energy in these currents is dissipated as heat in the electrical resistance of the conductor, so they are a cause of energy loss. Since the magnet's iron core is conductive, and most of the magnetic field is concentrated there, eddy currents in the core are the major problem. Eddy currents are closed loops of current that flow in planes perpendicular to the magnetic field. The energy dissipated is proportional to the area enclosed by the loop. To prevent them, the cores of AC electromagnets are made of stacks of thin steel sheets, or laminations, oriented parallel to the magnetic field, with an insulating coating on the surface. The insulation layers prevent eddy current from flowing between the sheets. Any remaining eddy currents must flow within the cross-section of each individual lamination, which reduces losses greatly. Another alternative is to use a ferrite core, which is a nonconductor.
Hysteresis losses: Reversing the direction of magnetization of the magnetic domains in the core material each cycle causes energy loss, because of the coercivity of the material. These are called hysteresis losses. The energy lost per cycle is proportional to the area of the hysteresis loop in the $BH$ graph. To minimize this loss, magnetic cores used in transformers and other AC electromagnets are made of "soft" low coercivity materials, such as silicon steel or soft ferrite. The energy loss per cycle of the alternating current is constant for each of these processes, so the power loss increases linearly with frequency.

## High-field electromagnets
### Superconducting electromagnets

When a magnetic field higher than the ferromagnetic limit of 1.6 T is needed, superconducting electromagnets can be used. Instead of using ferromagnetic materials, these use superconducting windings cooled with liquid helium, which conduct current without electrical resistance. These allow enormous currents to flow, which generate intense magnetic fields. Superconducting magnets are limited by the field strength at which the winding material ceases to be superconducting. Current designs are limited to 10–20 T, with the current (2017) record of 32 T. The necessary refrigeration equipment and cryostat make them much more expensive than ordinary electromagnets. However, in high-power applications this can be offset by lower operating costs, since after startup no power is required for the windings, since no energy is lost to ohmic heating. They are used in particle accelerators and MRI machines.

### Bitter electromagnets

Both iron-core and superconducting electromagnets have limits to the field they can produce. Therefore, the most powerful man-made magnetic fields have been generated by air-core non-superconducting electromagnets of a design invented by Francis Bitter in 1933, called Bitter electromagnets. Instead of wire windings, a Bitter magnet consists of a solenoid made of a stack of conducting disks, arranged so that the current moves in a helical path through them, with a hole through the center where the maximum field is created. This design has the mechanical strength to withstand the extreme Lorentz forces of the field, which increase with $B^{2}$. The disks are pierced with holes through which cooling water passes to carry away the heat caused by the high current. The strongest continuous field achieved solely with a resistive magnet is 41.5 T as of 22 August 2017, produced by a Bitter electromagnet at the National High Magnetic Field Laboratory in Tallahassee, Florida. The previous record was 37.5 T. The strongest continuous magnetic field overall, 45 T, was achieved in June 2000 with a hybrid device consisting of a Bitter magnet inside a superconducting magnet.
The factor that limits the strength of electromagnets is the inability to dissipate the enormous waste heat, so more powerful fields, up to 100 T, have been obtained from resistive magnets by sending brief pulses of high current through them; the inactive period after each pulse allows the heat produced during the pulse to be removed before the next pulse.

### Explosively pumped flux compression

The most powerful man-made magnetic fields have been created by using explosives to compress the magnetic field inside an electromagnet as it is pulsed; these are called explosively pumped flux compression generators. The implosion compresses the magnetic field to values of around 1,000 T for a few microseconds. While this method may seem very destructive, shaped charges redirect the blast outward to minimize harm to the experiment. These devices are known as destructive pulsed electromagnets. They are used in physics and materials science research to study the properties of materials at high magnetic fields.

## Definition of terms

| Term | Significance | Unit |
| $A\,$ | Cross sectional area of core | square meter |
| $B\,$ | Magnetic field (magnetic flux density) | tesla |
| $F\,$ | Force exerted by magnetic field | newton |
| $H\,$ | Magnetizing field | ampere per meter |
| $I\,$ | Current in the winding wire | ampere |
| $L\,$ | Total length of the magnetic field path $L_{\mathrm {core} }+L_{\mathrm {gap} }\,$ | meter |
| $L_{\mathrm {core} }\,$ | Length of the magnetic field path in the core material | meter |
| $L_{\mathrm {gap} }\,$ | Length of the magnetic field path in air gaps | meter |
| $m_{1},m_{2}\,$ | Pole strength of the electromagnet | ampere meter |
| $\mu \,$ | Permeability of the electromagnet core material | newton per square ampere |
| $\mu _{0}\,$ | Permeability of free space (or air) = $4\pi (10^{-7})\ \mathrm {N} \cdot \mathrm {A} ^{-2}$ | newton per square ampere |
| $\mu _{r}\,$ | Relative permeability of the electromagnet core material | dimensionless |
| $N\,$ | Number of turns of wire on the electromagnet | dimensionless |
| $r\,$ | Distance between the poles of two electromagnets | meter |