Wave 1D (wave_1d)
The wave equation is the non-dissipative counterweight to
heat_1d. Nothing decays: energy is conserved, every mode keeps
its amplitude and only turns its phase, and the solution at time \(T\) carries
exactly as much fine structure as the initial condition did. Operators trained
against diffusive targets often have a quiet low-pass bias, and this is the
model that finds it.

wave_1d): a single localised bump splits into left- and right-going characteristics that pass through each other.Equation
integrated as the first-order system
with periodic boundary conditions. The initial velocity is zero, so the initial displacement splits evenly into two counter-propagating halves.
Operator learning task
Parameters
| Parameter | Default | Range | Description |
|---|---|---|---|
wave_speed |
1.0 | (0.1, 10.0) | Propagation speed \(c\) |
time_end |
2.0 | (0.1, 20.0) | Final time \(T\) |
As with advection, only \(cT\) matters for where the waves end up; the two parameters are one knob wearing two labels.
Usage
from pdeforge import generate_dataset
dataset = generate_dataset(
model="wave_1d",
n_samples=1000,
resolution={"x": 256},
params={"wave_speed": 1.0, "time_end": 2.0},
seed=42,
)
Solver
Pseudo-spectral in space, with the first-order system integrated in time by
SciPy's adaptive odeint. Energy is therefore conserved to the integrator's
tolerance rather than exactly, so on long horizons check the energy drift
before trusting the tail of a trajectory. wave_2d applies the
exact spectral propagator instead, with no time-stepping error at all.
Behaviour
On the periodic box the two halves wrap around and re-collide, and because the equation is linear they pass straight through each other with no interaction. Long horizons therefore do not simplify the problem the way they do for the heat equation; they only rearrange it.
Data shapes
Related
wave_2d: the same model on the square.heterogeneous_wave_2d: the medium becomes the input, which turns this into an inverse-problem-shaped task.advection_1d: one characteristic instead of two.