Sub topic 15
Fields of a Long Straight Wire, a Circular Loop and a Solenoid
This chapter gives the magnetic field of three standard current configurations. It assumes you know the Biot-Savart law and Ampère's law from the previous two chapters, the right-hand rule, and basic vector and trigonometry skills. It also assumes you are comfortable with SI units, where B is in tesla (T).
All three results use the permeability of free space, μ0 = 4π × 10⁻⁷ T·m/A. This is accurate to about one part in 10⁹, and the 2019 SI redefinition made it a measured value instead of an exact one.
The three results at a glance
| Source | Where | Magnitude | Direction |
|---|---|---|---|
| Long straight wire | Distance r from the wire | B = μ0 I / (2π r) | Circles the wire (right-hand grip) |
| Circular loop, N turns | Center | B = μ0 N I / (2R) | Along the axis (right-hand thumb) |
| Circular loop, N turns | On axis, distance z | B = μ0 N I R² / (2 (R² + z²)^(3/2)) | Along the axis |
| Long solenoid | Well inside | B = μ0 n I | Along the axis |
| Long solenoid | Outside | B ≈ 0 | None |
Here n is the number of turns per meter of length, not the total number of turns.
The long straight wire
Symmetry decides the shape of the field. The wire is infinitely long and has no preferred point along its length. So B can depend only on the distance r from the wire, and it must point in the circular direction around it.
Ampère's law then does the work. Choose a circle of radius r centered on the wire and perpendicular to it. B is tangent to the circle and has constant magnitude on it, so the line integral is simple:
∮ B · dl = B (2π r) = μ0 I_enclosed
B = μ0 I / (2π r)The field falls off as 1/r. Doubling the distance halves the field.
Direction: point your right thumb along the current. Your fingers curl in the direction of B.
Inside a thick wire
Outside a wire of radius a, the formula above holds for r > a. Inside, only the current within radius r is enclosed. If the current density is uniform, I_enclosed = I r² / a², so:
B = μ0 I r / (2π a²) for r < aThe field rises linearly from zero at the axis, peaks at the surface, then falls as 1/r.
What "long" means
The 1/r formula is accurate when the distance to the wire is much smaller than the distance to its ends. A 1 m wire measured 1 cm from its middle is fine. The same wire measured 1 m from its middle is not.
The circular loop
A loop has no symmetry that Ampère's law can use. Use the Biot-Savart law instead, on the axis of the loop where the symmetry is good enough to integrate by hand.
Let the loop have radius R and carry current I. Take a point on the axis at distance z from the loop's plane.
- Each current element I dl is perpendicular to the vector from the element to the point. So dB = μ0 I dl / (4π (R² + z²)).
- Each dB is tilted away from the axis. Its components perpendicular to the axis cancel in opposite pairs around the loop.
- The axial component is dB multiplied by R / √(R² + z²).
- Summing dl around the loop gives 2πR.
The result is:
B(z) = μ0 I R² / (2 (R² + z²)^(3/2))With N tightly wound turns, multiply by N.
Two limits worth remembering
- At the center (z = 0), B = μ0 I / (2R).
- Far away (z ≫ R), B ≈ μ0 I R² / (2 z³). Because the loop's magnetic moment is μ = I π R², this is B ≈ μ0 μ / (2π z³). This is the dipole field on the axis, and it falls as 1/z³, much faster than a wire's 1/r.
Direction: curl your right fingers in the direction of the current. Your thumb points along B on the axis.
Off the axis, the field of a single loop has no simple closed form. It involves elliptic integrals, and in practice it is computed numerically.
The solenoid
A solenoid is a helical coil of wire. Think of it as a stack of closely spaced loops. Inside, the axial fields of the individual loops add up. Outside, the fields of neighboring turns largely cancel.
For an ideal solenoid, which is infinitely long and tightly wound, the field is uniform inside and zero outside. To find the value, use Ampère's law with a rectangular loop of length L. One long side lies inside, parallel to the axis. The other lies outside, where B = 0. The short sides are perpendicular to B, or lie outside, so they contribute nothing.
B L = μ0 (n L) I
B = μ0 n IThe result does not depend on the solenoid's radius or on where you are inside it. The field direction follows the same right-hand rule as the loop.
Real solenoids
- Near the open ends of a long solenoid, the axial field drops to about half the central value: B ≈ μ0 n I / 2.
- For a finite solenoid of length L and radius R, the on-axis field at its midpoint is B = μ0 n I L / √(L² + 4R²). This tends to μ0 n I as L ≫ R.
- The field outside is small but not zero. It is weak because it is a leakage field, not the strong interior field.
- A toroid (a solenoid bent into a ring) has B = μ0 N I / (2π r) inside, and nearly zero outside.
A ferromagnetic core multiplies the field by the material's relative permeability, which can reach hundreds or thousands. That is outside the scope of this chapter.
Choosing a method
Computing the fields in Python
The following script evaluates all three formulas. It uses the same constant everywhere, so you can compare the results.
import numpy as np
MU0 = 4e-7 * np.pi # T*m/A
def wire_field(current, r):
"""Field magnitude at distance r from a long straight wire."""
return MU0 * current / (2 * np.pi * r)
def loop_axis_field(current, radius, z, turns=1):
"""Field magnitude on the axis of a circular loop at distance z."""
return MU0 * turns * current * radius**2 / (2 * (radius**2 + z**2) ** 1.5)
def solenoid_field(current, turns_per_meter):
"""Field magnitude inside a long ideal solenoid."""
return MU0 * turns_per_meter * current
print("Wire, 10 A at 5 cm: ", wire_field(10, 0.05), "T")
print("Loop center, 2 A, R=5 cm:", loop_axis_field(2, 0.05, 0.0), "T")
print("Loop at z=10 cm: ", loop_axis_field(2, 0.05, 0.10), "T")
print("Solenoid, 1000/m, 2 A: ", solenoid_field(2, 1000), "T")The outputs are about 4.0 × 10⁻⁵ T, 2.5 × 10⁻⁵ T, 1.1 × 10⁻⁶ T and 2.5 × 10⁻³ T. For comparison, Earth's field is about 5 × 10⁻⁵ T. A wire carrying 10 A produces roughly that much at 5 cm.
Common errors
- Using total turns in place of turns per meter. Compute n = N / L before applying B = μ0 n I.
- Applying the long-wire formula inside a thick wire. Inside the conductor the field rises with r, not falls.
- Using the solenoid formula at the ends or outside. The interior value holds only well inside the coil, and the end field is about half.
- Forgetting the direction. A magnitude without a direction is half an answer. Use the right-hand rule and state it.
- Mixing units. Convert centimeters to meters before substituting into formulas that use μ0.
Exercises
Exercise
A long straight wire carries 25 A. At what distance from the wire is the magnitude of B equal to 1.0 × 10⁻⁴ T?
Show answer
Solve B = μ0 I / (2π r) for r. r = μ0 I / (2π B) = (2 × 10⁻⁷ T·m/A)(25 A) / (1.0 × 10⁻⁴ T) = 0.050 m, or 5.0 cm.
Exercise
A solenoid is 40 cm long and has 800 turns. It carries 1.5 A. Find the field well inside, and explain what changes at the end of the solenoid.
Show answer
n = 800 / 0.40 m = 2000 turns/m. B = μ0 n I = (4π × 10⁻⁷)(2000)(1.5) ≈ 3.8 × 10⁻³ T, directed along the axis by the right-hand rule. At an end on the axis, the field falls to about half, roughly 1.9 × 10⁻³ T. This is a long-solenoid estimate, and with L = 40 cm the exact value depends on the radius.
Exercise
A single circular loop of radius 4.0 cm carries 3.0 A. Compare the field at its center with the field on the axis 4.0 cm from the center.
Show answer
At the center, B = μ0 I / (2R) = (4π × 10⁻⁷)(3.0) / (0.080) ≈ 4.7 × 10⁻⁵ T. At z = R = 4.0 cm, B = μ0 I R² / (2 (2R²)^(3/2)) = B_center / 2^(3/2) ≈ 4.7 × 10⁻⁵ / 2.83 ≈ 1.7 × 10⁻⁵ T. The field at z = R is about 35% of the central value.