Toy model

Maxwell

Maxwell's equations in vacuum for electromagnetic field evolution.

Overview

This model simulates the propagation of electromagnetic waves in vacuum

using Maxwell's equations without sources. It uses a finite element exterior calculus (FEEC) formulation with the electric field in H(curl) and the magnetic field in H(div) spaces.

Use cases

Propagation of electromagnetic waves in vacuum.

Governing equations

PDEs solved by model:

Ampère's law (no current):

Faraday's law:

Normalization

Velocity and fields are normalized as:

where is the speed of light.

Discretization

Time integration is performed by the following propagators (in sequence):
  1. MaxwellWeakAmpere

Diagnostics

The following scalars are tracked during simulation:

  • Electric energy:
  • Magnetic energy:
  • Total energy:

Examples

Figure from the Coaxial waveguide example

Coaxial waveguide

An exact electromagnetic mode between two concentric conducting cylinders rotates around the annulus. Struphy's structure-preserving Maxwell solver reproduces its shape, its frequency and the conservation of its energy. With F(r)=J3(r)−0.28Y3(r)F(r)=J_3(r)-0.28Y_3(r), the initial mode is Er=−3F(r)rcos⁡(3θ),Eθ=F′(r)sin⁡(3θ),Bz=F(r)cos⁡(3θ),E_r=-\frac{3F(r)}{r}\cos(3\theta),\qquad E_\theta=F\prime(r)\sin(3\theta),\qquad B_z=F(r)\cos(3\theta), between r=2.326744r=2.326744 and r=3.686839r=3.686839; J3J_3 and Y3Y_3 are Bessel functions.

Figure from the Maxwell cavity resonances example

Maxwell cavity resonances

Noise in the electric field excites every electromagnetic mode of a rectangular periodic box. The power spectrum of the field over time has one peak per resonance, at the exact frequencies ω = c |k| of the box. The launch uses EzE_z coefficient noise of amplitude 0.10.1 and B(x,y,0)=0\mathbf{B}(x,y,0)=0. The periodic box selects kmn=2π(mLx,nLy),(Lx,Ly)=(1,1.5),\mathbf{k}_{mn}=2\pi\left(\frac{m}{L_x},\frac{n}{L_y}\right),\qquad (L_x,L_y)=(1,1.5), for integer mode numbers m,nm,n.

Figure from the Electromagnetic pulse on a distorted mesh example

Electromagnetic pulse on a distorted mesh

A Gaussian pulse of the electric field spreads as a ring across a periodic box, on a mesh that the Colella mapping has bent. The structure-preserving Maxwell solver keeps the energy constant and follows the exact solution, which is a sum of cosine modes. The initial pulse is a truncated, zero-mean Gaussian Fourier expansion: Ez(x,y,0)=∑0≤l,m≤6(l,m)≠(0,0)almcos⁡[kl(x−1)]cos⁡[qm(y−1.5)],E_z(x,y,0)=\sum_{\substack{0\le l,m\le6\\(l,m)\ne(0,0)}}a_{lm}\cos[k_l(x-1)]\cos[q_m(y-1.5)], where kl=πlk_l=\pi l, qm=2πm/3q_m=2\pi m/3 and alm=(2−δl0)(2−δm0)(2πσ2/6)e−σ2(kl2+qm2)/2a_{lm}=(2-\delta_{l0})(2-\delta_{m0})(2\pi\sigma^2/6)e^{-\sigma^2(k_l^2+q_m^2)/2}. The width is σ=0.25\sigma=0.25, δij\delta_{ij} is the Kronecker delta, and the magnetic field starts at zero.

Figure from the Structure preservation in time integration example

Structure preservation in time integration

One standing electromagnetic wave, stepped by Crank-Nicolson, RK4 and Heun's method at the same time step. The symplectic implicit scheme keeps the energy error bounded for the whole run, while the explicit schemes do not: RK4 loses energy steadily, and Heun's method is unstable for this operator. All three runs start from E(z,0)=(0.1sin⁡(πz/5),0,0),B(z,0)=0,\mathbf{E}(z,0)=(0.1\sin(\pi z/5),0,0),\qquad \mathbf{B}(z,0)=0, with periodic length Lz=20L_z=20 and time step Δt=0.25\Delta t=0.25 in units where c=1c=1.

Figure from the Maxwell light-wave dispersion example

Maxwell light-wave dispersion

Excite a broadband electric field and recover the vacuum dispersion relation ω = ck with Struphy’s FEEC Maxwell solver. The two transverse electric components start with coefficient-noise amplitude A=0.1A=0.1, while B(z,0)=0\mathbf{B}(z,0)=0. On the periodic interval Lz=20L_z=20, the allowed wavenumbers are kn=2πn20,n∈Z.k_n=\frac{2\pi n}{20},\qquad n\in\mathbb{Z}.