Skip to content
LumenaryAcademy
Waves 75 min

Maxwell's equations and electromagnetic waves

Four laws about electric and magnetic fields, one missing term, and the prediction that light, radio and Wi-Fi are the same thing travelling at 299,792,458 m/s.

Code tested · 5AI-draftedAwaiting review by an electrical engineer

Your guides: Chloe · The Physicist, Margaret · The Bench Engineer, Gideon · The Design Reviewer

MotivationH

One theory for radio, light and your phone

Hold a phone near a window. Sunlight is pouring through the glass; the phone is exchanging data with a mast a kilometre away; a radio in the next room is picking up a broadcast from a transmitter fifty kilometres off; the router on the shelf is filling the room with Wi-Fi. These look like four different things. They are one thing: electromagnetic waves, ripples in the electric and magnetic fields, differing only in their frequency.

That unity is a prediction, not an observation. In the 1860s James Clerk Maxwell took the laws of electricity and magnetism that Coulomb, Ampère and Faraday had found by experiment, noticed that one of them was inconsistent, repaired it with a single extra term, and found that the repaired equations allow a wave that travels through empty space at a speed he could compute from two numbers measured on a laboratory bench with capacitors and coils. The number came out equal to the measured speed of light. Twenty years later Heinrich Hertz made such waves with a spark gap and detected them across a room, and within another two decades they were carrying messages across the Atlantic.

Everything in the rest of this level rests on this lesson: transmission lines guide these waves along wires, antennas launch them into space, and modulation and coding load them with information. Here we meet the four laws, the missing term, the wave they predict, and a simulation of that wave in a few lines of NumPy.

IntuitionH

Fields, flux and circulation

A field is a quantity defined at every point of space and time. The electric field E\mathbf{E} tells you the force per unit charge a small test charge would feel: F=qE\mathbf{F} = q\mathbf{E}, measured in volts per metre. The magnetic field B\mathbf{B}, measured in teslas, adds the force on a moving charge: F=q(E+v×B)\mathbf{F} = q(\mathbf{E} + \mathbf{v}\times\mathbf{B}). You met both in magnetism and motors, where a current in a magnetic field turned a motor.

Maxwell's equations do not tell you the field at a point directly. They ask two kinds of question about it, and it helps to have pictures for both.

  • Flux through a surface: how much field passes through it. For a closed surface, like a balloon, the net flux out tells you whether the field is being produced inside (field lines start there) or absorbed (they end there).
  • Circulation around a closed loop: how much the field pushes along the loop, added up all the way round. A field whose lines curl around something has circulation; a field that points straight out from a charge has none.

Analogy, not a formal construction

Think of the wind on a hillside. Flux is how much air blows through a hoop you hold up, or, for a closed tent, whether more air leaves than enters (only if something inside is producing air, like a fan). Circulation is how strongly the wind pushes a bead around a ring of wire: zero for a steady breeze from one direction, large inside a whirlwind.

With those two words, all four laws fit in a sentence each:

  1. Gauss's law. The electric flux out of any closed surface is proportional to the charge inside. Electric field lines start on positive charges and end on negative ones.
  2. Gauss's law for magnetism. The magnetic flux out of any closed surface is zero. Magnetic field lines never start or end: there are no magnetic charges (no "monopoles" have ever been found), so the lines close on themselves.
  3. Faraday's law. The circulation of E\mathbf{E} around a loop equals minus the rate of change of the magnetic flux through it. A changing magnetic field makes a curling electric field: this is the induction behind every transformer and generator.
  4. The Ampère–Maxwell law. The circulation of B\mathbf{B} around a loop is proportional to the current through it plus the rate of change of the electric flux through it. Currents make curling magnetic fields, and so do changing electric fields.

The words "plus the rate of change of the electric flux" are Maxwell's addition. Without them, there are no electromagnetic waves.

DefinitionsH

The four laws, precisely

Definition— flux and circulation

For a surface SS with a unit normal n^\hat{\mathbf{n}}, the flux of a field F\mathbf{F} through SS is Φ=∫SF⋅n^ dA\Phi = \int_S \mathbf{F}\cdot\hat{\mathbf{n}}\,dA. For a closed curve CC, the circulation of F\mathbf{F} around CC is ∮CF⋅dℓ\oint_C \mathbf{F}\cdot d\boldsymbol{\ell}. When CC is the edge of SS, the direction round CC and the side n^\hat{\mathbf{n}} points to are linked by the right-hand rule.

Definition— Maxwell's equations in vacuum, integral form

For any closed surface ∂V\partial V enclosing charge QencQ_{\text{enc}}, and any loop CC bounding a surface SS through which a current IencI_{\text{enc}} flows:

∮∂VE⋅dA=Qencε0∮∂VB⋅dA=0\oint_{\partial V} \mathbf{E}\cdot d\mathbf{A} = \frac{Q_{\text{enc}}}{\varepsilon_0} \qquad \oint_{\partial V} \mathbf{B}\cdot d\mathbf{A} = 0

∮CE⋅dℓ=−ddt∫SB⋅dA∮CB⋅dℓ=μ0Ienc+μ0ε0 ddt∫SE⋅dA\oint_C \mathbf{E}\cdot d\boldsymbol{\ell} = -\frac{d}{dt}\int_S \mathbf{B}\cdot d\mathbf{A} \qquad \oint_C \mathbf{B}\cdot d\boldsymbol{\ell} = \mu_0 I_{\text{enc}} + \mu_0\varepsilon_0\,\frac{d}{dt}\int_S \mathbf{E}\cdot d\mathbf{A}

Here ε0≈8.854×10−12\varepsilon_0 \approx 8.854 \times 10^{-12} F/m is the vacuum permittivity and μ0≈1.2566×10−6\mu_0 \approx 1.2566 \times 10^{-6} N/A² the vacuum permeability.

Shrinking the surface and the loop to a point turns flux per unit volume into the divergence and circulation per unit area into the curl (the theorems of Gauss and Stokes from multivariable calculus). That gives the differential form, with charge density ρ\rho and current density J\mathbf{J}:

∇⋅E=ρε0∇⋅B=0∇×E=−∂B∂t∇×B=μ0J+μ0ε0∂E∂t\nabla\cdot\mathbf{E} = \frac{\rho}{\varepsilon_0} \qquad \nabla\cdot\mathbf{B} = 0 \qquad \nabla\times\mathbf{E} = -\frac{\partial\mathbf{B}}{\partial t} \qquad \nabla\times\mathbf{B} = \mu_0\mathbf{J} + \mu_0\varepsilon_0\frac{\partial\mathbf{E}}{\partial t}

LawIn wordsWhat it gives engineers
Gausscharges are where E\mathbf{E} lines begin and endcapacitance, the field near a charged conductor
Gauss (magnetism)B\mathbf{B} lines never begin or endmagnetic circuits in transformers and motors
Faradaychanging B\mathbf{B} makes curling E\mathbf{E}generators, transformers, inductance, induced noise
Ampère–Maxwellcurrents and changing E\mathbf{E} make curling B\mathbf{B}electromagnets, inductance, and (with Faraday) waves

Inside materials, engineers write the same laws with the displacement field D=εE\mathbf{D} = \varepsilon\mathbf{E} and the magnetic field strength H=B/μ\mathbf{H} = \mathbf{B}/\mu, where ε=εrε0\varepsilon = \varepsilon_r\varepsilon_0 and μ=μrμ0\mu = \mu_r\mu_0 absorb the material's response. In this lesson the materials are simple (linear, uniform, lossless), so you can read every formula with ε0→ε\varepsilon_0 \to \varepsilon.

ExplanationH

The missing term: displacement current

Ampère's law in its original form said only ∮CB⋅dℓ=μ0Ienc\oint_C \mathbf{B}\cdot d\boldsymbol{\ell} = \mu_0 I_{\text{enc}}, where IencI_{\text{enc}} is the current crossing any surface whose edge is CC. Apply it to a capacitor being charged.

IIloop CS₁S₂changing Eno charge crosses the gap
A capacitor being charged through a wire. The loop C circles the wire. Surface S₁, a flat disc bounded by C, is pierced by the wire and so carries the current I. Surface S₂ has the same edge but bulges into the gap between the plates, where no charge flows; what crosses it instead is a changing electric field.

The circulation of B\mathbf{B} around CC is one number: it depends only on the field along the loop. But Ampère's law gives two different answers for it. Through the flat disc S1S_1 the enclosed current is II. Through the bag S2S_2, which passes between the plates, it is zero, because no charge jumps the gap. One law, two surfaces with the same edge, two answers: the law is inconsistent whenever charge piles up somewhere.

Maxwell's repair was to notice what does cross S2S_2. As charge QQ builds up on the plates, the field in the gap grows: by Gauss's law the electric flux between the plates is ΦE=Q/ε0\Phi_E = Q/\varepsilon_0, so

ε0dΦEdt=dQdt=I.\varepsilon_0\frac{d\Phi_E}{dt} = \frac{dQ}{dt} = I.

The quantity Id=ε0 dΦE/dtI_d = \varepsilon_0\, d\Phi_E/dt, the displacement current, is exactly equal to the conduction current in the wire. Add it to the right-hand side of Ampère's law and both surfaces give μ0I\mu_0 I. The corrected law is consistent with conservation of charge for every surface, and that is the deeper reason it must be right: take the divergence of ∇×B=μ0J+μ0ε0 ∂E/∂t\nabla\times\mathbf{B} = \mu_0\mathbf{J} + \mu_0\varepsilon_0\,\partial\mathbf{E}/\partial t, use ∇⋅(∇×B)=0\nabla\cdot(\nabla\times\mathbf{B}) = 0 and Gauss's law, and out comes ∇⋅J=−∂ρ/∂t\nabla\cdot\mathbf{J} = -\partial\rho/\partial t, the continuity equation.

Example— How big is a displacement current?

A 100 pF capacitor on a circuit board is charged at a rate of 1 V per nanosecond, a typical edge in fast digital logic. The current in its leads is I=C dV/dt=100×10−12×109=0.1I = C\,dV/dt = 100\times10^{-12} \times 10^{9} = 0.1 A. The displacement current between its plates is the same 0.1 A: there is no conduction current there, but the field in the dielectric is changing, and it produces exactly the magnetic field that the missing current would have. This is why the magnetic field around a capacitor's leads does not stop abruptly at the plates.

ExplanationH

From four laws to a wave

Take empty space: no charges, no currents. The equations become beautifully symmetric:

∇⋅E=0,∇⋅B=0,∇×E=−∂B∂t,∇×B=μ0ε0∂E∂t.\nabla\cdot\mathbf{E} = 0, \qquad \nabla\cdot\mathbf{B} = 0, \qquad \nabla\times\mathbf{E} = -\frac{\partial\mathbf{B}}{\partial t}, \qquad \nabla\times\mathbf{B} = \mu_0\varepsilon_0\frac{\partial\mathbf{E}}{\partial t}.

Theorem— The wave equation

In a region with no charge and no current, every Cartesian component of E\mathbf{E} and of B\mathbf{B} satisfies the wave equation

∇2E=μ0ε0 ∂2E∂t2,∇2B=μ0ε0 ∂2B∂t2,\nabla^2 \mathbf{E} = \mu_0\varepsilon_0\,\frac{\partial^2\mathbf{E}}{\partial t^2}, \qquad \nabla^2 \mathbf{B} = \mu_0\varepsilon_0\,\frac{\partial^2\mathbf{B}}{\partial t^2},

whose solutions travel at the speed c=1/μ0ε0c = 1/\sqrt{\mu_0\varepsilon_0}.

Proof

Take the curl of Faraday's law and swap the order of the space and time derivatives:

∇×(∇×E)=−∂∂t(∇×B)=−μ0ε0∂2E∂t2,\nabla\times(\nabla\times\mathbf{E}) = -\frac{\partial}{\partial t}(\nabla\times\mathbf{B}) = -\mu_0\varepsilon_0\frac{\partial^2\mathbf{E}}{\partial t^2},

using the Ampère–Maxwell law in the second step. The vector identity ∇×(∇×E)=∇(∇⋅E)−∇2E\nabla\times(\nabla\times\mathbf{E}) = \nabla(\nabla\cdot\mathbf{E}) - \nabla^2\mathbf{E} and Gauss's law ∇⋅E=0\nabla\cdot\mathbf{E} = 0 turn the left side into −∇2E-\nabla^2\mathbf{E}, which gives the first equation. The same steps starting from the curl of the Ampère–Maxwell law give the second. In one dimension, ∂2f/∂z2=1c2 ∂2f/∂t2\partial^2 f/\partial z^2 = \frac{1}{c^2}\,\partial^2 f/\partial t^2 is solved by f(z−ct)f(z - ct) and f(z+ct)f(z + ct) for any twice-differentiable shape ff (substitute and check), so a disturbance of any shape moves at speed cc without changing shape.

∎

Now compute the speed from the two constants, and the ratio η0=μ0/ε0\eta_0 = \sqrt{\mu_0/\varepsilon_0} that will turn out to relate EE to HH in a wave. The last columns convert some familiar frequencies to wavelengths λ=c/f\lambda = c/f and to the energy hfhf of one photon.

python
import math

mu0 = 1.25663706127e-6      # vacuum permeability, N/A^2 (CODATA 2022)
eps0 = 8.8541878188e-12     # vacuum permittivity, F/m (CODATA 2022)
h = 6.62607015e-34          # Planck constant, J s (exact since 2019)
e = 1.602176634e-19         # elementary charge, C (exact since 2019)

c = 1 / math.sqrt(mu0 * eps0)
eta0 = math.sqrt(mu0 / eps0)
print(f"c    = 1/sqrt(mu0 eps0) = {c:,.1f} m/s")
print(f"eta0 = sqrt(mu0/eps0)   = {eta0:.2f} ohm")
print()
print(f"{'source':26}{'frequency':>12}{'wavelength':>14}{'photon energy':>16}")
for name, f in [("AM broadcast", 0.6e6), ("FM broadcast", 98e6),
                ("Wi-Fi, microwave oven", 2.45e9), ("5G millimetre wave", 28e9),
                ("thermal camera (10 um)", c / 10e-6), ("green light (530 nm)", c / 530e-9),
                ("medical X-ray (0.02 nm)", c / 0.02e-9)]:
    lam = c / f
    print(f"{name:26}{f:12.3e}{lam:12.3e} m{h * f / e:13.2e} eV")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

The first line is the punchline Maxwell reached with far cruder numbers: two constants measured with static charges and steady currents combine into 299,792,458 m/s, the speed of light. The second line is the impedance of free space, η0≈376.73 Ω\eta_0 \approx 376.73\ \Omega, which we meet again in the next section and in antennas. In a material with relative permittivity εr\varepsilon_r (and μr=1\mu_r = 1), the same derivation gives a speed c/εrc/\sqrt{\varepsilon_r}: the refractive index is n=εrn = \sqrt{\varepsilon_r}. A signal on a circuit board, in a dielectric with εr≈4\varepsilon_r \approx 4, travels at about half the speed of light, which matters a great deal in the next lesson.

ExplanationH

Plane waves, polarisation and the Poynting vector

Far from the antenna or star that produced it, a wave looks the same over any small patch of a plane at right angles to its direction: a plane wave. Choose zz as the direction of travel. The simplest solution of Maxwell's equations is

E=E0cos⁡(ωt−kz) x^,B=E0ccos⁡(ωt−kz) y^,ω=ck,\mathbf{E} = E_0\cos(\omega t - kz)\,\hat{\mathbf{x}}, \qquad \mathbf{B} = \frac{E_0}{c}\cos(\omega t - kz)\,\hat{\mathbf{y}}, \qquad \omega = ck,

with angular frequency ω=2πf\omega = 2\pi f and wavenumber k=2π/λk = 2\pi/\lambda. Substituting into Faraday's law confirms it: ∇×E=y^ kE0sin⁡(ωt−kz)\nabla\times\mathbf{E} = \hat{\mathbf{y}}\,kE_0\sin(\omega t - kz) and −∂B/∂t=y^ (ωE0/c)sin⁡(ωt−kz)-\partial\mathbf{B}/\partial t = \hat{\mathbf{y}}\,(\omega E_0/c)\sin(\omega t - kz) agree because ω/c=k\omega/c = k.

λxyzEBdirection of travel →
A linearly polarised plane wave at one instant. The electric field (solid) oscillates along x, the magnetic field (dashed) along y, and the wave travels along z. The two are in phase: both peak at the same places. The distance between successive peaks is the wavelength λ.

Three facts follow from Maxwell's equations and are worth remembering:

  • The wave is transverse. E\mathbf{E}, B\mathbf{B} and the direction of travel are mutually perpendicular. (Gauss's laws forbid a field component along zz that varies only with zz.)
  • EE and BB are in phase and in fixed ratio: ∣B∣=∣E∣/c|\mathbf{B}| = |\mathbf{E}|/c, or in terms of H=B/μ0\mathbf{H} = \mathbf{B}/\mu_0, ∣E∣/∣H∣=η0≈377 Ω|\mathbf{E}|/|\mathbf{H}| = \eta_0 \approx 377\ \Omega. That is why η0\eta_0 is called an impedance: it is the ratio of volts per metre to amperes per metre in a travelling wave.
  • The wave carries energy in the direction of travel.

Definition— Poynting vector

The Poynting vector S=E×H\mathbf{S} = \mathbf{E}\times\mathbf{H} is the power per unit area carried by the fields, in W/m², pointing in the direction the energy flows. For the plane wave above it points along +z+z and its time average, the intensity, is

⟨S⟩=E022η0=Erms2η0.\langle S\rangle = \frac{E_0^2}{2\eta_0} = \frac{E_{\text{rms}}^2}{\eta_0}.

Example— The electric field in sunlight and near a phone

Sunlight arriving above the atmosphere has an intensity of about 1361 W/m². Solving ⟨S⟩=E02/(2η0)\langle S\rangle = E_0^2/(2\eta_0) for the amplitude gives E0=2×376.73×1361≈1013E_0 = \sqrt{2 \times 376.73 \times 1361} \approx 1013 V/m, with a magnetic amplitude B0=E0/c≈3.4 μB_0 = E_0/c \approx 3.4\ \muT. Sunlight is of course a jumble of frequencies and polarisations; these are the values of a single wave carrying the same power.

A phone radiating 0.2 W, if it radiated equally in all directions, would spread that power over a sphere of area 4πr24\pi r^2. At r=1r = 1 m the intensity is 0.2/(4π)≈0.0160.2/(4\pi) \approx 0.016 W/m², and the field amplitude about 3.5 V/m. Antennas do not radiate equally in all directions, and the antennas lesson makes this calculation properly.

Polarisation

The plane wave in the figure is linearly polarised: its E\mathbf{E} always points along the same line. In general a wave travelling along zz has two independent components,

Ex=acos⁡(ωt−kz),Ey=bcos⁡(ωt−kz+ϕ).E_x = a\cos(\omega t - kz), \qquad E_y = b\cos(\omega t - kz + \phi).

If ϕ=0\phi = 0 or π\pi (or one amplitude is zero), the tip of E\mathbf{E} moves back and forth along a line: linear polarisation. If a=ba = b and ϕ=±π/2\phi = \pm\pi/2, the tip traces a circle: circular polarisation, right- or left-handed depending on the sign. Anything else traces an ellipse. Polarisation matters in practice: a vertically polarised antenna barely receives a horizontally polarised wave, satellite links (GPS among them) often use circular polarisation because the ionosphere rotates the plane of linear polarisation by an unpredictable amount, and mobile networks use pairs of cross-polarised antennas to carry two data streams at once.

Note

"Right-hand circular" is a convention, and two communities chose differently. The IEEE defines handedness looking along the direction of travel, away from the source; many optics books look back towards the source, which reverses the name. Before connecting two circularly polarised antennas, check which convention each datasheet uses.

ExplanationH

The electromagnetic spectrum

Maxwell's equations put no limit on the frequency. Every wavelength from kilometres to far less than an atom is an electromagnetic wave, and engineering uses almost all of them.

RegionFrequencyWavelengthEngineering uses
Radio (LF, MF, HF)30 kHz – 30 MHz10 km – 10 mnavigation beacons, AM and shortwave broadcasting, RFID cards at 13.56 MHz
VHF and UHF30 MHz – 3 GHz10 m – 10 cmFM radio, television, mobile phones, GPS, Bluetooth, 2.4 GHz Wi-Fi
Microwave (SHF, EHF)3 – 300 GHz10 cm – 1 mm5 and 6 GHz Wi-Fi, satellite links, radar, 5G millimetre wave
Terahertz and infrared0.3 – 400 THz1 mm – 750 nmthermal cameras, remote controls, optical fibre at 1550 nm
Visible light400 – 750 THz750 – 400 nmdisplays, lighting, cameras
Ultraviolet750 THz – 30 PHz400 – 10 nmlithography for chips, sterilisation
X-rays and gamma raysabove about 30 PHzbelow 10 nmmedical imaging, inspection, astronomy

The boundaries are conventions. The radio part is organised by the International Telecommunication Union (ITU), whose Radio Regulations divide it into decade-wide bands (LF from 30 to 300 kHz, MF to 3 MHz, HF to 30 MHz, and so on up to EHF) and allocate them to services; the last lesson of this level returns to who decides.

The code above also printed the energy of one photon, hfhf, at each frequency. Breaking a chemical bond or knocking an electron off an atom takes from a few electronvolts to a few tens of electronvolts. A 2.45 GHz photon carries about 10−510^{-5} eV, hundreds of thousands of times too little, which is why radio waves and microwaves are called non-ionising: their effect on the body is heating, and international guidelines such as those of ICNIRP limit exposure far below the level at which heating matters. Ultraviolet, X-rays and gamma rays are ionising; that is why sunburn and medical X-rays are taken seriously in a way that Wi-Fi is not.

Note

Two safety rules follow from the physics. High-power radio equipment, microwave ovens and radar are shielded and certified because concentrated radio power heats tissue, so never open or modify them. And lasers concentrate visible or infrared light into a narrow beam: never point one at anyone's eyes, including your own. Everything in this lesson can be explored safely by simulation.

ComputationC

Simulating a wave: 1-D FDTD

Most real electromagnetic problems (an antenna on a phone, a connector on a circuit board, a waveguide on a photonic chip) have no closed-form solution, and engineers solve Maxwell's equations numerically. The most direct method is finite-difference time-domain (FDTD), introduced by Kane Yee in 1966: chop space into cells and time into steps, and replace each derivative with a difference.

Consider a wave travelling along zz with fields Ex(z,t)E_x(z, t) and Hy(z,t)H_y(z, t). In a material of permittivity ε=εrε0\varepsilon = \varepsilon_r\varepsilon_0, the two curl equations reduce to

∂Ex∂t=−1ε∂Hy∂z,∂Hy∂t=−1μ0∂Ex∂z.\frac{\partial E_x}{\partial t} = -\frac{1}{\varepsilon}\frac{\partial H_y}{\partial z}, \qquad \frac{\partial H_y}{\partial t} = -\frac{1}{\mu_0}\frac{\partial E_x}{\partial z}.

Yee's insight was to stagger the grid: store EE at whole cells and whole time steps, HH at half cells and half time steps. Then every difference is centred, accurate to second order, and the update is a leapfrog: new HH from the curl of EE (Faraday), then new EE from the curl of HH (Ampère–Maxwell). Measuring HH in units of 1/η01/\eta_0 and writing the Courant number S=c Δt/ΔzS = c\,\Delta t/\Delta z, the updates become

hk+12−=S (ek+1−ek),ek−=Sεr (hk+12−hk−12).h_{k+\frac12} \mathrel{-}= S\,(e_{k+1} - e_k), \qquad e_k \mathrel{-}= \frac{S}{\varepsilon_r}\,(h_{k+\frac12} - h_{k-\frac12}).

The program below runs these updates with S=0.5S = 0.5, so a wave moves half a cell per step. A soft source adds a Gaussian pulse to the field at cell 30, launching one pulse each way. The left edge absorbs whatever reaches it (a value copied from two steps earlier, which works because a wave crosses one cell in exactly two steps); the right edge is a perfect conductor, where ExE_x is forced to zero.

python
import numpy as np

# 1-D FDTD (Yee) in normalised units: H is measured in units of 1/eta0, so free space has
# impedance 1, and the Courant number S = c*dt/dz = 0.5: a wave moves half a cell per step.
N = 120                       # cells; a perfect conductor (E = 0) sits at the right-hand end
S = 0.5
ex = np.zeros(N)
hy = np.zeros(N)
left_history = [0.0, 0.0]     # E at cell 1, two steps ago and one step ago (absorbing left edge)

def show(step):
    chars = []
    for v in ex[::2]:             # every second cell, so a line is 60 characters wide
        chars.append("#" if v > 0.5 else "+" if v > 0.1 else "=" if v < -0.5 else "-" if v < -0.1 else ".")
    print(f"step {step:3d} |" + "".join(chars) + "|")

for step in range(1, 401):
    hy[:-1] -= S * (ex[1:] - ex[:-1])              # Faraday's law:      dH/dt from the curl of E
    ex[1:] -= S * (hy[1:] - hy[:-1])               # Ampere-Maxwell law: dE/dt from the curl of H
    ex[30] += np.exp(-0.5 * ((step - 40) / 8) ** 2)  # soft source: a Gaussian pulse added at cell 30
    ex[0] = left_history.pop(0)                    # absorbing boundary, suited to S = 0.5
    left_history.append(ex[1])
    ex[-1] = 0.0                                   # perfect electric conductor
    if step in (60, 120, 180, 230, 260, 300, 360):
        show(step)

peak = np.argmax(np.abs(ex))
print("after 400 steps the largest field is", round(float(ex[peak]), 3), "at cell", int(peak))
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Read the picture from top to bottom. At step 60 two pulses leave the source. The left one is swallowed by the absorbing edge without a trace by step 120, while the right one marches on, about 60 cells in 120 steps: half a cell per step, as S=0.5S = 0.5 demands. At step 230 it is hitting the conductor, and from step 260 on it comes back upside down (= and - are negative). A perfect conductor cannot sustain a tangential electric field, so the reflected wave must cancel the incident one at the wall: the reflection coefficient for EE is −1-1. A pulse on a short-circuited cable does exactly the same, as we will see in transmission lines.

Now a quantitative test. Fill the right part of the grid with a dielectric of relative permittivity εr\varepsilon_r (refractive index n=εrn = \sqrt{\varepsilon_r}). At a boundary between free space and the dielectric, matching the tangential fields on both sides gives a reflection coefficient Γ=(1−n)/(1+n)\Gamma = (1 - n)/(1 + n) and a transmission coefficient τ=2/(1+n)\tau = 2/(1 + n) for EE. Let us measure both. A probe behind the source records the left-going copy of the pulse (which is identical to the right-going one) and, much later, the reflection; a probe inside the dielectric records the transmitted pulse. Dividing the area under each pulse by the area of the incident one gives Γ\Gamma and τ\tau; areas are used rather than peak heights because numerical dispersion changes a pulse's shape but not its area.

python
import numpy as np

def slab_experiment(eps_r, N=400, steps=900, src=60, interface=200):
    """A pulse in free space meets a dielectric filling the cells from `interface` on.
    Probe A (cell 20) sees the left-going copy of the pulse, then the reflection;
    probe B (40 cells inside the dielectric) sees the transmitted pulse."""
    S = 0.5
    eps = np.ones(N)
    eps[interface:] = eps_r
    ex, hy = np.zeros(N), np.zeros(N)
    hist = [0.0, 0.0]
    probe_a, probe_b = [], []
    for n in range(steps):
        hy[:-1] -= S * (ex[1:] - ex[:-1])
        ex[1:] -= S / eps[1:] * (hy[1:] - hy[:-1])
        ex[src] += np.exp(-0.5 * ((n - 60) / 12) ** 2)
        ex[0] = hist.pop(0)
        hist.append(ex[1])
        probe_a.append(ex[20])
        probe_b.append(ex[interface + 40])
    a, b = np.array(probe_a), np.array(probe_b)
    incident = a[:400].sum()          # the left-going copy, identical to the pulse sent right
    reflected = a[400:].sum()
    transmitted = b.sum()
    return reflected / incident, transmitted / incident

print("eps_r    n   Gamma: sim  theory    tau: sim  theory")
for eps_r in [1.0, 2.25, 4.0, 9.0]:
    n = np.sqrt(eps_r)
    gamma, tau = slab_experiment(eps_r)
    gamma = round(gamma, 3) + 0.0     # + 0.0 turns -0.0 into 0.0
    print(f"{eps_r:5.2f} {n:4.1f} {gamma:11.3f} {(1 - n) / (1 + n):7.3f} {tau:10.3f} {2 / (1 + n):7.3f}")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

The simulation agrees with the theory to three decimal places. With εr=4\varepsilon_r = 4 (roughly glass or circuit-board laminate at radio frequencies) a third of the field amplitude is reflected, inverted, and two thirds is transmitted.

Two thirds plus a third is not one, so where did the energy go? Nowhere: intensity is proportional to nE2nE^2, not E2E^2, because the wave impedance of the dielectric is η0/n\eta_0/n. The reflected fraction of the power is Γ2=1/9\Gamma^2 = 1/9 and the transmitted fraction is nτ2=2×4/9=8/9n\tau^2 = 2 \times 4/9 = 8/9. They add up to one, as they must.

ExplanationH

The professional view

Engineers rarely write Maxwell's equations down at work, but they are behind almost every design decision above a few hundred megahertz.

  • Computational electromagnetics. FDTD, as above but in three dimensions, suits broadband and transient problems and runs well on GPUs; open-source examples are Meep and openEMS. The finite element method handles curved, detailed geometry such as connectors and packages, and the method of moments solves for currents on metal surfaces, which suits wire antennas and reflectors. Commercial suites bundle all three.
  • Electromagnetic compatibility (EMC). A product must neither emit too much radio noise nor be upset by its neighbours'. Limits are set by international committees (CISPR, part of the IEC) and national regulators, and products are tested in shielded, absorber-lined chambers. Faraday's law is the usual culprit: a fast-changing current loop on a circuit board is a small transmitting antenna.
  • Exposure and safety. Phones are tested for the specific absorption rate (SAR), the power absorbed per kilogram of tissue, against limits derived from the ICNIRP guidelines or national equivalents.
  • Higher frequencies, same equations. The photonic chips and optical interconnects of photonics obey the same Maxwell's equations at a wavelength of about a micrometre, and are designed with the same solvers.
History & global context

A short history

Michael Faraday discovered induction in London in 1831 and pictured "lines of force" filling space, without equations. James Clerk Maxwell turned the pictures into mathematics between 1861 and 1865, added the displacement current, and concluded in his 1865 paper that light is an electromagnetic disturbance. His version had twenty equations in twenty unknowns; in the 1880s Oliver Heaviside, a self-taught telegraph engineer, recast them as the four vector equations used today.

Heinrich Hertz generated and detected radio waves in Karlsruhe in 1887–88. In Kolkata in the mid-1890s, Jagadish Chandra Bose worked with waves only millimetres to centimetres long, building horn antennas still recognisable today. Alexander Popov in Russia and Guglielmo Marconi in Italy and Britain turned the waves into telegraphy, and Marconi's company sent signals across the Atlantic in 1901. Einstein's special relativity (1905) began from the fact that Maxwell's equations give the same cc for every observer.

Common misconceptionsH

Common misconceptions

Misconception

"In an electromagnetic wave, E and B are 90° out of phase, trading energy back and forth like a pendulum." In a travelling plane wave in free space they are in phase: both peak at the same place and time, and the energy flows steadily forward. The quarter-period trading picture describes standing waves, such as those in a cavity or on a shorted line, where the electric and magnetic energy do swap back and forth.

Misconception

"The displacement current is a current of charges hopping across the capacitor." No charge crosses the gap. The displacement current is a changing electric field, which produces the same magnetic field a real current would. It exists in perfect vacuum, which is exactly what lets light cross empty space.

Misconception

"Electromagnetic waves need a medium to travel in." Nineteenth-century physicists looked for that medium, the aether, and the Michelson–Morley experiment (1887) and its successors failed to find it. The fields themselves are the wave; nothing else needs to move.

Misconception

"Higher-frequency radio waves are dangerous in the same way as X-rays." What makes radiation ionising is the energy of a single photon, and a 28 GHz photon carries about 10−410^{-4} eV against the several electronvolts needed to break chemical bonds. Radio waves can heat tissue at high intensity, which is what exposure limits guard against; they cannot ionise it at any intensity.

Exercises

Exercises

1. Maxwell's equations and electromagnetic waves

Warm-upHuman

Suppose an experiment found a magnetic monopole: a particle from which magnetic field lines point outwards in every direction, the way electric field lines leave a positive charge. Which of Maxwell's equations would have to change?

Choose one

2. Maxwell's equations and electromagnetic waves

Warm-upHuman

Some Wi-Fi and drone video links use a carrier near 5.8 GHz. What is its wavelength in free space, in millimetres, rounded to the nearest whole number? Use c=299,792,458c = 299{,}792{,}458 m/s.

3. Maxwell's equations and electromagnetic waves

CoreHuman

A parallel-plate capacitor has square plates 10 cm by 10 cm, separated by 1 mm of air (εr≈1\varepsilon_r \approx 1). The voltage across it is rising at 10610^{6} V/s. What is the displacement current between the plates, in microamperes, to the nearest whole number? Use ε0=8.854×10−12\varepsilon_0 = 8.854\times10^{-12} F/m and ignore fringing.

4. Maxwell's equations and electromagnetic waves

CoreHuman

Far from a broadcast transmitter, the signal is a plane wave with an average intensity of 0.5 mW/m². What is the amplitude E0E_0 of its electric field, in millivolts per metre, to the nearest whole number? Use η0=376.73 Ω\eta_0 = 376.73\ \Omega.

5. Maxwell's equations and electromagnetic waves

CoreHuman

For a plane electromagnetic wave travelling through empty space, which statements are true? Select all that apply.

Choose all that apply

6. Maxwell's equations and electromagnetic waves

CoreComputational

A wave travelling along zz has components Ex=acos⁡(ωt−kz)E_x = a\cos(\omega t - kz) and Ey=bcos⁡(ωt−kz+ϕ)E_y = b\cos(\omega t - kz + \phi), with amplitudes a,b≥0a, b \ge 0 (not both zero) and phase difference ϕ\phi in radians.

Write polarisation(a, b, phi) that returns "linear", "circular" or "elliptical". Remember that phases are only defined modulo 2π2\pi, and compare floating-point numbers with a small tolerance (say 10−910^{-9}), not with ==.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

7. Maxwell's equations and electromagnetic waves

StretchComputational

Complete the FDTD program from the lesson. The function fdtd_pulse(n_cells, n_steps, src, S) should, at every time step:

  1. update hy[:-1] from the differences of neighbouring ex values (Faraday's law), then
  2. update ex[1:] from the differences of neighbouring hy values (the Ampère–Maxwell law),

using the normalised Yee updates with Courant number S in free space (εr=1\varepsilon_r = 1). The source and the perfect-conductor ends are already written. The tests check that pulses move at S cells per step in both directions, that the result is symmetric about the source, and that a pulse comes back inverted from a conductor.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Further reading and resources