OpenWorldLab

Loading interactive view…

Electricity and magnetism

An electromagnetism lab

Place charges, rods, shells and dipoles on a board and see their fields as flowing light and field lines, in real units. Probes, Gauss surfaces and paths measure the fields while you move things, and every experiment checks its reading against the textbook.

The four equations

Everything on this board follows from four equations, written down by James Clerk Maxwell in the 1860s. Each one below links to the experiments that show it.

Gauss’s law

∇⋅E=ρε0\nabla\cdot\mathbf E = \frac{\rho}{\varepsilon_0}

Charge is where electric field lines begin and end.

No magnetic monopoles

∇⋅B=0\nabla\cdot\mathbf B = 0

Magnetic field lines never end: they close on themselves.

Faraday’s law

∇×E=−∂B∂t\nabla\times\mathbf E = -\frac{\partial \mathbf B}{\partial t}

A changing magnetic field drives an electric field round in loops. Without one, the electric field is conservative.

Ampère–Maxwell law

∇×B=μ0J+μ0ε0∂E∂t\nabla\times\mathbf B = \mu_0\mathbf J + \mu_0\varepsilon_0\frac{\partial \mathbf E}{\partial t}

Currents, and changing electric fields, drive magnetic fields round in loops. Together with Faraday’s law it makes light.

Three worlds on a flat board

A screen is flat; electricity and magnetism are not. A dot on the board can mean three different things, and the badge in the corner always says which:

  • 3D, slice. A real three-dimensional world seen through the plane of the screen. A dot is a point charge; its field falls as 1/r21/r^2. This is what textbooks draw.
  • 2D, extruded. Everything runs on forever into the screen. A dot is a line of charge, whose field falls as 1/r1/r; a circle is a cylinder. Wires, coaxial cables and long capacitors live here, and so do the grid solvers.
  • 3D, round. Everything is a body of revolution about the dashed vertical axis. A dot off the axis is a ring. The fields are truly three-dimensional, so spheres, coils and antennas come out exactly right.

The same arrangement gives different fields in different worlds. The field-line experiment shows why that matters for every field-line picture you have seen.

How the lab computes

Charges, dipoles, rods, rings and loops have exact fields in closed form, so the lab adds them up at every pixel on the graphics card and again, in double precision, wherever a probe or a field line needs a number. Field lines are integrated with an adaptive Runge–Kutta method and leave each charge in proportion to its charge.

Every reading carries the textbook’s prediction beside it, worked out from the board’s own numbers, and the lab’s tests check each experiment against it.

What the lab leaves out

  • Fields follow charges instantly, which is right while they move much slower than light.
  • Quantum effects: spin, atoms’ energy levels, semiconductors beyond an ideal diode.
  • Fully three-dimensional grids: matter is solved in the extruded and round worlds only.

References

  • D. J. Griffiths (2017), Introduction to Electrodynamics, 4th edition, Cambridge University Press.
  • E. M. Purcell and D. J. Morin (2013), Electricity and Magnetism, 3rd edition, Cambridge University Press.
  • R. P. Feynman, R. B. Leighton and M. Sands, The Feynman Lectures on Physics, Volume II.