Magnetic Field of a Solenoid Using Ampere's Law: Difference between revisions

From Physics Book
Jump to navigation Jump to search
No edit summary
Rewrote derivation with MIT figures, added GlowScript model, new examples, connectedness and updated history and references.
 
(46 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Claimed by Mary Jane Chandler Fall 2016


This page explains how to use Ampere's Law to solve for the magnetic field of a solenoid.
'''Improved by Katherine Preheim Fall 2026, Improved by Miranda Harmon Spring 2018'''
 
This page explains how to use Ampere's Law to solve for the magnetic field of a solenoid, and the derivation of the formula of the magnetic field of a solenoid.


==The Main Idea==
==The Main Idea==


A solenoid is a cylindrical coil of wire that produces a uniform magnetic field when it is carrying an electric current. A solenoid is a form of an electromagnet that can create strong controlled magnetic fields throughout the coil except at the ends. Ampere's Law states that the magnetic field in space around an electric current is proportional to the source of the electric current. This can be applied to solve the magnetic field of a Solenoid.
A solenoid is a cylindrical coil of wire that produces a nearly uniform magnetic field inside the coil when it carries an electric current. The overall field pattern is similar to the field of a bar magnet. A solenoid is a form of electromagnet that can create strong, controlled magnetic fields throughout the coil except near the ends. The magnetic field of a solenoid can be found using Ampere's law, which relates the magnetic field along a closed path to the current passing through that path. The field inside the solenoid is directly proportional to the current and to the number of turns per unit length (N/L).


[[File:solenoidfrombook.png]]
[[File:MIT_Solenoid_Field_Lines.png|frame|center|Magnetic field lines of a loosely wound solenoid (left) and a tightly wound solenoid (right). Figure 9.4.1 from MIT OpenCourseWare 8.02T course notes by John Belcher, Peter Dourmashkin, and Sen-Ben Liao, CC BY-NC-SA (ocw.mit.edu/terms).]]


As you can see in this model, in the middle of the solenoid the field is constant throughout the entirety of the interior and is parallel to the axis. At the ends of a solenoid the magnetic field starts to point outward at varying angles.  
In the left picture, the field circles around each wire, but inside the coil the fields from all the turns add up, while outside they mostly cancel. When the coil is tightly wound (right), the field inside becomes nearly uniform and the outside looks like the field of a bar magnet, with a north and a south end. In the middle of the solenoid, the field is constant throughout the interior and parallel to the axis. Near the ends, the field lines spread out, and on the axis the field at each end is only about half of the field at the center. The greater the current and the more turns per unit length, the stronger the field inside. An ideal (infinitely long) solenoid would have a perfectly uniform field inside and zero field outside.


===A Mathematical Model===
===A Mathematical Model===


If there are <math>N</math> loops of wire that compose a solenoid of length <math>L</math>, and we know that Ampere's Law gives us the form:
Ampere's law says that if you add up B · dl around any closed path, the result equals μ0 times the current passing through the path:
 
<math>\oint \vec{B} \cdot d\vec{l} = \mu_0 I_{enclosed}</math>
 
For a long solenoid with N turns, length L, and current I, Ampere's law gives the field inside the solenoid:
 
<math>B = \frac{\mu_0 N I}{L} = \mu_0 n I</math>
 
where n = N/L is the number of turns per unit length. The field does not depend on the radius of the solenoid or on where you are inside it, as long as you are not near the ends.
 
The direction of the field comes from the right-hand rule. Curl the fingers of your right hand around the coil in the direction of the current, and your thumb points in the direction of the magnetic field inside the solenoid, along its axis. This also works backwards: if you know the direction of the field, point your thumb that way, and your fingers curl in the direction of the conventional current.
 
====Derivation====


<math>{\oint\,\vec{B}•d\vec{l} = μ_{0}∑I_{inside path}}</math>
[[File:MIT_Solenoid_Amperian_Loop.png|frame|center|Amperian loop for calculating the magnetic field of an ideal solenoid. Figure 9.4.2 from MIT OpenCourseWare 8.02T course notes by John Belcher, Peter Dourmashkin, and Sen-Ben Liao, CC BY-NC-SA (ocw.mit.edu/terms).]]


[[File:sol.png|frame|Solenoid with variables]]
To use Ampere's law, choose a rectangular path (an Amperian loop) like the one in the figure, with segment 3 of length l inside the solenoid, parallel to the axis, and segment 1 outside the solenoid. Then look at each segment:


We can then solve for <math>B</math>:
# Segment 3 (inside): B is parallel to the path and constant, so this segment contributes <math>Bl</math>.
# Segments 2 and 4: inside the solenoid, B is perpendicular to these segments, so <math>\vec{B} \cdot d\vec{l} = 0</math>. Outside, B is close to zero. These segments contribute nothing.
# Segment 1 (outside): the field outside a long solenoid is close to zero, so this segment contributes nothing.


<math>{B = \frac{μ_{0}NI}{L}}</math>
The width w of the loop doesn't matter, as long as segment 3 is inside the solenoid and segment 1 is outside.


The Right Hand Rule can be used to find the direction of the magnetic field by using your right hand and curling your fingers in the direction of the current with your thumb pointing in the direction of the magnetic field. This is always along the axis for a solenoid.
Adding up the four segments, going counterclockwise around the loop:


[[File:Righthand.png]]
<math>\oint \vec{B} \cdot d\vec{l} = \int_1 \vec{B} \cdot d\vec{l} + \int_2 \vec{B} \cdot d\vec{l} + \int_3 \vec{B} \cdot d\vec{l} + \int_4 \vec{B} \cdot d\vec{l} = 0 + 0 + Bl + 0 = Bl</math>


So the left side of Ampere's law is just <math>Bl</math>.
For the right side, count the current passing through the rectangle. The rectangle covers a length l of the solenoid, which contains <math>\frac{N}{L} l</math> turns, and each turn carries current I:
<math>I_{enclosed} = \frac{N}{L} l I</math>
Setting the two sides equal:
<math>Bl = \mu_0 \frac{N}{L} l I</math>
The l cancels on both sides, which gives <math>B = \frac{\mu_0 N I}{L}</math>.
This is where the N in the formula comes from. The Amperian loop encloses many turns of wire, and each turn adds a current I to the total current through the loop.
Symbols:
* B: magnetic field inside the solenoid (T)
* μ0: permeability of free space, 4π × 10<sup>-7</sup> T·m/A
* N: number of turns
* L: length of the solenoid (m)
* n = N/L: number of turns per unit length (1/m)
* I: current in the wire (A)
* l: length of segment 3 of the Amperian loop, inside the solenoid (m)
===A Computational Model===
[[File:SolenoidGlowScriptModel.png|frame|center|Screenshot of the GlowScript model. Blue: adding up the loops. Red: Ampere's law for an infinitely long solenoid.]]
[https://www.glowscript.org/#/user/katherinepreheim/folder/MyPrograms/program/SolenoidField Click here to run the GlowScript model]
This model finds the magnetic field along the axis of a solenoid by adding up the fields of all its loops. On the axis of a single loop, the field is
<math>B = \frac{\mu_0 I R^2}{2(R^2 + z^2)^{3/2}}</math>
where z is the distance from the loop. The program adds this up for all N loops (superposition), draws arrows along the axis, and graphs B versus position. The blue curve is the model, and the red curve is the Ampere's law result for an infinitely long solenoid (μ0NI/L inside and zero outside).
For a solenoid with 40 turns, a length of 40 cm, a radius of 5 cm, and a current of 2 A, the model gives:
* B at the center: 2.44 × 10<sup>-4</sup> T, about 3% less than μ0NI/L = 2.51 × 10<sup>-4</sup> T. The difference is because this solenoid isn't infinitely long.
* B at the ends: 1.25 × 10<sup>-4</sup> T, about half of the field at the center.
* Outside the ends, the field drops off quickly.
To try other values, change I, N, L, or R at the top of the code and run it again. One limitation is that this model only finds the field on the axis, not off to the side.
<pre>
Web VPython 3.2
# Magnetic field along the axis of a solenoid.
# A solenoid is N loops of wire. On the axis of ONE loop, the field is
#    B = mu0*I*R^2 / (2*(R^2 + z^2)^1.5)
# where z is the distance from the loop. Adding up (superposing) this field
# for all N loops gives the field of the whole solenoid.
mu0 = 4*pi*1e-7    # T*m/A
I = 2              # current (A)
N = 40            # number of turns
L = 0.4            # length of the solenoid (m)
R = 0.05          # radius of the loops (m)
d = L/N            # spacing between loops (m)
# Draw the loops of wire
for n in range(N):
    x = -L/2 + d/2 + n*d
    ring(pos=vector(x, 0, 0), axis=vector(1, 0, 0), radius=R, thickness=0.002, color=color.orange)
# Field on the axis at position x: add up the field of every loop
def B_axis(x):
    B = 0
    for n in range(N):
        z = x - (-L/2 + d/2 + n*d)    # distance from loop n to the point
        B = B + mu0*I*R**2/(2*(R**2 + z**2)**1.5)
    return B
# Arrows along the axis show the field (longer arrow = stronger field)
scale = 150        # arrow length (m) per tesla
x = -0.35
while x < 0.36:
    arrow(pos=vector(x, 0, 0), axis=vector(scale*B_axis(x), 0, 0), color=color.cyan)
    x = x + 0.05
# Graph of B along the axis.
# Blue: adding up the loops. Red: Ampere's law for an infinitely long solenoid.
graph(title="Magnetic field along the axis", xtitle="x (m)", ytitle="B (T)")
model = gcurve(color=color.blue)
ampere = gcurve(color=color.red)
x = -0.35
while x < 0.35:
    model.plot(x, B_axis(x))
    if abs(x) < L/2:
        ampere.plot(x, mu0*N*I/L)
    else:
        ampere.plot(x, 0)
    x = x + 0.005
print("B at the center, adding up the loops:", B_axis(0), "T")
print("B from Ampere's law, mu0*N*I/L:", mu0*N*I/L, "T")
print("B at the end of the coil:", B_axis(L/2), "T")
</pre>


==Examples==
==Examples==


===Simple===
Find the magnetic field inside a 20 cm long solenoid with 200 turns carrying a current of 8 A.
Convert the length to meters: L = 20 cm = 0.20 m. Then use the solenoid formula:


===Simple===
<math>B = \frac{\mu_0 N I}{L}</math>
Find the magnetic field produced by a 40 cm long solenoid if the number of loops is 400 and current passing through it is 5 A.
 
[[File:Examplesolenoid.jpg|700x900px]]
<math>B = \frac{(4\pi \times 10^{-7}\ \text{T m/A})(200)(8\ \text{A})}{0.20\ \text{m}}</math>
 
<math>B = 1.0 \times 10^{-2}\ \text{T}</math>
 
The field points along the axis of the solenoid, in the direction given by the right-hand rule.


This example is very simple, as all of the variables of the equation are provided. All you need to do is plug them in and find the direction using the right hand rule.
===Middling===
===Middling===
A solenoid has a magnetic field of 5x10<sup>-4</sup> T, 3000 turns, and is 30 cm long. What is the current through the solenoid?
A solenoid is 10 cm long, has 2000 turns, and has a radius of 1.5 cm.
[[File:example2solenoid.jpg|700x900px]]
 
(a) What current is needed to make a magnetic field of 6.0 × 10<sup>-4</sup> T inside the solenoid?
 
Solve the solenoid formula for I:
 
<math>I = \frac{BL}{\mu_0 N}</math>
 
<math>I = \frac{(6.0 \times 10^{-4}\ \text{T})(0.10\ \text{m})}{(4\pi \times 10^{-7}\ \text{T m/A})(2000)}</math>
 
<math>I = 0.024\ \text{A}</math>
 
(b) What is the magnetic flux through one turn of the solenoid?
 
The field inside is uniform and perpendicular to the cross section, so the flux is B times the area:
 
<math>\Phi = BA = B \pi r^2</math>
 
<math>\Phi = (6.0 \times 10^{-4}\ \text{T}) \pi (0.015\ \text{m})^2</math>
 
<math>\Phi = 4.2 \times 10^{-7}\ \text{Wb}</math>


This example is just a reverse solving of the equation derived above for the magnetic field of a solenoid. It is not munch more difficult than the previous example.
===Difficult===
===Difficult===
A long, tightly wound solenoid has a circular cross section of radius 0.02 m. The solenoid is connected to a power supply (not shown), and this current changes with time, so the magnetic field inside the solenoid also changes with time. At time t = 0 s, the magnitude of the magnetic field inside the solenoid is 1.8 T. At time t = 0.3 s, the magnitude of the magnetic field inside the solenoid is 0.5 T. The direction of the magnetic field inside the solenoid is shown in the diagram. The solenoid passes through a coil of wire, which has 45 turns of radius 0.15 m. The coil is connected to a voltmeter (not shown).
A 5-turn coil with a radius of 4.0 cm is wrapped around the middle of the solenoid from the Middling example. The current in the solenoid increases steadily from 0 to 0.024 A in 2.0 ms. What emf is induced in the outer coil?
 
From the Middling example, the field inside the solenoid goes from 0 to 6.0 × 10<sup>-4</sup> T, so:
 
<math>\frac{dB}{dt} = \frac{6.0 \times 10^{-4}\ \text{T}}{2.0 \times 10^{-3}\ \text{s}} = 0.30\ \text{T/s}</math>
 
The key step is finding the area. The field outside the solenoid is close to zero, so the only flux through the outer coil is the flux inside the solenoid. That means we use the solenoid's radius (1.5 cm), not the coil's radius (4.0 cm):
 
<math>\Phi = B \pi r_{solenoid}^2</math>
 
By Faraday's law, the emf in the 5-turn coil is:
 
<math>|\varepsilon| = N_{coil} \pi r_{solenoid}^2 \frac{dB}{dt}</math>


[[File:hardexdigram.png]]
<math>|\varepsilon| = (5) \pi (0.015\ \text{m})^2 (0.30\ \text{T/s})</math>


a.) At the same instant (t = 0.3 seconds), what will the absolute value of the reading on the
<math>|\varepsilon| = 1.1 \times 10^{-3}\ \text{V}</math>
voltmeter be?
[[File:harda.jpg|700x900px]]


b.) The resistance of the coil is 2 ohms. At time t = 0.3 seconds, what is the conventional current
Using the outer coil's 4.0 cm radius would give 7.5 × 10<sup>-3</sup> V, which is wrong because there is almost no field in the space between the solenoid and the coil.
in the coil?
[[File:hardb.jpg|700x900px]]


c.) At time t = 0.3 seconds, what is the magnitude of the non-coulomb electric field E<sub>NC</sub> in
By Lenz's law, the induced current in the outer coil goes around in the opposite direction from the solenoid's current, so its field opposes the increase.
the coil?
[[File:hardc.jpg|700x900px]]


==Connectedness==
==Connectedness==
#Solenoids are important because they are the easiest way to create electromagnets and are an important piece in transformers.
#As a Computer Engineering major, solenoids are important, at least for the EE parts of my major, because as stated above they are used to create transformers which are a major piece in large and small scale power grids.


# I'm interested in EV motors and drivetrains, and the stator of an electric motor is basically a set of coils wrapped around an iron core. Each coil works like a short solenoid: running current through it creates a magnetic field, and the field gets stronger with more turns and more current (B is proportional to NI, like in the solenoid equation). In an EV motor, the stator coils are fed alternating currents that create a rotating magnetic field, and that rotating field pulls the rotor around.
# As a mechanical engineering major, I care about how these fields turn into force and motion. Motor designers have to trade off more turns or more current for a stronger field against more resistance, more heat, and more inductance, which limits how fast the current can change at high speeds. The iron core is made of thin laminated sheets instead of solid metal so that the changing magnetic field doesn't induce large eddy currents (Faraday's law), which would waste energy as heat.
# An interesting industrial application is the MRI machine. Its main magnet is a large superconducting solenoid, which makes a strong, uniform field inside the tube where the patient lies.


==See Also==
==History==
[[Ampere's Law]]


[[Magnetic Field of a Long Thick Wire Using Ampere's Law]]
In 1820, Danish physicist Hans Christian Oersted noticed during a lecture demonstration that a compass needle moved whenever he turned on the current in a nearby wire. This showed that electric currents create magnetic fields. In September 1820 the discovery was reported to the French Academy of Sciences in Paris, and the French physicist Andre-Marie Ampere started experimenting right away. By the end of that month he had shown that two parallel wires carrying current attract or repel each other, depending on the directions of the currents. He also wound wires into helices and spirals to see what magnetic effects they produced, and in 1823 he named the helical coil a solenoid.


[[Magnetic Field of Coaxial Cable Using Ampere's Law]]
==See Also==


[[Magnetic Field of a Toroid Using Ampere's Law]]
These pages use Ampere's law for other shapes, or build on the field of a solenoid:
* [[Ampere's Law]]
* [[Magnetic Field of a Long Thick Wire Using Ampere's Law]]
* [[Magnetic Field of Coaxial Cable Using Ampere's Law]]
* [[Magnetic Field of a Toroid Using Ampere's Law]]
* [[Magnetic Field of a Loop]]
* [[Faraday's Law]]
* [[Inductors]]


===Further Reading===
===Further Reading===
 
* OpenStax, ''University Physics Volume 2'', Section 12.6: Solenoids and Toroids. https://openstax.org/books/university-physics-volume-2/pages/12-6-solenoids-and-toroids
Chabay, Sherwood. (2015). Matter and Interactions (4th ed., Vol. 2). Raleigh, North Carolina: Wiley.
* Feynman, Leighton, and Sands, ''The Feynman Lectures on Physics'', Volume II. https://www.feynmanlectures.caltech.edu/
* Chabay and Sherwood, ''Matter and Interactions'' (4th ed., Vol. 2). Wiley, 2015.
* Williams, L. Pearce (1970). "Ampère, André-Marie". ''Dictionary of Scientific Biography'', Vol. 1. New York: Charles Scribner's Sons. pp. 139–147. ISBN 0-684-10114-9.


===External Links===
===External Links===
*http://www.one-school.net/Malaysia/UniversityandCollege/SPM/revisioncard/physics/electromagnetism/electromagnet.html
* http://www.physicstutorials.org/home/magnetism/magnetic-field-around-a-solenoid
 
* http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/solenoid.html
*http://www.physicstutorials.org/home/magnetism/magnetic-field-around-a-solenoid
* https://www.youtube.com/watch?v=MXuZ1SRjpqk
 
* https://www.youtube.com/watch?v=xdsXP_l3q_0
*http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/solenoid.html
* [https://ocw.mit.edu/courses/8-02t-electricity-and-magnetism-spring-2005/ MIT OpenCourseWare 8.02T Electricity and Magnetism] (Chapter 9 of the course notes covers solenoids)
* [https://phet.colorado.edu/en/simulations/faradays-electromagnetic-lab PhET: Faraday's Electromagnetic Lab] (the Electromagnet screen shows the field of a coil)


==References==
==References==
Chabay, Sherwood. (2015). Matter and Interactions (4th ed., Vol. 2). Raleigh, North Carolina: Wiley. Pg 887-888.
# MIT OpenCourseWare, 8.02T Electricity and Magnetism (Spring 2005), course notes Chapter 9, "Sources of Magnetic Fields," by John Belcher, Peter Dourmashkin, and Sen-Ben Liao. Figures 9.4.1 and 9.4.2 and Equation 9.4.1. License: CC BY-NC-SA. https://ocw.mit.edu/courses/8-02t-electricity-and-magnetism-spring-2005/
Physics 2212 Spring 2016 Lab Quiz 8
# OpenStax, ''University Physics Volume 2'', Section 12.6: Solenoids and Toroids. License: CC BY 4.0. https://openstax.org/books/university-physics-volume-2/pages/12-6-solenoids-and-toroids
# Chabay and Sherwood, ''Matter and Interactions'' (4th ed., Vol. 2). Wiley, 2015.
# "Solenoid." Wikipedia. https://en.wikipedia.org/wiki/Solenoid
# "Ampère's circuital law." Wikipedia. https://en.wikipedia.org/wiki/Amp%C3%A8re%27s_circuital_law
# "André-Marie Ampère." Wikipedia. https://en.wikipedia.org/wiki/Andr%C3%A9-Marie_Amp%C3%A8re#Work_in_electromagnetism
# "July 1820: Oersted & Electromagnetism." APS News. https://aps.org/apsnews/2008/07/1820-oersted-electromagnetism
# "André-Marie Ampère." Linda Hall Library. https://lindahall.org/andre-marie-ampere
# Web VPython (GlowScript). https://www.glowscript.org/


[[Category:Maxwell's Equations]]
[[Category:Maxwell's Equations]]

Latest revision as of 21:34, 29 November 2026

Improved by Katherine Preheim Fall 2026, Improved by Miranda Harmon Spring 2018

This page explains how to use Ampere's Law to solve for the magnetic field of a solenoid, and the derivation of the formula of the magnetic field of a solenoid.

The Main Idea

A solenoid is a cylindrical coil of wire that produces a nearly uniform magnetic field inside the coil when it carries an electric current. The overall field pattern is similar to the field of a bar magnet. A solenoid is a form of electromagnet that can create strong, controlled magnetic fields throughout the coil except near the ends. The magnetic field of a solenoid can be found using Ampere's law, which relates the magnetic field along a closed path to the current passing through that path. The field inside the solenoid is directly proportional to the current and to the number of turns per unit length (N/L).

Magnetic field lines of a loosely wound solenoid (left) and a tightly wound solenoid (right). Figure 9.4.1 from MIT OpenCourseWare 8.02T course notes by John Belcher, Peter Dourmashkin, and Sen-Ben Liao, CC BY-NC-SA (ocw.mit.edu/terms).

In the left picture, the field circles around each wire, but inside the coil the fields from all the turns add up, while outside they mostly cancel. When the coil is tightly wound (right), the field inside becomes nearly uniform and the outside looks like the field of a bar magnet, with a north and a south end. In the middle of the solenoid, the field is constant throughout the interior and parallel to the axis. Near the ends, the field lines spread out, and on the axis the field at each end is only about half of the field at the center. The greater the current and the more turns per unit length, the stronger the field inside. An ideal (infinitely long) solenoid would have a perfectly uniform field inside and zero field outside.

A Mathematical Model

Ampere's law says that if you add up B · dl around any closed path, the result equals μ0 times the current passing through the path:

[math]\displaystyle{ \oint \vec{B} \cdot d\vec{l} = \mu_0 I_{enclosed} }[/math]

For a long solenoid with N turns, length L, and current I, Ampere's law gives the field inside the solenoid:

[math]\displaystyle{ B = \frac{\mu_0 N I}{L} = \mu_0 n I }[/math]

where n = N/L is the number of turns per unit length. The field does not depend on the radius of the solenoid or on where you are inside it, as long as you are not near the ends.

The direction of the field comes from the right-hand rule. Curl the fingers of your right hand around the coil in the direction of the current, and your thumb points in the direction of the magnetic field inside the solenoid, along its axis. This also works backwards: if you know the direction of the field, point your thumb that way, and your fingers curl in the direction of the conventional current.

Derivation

Amperian loop for calculating the magnetic field of an ideal solenoid. Figure 9.4.2 from MIT OpenCourseWare 8.02T course notes by John Belcher, Peter Dourmashkin, and Sen-Ben Liao, CC BY-NC-SA (ocw.mit.edu/terms).

To use Ampere's law, choose a rectangular path (an Amperian loop) like the one in the figure, with segment 3 of length l inside the solenoid, parallel to the axis, and segment 1 outside the solenoid. Then look at each segment:

  1. Segment 3 (inside): B is parallel to the path and constant, so this segment contributes [math]\displaystyle{ Bl }[/math].
  2. Segments 2 and 4: inside the solenoid, B is perpendicular to these segments, so [math]\displaystyle{ \vec{B} \cdot d\vec{l} = 0 }[/math]. Outside, B is close to zero. These segments contribute nothing.
  3. Segment 1 (outside): the field outside a long solenoid is close to zero, so this segment contributes nothing.

The width w of the loop doesn't matter, as long as segment 3 is inside the solenoid and segment 1 is outside.

Adding up the four segments, going counterclockwise around the loop:

[math]\displaystyle{ \oint \vec{B} \cdot d\vec{l} = \int_1 \vec{B} \cdot d\vec{l} + \int_2 \vec{B} \cdot d\vec{l} + \int_3 \vec{B} \cdot d\vec{l} + \int_4 \vec{B} \cdot d\vec{l} = 0 + 0 + Bl + 0 = Bl }[/math]

So the left side of Ampere's law is just [math]\displaystyle{ Bl }[/math].

For the right side, count the current passing through the rectangle. The rectangle covers a length l of the solenoid, which contains [math]\displaystyle{ \frac{N}{L} l }[/math] turns, and each turn carries current I:

[math]\displaystyle{ I_{enclosed} = \frac{N}{L} l I }[/math]

Setting the two sides equal:

[math]\displaystyle{ Bl = \mu_0 \frac{N}{L} l I }[/math]

The l cancels on both sides, which gives [math]\displaystyle{ B = \frac{\mu_0 N I}{L} }[/math].

This is where the N in the formula comes from. The Amperian loop encloses many turns of wire, and each turn adds a current I to the total current through the loop.

Symbols:

  • B: magnetic field inside the solenoid (T)
  • μ0: permeability of free space, 4π × 10-7 T·m/A
  • N: number of turns
  • L: length of the solenoid (m)
  • n = N/L: number of turns per unit length (1/m)
  • I: current in the wire (A)
  • l: length of segment 3 of the Amperian loop, inside the solenoid (m)

A Computational Model

Screenshot of the GlowScript model. Blue: adding up the loops. Red: Ampere's law for an infinitely long solenoid.

Click here to run the GlowScript model

This model finds the magnetic field along the axis of a solenoid by adding up the fields of all its loops. On the axis of a single loop, the field is

[math]\displaystyle{ B = \frac{\mu_0 I R^2}{2(R^2 + z^2)^{3/2}} }[/math]

where z is the distance from the loop. The program adds this up for all N loops (superposition), draws arrows along the axis, and graphs B versus position. The blue curve is the model, and the red curve is the Ampere's law result for an infinitely long solenoid (μ0NI/L inside and zero outside).

For a solenoid with 40 turns, a length of 40 cm, a radius of 5 cm, and a current of 2 A, the model gives:

  • B at the center: 2.44 × 10-4 T, about 3% less than μ0NI/L = 2.51 × 10-4 T. The difference is because this solenoid isn't infinitely long.
  • B at the ends: 1.25 × 10-4 T, about half of the field at the center.
  • Outside the ends, the field drops off quickly.

To try other values, change I, N, L, or R at the top of the code and run it again. One limitation is that this model only finds the field on the axis, not off to the side.

Web VPython 3.2

# Magnetic field along the axis of a solenoid.
# A solenoid is N loops of wire. On the axis of ONE loop, the field is
#     B = mu0*I*R^2 / (2*(R^2 + z^2)^1.5)
# where z is the distance from the loop. Adding up (superposing) this field
# for all N loops gives the field of the whole solenoid.

mu0 = 4*pi*1e-7    # T*m/A
I = 2              # current (A)
N = 40             # number of turns
L = 0.4            # length of the solenoid (m)
R = 0.05           # radius of the loops (m)
d = L/N            # spacing between loops (m)

# Draw the loops of wire
for n in range(N):
    x = -L/2 + d/2 + n*d
    ring(pos=vector(x, 0, 0), axis=vector(1, 0, 0), radius=R, thickness=0.002, color=color.orange)

# Field on the axis at position x: add up the field of every loop
def B_axis(x):
    B = 0
    for n in range(N):
        z = x - (-L/2 + d/2 + n*d)    # distance from loop n to the point
        B = B + mu0*I*R**2/(2*(R**2 + z**2)**1.5)
    return B

# Arrows along the axis show the field (longer arrow = stronger field)
scale = 150        # arrow length (m) per tesla
x = -0.35
while x < 0.36:
    arrow(pos=vector(x, 0, 0), axis=vector(scale*B_axis(x), 0, 0), color=color.cyan)
    x = x + 0.05

# Graph of B along the axis.
# Blue: adding up the loops. Red: Ampere's law for an infinitely long solenoid.
graph(title="Magnetic field along the axis", xtitle="x (m)", ytitle="B (T)")
model = gcurve(color=color.blue)
ampere = gcurve(color=color.red)
x = -0.35
while x < 0.35:
    model.plot(x, B_axis(x))
    if abs(x) < L/2:
        ampere.plot(x, mu0*N*I/L)
    else:
        ampere.plot(x, 0)
    x = x + 0.005

print("B at the center, adding up the loops:", B_axis(0), "T")
print("B from Ampere's law, mu0*N*I/L:", mu0*N*I/L, "T")
print("B at the end of the coil:", B_axis(L/2), "T")

Examples

Simple

Find the magnetic field inside a 20 cm long solenoid with 200 turns carrying a current of 8 A.

Convert the length to meters: L = 20 cm = 0.20 m. Then use the solenoid formula:

[math]\displaystyle{ B = \frac{\mu_0 N I}{L} }[/math]

[math]\displaystyle{ B = \frac{(4\pi \times 10^{-7}\ \text{T m/A})(200)(8\ \text{A})}{0.20\ \text{m}} }[/math]

[math]\displaystyle{ B = 1.0 \times 10^{-2}\ \text{T} }[/math]

The field points along the axis of the solenoid, in the direction given by the right-hand rule.

Middling

A solenoid is 10 cm long, has 2000 turns, and has a radius of 1.5 cm.

(a) What current is needed to make a magnetic field of 6.0 × 10-4 T inside the solenoid?

Solve the solenoid formula for I:

[math]\displaystyle{ I = \frac{BL}{\mu_0 N} }[/math]

[math]\displaystyle{ I = \frac{(6.0 \times 10^{-4}\ \text{T})(0.10\ \text{m})}{(4\pi \times 10^{-7}\ \text{T m/A})(2000)} }[/math]

[math]\displaystyle{ I = 0.024\ \text{A} }[/math]

(b) What is the magnetic flux through one turn of the solenoid?

The field inside is uniform and perpendicular to the cross section, so the flux is B times the area:

[math]\displaystyle{ \Phi = BA = B \pi r^2 }[/math]

[math]\displaystyle{ \Phi = (6.0 \times 10^{-4}\ \text{T}) \pi (0.015\ \text{m})^2 }[/math]

[math]\displaystyle{ \Phi = 4.2 \times 10^{-7}\ \text{Wb} }[/math]

Difficult

A 5-turn coil with a radius of 4.0 cm is wrapped around the middle of the solenoid from the Middling example. The current in the solenoid increases steadily from 0 to 0.024 A in 2.0 ms. What emf is induced in the outer coil?

From the Middling example, the field inside the solenoid goes from 0 to 6.0 × 10-4 T, so:

[math]\displaystyle{ \frac{dB}{dt} = \frac{6.0 \times 10^{-4}\ \text{T}}{2.0 \times 10^{-3}\ \text{s}} = 0.30\ \text{T/s} }[/math]

The key step is finding the area. The field outside the solenoid is close to zero, so the only flux through the outer coil is the flux inside the solenoid. That means we use the solenoid's radius (1.5 cm), not the coil's radius (4.0 cm):

[math]\displaystyle{ \Phi = B \pi r_{solenoid}^2 }[/math]

By Faraday's law, the emf in the 5-turn coil is:

[math]\displaystyle{ |\varepsilon| = N_{coil} \pi r_{solenoid}^2 \frac{dB}{dt} }[/math]

[math]\displaystyle{ |\varepsilon| = (5) \pi (0.015\ \text{m})^2 (0.30\ \text{T/s}) }[/math]

[math]\displaystyle{ |\varepsilon| = 1.1 \times 10^{-3}\ \text{V} }[/math]

Using the outer coil's 4.0 cm radius would give 7.5 × 10-3 V, which is wrong because there is almost no field in the space between the solenoid and the coil.

By Lenz's law, the induced current in the outer coil goes around in the opposite direction from the solenoid's current, so its field opposes the increase.

Connectedness

  1. I'm interested in EV motors and drivetrains, and the stator of an electric motor is basically a set of coils wrapped around an iron core. Each coil works like a short solenoid: running current through it creates a magnetic field, and the field gets stronger with more turns and more current (B is proportional to NI, like in the solenoid equation). In an EV motor, the stator coils are fed alternating currents that create a rotating magnetic field, and that rotating field pulls the rotor around.
  2. As a mechanical engineering major, I care about how these fields turn into force and motion. Motor designers have to trade off more turns or more current for a stronger field against more resistance, more heat, and more inductance, which limits how fast the current can change at high speeds. The iron core is made of thin laminated sheets instead of solid metal so that the changing magnetic field doesn't induce large eddy currents (Faraday's law), which would waste energy as heat.
  3. An interesting industrial application is the MRI machine. Its main magnet is a large superconducting solenoid, which makes a strong, uniform field inside the tube where the patient lies.

History

In 1820, Danish physicist Hans Christian Oersted noticed during a lecture demonstration that a compass needle moved whenever he turned on the current in a nearby wire. This showed that electric currents create magnetic fields. In September 1820 the discovery was reported to the French Academy of Sciences in Paris, and the French physicist Andre-Marie Ampere started experimenting right away. By the end of that month he had shown that two parallel wires carrying current attract or repel each other, depending on the directions of the currents. He also wound wires into helices and spirals to see what magnetic effects they produced, and in 1823 he named the helical coil a solenoid.

See Also

These pages use Ampere's law for other shapes, or build on the field of a solenoid:

Further Reading

External Links

References

  1. MIT OpenCourseWare, 8.02T Electricity and Magnetism (Spring 2005), course notes Chapter 9, "Sources of Magnetic Fields," by John Belcher, Peter Dourmashkin, and Sen-Ben Liao. Figures 9.4.1 and 9.4.2 and Equation 9.4.1. License: CC BY-NC-SA. https://ocw.mit.edu/courses/8-02t-electricity-and-magnetism-spring-2005/
  2. OpenStax, University Physics Volume 2, Section 12.6: Solenoids and Toroids. License: CC BY 4.0. https://openstax.org/books/university-physics-volume-2/pages/12-6-solenoids-and-toroids
  3. Chabay and Sherwood, Matter and Interactions (4th ed., Vol. 2). Wiley, 2015.
  4. "Solenoid." Wikipedia. https://en.wikipedia.org/wiki/Solenoid
  5. "Ampère's circuital law." Wikipedia. https://en.wikipedia.org/wiki/Amp%C3%A8re%27s_circuital_law
  6. "André-Marie Ampère." Wikipedia. https://en.wikipedia.org/wiki/Andr%C3%A9-Marie_Amp%C3%A8re#Work_in_electromagnetism
  7. "July 1820: Oersted & Electromagnetism." APS News. https://aps.org/apsnews/2008/07/1820-oersted-electromagnetism
  8. "André-Marie Ampère." Linda Hall Library. https://lindahall.org/andre-marie-ampere
  9. Web VPython (GlowScript). https://www.glowscript.org/