Mass moving on a graph
The model lives on the discrete torus \(X=(\mathbb Z/N\mathbb Z)^2\). At each vertex, \(\rho_t(x)\) is a mass, with \(\sum_x\rho_t(x)=1\). The two horizontal axes run through the actual \(N\times N\) graph, whose vertices and edges are shown; the height gives \(\rho_t\). The surface between vertices is a piecewise-linear visual interpolation, not an additional continuous density model. Opposite edges are adjacent. The square is therefore a chart of the discrete torus, rather than a domain with boundary conditions.
The kernel is that of the full model, with \(\beta>0\):
\[ k_\beta(z)=\exp\!\left[\beta\left(\cos\frac{2\pi z_1}{N}+\cos\frac{2\pi z_2}{N}\right)\right], \qquad U_\rho=k_\beta*\rho. \]Attraction favours increasing the energy \(E_\beta(\rho)=\sum_x\rho(x)U_\rho(x)\). Mass is transported only along graph edges. The integrated vector field is exactly the one in the article, using the mass convention and \(a(x,y)=1/4\):
\[ \dot\rho(x)=\frac12\sum_{y\sim x}\Theta(\rho(x),\rho(y))\bigl(U_\rho(x)-U_\rho(y)\bigr), \qquad \Theta(s,t)=\frac{s-t}{\log s-\log t}. \]On the diagonal, \(\Theta(s,s)=s\). As soon as either argument vanishes, the mobility vanishes. This is the delicate feature of the model: exterior mass may lose the paths connecting it to the vertex at which concentration is expected. The energy increases, but that alone does not force a Dirac mass. The visualisation therefore makes no assumption that every initial condition eventually forms a single peak.
What is computed
Each experiment starts from a random mixture of periodic bumps, with a strictly positive background. The result is normalised to have total mass one. The seed is displayed: a new experiment changes it, and the exported results allow the initial condition to be reproduced exactly. Changing a parameter and choosing “Recompute” retains the seed, making comparisons possible.
The periodic convolution is computed by FFT. Fluxes are constructed on each unoriented edge and added with opposite signs at its endpoints. This formulation conserves mass up to roundoff. An adaptive Heun scheme controls the local error, positivity and energy increase. The setting \(\Delta t_{\max}\) is an upper bound; the steps actually taken may be smaller, especially near the boundary of the simplex.
A decreasing coordinate below \(10^{-10}\) is set to zero and remains zero. The mass removed in this way is recorded in the results. This approximates the continuation with non-increasing support studied in the text. The threshold is not an extinction theorem: a careful study near the boundary requires lowering it and refining the time step. The program does not explore other continuations that the continuous vector field might admit at the boundary.
Long horizons and the time axis
The requested horizon can extend to \(T=10^6\). Increasing \(T\) does not change the equation or accelerate its physical clock. The maximum step remains the value entered, with a permitted range up to \(10^4\). For a long calculation, a ceiling such as \(100\) or \(1000\) allows larger steps in slowly varying portions of the trajectory; error, positivity and energy checks still reduce the steps wherever needed. Raising this ceiling is not the same as imposing a large fixed step.
Saved times are equally spaced for \(T\leq160\). Beyond that, the default uses the coordinate \(\log(1+t)\), keeping more detail near the start while covering a much longer interval:
\[ t_j=\exp\!\left(\frac{j}{m-1}\log(1+T)\right)-1,\qquad j=0,\ldots,m-1. \]The labels and time entry always give the physical model time \(t\). The logarithmic scale changes navigation and the saved observation times; it does not rescale the evolution. A large gap between saved times may contain many adaptive steps. The Python option --time-sampling can select linear or logarithmic explicitly.
A constant continuation is used only once the computed vector field is exactly zero. Its starting time is saved and reported. This can happen with several isolated occupied vertices, because the logarithmic mobility vanishes across every intervening zero. It is a stationary state of the numerical continuation; the extinction threshold remains part of that approximation.
Otherwise the solver keeps integrating. The default work budget is \(30{,}000\) accepted or rejected trial steps. If it runs out, the result stops at the last time actually reached and the status reports the incomplete interval. A nonzero drift that becomes too small to produce a representable update is also reported as an incomplete calculation, rather than replaced by a stationary tail. The exported values completed, reached_T and termination make the distinction explicit. A larger maximum step may make a long run practical; local runs can also increase the budget with --max-steps.
Reading and comparing trajectories
The time slider below the figure gives access to the saved trajectory, ending at the last computed time if a run is incomplete. During playback, the display interpolates linearly between saved times; the values at those times come from the solver. Interpolation makes the animation smooth and does not perform a new integration. The vertical axis rescales to the current frame, so use its numerical labels and the displayed maximum to compare heights over time. Rescaling changes the drawing, not the masses or the diagnostic curves.
The parameter \(N\) changes the graph itself. This is not merely a mesh refinement for a fixed continuous equation, since the edge weights remain those of the manuscript. The parameter \(\beta\) changes the kernel, its amplitude and its time scale: comparing two values at the same physical time therefore differs from comparing them after rescaling time. No implicit reduction to the \(\beta=0\) model is made.
The energy curve and the mass, maximum and support values help interpret the result. The first-mode quantity is recorded, but its monotonicity is not imposed for the full exponential kernel. Results can be exported with all parameters; the Python script shown below is the file executed by this experiment.
