Back to Experiments

Burgers-equation experiment: 25-case S contingency

Overview

The system is a 1D viscous Burgers finite-difference simulation, \(u_t + u u_x = \nu u_{xx}\), run 25 times with varied initial data and viscosity. It is a scalar model equation whose steep gradients are shocks; it is not the 3D Navier–Stokes system. Each run is classified by whether the gradient norm stays below a fixed excursion threshold within the window, and by the minimum value of the convergence score \(S\) attained; the run then sweeps a tolerance \(\epsilon\) in the classifier \(S \geq -\epsilon\) and records precision and recall. The classification, the tolerance and the lead times are properties of this grid, window and threshold.

Method

  1. Run 25 simulations of the viscous Burgers equation with varied initial conditions and viscosity values spanning diffusion-dominated to advection-dominated regimes.
  2. Classify each simulation as below threshold (gradient bounded throughout the window) or crossed threshold (gradient exceeds the excursion threshold).
  3. Record the minimum \(S\) value attained during each simulation. Classify as \(S \geq 0\) or \(S < 0\).
  4. Build the \(2 \times 2\) contingency table. Sweep the tolerance \(\epsilon\) from 0 to 1 and compute precision/recall at each.
  5. For threshold-crossing cases, record the time between the first \(S < 0\) and the crossing.

Results

Contingency Table (tolerance \(S = 0\))

Below thresholdCrossed thresholdTotal
\(S \geq 0\) throughout505
\(S < 0\) at some step14620
Total19625

At \(S = 0\): precision = 6/20 = 0.30, recall = 6/6 = 1.00. Zero false negatives, 14 false positives.

Shifted Tolerance: \(S \geq -0.2\)

Below thresholdCrossed thresholdTotal
\(S \geq -0.2\) throughout19019
\(S < -0.2\) at some step066
Total19625

At \(S = -0.2\): precision = 6/6 = 1.00, recall = 6/6 = 1.00 on these 25 cases.

Temporal Lead

Case\(S < 0\) timeThreshold-crossing timeLead (time units)
10.411.230.82
20.381.050.67
30.521.180.66
40.290.980.69
50.441.100.66
60.351.070.72

Average lead: 0.70 time units. In all six cases \(S\) is negative before the crossing, never at or after it.

Notes

  • \(S = 0\) catches every crossing but is noisy. At tolerance 0, recall is 1.00 and precision 0.30 (70% false-positive rate): many below-threshold runs have transient negative excursions of \(S\).
  • \(S = -0.2\) separates the 25 cases. Shifting the tolerance to \(-0.2\) removes all false positives while keeping recall at 1.00. The 14 below-threshold runs with \(S < 0\) all have \(\min(S) > -0.2\).
  • Temporal ordering. In all 6 crossing cases \(S\) goes negative first, with an average lead of 0.70 time units.
  • Reading of the tolerance. Small negative excursions of \(S\) recover within the window; \(S < -0.2\) in this data set coincides with runs whose gradient continues to steepen.
Caveats. (1) 25 cases is a small sample; the tolerance \(-0.2\) may be specific to this data set. (2) The tolerance is expected to depend on viscosity and grid resolution. (3) The system is 1D Burgers only. (4) Precision and recall of 1.00 on 25 cases do not make \(S\) a general classifier.

Summary

On 25 runs of 1D viscous Burgers, \(S \geq 0\) throughout gives zero false negatives for gradient-threshold crossing (recall 1.00, precision 0.30); shifting the tolerance to \(S \geq -0.2\) gives precision and recall of 1.00 on this data set. In every crossing case \(S\) goes negative first, with a lead of about 0.70 time units.

Reproducibility

../simplex/build/sxc exp_ns_smoothness.sx -o build/exp_ns_smoothness.ll

OPENSSL_PREFIX=$(brew --prefix openssl)
clang -O2 build/exp_ns_smoothness.ll \
  ../simplex/runtime/standalone_runtime.c \
  -o build/exp_ns_smoothness \
  -lm -lssl -lcrypto -L${OPENSSL_PREFIX}/lib

./build/exp_ns_smoothness

Related