Magnetic Field of a Solenoid Using Ampere's Law: Difference between revisions
mNo edit summary |
Rewrote derivation with MIT figures, added GlowScript model, new examples, connectedness and updated history and references. |
||
| Line 1: | Line 1: | ||
''' | '''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. | 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. | ||
| Line 6: | Line 6: | ||
==The Main Idea== | ==The Main Idea== | ||
A solenoid is a cylindrical coil of wire that produces a uniform magnetic field when it | 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: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).]] | |||
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>\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==== | |||
[[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).]] | |||
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: | |||
# 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. | |||
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>\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: | [[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. | |||
L | 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 | 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>B = \frac{\mu_0 N I}{L}</math> | |||
<math>B = \frac{(4\pi \times 10^{-7}\ \text{T m/A})(200)(8\ \text{A})}{0.20\ \text{m}}</math> | |||
<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. | |||
===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<sup>-4</sup> T inside the solenoid? | |||
Solve the solenoid formula for I: | |||
<math>I = \frac{BL}{\mu_0 N}</math> | |||
<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> | <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> | |||
===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<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> | ||
<math>|\varepsilon| = (5) \pi (0.015\ \text{m})^2 (0.30\ \text{T/s})</math> | |||
<math>|\varepsilon| = 1.1 \times 10^{-3}\ \text{V}</math> | |||
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. | |||
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== | |||
# 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. | |||
== | ==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: | ||
* [[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]] | |||
*https://www. | ===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 | |||
* 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=== | |||
* http://www.physicstutorials.org/home/magnetism/magnetic-field-around-a-solenoid | |||
* http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/solenoid.html | |||
* https://www.youtube.com/watch?v=MXuZ1SRjpqk | |||
* https://www.youtube.com/watch?v=xdsXP_l3q_0 | |||
* [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== | ||
# 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/ | |||
# 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 | |||
André-Marie Ampère. | # 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).

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

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:
- Segment 3 (inside): B is parallel to the path and constant, so this segment contributes [math]\displaystyle{ Bl }[/math].
- 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.
- 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

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
- 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.
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:
- 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
- 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
- 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
- http://www.physicstutorials.org/home/magnetism/magnetic-field-around-a-solenoid
- http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/solenoid.html
- https://www.youtube.com/watch?v=MXuZ1SRjpqk
- https://www.youtube.com/watch?v=xdsXP_l3q_0
- MIT OpenCourseWare 8.02T Electricity and Magnetism (Chapter 9 of the course notes covers solenoids)
- PhET: Faraday's Electromagnetic Lab (the Electromagnet screen shows the field of a coil)
References
- 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/
- 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/