Electricity & magnetism

Magnetic Field Explorer

Up to six long straight wires seen end-on, or up to four coaxial circular coils seen from the side: the lab adds their magnetic fields (the closed form for a wire; for a coil the exact loop field from complete elliptic integrals by eight arithmetic-geometric-mean steps, or the point-dipole approximation) and returns a 15 x 15 map of field strength and direction, six field lines traced in 0.5 cm steps, the field and direction at a compass with an optional uniform Earth field and its needle deflection, a log-log distance scan with 1/d and 1/d^3 guide lines and the distance beyond which the dipole agrees with the exact loop within 1%, an axis profile with the zero of the field, the centre field, the dipole moment and the uniformity of a coil pair. A compass on a wire or at a zero of the field reads CHECK. Five challenges are scored by the lab. For learning how magnetic fields of wires and coils add and fall off with distance.

Last updated

Calculator overview

Inputs and outputs

This summary comes from the calculator's published input and output contract.

Inputs

View (required)
About this input

Which sources you work with: Wires (long straight wires seen end-on, from above) or Coils (circular loops on one axis, seen from the side). Chosen with the tabs on the stage.

Default Wires Allowed Wires, Coils
Earth's field (required)
About this input

On adds a uniform Earth field pointing to the top of the stage (north) at the compass only; the map and the field lines show the wires or coils alone.

Default Off Allowed Off, On
Earth's field strength (required)
About this input

The strength of the Earth field at the compass, from 0 to 100 microtesla (about 20 is typical for the horizontal part at mid-latitudes). Used only while Earth's field is On.

Unit µT Default 20 Range 0 to 100
Wires (row k is wire k; leave a row blank when it is not used) (required)
About this input

Up to 6 long straight wires. Row k is wire k: its x and y position in cm from -8 to 8, and its current in amperes from -10 to 10, not 0 (positive flows toward you, negative away). Leave a row blank for a wire you do not use; wires must be at least 0.5 cm apart. Used in the Wires view only.

Default 2 rows
ColumnRange or allowed values
x (cm) -8 to 8
y (cm) -8 to 8
Current (A) -10 to 10
Your prediction: the wire's field at 8 cm
When omitted Blank
About this input

Challenge 1 only: your prediction, at 8 cm, of the field of a long wire that has the same field as the coil at 2 cm, in microtesla. Place the marker on the scan chart; blank until you predict.

Unit µT Default Not set Range 0.001 to 100000
Scan line (required)
About this input

The line the distance scan follows from coil 1's centre: Axis (along the axis) or Plane (outward in the coil's own plane). Coils view only.

Default Axis Allowed Axis, Plane
Coil model (required)
About this input

How each coil's field is worked out: Exact loop (the full field of a circular current) or Point dipole (the far-away approximation). Coils view only.

Default Exact loop Allowed Exact loop, Point dipole
Your prediction: the coil's field at 8 cm
When omitted Blank
About this input

Challenge 1 only: your prediction of the coil's field 8 cm along its axis, in microtesla. Place the marker on the scan chart; blank until you predict.

Unit µT Default Not set Range 0.001 to 100000
Challenge (required)
About this input

0 for free play; 1 to 5 load one of the five challenges: predict how fields fall off with distance, cancel two wires' fields, make an even field with two coils, balance a coil against Earth's field, or move the zero between two coils.

Default 0 Range 0 to 5
Compass position up (required)
About this input

Where the compass sits up the plot, from -8 to 8 cm (the distance from the axis in the Coils view). Drag the compass.

Unit cm Default 3 Range -8 to 8
Compass position across (required)
About this input

Where the compass sits across the plot, from -8 to 8 cm (along the axis in the Coils view). Drag the compass.

Unit cm Default 0 Range -8 to 8
Coils on one axis (row k is coil k; leave a row blank when it is not used) (required)
About this input

Up to 4 circular coils on one shared axis. Row k is coil k: its position along the axis in cm from -8 to 8, its radius in cm from 0.5 to 6, its number of turns (a whole number from 1 to 200) and its current in amperes from -10 to 10, not 0 (positive gives a field along +z at its centre). Leave a row blank for a coil you do not use; two coils cannot have both the same position and the same radius. Used in the Coils view only.

Default 1 row
ColumnRange or allowed values
Position z (cm) -8 to 8
Radius (cm) 0.5 to 6
Turns 1 to 200
Current (A) -10 to 10

Outputs

Dipole moment of coil 1
About this output

The magnetic dipole moment of coil 1 (turns x current x loop area), in milliampere square metres. Coils view only.

Unit mA·m²
Compass position up used
About this output

The compass position up the stage, in cm, used for the compass results.

Unit cm
Earth's field used
About this output

Whether Earth's field was added at the compass.

No unit declared
The distance scan: field strength along the scan line (µT)
About this output

The field along the scan line at 31 distances from 0.5 to 90.5 cm (each 2 to the power 1/4 times the last): the field with the chosen model, the exact field, the point-dipole field, the local log-log slope, and two guide lines through the 2 cm value that fall like 1/d and 1/d^3.

No unit declared
Compass position across used
About this output

The compass position across the stage, in cm, used for the compass results (a challenge may place the compass itself).

Unit cm
Field at the compass, up
About this output

The up-the-stage part of the field at the compass from the wires or coils alone, in microtesla.

Unit µT
Field at the compass, across
About this output

The across-the-stage part of the field at the compass from the wires or coils alone, in microtesla (along the axis in the Coils view).

Unit µT
Field strength at the compass
About this output

The strength of the field at the compass from the wires or coils alone, in microtesla.

Unit µT
Field direction at the compass
About this output

The direction of that field at the compass, in degrees from the across-the-stage direction, counter-clockwise positive, from -180 to 180; blank where the field is zero.

Unit degrees
Scan line used
About this output

The scan line the distance scan followed; blank in the Wires view.

No unit declared
Compass needle angle from north
About this output

How far the compass needle turns from north (the top of the stage), in degrees, positive toward the right, with Earth's field added when it is on; blank where the total field is zero.

Unit degrees
Field variation over the middle 2 cm
About this output

How much the field on the axis varies over 2 cm around the middle of coils 1 and 2 (or around coil 1's centre if it is alone), as a percentage of the middle value. Coils view only.

Unit %
Sources in use
About this output

How many wires (Wires view) or coils (Coils view) are in use.

No unit declared
Formula module versions
About this output

The versions of the formula modules inside the model: the exact loop field, the field-line tracer and the wire field.

No unit declared
View used
About this output

The view the results were computed for.

No unit declared
Earth's field strength used
About this output

The Earth field used at the compass, in microtesla; blank while Earth's field is off.

Unit µT
Model version
About this output

The version of the model that produced these results.

No unit declared
Model Status
About this output

OK when the results are computed; CHECK when the compass sits within 0.25 cm of a wire (or of a point dipole's centre) or where the field is exactly zero; NOT VALID with the input to fix when the inputs cannot be used.

No unit declared
Field lines: across position of each point (cm)
About this output

The across-the-stage position, in cm, of every point of every field line: one row per line (6 lines), points 0 to 20 across; later points blank once the line ends.

No unit declared
Field lines: source, points and how each ends
About this output

For each field line: the wire or coil it starts beside, how many points it kept and how it ended (REACHED_WIRE, LEFT_PLOT, ZERO_FIELD, CLOSED, MAX_STEPS, NOT_RUN or NULL_POINT).

No unit declared
Magnetic field strength on the 15 x 15 grid (µT; blank inside 0.25 cm of a source)
About this output

The field strength at each of the 15 x 15 map points from -7 to 7 cm (1 cm apart), in microtesla; the first column is the row's y. Blank within 0.25 cm of a wire or a coil's crossing.

No unit declared
Field lines: up position of each point (cm)
About this output

The up-the-stage position, in cm, of every point of every field line, laid out as the across table.

No unit declared
Magnetic field direction on the grid (degrees from +x)
About this output

The field direction at each map point, in degrees from the across-the-stage direction; blank within 0.25 cm of a wire or a coil's crossing and where the field is zero.

No unit declared
Distance where the dipole agrees within 1%
About this output

How far along the scan line, from coil 1's centre, the point-dipole field comes within 1% of the exact loop field and stays there, in cm; blank if that happens beyond 90.5 cm. Coils view only.

Unit cm
Elliptic-integral convergence check
About this output

A check on the accuracy of the exact loop field: the gap left after eight averaging steps at the hardest point of this set-up. It reads 0 when the elliptic integrals are exact to the last digit. Coils view with the exact model only.

No unit declared
The field along the axis (µT)
About this output

The field along the axis at 41 points from -8 to 8 cm (0.4 cm apart), in microtesla, positive along +z. Coils view only.

No unit declared
Position of the zero on the axis
About this output

Where the field along the axis first passes through zero, from left to right, in cm; blank if it never does on the plotted axis. Coils view only.

Unit cm
Coil model used
About this output

The coil model the results were computed with; blank in the Wires view.

No unit declared
Challenge result
About this output

No challenge selected, MET or NOT MET.

No unit declared
Colour scale, lowest
About this output

The weakest non-zero field on the map, in microtesla; the map's colour scale starts here.

Unit µT
Colour scale, highest
About this output

The strongest field on the map, in microtesla; the map's colour scale ends here.

Unit µT
Challenge score
About this output

100 when the selected challenge is met, otherwise 0.

No unit declared
Challenge feedback
About this output

Why the selected challenge is met, or what to change; blank with no challenge.

No unit declared
Field at the centre of coil 1
About this output

The field at the centre of coil 1 along the axis, from every coil, in microtesla. Coils view only.

Unit µT
Challenge: the value scored
About this output

The value the selected challenge scores: the field at the centre in microtesla (challenge 2), the uniformity in percent (3), the needle deflection in degrees (4) or the zero's position in cm (5); blank in challenge 1.

No unit declared
Challenge goal
About this output

What the selected challenge asks for; blank with no challenge.

No unit declared
This page is provided by LogicCommons for informational purposes only. Results are analysis outputs computed from the inputs you supply and are not professional advice. Verify all inputs and results independently.

LogicCommons is in beta. If a result, label, or reference looks wrong, tell us here; we read every message.

Methodology

Purpose and model boundary

This lab adds the steady magnetic fields of up to six long straight wires seen end-on (the Wires view) or up to four coaxial circular coils seen from the side, as a cross-section through their axis (the Coils view). A wire's field comes from its closed form; a coil's is either the exact field of a circular loop, from complete elliptic integrals computed by eight steps of Gauss's arithmetic-geometric mean, or the point-dipole approximation. The model returns a 15 × 15 map of field strength and direction, six field lines traced in 0.5 cm steps, the field at a compass with an optional uniform Earth field and the needle's deflection, a log-log distance scan with 1/d and 1/d³ guide lines and the distance beyond which the dipole agrees with the exact loop within 1%, an axis profile with the zero of the field, the centre field, the dipole moment and the uniformity of a coil pair. Five scored challenges go with it.

It is a lab for learning how magnetic fields of wires and coils add and fall off with distance: why a wire's field falls like 1/d and a coil's, far away, like 1/d³, where the point-dipole picture of a coil can be trusted, how two fields can cancel at a point, how the spacing of two coils sets how even the field between them is, and how a coil can turn a compass against Earth's field. It is not a tool for designing real magnets, coils or shielding: it gives no field value close to a wire or a loop, and it models no magnetic material, induction or changing current.

The model is the calculation authority. The page sends the values you set to the model and draws only what it returns: the map's colours and arrows, the field lines and how each ended, the compass needle, the scan and slope curves, the guide lines, the agreement mark and the axial zero all come from the model's own tables. The page computes no field, direction, line point, slope or distance itself.

Inputs and units

Positions and radii are in centimetres (cm), currents in amperes (A), fields in microtesla (µT), directions in degrees and the dipole moment in milliampere square metres (mA·m²). Inside the model lengths are converted to metres.

Input Meaning and unit
View Wires (default) or Coils (loops on one axis seen from the side, the axis across the stage).
Wires (6 rows) Row k is wire k: x and y, each from -8 to 8 cm, and a current from -10 to 10 A, not 0, positive toward you. A blank row is a wire not in use. Default: +2 A at (-2, 0) and -1 A at (2, 0). Wires view only.
Coils (4 rows) Row k is coil k: position z along the axis, from -8 to 8 cm; radius, from 0.5 to 6 cm; turns, a whole number from 1 to 200; current, from -10 to 10 A, not 0, positive giving a field along +z at its centre. A blank row is a coil not in use. Default: one coil at z = 0, radius 2 cm, 10 turns, 1 A. Coils view only.
Coil model Exact loop (default) or Point dipole (the far-away approximation), for every coil. Coils view only.
Compass position across and up Each from -8 to 8 cm (default 0 and 3 cm). In the Coils view, across is along the axis and up is the distance from it.
Scan line Axis (default): along the axis from coil 1's centre. Plane: outward in coil 1's own plane. Coils view only.
Earth's field Off (default) or On: a uniform field toward the top of the stage (north), added at the compass only.
Earth's field strength From 0 to 100 µT (default 20, a typical horizontal value at mid-latitudes). Used only while Earth's field is On.
Challenge number 0 for free exploration, or 1 to 5 to load a challenge.
Your prediction: the coil's field at 8 cm Blank, or 0.001 to 100,000 µT: your answer for challenge 1. Blank means not yet predicted.
Your prediction: the wire's field at 8 cm Blank, or 0.001 to 100,000 µT: your second answer for challenge 1.

A row in use needs every one of its values. An input is checked and used only when it applies: the wires in the Wires view; the coils, the coil model and the scan line in the Coils view; the Earth field strength while Earth's field is On; the predictions in challenge 1. In its place the model uses the input's default.

Where each input is set:

  • On the canvas only: every input except the challenge number. Chips on the stage choose the view. A wire is added with + Wire and a tap on the plane, dragged to move it (0.1 cm steps), tapped to reverse it and cleared with Delete; its current is its arrow's length (0.01 A steps). A coil is dragged along the axis for its position and by its outer mark for its radius (0.1 cm steps), its current is its arrow, and its turns are on a stepper under the map. The compass is dragged (0.1 cm steps). From Experiment, chips set the coil model, the scan line and Earth's field, whose strength is the N arrow's length (1 µT steps). The two predictions are markers on the scan chart at 8 cm, shown only in challenge 1.
  • In the input panel: the challenge picker only.

Governing relationships

The constant. The model uses the vacuum magnetic permeability μ₀ = 1.25663706127×10⁻⁶ N/A², the 2022 CODATA value.

A long straight wire. A wire carrying current I gives a field of strength μ₀·I/(2π·r) at distance r, circling the wire. At a point (x, y), with dx and dy the offsets from wire w, the components are B_h = Σ -μ₀·I_w·dy/(2π·r²) across the stage and B_v = Σ μ₀·I_w·dx/(2π·r²) up it, summed over every wire in use.

A circular coil, exact. For a coil of radius a, N turns and current I, at an axial distance ζ from its centre and a distance ρ from the axis, let α² = (a - ρ)² + ζ² and β² = (a + ρ)² + ζ² (the squared distances to the near and far crossings of the loop) and m = 1 - α²/β². With C = μ₀·N·I/(2π), the field along the axis is

B_z = C/(α²·β) · ((a² - ρ² - ζ²)·E + α²·K),

and the field across it is C·ζ/(α²·β·ρ) · ((a² + ρ² + ζ²)·E - α²·K), signed by the side of the axis. K and E are the complete elliptic integrals of the first and second kind with parameter m.

The elliptic integrals by the arithmetic-geometric mean. Starting from a₀ = 1, b₀ = α/β and c₀² = m, eight fixed steps of a_(n+1) = (a_n + b_n)/2, b_(n+1) = √(a_n·b_n) and c_(n+1) = (a_n - b_n)/2 give K = π/(2·a₈) and E = K·(1 - (c₀²/2 + Σ 2^(n-1)·c_n²)), summed over n = 1 to 8. There is no convergence test.

On and near the axis. Where ρ is below 10⁻³ of the radius (the axis included), the model uses the on-axis form B_z = μ₀·N·I·a²/(2·(a² + ζ²)^(3/2)), with a small field across the axis of (3/4)·μ₀·N·I·a²·ζ·y/(a² + ζ²)^(5/2), exactly 0 on the axis. At the centre of a single coil the field is μ₀·N·I/(2a).

A coil as a point dipole. The coil becomes a dipole of moment N·I·π·a² at its centre. With r the distance from the centre, the field along the axis is μ₀·N·I·a²/4 · (3·ζ² - r²)/r⁵ and across it μ₀·N·I·a²/4 · 3·ζ·y/r⁵. On the axis the exact field over the dipole field is (ζ²/(a² + ζ²))^(3/2), so the dipole overestimates there and comes within 1% of the exact loop beyond about 12.2 radii.

Adding the sources. The fields of all the sources in use are added as vectors. The strength is |B| = √(B_h² + B_v²), and the direction is the angle of the field from the across-the-stage direction, counter-clockwise positive, from -180 to 180 degrees.

The exclusion and the null band. No field is computed within 0.25 cm of a wire, of a coil's crossings of the section (z, ±a) or, in the point-dipole model, of a coil's centre, where the field has no finite value. The source scale is the sum over the sources in use of μ₀·|N·I|/(2π·0.25 cm) (N = 1 for a wire). A component no larger than 10⁻¹² of it reads 0, and a field that small counts as zero, with no direction.

The compass. The model returns the components, strength and direction of the sources' field at the compass. Earth's field, when on, is added there toward the top of the stage (north), and the needle deflection is the angle of that total from north, positive toward the right. The stronger the coil's field across the needle is against Earth's, the farther the needle turns from north.

Field lines. Six lines are traced along the field. In the Wires view lines 1 to 4 start 0.6 cm to the right of wires 1 to 4, and lines 5 and 6 start 1.6 cm to the right of wires 1 and 2. In the Coils view lines 1 and 2 start above and below coil 1's centre, lines 3 and 4 at coil 2 and lines 5 and 6 at coil 3, at half the radius from the axis, kept at least 0.35 cm from the coil's own crossing (exact loop) or centre (point dipole). Wires 5 and 6 and coil 4 have no line, but they still add to every field. Each step is the midpoint method (second-order Runge-Kutta) with a fixed step of 0.5 cm: the field direction at the start point gives a half step to a midpoint, and the direction there gives the full step. A line has at most 20 steps (21 points) and stops with one code:

  • REACHED_WIRE: the midpoint or the new point falls within 0.25 cm of a source, or the line starts there;
  • LEFT_PLOT: the new point is more than 8 cm from the centre across or up;
  • ZERO_FIELD: the field at the point or the midpoint is zero;
  • NULL_POINT: the field turns by 90 degrees or more within half a step, which usually marks a nearby point of zero field;
  • CLOSED: after at least 6 steps the line comes back within 0.25 cm of its start;
  • MAX_STEPS: 20 steps with no stop;
  • NOT_RUN: the source for that line is not in use.

The map. The field strength and direction at 225 points from -7 to 7 cm, 1 cm apart both ways, blank within the exclusion. The colour scale runs from the weakest non-zero strength on the map to the strongest.

The distance scan. In the Wires view the scan runs from wire 1 to the right; in the Coils view it runs from coil 1's centre along the axis or outward in the coil's plane. Its 31 distances are d = 0.5·2^(j/4) cm for j = 0 to 30, from 0.5 to 90.5 cm, with 2 cm and 8 cm among them. Each row gives the field with the chosen model, the exact field and the point-dipole field (Coils view), the local slope of the field on log-log scales (a centred difference, one-sided at the ends), and two guide lines through the 2 cm value: one falling like 1/d and one like 1/d³. A point within the exclusion is a blank row. On the axis every coil's field uses the on-axis form.

The agreement distance. In the Coils view a row agrees when the dipole field is within 1% of the exact field, |dipole/exact - 1| ≤ 0.01. The agreement distance is where the scan enters agreement for good: from the first row after which every row agrees, interpolated in ln d between that row and the one before it. It is blank when the scan never settles into agreement by 90.5 cm.

The axis profile and its zero. The field along the axis at 41 points from -8 to 8 cm, 0.4 cm apart. The axial zero is the first place, from the left, where that field changes sign, interpolated linearly between the two samples (a sample that is itself zero is the zero). It is blank when the field never changes sign.

Uniformity, centre field and dipole moment. The uniformity is the range of the axial field over five points 1 cm, 0.5 cm and 0 cm either side of the midpoint between coils 1 and 2 (or coil 1's centre when it is alone), as a percentage of the middle value: 100·(largest - smallest)/|B(middle)|. The centre field is the field along the axis at coil 1's centre, summed over every coil by the on-axis form above, and the dipole moment is coil 1's N·I·π·a², in mA·m².

The accuracy check. For the exact loop, one 8-step mean is run from the hardest start of this set-up (the closest any evaluated point comes to a coil crossing, over 22 cm), and the gap left between its two sequences is reported; it reads 0 when the elliptic integrals are exact to the last digit.

Calculation sequence

  1. Check the inputs that apply, in the order of the list under Errors and warnings, on the values entered.
  2. In a challenge, replace the inputs the challenge fixes with its own values. An input that does not apply takes its default, and a row not in use adds nothing.
  3. Compute the source scale, the null band and each source's constants.
  4. Compute the field at the 225 map points.
  5. Trace the six field lines, step by step, applying the stop rules.
  6. Compute the field, direction and needle deflection at the compass.
  7. Compute the distance scan, its slope and guides, and in the Coils view the agreement distance, the axis profile and its zero, the uniformity, the centre field, the dipole moment and the accuracy check.
  8. Set the status and, in a challenge, score it and hold back what the challenge keeps back.

Outputs and interpretation

  • Compass field (µT) and compass direction (degrees from the across-the-stage direction): the sources' field at the compass, without Earth's.
  • Needle deflection (degrees from north, positive to the right), with Earth's field added when it is on.
  • Centre field (µT), agreement distance (cm), uniformity (%) and axial zero (cm): Coils view only.
  • Sources in use: how many wires or coils are in use.
  • Compass components across and up the stage (µT), the dipole moment of coil 1 (mA·m²) and the accuracy check, at Advanced.
  • Settings used: the view, coil model, compass position, scan line and Earth field in effect (a challenge may fix them), each blank where it does not apply; the model and module versions.
  • Tables: the map (15 × 15 strengths and directions), the field lines (6 lines of 21 points, blank after a stop, with each line's source, points kept and stop code), the distance scan and the axis profile.

Reading the canvas: the map is coloured by the logarithm of the field strength between the returned scale ends, with an arrow at each point along the returned direction, and the field lines are drawn through their returned points, with a ring where a line ended at a zero of the field. At Explore the compass shows an arrow along the field; from Experiment it shows the needle beside Earth's N arrow, with a ring when the field there is zero. The scan chart, log scales on both axes, shows the field and the 1/d and 1/d³ guides; from Experiment it adds the exact and dipole fields, and in the Coils view an unlabelled line marks the agreement distance. From Experiment a ring marks the axial zero; at Advanced a second chart shows the local slope.

What to take from the lab: the field of one wire falls like 1/d, a slope of -1 on the scan; a coil's field far along its axis falls like 1/d³, a slope near -3, as a dipole's does. The dipole picture overestimates close to the coil and agrees within 1% only beyond about 12 radii on the axis. Fields add as vectors, so two wires or two coils can cancel at a point, leaving a zero of the field where a compass has no direction. The spacing of two equal coils sets how even the field between them is: too close and it peaks in the middle, too far and it dips there. A coil turns a compass needle away from north by an angle set by its field against Earth's.

Challenges

Each challenge fixes its own set-up and leaves only some inputs to you. The model scores each one MET (100) or NOT MET (0) and gives a one-line hint while it is not met. The challenges are listed from Experiment, as in the other Learning Labs; challenge 4 needs Earth's field, which Experiment adds.

  1. Predict the fall-off. A small coil (radius 0.5 cm, 20 turns, 1 A) in the Coils view with the axis scan. Predict the fields at 8 cm: the coil's own, and that of a long wire with the same field as the coil at 2 cm (the 1/d guide line). Place both markers. Met when each prediction is within 15% of its target, the scan's field at 8 cm and the 1/d guide at 8 cm.
  2. Cancel at the centre. Wire 1 carries +2 A at (-2, 0) and wire 2 carries +1 A. Drag wire 2 so the field at the centre (0, 0) is at most 0.5 µT. The value scored is the field at the centre. Met when it is at most 0.5 µT.
  3. Make an even field. Two coils of radius 4 cm, 10 turns and 1 A, coil 1 at z = -2 cm. Drag the second coil along the axis until the field varies by at most 1% over the middle 2 cm. The value scored is the uniformity. Met when it is at most 1%.
  4. Balance Earth's field. A coil of radius 5 cm and 10 turns, with Earth's field on at 20 µT and the compass at its centre. Drag the coil's current until the needle points 45° away from north. The value scored is the needle deflection. Met when it is within 1° of 45°.
  5. Move the zero. Coil 1 at z = -2 cm and coil 2 at z = 2 cm, both of radius 4 cm and 10 turns, coil 1 at +1 A. Drag the second coil's current to move the zero of the axial field to z = 0.5 cm. The value scored is the axial zero. Met when it lies from 0.4 to 0.6 cm.

Challenge 1 holds back the answer until both markers are placed. While either prediction is blank, the compass results, the needle, the centre field, the agreement distance, the scan rows beyond 2 cm, and the map points and axis profile farther than 2 cm from coil 1's centre are blank, and the challenge reads NOT MET with the prompt to place both markers. The scan rows up to 2 cm, the field lines and the coil stay as the tools. Once both are placed, every result appears and the challenge is scored, met or not. Challenge 4 holds back the centre field and the compass field and components until it is met; the needle is the tool. Challenges 2, 3 and 5 hold nothing back: the map, the field lines, the uniformity and the axial zero are the tools.

Validation and status logic

The status reads the first match in the list under Errors and warnings. The NOT VALID checks read the values you entered, and only for the inputs that apply: the wire checks in the Wires view, the coil, coil model and scan line checks in the Coils view, the Earth field strength while Earth's field is On, and the predictions in challenge 1. Wire k or coil k names the first row with a fault, and a pair names the first pair in row order. The CHECK messages read the values in effect after a challenge has fixed its own, and apply inside challenges too. A challenge number that is not a whole number from 0 to 5 counts as no challenge; any other NOT VALID message in a selected challenge reads NOT MET with that challenge's goal and hint.

Assumptions and limitations

  • Steady currents in thin wires and loops: no magnetic materials, induction or changing currents. Wires are infinitely long and perpendicular to the page; coils are flat loops on one shared axis, never tilted.
  • At most 6 wires and 4 coils; the plot spans -8 to 8 cm and the map -7 to 7 cm at 1 cm spacing; no field within 0.25 cm of a wire, a coil's crossing or a point dipole's centre.
  • Earth's field is uniform and acts only at the compass, never on the map, the field lines or the scan.
  • The elliptic integrals use a fixed 8 steps of the mean; within 10⁻³ of the radius from the axis the on-axis form is used.
  • Six field lines of at most 20 fixed steps of 0.5 cm, for wires 1 to 4 and coils 1 to 3 only, so a line can stop before it closes. A NULL_POINT stop usually, but not always, marks a nearby zero of the field.
  • The scan reaches 90.5 cm, so an agreement distance beyond that is blank. The axial zero is the first from the left, interpolated between samples 0.4 cm apart.
  • A value within about 1×10⁻⁹ (relative) of a threshold, such as the 0.25 cm exclusion, the 1% agreement, a field-line stop rule or a challenge band, may fall either side of it.

Restrictions and non-computing states

Under NOT VALID every result and every table is blank, except the model and module versions, the challenge result (No challenge selected, or NOT MET with a challenge selected), a score of 0, and the goal and hint of a selected challenge.

When the compass sits within 0.25 cm of a wire or a point dipole's centre, the compass results and the needle are blank; the rest is computed. When the field at the compass is zero, its direction and the needle are blank and its strength reads 0.

In challenges 1 and 4 the results listed under Challenges are held back until the challenge allows them.

Errors and warnings

The status messages, first match wins (k and j are row numbers):

  • NOT VALID: choose the view (Wires or Coils) from the list
  • NOT VALID: wire k needs x and y from −8 to 8 cm and a current from −10 to 10 A that is not 0, or leave the row blank: Wires view.
  • NOT VALID: at least one wire is needed: Wires view.
  • NOT VALID: wires j and k are closer than 0.5 cm: Wires view.
  • NOT VALID: coil k needs a position from −8 to 8 cm, a radius from 0.5 to 6 cm, a whole number of turns from 1 to 200 and a current from −10 to 10 A that is not 0, or leave the row blank: Coils view.
  • NOT VALID: at least one coil is needed: Coils view.
  • NOT VALID: coils j and k are the same loop (the same position and radius): Coils view.
  • NOT VALID: choose the coil model from the list: Coils view.
  • NOT VALID: choose the scan line from the list: Coils view.
  • NOT VALID: the compass must be from −8 to 8 cm in both directions
  • NOT VALID: choose whether Earth's field is on from the list
  • NOT VALID: Earth's field must be a number from 0 to 100 µT: while Earth's field is On.
  • NOT VALID: the challenge number must be a whole number from 0 to 5, and each prediction blank or a number from 0.001 to 100000 µT
  • CHECK: the compass is within 0.25 cm of a wire or of a point dipole's centre, where the field has no finite value; the compass results are blank
  • CHECK: the field at the compass is zero (a null point), so it has no direction
  • OK

References

This laboratory is an educational model of the steady magnetic fields of up to six long straight wires seen end-on, or up to four coaxial circular coils seen from the side. A wire's field circles it with strength mu0 I/(2 pi r), and the fields of all the sources are added. A coil's field is the exact field of a circular loop, written with the complete elliptic integrals K and E, which are computed by eight steps of Gauss's arithmetic-geometric mean; for comparison it can be replaced by the field of a point dipole of moment N I pi a^2. The lab maps the field's strength and direction, traces field lines in 0.5 cm steps, finds the field at a compass with an optional uniform Earth field, and scans how the field falls off with distance, including the distance beyond which the dipole agrees with the exact loop within 1%.

Sources and further reading

  • The value of the vacuum magnetic permeability mu0: NIST, CODATA Value: vacuum magnetic permeability, 2022 CODATA recommended values. NIST
  • The complete elliptic integrals K and E by Gauss's arithmetic-geometric mean: NIST Digital Library of Mathematical Functions, Release 1.2.8 of 2026-09-15, section 19.8(i), Gauss's Arithmetic-Geometric Mean, equations 19.8.1 to 19.8.6. DLMF

No table or text from any of these publications is reproduced, and none of their authors or publishers has reviewed or endorses this laboratory.

This laboratory is for learning. Its results hold only within its stated ranges; it gives no field value close to a wire or a loop, and it is not a tool for designing real magnets, coils or shielding.

Results are informational and not professional advice. See our Terms of Use. Powered by SpreadsheetWeb · About · Privacy · Terms