Papers
Topics
Authors
Recent
Search
2000 character limit reached

Learned Energy-Constrained Stencils

Updated 13 January 2026
  • The paper presents a novel data-driven approach that learns convolution stencils subject to skew-adjoint constraints to preserve discrete electromagnetic energy.
  • It formulates the stencil learning as a convex quadratic program with rigorous linear and box constraints, ensuring energy conservation under Crank–Nicolson schemes.
  • Numerical tests demonstrate that learned stencils maintain energy invariants to machine precision while matching or slightly improving accuracy compared to classical central-difference methods.

Energy-constrained learned stencils are data-driven spatial discretizations tailored for the one-dimensional Maxwell system that preserve discrete electromagnetic energy through explicit enforcement of skew-adjointness. These stencils are designed by learning convolution operators from high-fidelity spectral data, subject to rigorous linear constraints that guarantee exact conservation properties under implicit time discretization schemes such as Crank–Nicolson. The approach connects data-driven numerical methods with the classical structure-preserving finite-difference time-domain (FDTD) paradigm by marrying data fit with structural constraints that ensure energy conservation at the semi-discrete level (Obieke, 5 Jan 2026).

1. Formulation of the Data-Driven Stencil Learning Problem

Let wR2R+1w \in \mathbb{R}^{2R+1} denote the convolution stencil weights representing the discrete spatial derivative, with support width RR. The learning problem is formulated as a convex quadratic program:

minwR2R+1    12Awb22+λ2w22\min_{w \in \mathbb{R}^{2R+1}} \;\; \frac{1}{2}\|A w - b\|_2^2 + \frac{\lambda}{2}\|w\|_2^2

subject to

Cw=d,MwM,    =R,,+RC w = d, \qquad -M \leq w_\ell \leq M, \;\; \ell=-R,\ldots,+R

Here, AA is the design matrix that compiles all sliding window patches from training data for EE and HH fields, bb contains target temporal derivatives, and λ\lambda implements Tikhonov regularization. The linear constraint Cw=dCw=d enforces discrete skew-adjointness via

  • w0=0w_0 = 0
  • w+w+=0w_{-\ell} + w_{+\ell} = 0 for =1,,R\ell = 1,\ldots,R

This is both necessary and sufficient for a discrete operator DD to satisfy Du,v=u,Dv\langle Du, v \rangle = -\langle u, Dv \rangle in the grid L2L^2 inner product. The box constraints wM|w_\ell| \leq M bound the coefficients.

2. Skew-Symmetric Convolutions and Discrete Energy Conservation

Consider the semi-discrete Maxwell system on a uniform grid with NN points and mesh spacing Δx\Delta x:

tE=DH,tH=DE\partial_t E = D H, \qquad \partial_t H = D E

where DD is the convolution operator defined by learned stencil ww. The discrete electromagnetic energy is

E(t)=12E(t)2+12H(t)2\mathcal{E}(t) = \frac{1}{2}\|E(t)\|^2 + \frac{1}{2}\|H(t)\|^2

Differentiation yields

ddtE(t)=DH,E+DE,H\frac{d}{dt}\mathcal{E}(t) = \langle D H, E \rangle + \langle D E, H \rangle

If DD is skew-adjoint (DT=DD^T = -D), the two terms cancel exactly, so dE/dt=0d\mathcal{E}/dt = 0: the discrete system preserves electromagnetic energy identically. This condition is extended to Crank–Nicolson time stepping: the implicit midpoint update

Un+1UnΔt=AUn+1+Un2\frac{U^{n+1} - U^n}{\Delta t} = A \frac{U^{n+1} + U^n}{2}

for

A=(0D DT0),AT=A,Un=(Hn,En)TA = \begin{pmatrix} 0 & D \ D^T & 0 \end{pmatrix}, \qquad A^T = -A, \qquad U^n = (H^n, E^n)^T

ensures

En+1=En,n\mathcal{E}^{n+1} = \mathcal{E}^n, \quad \forall n

by virtue of the skew-adjointness constraint. Thus, discrete energy is conserved to machine precision.

3. Fourier Symbol, Numerical Wave Speed, and CFL Condition

The periodic convolution stencil has the Fourier symbol

μ(θ)=k=RRwkeikθ,θ[π,π]\mu(\theta) = \sum_{k=-R}^{R} w_k\,e^{ik\theta}, \qquad \theta \in [-\pi, \pi]

This symbol determines the eigenvalues for each mode as λ(θ)=±iμ(θ)\lambda(\theta) = \pm i |\mu(\theta)|, and therefore the numerical wave speed

c(θ)=μ(θ)c(\theta) = | \mu(\theta) |

The maximum wave speed cmaxc_{\max} is

cmax=maxθ[π,π]μ(θ)c_{\max} = \max_{\theta \in [-\pi, \pi]} | \mu(\theta) |

When using explicit time-stepping (e.g., the leapfrog scheme), the CFL condition for stability is

Δt2cmax\Delta t \leq \frac{2}{c_{\max}}

The learned stencil’s Fourier symbol therefore sets both propagation speeds and stability boundaries in the discrete solver.

4. Comparison of Convex Optimization Solvers

Several convex solvers are evaluated for the quadratic program:

  • Projected Gradient (PG) and Nesterov-Accelerated Gradient (NAG): Solve equality-constrained problems with updates projected onto Cw=dCw=d. They enforce constraints to machine precision (residual 1016\lesssim 10^{-16}) and are computationally inexpensive, but for larger stencil radii RR, they plateau at suboptimal objective values.
  • ADMM (Alternating Direction Method of Multipliers): Employs variable splitting (w=zw=z), accomplishing constraint fulfillment in ww-updates and box clipping in zz-updates. ADMM reaches the same objective as interior-point solvers in 1–2 iterations, equality violations 1013\lesssim 10^{-13}, and data-fit error remains low as RR increases.
  • Interior-Point (CVXPY+SCS): Used as a reference; achieves lowest objectives nearly identical to ADMM to 6–7 digits, with residuals 107\lesssim 10^{-7}, but incurs higher runtime.

Numerical tests for R=1R=1 (with Δx=1/64\Delta x=1/64) yield stencils [32.906114,0,+32.906114]\approx [-32.906114, 0, +32.906114] (compared to exact centered-difference [32,0,+32][-32,0,+32]), and all methods deliver final-time electric-field L2L^2 error 5×103\approx 5 \times 10^{-3}. For R2R \geq 2, PG and NAG errors rise to O(1)O(1), while ADMM and CVX remain at (3\approx (36)×1036) \times 10^{-3}.

5. Discrete Energy Conservation under Crank–Nicolson Schemes

Crank–Nicolson applied to dU/dt=AUdU/dt = A U with AT=AA^T = -A yields an update that preserves the discrete energy invariant:

Un+1UnΔt=AUn+1+Un2\frac{U^{n+1} - U^n}{\Delta t} = A\,\frac{U^{n+1}+U^n}{2}

Defining En=12Un22\mathcal{E}^n = \frac{1}{2}\|U^n\|_2^2, the update guarantees

En+1En=0\mathcal{E}^{n+1} - \mathcal{E}^n = 0

Numerically, the drift after Nt=300N_t = 300 CN steps with Δt=0.5Δx\Delta t = 0.5 \Delta x is EnE01014|\mathcal{E}^n - \mathcal{E}^0| \lesssim 10^{-14} for both learned and standard stencils, matching machine roundoff.

6. Quantitative Comparison with Classical Central-Difference Stencils

For a grid spacing Δx=1/64\Delta x=1/64 and R=1R=1:

  • Centered-Difference Stencil: wCD=[1/(2Δx),0,+1/(2Δx)]=[32,0,+32]w_\text{CD} = [-1/(2\Delta x),0,+1/(2\Delta x)] = [-32,0,+32]
  • Learned Energy-Constrained (ADMM): w=[32.906114,0,+32.906114]w = [-32.906114,0,+32.906114]; observed cmax=32.906114c_\text{max}=32.906114 (vs. $32$ for CD)
  • Electric Field L2L^2 Error: errCD5.05×103\text{err}_\text{CD} \approx 5.05 \times 10^{-3}; errlearned5.12×103\text{err}_\text{learned} \approx 5.12 \times 10^{-3}
  • Discrete Energy Drift: maxnEnE01014\max_n |\mathcal{E}^n - \mathcal{E}^0| \lesssim 10^{-14}

For wider stencils (R>1R > 1), learned stencils produce accuracy at least comparable to central differences for R=1R=1 and show modest improvement for R>1R>1, all while exactly preserving energy under CN.

7. Structural Significance and Implications

Energy-constrained learned stencils provide a framework that bridges traditional structure-preserving discretizations and modern data-driven schemes. By learning spatial discretizations subject to essential physical constraints, the methodology enables exact conservation of semi-discrete invariants while leveraging training data for enhanced accuracy. The Fourier analytic characterization links the learned stencil to propagation and stability traits, and efficient convex solvers enable practical deployment in simulation pipelines. A plausible implication is the extension of such physically-constrained learning approaches to broader PDE classes, where invariants such as energy, mass, or momentum are fundamental.

For implementation details and further mathematical development, see "Energy Conserving Data Driven Discretizations for Maxwells Equations" (Obieke, 5 Jan 2026).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Energy-Constrained Learned Stencils.