Roughening of a stochastic Kuramoto–Sivashinsky interface¶
The height equation amplifies long waves, damps short ones and couples them through a squared-gradient term. The mean is unforced. Runtime depends on the machine. The default runs in a few minutes or less. Set EXPONAX_SPDE_PRESET=smoke for a shorter diagnostic. Figures are written only if SAVE_FIGURES is enabled.
Exact law: linear finite-time structure factor¶
Switch off the squared-gradient term. With unit second- and fourth-derivative scales the linear symbol is \(L_k=|k|^2-|k|^4\). From zero, the raw FFT power is \(N\sigma^2q_k \int_0^T\exp(2L_ks)\,ds/\Delta x\). For interior 1-D modes the package structure factor multiplies this power by \(4/N^2\). The exact target is \(4\sigma^2q_k(\exp(2L_kT)-1)/(2L_k\, L)\) on a domain of length \(L\). The expression extends to \(L_k=0\) by the time factor \(T\). Check one growing and one damped mode. Each squared circular modulus has CV 1, so 1,600 independent terminal draws plan for a 2.5% relative SE.
PASS | linear KS mode 1 (unstable) | 0.009694204 ± 0.00024 SE | target 0.00989058 | 0.82 SE | relative SE 2.48% PASS | linear KS mode 3 (damped) | 0.001362933 ± 3.5e-05 SE | target 0.001401897 | 1.13 SE | relative SE 2.54%
DIAGNOSTIC: interface growth and late-time widths¶
The width is the RMS height about each path's spatial mean. For growth, use \(N=8192\), \(L=N\pi/4\), \(h=0.125\), \(T=2000\) and 64 independent paths, with a predeclared fit from \(t=300\) to \(2000\) after the KS transient. For pre-asymptotic roughness, compare the final-quarter widths of the four smaller boxes at the same grid spacing. Whole-path bootstrap intervals retain temporal dependence within each path.
In 1+1 dimensions KPZ predicts growth and roughness exponents \(1/3\) and \(1/2\). Noisy KS needs large scales to reach asymptotic KPZ scaling, and crossover effects matter for the smaller boxes. Kardar, Parisi & Zhang (1986) · Cuerno & Lauritsen (1995) · Ueno, Sakaguchi & Okamura (2005).
sizes = np.array([32, 48, 64, 96] if SMOKE else [64, 96, 128, 192])
lengths = sizes * (np.pi / 4)
h, paths = 0.125, (4 if SMOKE else 16)
blocks, stride = (32, 4) if SMOKE else (512, 8)
times = h * stride * np.arange(1, blocks + 1)
def width_history(n, length, seed, blocks, stride, path_count=paths):
step = spde.StochasticKuramotoSivashinsky(
1, length, n, h, sigma=0.5, noise_alpha=1.0
)
initial = jnp.zeros((1, n // 2 + 1), dtype=jnp.complex128)
def member(key):
def block(state, block_index):
def advance(index, state):
key_i = jax.random.fold_in(key, block_index * stride + index)
return step.step_fourier(state, key=key_i)
result = jax.lax.fori_loop(0, stride, advance, state)
field = ex.ifft(result, num_points=n)
return result, jnp.var(field)
# Only one scalar per saved time is retained for each path.
return jax.lax.scan(block, initial, jnp.arange(blocks))[1]
keys = jax.random.split(jax.random.key(seed), path_count)
batch = jax.jit(jax.vmap(member))
return np.concatenate(
[np.asarray(batch(keys[i : i + paths])) for i in range(0, path_count, paths)]
)
widths = np.stack(
[
width_history(int(n), float(length), 34310 + i, blocks, stride)
for i, (n, length) in enumerate(zip(sizes, lengths, strict=True))
]
)
growth_n, growth_end = (128, 16) if SMOKE else (8192, 2000)
growth_stride = 8
growth_blocks = round(growth_end / (h * growth_stride))
growth_times = h * growth_stride * np.arange(1, growth_blocks + 1)
growth_path_count = paths if SMOKE else 64
growth_widths = width_history(
growth_n,
growth_n * np.pi / 4,
35310,
growth_blocks,
growth_stride,
path_count=growth_path_count,
)
window = (growth_times >= (3 if SMOKE else 300)) & (growth_times <= growth_end)
late = times >= 0.75 * times[-1]
late_squares = widths[:, :, late].mean(axis=-1)
for length, n, terminal_squares in zip(lengths, sizes, late_squares, strict=True):
print(
f"DIAGNOSTIC | L={length:.3g}, N={n} | late width "
f"{np.sqrt(terminal_squares.mean()):.5g}"
)
def fit(x, squares):
logx = np.log(x)
centred = logx - logx.mean()
return np.log(np.sqrt(squares)) @ centred / (centred @ centred)
growth_rng = np.random.default_rng(34320)
roughness_rng = np.random.default_rng(34321)
growth_paths = growth_widths[:, window]
draws = growth_rng.integers(0, growth_path_count, (1000, growth_path_count))
growth_samples = fit(growth_times[window], growth_paths[draws].mean(axis=1))
indices = roughness_rng.integers(0, paths, (len(sizes), 1000, paths))
roughness_samples = fit(
lengths,
np.take_along_axis(late_squares[:, None, :], indices, axis=2).mean(axis=-1).T,
)
growth = fit(growth_times[window], growth_paths.mean(axis=0))
roughness = fit(lengths, late_squares.mean(axis=1))
for name, measured, samples, expected in (
("growth", growth, growth_samples, 1 / 3),
("late-time roughness", roughness, roughness_samples, 1 / 2),
):
lo, hi = np.quantile(samples, (0.025, 0.975))
print(
f"DIAGNOSTIC | {name} exponent {measured:.3f} "
f"| 95% [{lo:.3f}, {hi:.3f}] | KPZ {expected:.3f}"
)
fig, (history, scaling) = plt.subplots(1, 2, figsize=(9, 3.75), layout="constrained")
for length, ms in zip(lengths, widths.mean(axis=1), strict=True):
history.loglog(times, np.sqrt(ms), label=f"L={length:.1f}")
history.loglog(
growth_times,
np.sqrt(growth_widths.mean(axis=0)),
color="black",
label=f"N={growth_n}",
)
history.axvspan(growth_times[window][0], growth_end, alpha=0.12, color="0.5")
history.set(xlabel="Time", ylabel="RMS width")
history.legend(fontsize=8)
scaling.loglog(lengths, np.sqrt(late_squares.mean(axis=1)), "o-", label="Late mean")
scaling.loglog(
lengths,
np.sqrt(late_squares[0].mean() * lengths / lengths[0]),
"--",
label="KPZ 1/2 guide",
)
scaling.set(xlabel="Domain length", ylabel="Pre-asymptotic late RMS width")
scaling.legend(fontsize=8)
show(fig, "ks_roughening")
DIAGNOSTIC | L=50.3, N=64 | late width 2.8379 DIAGNOSTIC | L=75.4, N=96 | late width 3.2078 DIAGNOSTIC | L=101, N=128 | late width 3.6581 DIAGNOSTIC | L=151, N=192 | late width 4.408
DIAGNOSTIC | growth exponent 0.241 | 95% [0.220, 0.261] | KPZ 0.333 DIAGNOSTIC | late-time roughness exponent 0.404 | 95% [0.322, 0.475] | KPZ 0.500