EMDyna Sandbox Scene Details
Overview Manual & Theory Validation Suite Python API Gallery Open Simulator

← Back to Scene Gallery

OfficialBasicMagnetic Field Created by a Coil (Number of Turns, Current, and Magnetic Field Strength)

A power supply and a resistor are connected to a coil (initially 20 turns, length 4 cm, radius 1.5 cm) to run current through it. You can read the magnetic field magnitude with the "Magnetic field at coil center" probe and current with the "Ammeter". This scene corresponds to the classroom lesson "Magnetic Field Created by a Coil" (/classroom). [Highlights] - Click the coil and change "Turns" in the right panel to 10, 20, 30, or 40 (since coil length is fixed, windings become denser). As long as current remains nearly constant, the center magnetic field increases in direct proportion to turns. - Click the power supply and change voltage to 1.5, 3, 4.5, or 6 V to alter the current. The center field is strictly proportional to current. - Invert the voltage sign to reverse current direction; magnetic field arrows flip accordingly (right-hand grip rule). - The 5.5 Ω ballast resistor is much larger than coil internal resistance (approx. 0.06 Ω for 20 turns), so current barely changes when modifying turn count. - Central flux density for this geometry is B = μ0 N I / √(l² + 4a²) (l: length, a: radius), giving approx. 0.5 mT at 20 turns and 1 A.

Oct 26, 2026 • 11 views

Launch & Remix in Simulator

Read the explanation, with equations and figures ↓

Modify this scene in the simulator, then open the "Scene" tab and click "Publish Current Scene to Gallery" to share your remix!

·

In short

A coil is a wire wound round and round. When current flows through it, the coil becomes a magnet (an electromagnet). This scene measures how strong the magnetic field is at the middle of the coil.

With 20 turns and about 1 A, the field at the center is about 500 microtesla (μT), roughly ten times the Earth's magnetic field.

What you are looking at

The magnetic field generated by a cylindrical electromagnetic coil (solenoid) and its quantitative dependence on the number of turns and electrical current:

  • An air-core cylindrical coil of fixed length l=4 cml = 4\text{ cm} (0.04 m0.04\text{ m}) and radius a=1.5 cma = 1.5\text{ cm} (0.015 m0.015\text{ m}), wound with NN turns (initially N=20N = 20).
  • A DC series circuit containing a DC voltage source VV (6 V6\text{ V}, internal resistance Rint=0.5 ΩR_{\text{int}} = 0.5\ \Omega), a ballast resistor R=5.5 ΩR = 5.5\ \Omega, and a closed knife switch.
  • Two designated measurement probes:
  • Magnetic field at coil center: A field sensor placed precisely at the origin (0,0,0)(0, 0, 0) inside the solenoid bore, measuring magnetic flux density magnitude ∣B∣|\mathbf{B}| in microteslas (μT\mu\text{T}).
  • Ammeter: A current sensor placed on the wire loop, measuring the loop current II in milliamperes (mA\text{mA}).

The ballast resistor (5.5 Ω5.5\ \Omega) is almost two orders of magnitude larger than the internal resistance of the copper windings (approximately 0.06 Ω0.06\ \Omega for 20 turns). As a result, changing the coil's turn count changes the coil's winding density without altering the total circuit resistance or current, allowing an ideal controlled experiment.

Proportionality laws

1. Proportionality to turns (B∝NB \propto N)

When the coil length ll is kept constant and turns NN are changed, the windings become more closely spaced. Because the external resistance dominates the circuit, current remains practically constant (I≈0.98 AI \approx 0.98\text{ A} to 0.99 A0.99\text{ A}). Each turn contributes equally to the total axial field, producing a strict direct proportion:

B∝N(I=const)B \propto N \quad (I = \text{const})

2. Proportionality to current (B∝IB \propto I)

According to Ohm's law, varying the source voltage VV directly scales the current I≈V/(R+Rint)I \approx V / (R + R_{\text{int}}). The magnetic field responds linearly:

B∝I(N=const)B \propto I \quad (N = \text{const})

3. Field direction (Right-hand rule)

The vector direction of B\mathbf{B} along the solenoid axis follows the right-hand grip rule: when fingers curl in the direction of conventional current circling the coil, the thumb points in the direction of the magnetic field vector. Reversing the DC voltage (e.g., to −6 V-6\text{ V}) reverses the current direction and inverts the magnetic field vector.

Magnetic field of a finite solenoid

According to the Biot–Savart law, the on-axis magnetic flux density BB at the exact center of a finite single-layer solenoid of length ll, radius aa, and total turns NN carrying current II is given by:

B=μ0NIl2+4a2B = \frac{\mu_0 N I}{\sqrt{l^2 + 4a^2}}

where μ0=4π×10−7 H/m\mu_0 = 4\pi \times 10^{-7}\text{ H/m} is the vacuum magnetic permeability.

For an infinitely long solenoid with turn density n=N/ln = N/l, the textbook formula is:

B∞=μ0nI=μ0NIlB_\infty = \mu_0 n I = \frac{\mu_0 N I}{l}

For the dimensions in this scene (l=0.04 ml = 0.04\text{ m} and a=0.015 ma = 0.015\text{ m}):

l2+4a2=0.042+4×0.0152=0.0016+0.0009=0.0025=0.05 m\sqrt{l^2 + 4a^2} = \sqrt{0.04^2 + 4 \times 0.015^2} = \sqrt{0.0016 + 0.0009} = \sqrt{0.0025} = 0.05\text{ m}

The finite geometry introduces an exact reduction factor of:

ll2+4a2=0.04 m0.05 m=0.80\frac{l}{\sqrt{l^2 + 4a^2}} = \frac{0.04\text{ m}}{0.05\text{ m}} = 0.80

At the coil center, the field is exactly 80%80\% of the infinite solenoid approximation because magnetic flux lines begin to diverge and spread outward near both open ends.

Measured simulation values

Winding turns sweep (V=6 VV = 6\text{ V})

Turns NNCurrent IICenter field BB (simulated)Theoretical BBRatio B/NB/N
10 turns994 mA994\text{ mA}250 μT250\ \mu\text{T}250 μT250\ \mu\text{T}25.0 μT/turn25.0\ \mu\text{T}/\text{turn}
20 turns989 mA989\text{ mA}497 μT497\ \mu\text{T}497 μT497\ \mu\text{T}24.9 μT/turn24.9\ \mu\text{T}/\text{turn}
30 turns984 mA984\text{ mA}742 μT742\ \mu\text{T}742 μT742\ \mu\text{T}24.7 μT/turn24.7\ \mu\text{T}/\text{turn}
40 turns978 mA978\text{ mA}984 μT984\ \mu\text{T}983 μT983\ \mu\text{T}24.6 μT/turn24.6\ \mu\text{T}/\text{turn}

Voltage sweep (N=20 turnsN = 20\text{ turns})

Voltage VVCurrent IICenter field BB (simulated)Theoretical BBRatio B/IB/I
1.5 V247 mA247\text{ mA}124 μT124\ \mu\text{T}124 μT124\ \mu\text{T}502 μT/A502\ \mu\text{T}/\text{A}
3.0 V494 mA494\text{ mA}249 μT249\ \mu\text{T}248 μT248\ \mu\text{T}504 μT/A504\ \mu\text{T}/\text{A}
4.5 V742 mA742\text{ mA}373 μT373\ \mu\text{T}373 μT373\ \mu\text{T}503 μT/A503\ \mu\text{T}/\text{A}
6.0 V989 mA989\text{ mA}497 μT497\ \mu\text{T}497 μT497\ \mu\text{T}503 μT/A503\ \mu\text{T}/\text{A}

The slight decrease in current from 1010 to 4040 turns (994 mA→978 mA994\text{ mA} \to 978\text{ mA}) reflects the small added resistance of the longer copper wire, perfectly replicating real-world circuit behavior.

Try it

Comments