← tomás.erdmannsdörffer ● live race · pure JS, no libraries

Neural operator vs. numerical solver.

Two algorithms, same PDE, same starting gun. The finite-difference solver (left, teal) crawls timestep by timestep, the way numerical codes have for decades. The operator surrogate (right, coral) jumps straight from initial condition to any time t in one shot. Same answer to within a couple percent, watch which one finishes. This is the story neural operators (FNO, DeepONet) tell, and why they're one of the hottest directions in scientific ML.

Burgers equationCole-Hopf operator Finite differenceCFL-bounded mode truncationzero backend
▸ Finite-difference solver
explicit Euler · central differences · CFL-bounded Δt
idle
step
-
sim t
-
compute ms
-
◆ Operator surrogate
Cole-Hopf → heat eq. in Fourier modes · evaluate any t directly
idle
setup ms
-
eval ms
-
total ms
-
speedup
-
accuracy
press race to find out
After the race, the solver's final answer is overlaid (dashed) on the operator's, they should sit on top of each other.

What you're actually watching

Both sides solve the 1D viscous Burgers equation, the canonical nonlinear PDE benchmark mixing advection and diffusion:

∂u/∂t + u · ∂u/∂x = ν · ∂²u/∂x²    x ∈ [0, 1], periodic

the solver (left)

Classical explicit finite differences. The CFL stability condition forces tiny timesteps, for ν = 0.02 at Nx = 256 that's thousands of sequential steps to reach t = 0.5, and you can't compute step n before step n−1 exists. The animation deliberately shows the time-marching.

the operator (right)

Burgers admits the Cole-Hopf transformation: substitute u = −2ν·φₓ/φ and φ obeys the linear heat equation, which is diagonal in Fourier space, every mode just decays exponentially. So the "operator" maps the initial condition to its spectral coefficients once, and evaluating the solution at any time t is a single O(Nx·K) pass. No time marching at all.

φ̂(t, k) = φ̂(0, k) · e^(−ν(2πk)²t)   →   u(t, x) = −2ν · φₓ/φ

why this is the neural-operator story

A neural operator like FNO (Li et al., 2021) does conceptually the same thing, it learns a map from initial conditions to solutions, parameterized in frequency space, for problems where no analytic transform exists (Navier-Stokes, Darcy flow, weather). Trained once on solver outputs, then deployed at constant inference cost. Published FNO speedups reach 1000×+; what you measure here is the same structural advantage in its purest form.

Honest framing. The right-hand racer is not a trained neural network, it's the exact Cole-Hopf operator. Deliberate choice: training a real FNO and shipping weights would add days of GPU time without changing the visual story, and the analytic operator makes the accuracy comparison clean. A real FNO replaces the analytic step with a learned one. Same architecture concept, same punchline.

try this