Sitemap
Press enter or click to view image in full size
This figure describes the continuous geometric Maxwell numerical artifacts when they are discretized. The continuous formulation preserves the coordinate-free relation ∇F=J and the exact identity d²=0, yielding the homogeneous and inhomogeneous Maxwell equations with smooth derivative fields. Discretization replaces the continuous operators by discrete approximations, represented here by a physically fragmented surface. Three representative structure-violation artifacts are illustrated: (1) spurious magnetic charge from ∇h ⁣⋅Bh≠0, (2) distorted Faraday induction from an imperfect discrete induction relation, and (3) electric Gauss-law drift from ∇h ⁣⋅Eh≠ρh. These examples illustrate how numerical artifacts can be interpreted as signatures of geometric structure lost during discretization.

From Field Theory Equations to Numerical Artifacts

11 min readSep 19, 2026

--

What happens when continuous physics enters a computer

In its purest coordinate-free form, classical electromagnetism is not a sprawling list of vector calculus identities; it is encoded in a single, remarkably compact geometric law. This unified formulation captures the entire physical architecture in one stroke, treating electric and magnetic fields as integral components of a single spacetime object without needing to choose specific axes, grids, or preferred observers. Yet, a computer cannot directly process continuous field theories. To run an electromagnetic simulation, we must translate the continuous language of calculus into discrete machine language — converting smooth fields and derivatives into grids, matrices, finite-difference stencils, and step-by-step update rules. That translation inevitably creates numerical artifacts. While some errors are merely the unavoidable cost of finite spatial and temporal resolution, others are far more revealing: they signal that our discrete model has broken a fundamental identity, symmetry, or conservation law that remains exact in the continuous physical world. The useful question is therefore not just:

“How accurate is the numerical solution?”

It is also:

“Which geometric and physical structures survived the translation into software?”

In this article, which is based on a recent research note, we begin with Maxwell’s theory in its compact geometric form, trace how it unfolds into the familiar four-equation system and use that structural backbone to systematically categorize the numerical artifacts that affect electromagnetic simulations [1].

Maxwell’s equations before the split

In spacetime algebra, Maxwell’s equations can be written as one geometric relation:

Here:

  • F is the electromagnetic field bivector, containing the electric and magnetic fields.
  • ∇ is the spacetime derivative.
  • J is the four-current, containing charge density and electric-current density.

In differential-forms notation, the same physical content is usually written as two compact equations:

dF = 0

d⋆F = J

Here:

  • F is the Faraday 2-form.
  • d is the exterior derivative.
  • ⋆ is the Hodge-star operator.
  • J is the current 3-form.

Here J is taken to be the current 3-form. In conventions that represent the current as a 1-form, the second equation is written using the codifferential, d†F = j; signs may vary with metric and orientation conventions. These formulations are coordinate-free. They do not begin by selecting Cartesian axes, a mesh, or even a preferred observer. The electric field and magnetic field appear as parts of one spacetime object rather than as two independently primary fields.

How one law becomes four equations

Once we choose an inertial observer and perform a space–time split, the compact geometric law becomes the familiar Maxwell system.

In these equations:

  • E is the electric field.
  • B is the magnetic field.
  • ρ is charge density.
  • J is current density.
  • ∇ · denotes divergence.
  • ∇ × denotes curl.

For compactness, this form absorbs constitutive factors. In SI units, the equations include ε₀, μ₀, and c in the usual places.

The four equations divide naturally into two pairs:

Press enter or click to view image in full size

This is more than a compact rewriting. The geometric expression reveals relations between the equations that are less apparent in the component form.

The identity that holds everything together

A defining identity of differential forms is:

d² = 0

This means that applying the exterior derivative twice always gives zero.

In ordinary vector-calculus language, it contains identities such as:

∇ × (∇φ) = 0

and

∇ · (∇ × A) = 0

where φ is a scalar field and A is a vector potential.

If the electromagnetic field is derived locally from a potential A, then:

F = dA

and therefore:

dF = d(dA) = d²A = 0

The homogeneous Maxwell equations are thus automatically satisfied when the field is represented in this way.

The same identity leads to charge conservation. Starting from:

d⋆F = J

and applying d gives:

dJ = 0

After a space–time split, that becomes:

∂ρ/∂t + ∇ · J = 0

This is the continuity equation: charge cannot be created or destroyed by the field evolution. The key lesson is that Maxwell’s equations are not merely four differential equations. They are tied together by exact geometric identities.

What a computer actually does

A computer replaces the continuum by a finite collection of degrees of freedom. For example:

  • Electric-field components may live on mesh edges.
  • Magnetic-field components may live on mesh faces.
  • Charge may live in cells or be carried by particles.
  • Derivatives become finite-difference stencils, matrices, or weak operators.
  • Integrals become sums or quadrature rules.
  • Time evolution becomes a sequence of updates.

Symbolically, the continuous operators become discrete ones:

d → dₕ

⋆ → ⋆ₕ

∇ → ∇ₕ

The subscript h denotes a mesh scale or a discrete approximation. This is the moment when numerical artifacts enter. They fall into two broad classes.

Two classes of numerical artifacts

1. Resolution-limited effects

These arise because the simulation has finite spatial and temporal resolution. They include:

  • Numerical dispersion
  • Grid anisotropy
  • Finite spectral bandwidth
  • Aliasing

They are usually reduced by mesh refinement, higher-order approximation, adaptive resolution, filtering, or a different representation such as a spectral method.

2. Structure-violation defects

These occur when the discrete operators fail to preserve a property that is exact in the continuous theory.

Examples include:

  • Failure to preserve ∇ · B = 0
  • Drift in Gauss’s law ∇ · E = ρ
  • Failure of discrete charge conservation
  • Spurious eigenmodes
  • Artificial energy gain or loss
  • Long-time instability

These are not always cured simply by using a finer mesh. They may require a different discrete representation or a structure-preserving numerical scheme.

Artifact 1: spurious magnetic charge

The continuous magnetic constraint is:

∇ · B = 0

A discrete simulation may instead produce:

∇ₕ · Bₕ ≠ 0

This behaves as if the code had created artificial magnetic monopoles.

In a field-only calculation, the defect may appear as a constraint error. In particle–field and plasma calculations, it can generate unphysical forces and contaminate long-time dynamics.

Why does this happen?

In the continuous theory:

d² = 0

A compatible discrete scheme aims to preserve the corresponding identity:

dₕ² = 0

For compatible discretizations — such as discrete exterior calculus, finite-element exterior calculus, or suitably staggered schemes — the discrete exterior derivative is constructed so that dₕ² = 0 exactly:

Bₕ = dₕAₕ

then:

dₕBₕ = dₕ(dₕAₕ) = dₕ²Aₕ = 0

The magnetic-divergence constraint then holds exactly at the algebraic level, up to machine round-off.

This is one reason that staggered Yee grids, discrete exterior calculus, and compatible finite-element formulations are important. Their field placement and discrete operators are designed so that the topological structure of the continuous equations survives discretization.

Artifact 2: distorted Faraday induction

Faraday’s law is:

Get Ahmed M. Hala’s stories in your inbox

Join Medium for free to get updates from this writer.

∇ × E + ∂B/∂t = 0

A numerical method may enforce a discrete update relation that resembles this equation while still producing an imperfect approximation of the actual continuum dynamics.

The consequences can include:

  • Incorrect phase accumulation
  • Wave propagation at the wrong speed
  • Distorted inductive coupling
  • Inaccurate exchange of energy between E and B

Finite-difference time-domain methods, for example, build Faraday’s law directly into the update rule. But the resulting discrete waves usually remain dispersive and anisotropic.

A structure-preserving method can maintain the algebraic relation between discrete fields while still exhibiting finite-resolution errors through the representation of metric-dependent quantities, material properties, or the discrete Hodge-star operator. Preserving topology does not automatically remove all approximation error.

Artifact 3: drift in electric Gauss’s law

The electric Gauss law is:

∇ · E = ρ

A discrete simulation can violate it:

∇ₕ · Eₕ ≠ ρₕ

This often arises when the field solver, charge deposition, current deposition, and time-update rule are not mutually compatible.

The effects can be serious:

  • Spurious charge accumulation
  • Artificial self-force on simulated particles
  • Secular growth of constraint error
  • Instability in particle-in-cell simulations

The underlying continuous conservation law is:

∂ρ/∂t + ∇ · J = 0

In a numerical model, the charge update and current deposition must satisfy an equivalent discrete continuity equation. If they do not, the field solver may no longer preserve Gauss’s law even if the initial condition was correct.

Common remedies include:

  • Charge-conserving current deposition
  • Divergence cleaning
  • Projection methods
  • Compatible finite-element spaces
  • Gauge-invariant discrete-action methods
  • Variational particle–field formulations

The best approach depends on the application, but the central principle is the same: Gauss’s law should be built into the discrete architecture, not merely corrected after drift becomes visible.

Artifact 4: numerical dispersion and anisotropy

In vacuum, continuum electromagnetic waves satisfy:

ω² = c²k²

where:

  • ω is angular frequency,
  • k is wavenumber,
  • c is the speed of light.

A discrete scheme generally satisfies a modified relation instead:

ωₕ = ωₕ(k, Δx, Δt, direction, scheme)

The exact formula depends on the method. The important point is that the numerical wave speed may depend on wavelength and direction.

This produces numerical dispersion:

  • Different wavelengths travel at different numerical phase velocities.
  • The simulated wave can lag behind or outrun the physical wave.
  • Group velocity can also be incorrect.

It also produces grid anisotropy:

  • A wave moving along a coordinate axis may propagate differently from a wave moving diagonally.
  • The mesh has preferred directions even when the physical vacuum does not.

These effects are broadly associated with finite resolution. They can be reduced, but not usually eliminated, by:

  • Smaller Δx
  • Smaller Δt
  • Higher-order finite differences
  • Higher-order finite elements
  • Spectral or pseudo-spectral methods
  • Better mesh design
  • Adaptive refinement

Structure-preserving methods help maintain constraints and invariants, but they do not automatically make the discrete wave relation identical to the continuum one.

Artifact 5: spurious modes

The continuous curl–curl operator has a physical spectrum of electromagnetic modes. It also has gauge-related null directions that should not generate independent physical waves. A poor discrete representation can introduce modes that have no physical continuum counterpart.

These may appear as:

  • False cavity resonances
  • Unphysical standing waves
  • Artificial zero modes
  • Slowly drifting fields
  • Unstable growing modes

This is often called spurious-mode contamination or spectral pollution. The issue is strongly scheme dependent. Node-based finite elements can be problematic for electromagnetic vector fields because they may not represent the kernel of the curl operator correctly. Edge elements, such as Nédélec elements, are designed to be curl-conforming and to preserve the appropriate field continuity.

Compatible finite elements, finite-element exterior calculus, and discrete exterior calculus aim to reproduce the underlying de Rham structure:

with discrete analogues that preserve the correct relations between kernels and images. This matters because a spurious mode is not merely a coarse approximation of a real wave. It can be a numerical degree of freedom that should not exist at all.

Artifact 6: energy drift and long-time behavior

For a lossless electromagnetic system, the continuous energy balance is:

The left side is the rate of change of electromagnetic field energy. The right side is the power transferred to matter.

A numerical calculation may exhibit:

  • Secular energy drift
  • Artificial heating
  • Artificial damping
  • Momentum drift
  • Slow growth of constraint errors

These problems matter most in long integrations. An error that appears tiny per time step can accumulate until it alters the qualitative physics.

Different scheme families preserve different features:

Press enter or click to view image in full size

No method is universally best. The relevant question is which structure is indispensable for the physical regime being simulated.

A compact diagnostic catalog

Press enter or click to view image in full size

A practical way to diagnose a simulation

When a numerical electromagnetic result looks suspicious, it helps to ask these questions in order:

  1. Is the phenomenon physically resolvable?
    Compare its wavelength, time scale, and spatial scale with the mesh and time step.
  2. Does the scheme preserve the discrete magnetic constraint?
    Check whether:

is satisfied to round-off or merely approximately.

3. Is discrete charge continuity satisfied?
Check whether the source update obeys a discrete form of:

4. Is the observed feature a physical mode or a spurious eigenmode?
Examine convergence under mesh refinement and compare against the expected curl–curl spectrum.

5. Is energy behavior consistent with the intended physics?
Separate physical power transfer from numerical heating, damping, and drift.

6. Which continuous structure is being preserved?
Look beyond formal order of accuracy. Ask whether the method preserves divergence constraints, gauge structure, charge continuity, energy balance, or Hamiltonian geometry.

The main point

Numerical artifacts are not all “just error.” Some are inevitable consequences of finite resolution. Others are diagnostic signals that a discrete representation has broken a geometric relation that the continuous theory enforces exactly. Starting from the coordinate-free Maxwell equation makes this visible:

Press enter or click to view image in full size

or, equivalently,

From these compact relations emerge the four Maxwell equations, the divergence constraints, charge conservation, and the structural identities that connect them. A numerical method should therefore be judged not only by how closely it approximates each equation at a single time step, but also by which geometric and physical structures it preserves over the entire computation. That is the difference between treating a simulation as a sequence of numbers and treating it as a discrete realization of mathematical physics.

Conclusion: Diagnosing Broken Geometry

When running electromagnetic simulations, it is tempting to view every numerical discrepancy simply as routine error to be driven down by refining the mesh. However, looking at electromagnetism through a structural lens reveals a crucial distinction between two types of numerical issues:

  1. Resolution-limited effects — such as numerical dispersion, grid anisotropy, and aliasing — are generic consequences of attempting to represent an infinite continuous spectrum using a finite computational grid.
  2. Structure-violation defects — such as artificial magnetic charge accumulation, electric charge drift, and spurious nonphysical modes — are architectural failures. They occur when discrete operators fail to preserve fundamental algebraic identities, topology, or exact conservation chains present in the continuum.

The encouraging takeaway is that structure-violating artifacts are largely avoidable. By choosing compatible discretizations — such as discrete exterior calculus, edge-conforming vector elements, staggered grids, or variational energy-preserving integrators — we can embed the core topological and geometric constraints of mathematical physics directly into the software’s architecture.

Ultimately, evaluating a numerical scheme requires looking beyond short-term mathematical accuracy. The true test of a simulation is whether its discrete operations honor the geometric identities that keep the continuous physical world coherent over time. When a code exhibits unphysical behavior, don’t just add more grid points — ask which continuous structure was lost in translation.

— — —

[1] Ahmed M. Hala “From a Single Geometric Maxwell Law to Numerical Artifacts: A Structure-Based Catalog” (2026) https://doi.org/10.5281/zenodo.22847730.

--

--