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

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


Improved by Quinnell Smith Fall 2017
'''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 7: Line 6:
==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.The magnetic field of solenoid can be solved by using Ampere's Law equation which relates the magnetic field surrounding the solenoid and the electric current.
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).]]


[[File:solenoidAmpere.jpg||600px|]]
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.


Looking at the 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.
===A Mathematical Model===


===Equation===
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:


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:
<math>\oint \vec{B} \cdot d\vec{l} = \mu_0 I_{enclosed}</math>


<math>{\oint\,\vec{B}•d\vec{l} = μ_{0}∑I_{inside path}}</math>
For a long solenoid with N turns, length L, and current I, Ampere's law gives the field inside the solenoid:


We can then solve for <math>B</math>:
<math>B = \frac{\mu_0 N I}{L} = \mu_0 n I</math>


<math>{B = \frac{μ_{0}NI}{L}}</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 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. The direction in which your thumb ends up pointing in after curling your fingers around the current, determines the direction of the magnetic. Keep in mind that the direction of the magnetic field will lie on the same axis as the length of the solenoid.
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:righthandsolenoid.jpg||600px|]]
[[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:


===Derivation of Equation===
# 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.


Looking at the equation of a solenoid, it could be difficult to understand how this equation was derived. Listed below are the steps taken to derive the equation and an image depicting what each symbol represents.
The width w of the loop doesn't matter, as long as segment 3 is inside the solenoid and segment 1 is outside.


Steps to Derive Equation:
Adding up the four segments, going counterclockwise around the loop:


1. Apply Ampere's law could by finding the formula for relating the path of the current and magnetic field: Bl
<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>


2. Find that Ampere's law is proportional to the path and solenoid's length proportionality times the number of turns in the solenoid and the electric current: <math>{Bl = \frac{μ_{0}NIl}{L}}</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:


3.Cancel out the length of the path on each side of the equal sign to get the equation we use: <math>{B = \frac{μ_{0}NI}{L}}</math>
<math>I_{enclosed} = \frac{N}{L} l I</math>


Setting the two sides equal:


[[File:Step0.jpg|300px|]]
<math>Bl = \mu_0 \frac{N}{L} l I</math>


Drawing of the solenoid
The l cancels on both sides, which gives <math>B = \frac{\mu_0 N I}{L}</math>.


[[File:step12.jpg||600px|]]
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.


Ampere's law is proportional to the path and solenoid's length proportionality times the number of turns in the solenoid and the electric current
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.]]


[[File:step22.jpg|600px|]]
[https://www.glowscript.org/#/user/katherinepreheim/folder/MyPrograms/program/SolenoidField Click here to run the GlowScript model]


Cancel out the length of the path on each side of the equal sign to get the equation we use
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>


Symbols:
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


l:the length of the rectangular path decided to take to the length apply Ampere's Law
# 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:the length of the 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)


B: the magnetic field of the solenoid
# 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)


N: the number of turns in the solenoid
# 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


μ_0: a constant
# 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


I: conventional current flowing through the solenoid
# 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==


===Solving for the Magnetic Field===
===Simple===
Find the magnetic field produced by a 20 cm long solenoid if the number of loops is 200 and current passing through it is 8 A.
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>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>


For this example all of the variables are given so it is just a simple math calculation using Ampere's Law, as given above, but for reiteration.
<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>{\oint\,\vec{B}•d\vec{l} = μ_{0}∑I_{inside path}}</math>
<math>I = 0.024\ \text{A}</math>


<math>{B = \frac{200*8}{.2}}</math>
(b) What is the magnetic flux through one turn of the solenoid?
<math>{B = 8,000} </math>


Once you have solved for <math>B</math> all you have to do is find the direction of the magnetic field using the Right Hand Rule.
The field inside is uniform and perpendicular to the cross section, so the flux is B times the area:


*Must convert 20 cm to .2 m
<math>\Phi = BA = B \pi r^2</math>


===Solving for the Current===
<math>\Phi = (6.0 \times 10^{-4}\ \text{T}) \pi (0.015\ \text{m})^2</math>
A solenoid has a magnetic field of 6x10<sup>-4</sup> T, 2000 turns, and is 10 cm long. What is the current through the solenoid?
For this example you are solving for I. Very similar to the above question, just rearranging the calculation of Ampere's Law.


<math>{I = \frac{LB}{μ_{0}N}}</math>
<math>\Phi = 4.2 \times 10^{-7}\ \text{Wb}</math>


<math>{I = \frac{.1*6E-4}{2000}}</math>
===Difficult===
<math>{I = 3E-8 A} </math>
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?


*Must change 10 cm to .1 for the cm to m conversion
From the Middling example, the field inside the solenoid goes from 0 to 6.0 × 10<sup>-4</sup> T, so:


==Connectedness==
<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>
#Solenoids are important because they can create controlled magnetic fields making them useful for a variety of applications.
#As a mechanical engineering major solenoids are relevant to my major because mechanical engineers use solenoid components, and solenoid valves on a daily basis. An example of solenoids is a transformer which consists of a solenoid with different induced electric currents and number of turns which can perform step down or step up functionalities.


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):


==History==
<math>\Phi = B \pi r_{solenoid}^2</math>


The history of Ampere's Law and its application for solenoids dates back to the 1800s when a French scientist and mathematician Andre-Mare Ampere developed a theory called Ampere's Law in which could be defined as electromagnetism. Ampere was also the founder of creating the solenoid, and therefore used Ampere's Law to define the relationship between the solenoid's magnetic field to the current in the solenoid.
By Faraday's law, the emf in the 5-turn coil is:


==See Also==
<math>|\varepsilon| = N_{coil} \pi r_{solenoid}^2 \frac{dB}{dt}</math>
[[Ampere's Law]]


[[Magnetic Field of a Long Thick Wire Using Ampere's Law]]
<math>|\varepsilon| = (5) \pi (0.015\ \text{m})^2 (0.30\ \text{T/s})</math>


[[Magnetic Field of Coaxial Cable Using Ampere's Law]]
<math>|\varepsilon| = 1.1 \times 10^{-3}\ \text{V}</math>


[[Magnetic Field of a Toroid Using Ampere's Law]]
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.


===Further Reading===
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.


Chabay, Sherwood. (2015). Matter and Interactions (4th ed., Vol. 2). Raleigh, North Carolina: Wiley.
==Connectedness==


Williams, L. Pearce (1970). "Ampère, André-Marie". Dictionary of Scientific Biography. 1. New York: Charles Scribner's Sons. pp. 139–147. ISBN 0-684-10114-9
# 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.


===External Links===
==History==


*http://www.physicstutorials.org/home/magnetism/magnetic-field-around-a-solenoid
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.


*http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/solenoid.html
==See Also==


*https://www.youtube.com/watch?v=MXuZ1SRjpqk
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.youtube.com/watch?v=xdsXP_l3q_0
===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==
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/
 
# 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.” Wikipedia, Wikimedia Foundation, 13 Nov. 2017, en.wikipedia.org/wiki/Andr%C3%A9-Marie_Amp%C3%A8re#Work_in_electromagnetism
# 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/