The physics
An electric current creates a magnetic field that circles around it. For a long straight wire, the Biot–Savart law (or Ampère's law) gives a field whose strength falls off as 1/r:
Its direction follows the right-hand rule. Point your thumb along the current and your fingers curl the way the field circulates. In the simulation, the wires run perpendicular to the screen: ⊙ is current coming out towards you (counter-clockwise field), and ⊗ is current going in (clockwise). Fields of several wires add as vectors.
| Symbol | Meaning | SI unit |
|---|---|---|
| I | Current | A |
| r | Distance from the wire | m |
| B | Magnetic flux density | T (shown in μT) |
| μ₀ | Vacuum permeability, 1.2566 × 10⁻⁶ | N/A² |
| A_z | Magnetic vector potential | T·m |
Field lines and coils
Magnetic field lines never start or end: they form closed loops. For currents perpendicular to the plane, the field can be written as B = ∇ × (Az ẑ), with
Field lines are the contours of Az, so they are drawn exactly that way, at equal steps of Az. The spacing between lines is then inversely proportional to the field strength. A coil seen edge-on looks like a pair of opposite currents. The field is strong and nearly uniform between them, which is the principle behind electromagnets and solenoids.
Method and validation
The field is computed exactly by superposition of equation (1). Automated tests check the single-wire formula and the right-hand rule, and check that B = ∇ × (Az ẑ). They also verify Ampère's law: the circulation of B around a closed loop equals μ0 times the enclosed current, to better than one part in a billion, even with a strong wire outside the loop.
Assumptions and limitations
- Infinitely long, thin, straight wires perpendicular to the plane, in vacuum.
- Steady (DC) currents. Induction and electromagnetic waves are not modelled.
- Real coils are three-dimensional, so this cross-section is a 2D approximation.