Paper 27 — Kuramoto-Sakaguchi with ζ Driver

Governing Equation

i/dt = ωi + Σj Kij sin(θj − θi − α) + ζ sin(Ψ − θi)

Each oscillator i has natural frequency ωi, couples to all others via Kij (the Knm matrix), with phase frustration α and external driver ζ at global phase Ψ. The driver enables entrainment and phase-amplitude coupling across SCPN layers.

Phase Subpackage Modules

ModuleDescriptionStatus
kuramoto.py Core Kuramoto-Sakaguchi integrator. RK4 stepper. Vectorised NumPy + Rust backend. Configurable N, K, α, ω distribution. Production
knm.py Knm coupling matrix construction. 16×16 inter-layer coupling. Exponential decay with distance. Calibration from experimental data. Production
upde.py Universal Phase Dynamics Engine. 9-layer solver with PAC (Phase-Amplitude Coupling) gating. Configurable γ parameter. Production
lyapunov_guard.py Sliding-window Lyapunov exponent computation. λ<0 = stable. Real-time stability monitoring with configurable window size. Stable
realtime_monitor.py Dashboard-ready phase state monitor. Order parameter R(t), mean field Ψ(t), per-oscillator phase tracking. Stable
ws_phase_stream.py Async WebSocket server for live phase visualisation. JSON streaming of θ, R, Ψ, λ at configurable frame rate. Stable
adaptive_knm.py Runtime adaptation of Knm based on observed synchronisation. Hebbian-like strengthening of synchronised pairs. Experimental
plasma_knm.py Maps Knm coupling to plasma physics: layer ↔ flux surface, coupling ↔ transport coefficient. Bridge to GK transport. Experimental
gk_upde_bridge.py Bidirectional bridge between UPDE phase dynamics and gyrokinetic transport solver. Phase coherence modulates transport. Experimental

Knm Coupling Matrix

16×16 Inter-Layer Coupling

The Knm matrix defines coupling strength between all 16 SCPN layers (15+1). Entries follow exponential decay: Knm = K0 exp(-|n-m|/ℓ) where ℓ is the characteristic coupling length. Diagonal elements set to zero (no self-coupling). Matrix is not necessarily symmetric — directed coupling enables hierarchical control flow.

Calibration uses correlation analysis from experimental (or simulated) multi-layer phase data. Validated against Paper 27 reference values (r=0.951 correlation).

UPDE Solver

9-Layer Phase Dynamics Engine

The Universal Phase Dynamics Engine solves coupled Kuramoto-Sakaguchi systems across 9 interacting layers. PAC (Phase-Amplitude Coupling) gating modulates inter-layer coupling strength based on amplitude envelopes. With γ=0, layers evolve independently; with γ=1.0, full cross-layer phase-amplitude interaction is active (12% computational overhead, see benchmarks).

Lyapunov Guard

Real-Time Stability Monitoring

Sliding-window computation of the maximum Lyapunov exponent λmax from phase trajectory data. Stability criterion: λmax < 0 indicates stable synchronisation. Window size configurable (default: 500 steps). Alarm triggers on λ > 0 with configurable hysteresis to avoid false positives. See Lyapunov vs ζ table for stability boundaries.

WebSocket Streaming

Live Phase Visualisation

Async WebSocket server (ws_phase_stream.py) streams phase state as JSON frames. Fields: θ (all oscillator phases), R (order parameter), Ψ (mean field), λ (Lyapunov exponent), t (simulation time). Default: 30 fps. Connects to Streamlit dashboard or any WebSocket client for real-time monitoring of synchronisation dynamics.

# Start WebSocket phase stream server
scpn-control live --port 8765 --fps 30 --layers 9