Computational Methods for Kuramoto BenchmarkðŠķ
Numerical Discretization: Taylor Series ExpansionðŠķ
ðïļ Recall
We can numerically solve \(\dot{\theta}_i(t)=f(\theta, t)\) using a Taylor series expansion to approximate the solution at \(t + \Delta t\):
ðĒ Euler's Method Only retains the first-order term \(\mathcal{O}(\Delta t)\).
ðī Runge-Kutta Methods Approximates higher-order terms (HOTs) via evaluation of \(f\) at multiple grid points within the interval $[t, t+\Delta t] without requiring explicit HOTs.
Numerical Methods Implemented in the Kuramoto BenchmarkðŠķ
Adaptive Integration via RK45
Implementation
- Implemented as an embedded method in
src/kuramoto/model.py. -
For each time step, it computes two estimates of the next state:
- A fourth-order estimate \(\theta[t_{k+1}]\).
- A fifth-order estimate \(\hat{\theta}[t_{k+1}]\).
-
Estimated error is $$ \epsilon = | \hat{\theta}[t_{k+1}] - \theta[t_{k+1}] | $$
Double-check the accuracy of this description.
Adaptive Step-Size Logic
The step size \(\Delta t\) is dynamically adjusted so that the error \(\epsilon\) stays below a tolerance \(\tau = \text{atol} + \text{rtol} \cdot \|\theta[t_k]\|\):
- If \(\epsilon > \tau\), then reject the step and decrease \(\Delta t\).
- If \(\epsilon \ll \tau\), then accept the step and increase \(\Delta t\) for the next iteration.
ðĻ Significance for Kuramoto Benchmark
The adaptive step size logic is important because it prevents the dynamics from becoming "stiff" when the order parameter \(r(t)\) reaches the synchronization threshold.
Overview
In nonlinear oscillator networks undergoing high-frequency phase evolution, standard adaptive ODE integration schemes that have step sizes exceeding the Nyquist frequency and error tolerances that are satisfied purely locally are subject to phase-slip undersampling and numerical aliasing.
Here, we address this issue by imposing a dynamic upper bound on the solver's maximum integration
step size (max_step). The upper bound is derived from the system's maximum characteristic frequency
\(\lambda_{text{max}}\)) and guarantees that even during fast transient or weakly coupled regime steps, the
integrator samples the fastest dynamic mode with sufficient resolution.
Background
The Nyquist-Shannon Sampling Theorem states that reconstructing or resolving a continuous signal requires sampling at a rate \(f_s=\frac{1}{\Delta t}\) that is strcitly greater than twice the highest frequency component present in the signal (\(f_\text{max}\)) called the Nyquist rate:
In the context of numerical integration of ordinary differential equations (such as Kuramoto phase oscillators \(\dot{\theta}_i=\omega_i + \frac{K}{N} \sum_j{A_{ij}\sin(\theta_j-\theta_i})\) ):
-
The fastest effective timescale is governed not only by the maximum frequency \(\omega_\text{max} = \max_i \| \omega_i \|\), but also the maximum coupling torque \(\propto K \cdot \deg_\text{max}\).
-
Setting a step size limmit based on this fastest scale ensures that the numerical trajectory does not skip cycles (\(2\pi\) phase wraps) beteween solver evaluations.
-
In order to to maintain numerical stability and high integration accuracy in Runge-Kutta schemes (e.g., RK45), the step size should be limited to a conservative fraction of the minimum intrinsic frequency (e.g., 20 steps per period), comfortably exceeding the theoretical minimum Nyquist threshold of 2 steps per period.
Implementation
The step-size limit is implemented in src/kuramoto/model.py
as follows:
-
Upper bound estimation (
KuramotoModel._max_step)Inside
src/kuramoto/model.py:-
Constant
_STEP_PER_PERIOD = 20defines the oversampling factor per cycle. -
The method
_max_step()computes the maximum rate:
-
-
Model Simulation (
KuramotoModel.simulate)When running
model.simulate(t_span, n_points):-
max_stepis computed dynamically from current craph topology and parameters:
-
-
Solver Enforcement (
sovlers.solve_kuramoto)Inside
src/kuramoto/solvers.py:-
solve_kuramotovalidatesmax_stepand passes it directly to SciPy'ssolve_ivp: -
This forces SciPy's adaptive RK45 engine to constrain every internal step \(h_n \leq \max_\text{step}\), preventing excessive step sizes and ensuring a robust trajectory resolution across arbitrary network topologies.
-