A computational framework for visualizing emergent structure in complex adaptive systems through operator-driven field evolution.
The Structural Field Dynamics (SFD) Engine is an interactive visualization tool that demonstrates how local computational rules can produce coherent global patterns. It renders real-time 2D manifold simulations featuring curvature-driven flows, attractor basins, and emergent geometric structures.
This framework provides researchers and practitioners with a sandbox for exploring parameter spaces, observing regime transitions, and developing intuitions about structure formation in dynamical systems.
- Real-time field evolution with configurable operator weights
- Multiple visualization modes including primary field, curvature, gradient, tension, and variance maps
- Regime detection with automatic classification of system states
- Temporal playback with 100-frame ring buffer history
- Multi-point probe system for detailed field inspection
- Comprehensive export suite supporting PNG, WebM, CSV, NumPy, and Python reconstruction scripts
- Preset configurations for common dynamical regimes
- Mobile-optimized interface with touch controls
The SFD Engine:
- Visualizes how local update rules produce global spatial patterns
- Provides interactive parameter adjustment with immediate visual feedback
- Tracks and displays key metrics: field energy, variance, basin count, and curvature
- Detects and logs structural events (variance spikes, basin merges, boundary fractures)
- Enables systematic exploration of parameter spaces through preset regimes
- Exports simulation data in formats suitable for further analysis
To set appropriate expectations:
- Not a physics simulator — The operators do not correspond to specific physical laws
- Not a predictive model — Results describe emergent behavior within the defined rules, not real-world forecasts
- Not validated against empirical data — This is a computational exploration tool, not a scientific instrument
- Not making ontological claims — The terminology (fields, attractors, basins) is descriptive, not asserting these structures exist in nature
The engine operates on a discrete 2D grid where each cell holds a scalar field value. At each simulation step, five operators contribute to field evolution:
- Diffusion — Smooths local variations, promoting spatial coherence
- Curvature — Enhances or suppresses regions based on local surface geometry
- Tension — Resists deviation from neighboring values
- Coupling — Introduces nonlinear feedback based on field magnitude
- Noise — Adds stochastic perturbations to prevent stagnation
The relative weights of these operators determine the system's behavior, producing distinct dynamical regimes ranging from stable equilibria to chaotic evolution.
At each timestep, the field
where
| Operator | Definition | Effect |
|---|---|---|
| Diffusion |
|
Spatial smoothing |
| Curvature | Mean curvature of |
Geometric flow |
| Tension | Local averaging | |
| Coupling | $\tanh(\phi) \cdot | \nabla\phi |
| Noise | Stochastic perturbation |
The system automatically classifies behavior into regimes based on metrics:
- Ground State — Minimal variance, single basin
- Crystalline — Low variance, multiple stable basins
- Wave-Locked — Moderate variance with oscillatory character
- Turbulent Mixing — High variance, frequent basin changes
- Critical — Sensitivity to perturbations, complex basin structure
- Chaotic — Very high variance with rapid unpredictable changes
-
Field Energy:
$E = \sum_{i,j} \phi_{i,j}^2$ -
Variance:
$\sigma^2 = \text{Var}(\phi)$ - Basin Count: Number of distinct attractor basins via gradient descent
- Curvature Range: Min/max of discrete mean curvature
The engine provides comprehensive export capabilities:
- PNG Snapshot — Current field state as image
- WebM Video — Playback history as video
- Field Layers — Contact sheet of all derived fields
- Metrics Summary — CSV of tracked metrics over time
- Settings JSON — Current parameter configuration
- Event Log — Chronological record of structural events
- NumPy Array — Raw field data as
.npyfile - Python Script — Reconstruction script with matplotlib visualization
- Batch Spec — Minimal parameters for automated runs
- Full Archive — Complete simulation state bundle
- Open the project in Replit
- Click "Run" — the application starts automatically
- Access the visualization at the provided URL
# Clone the repository
git clone <repository-url>
cd sfd-engine
# Install dependencies
npm install
# Start development server
npm run devThe application will be available at http://localhost:5000.
Exported .npy files can be loaded in Python:
import numpy as np
import matplotlib.pyplot as plt
# Load exported field
field = np.load('sfd-numpy-export.npy')
# Visualize
plt.imshow(field, cmap='inferno')
plt.colorbar(label='Field Value')
plt.title('SFD Field Reconstruction')
plt.show()- Select a regime preset from the Home tab to configure operators
- Observe the field evolution in the main canvas
- Adjust parameters in the Controls tab to explore variations
- Use the timeline to scrub through simulation history
- Place probes to inspect local field values
- Export data for external analysis or publication
Run the SFD Engine directly in your browser: https://sfd-engine.replit.app/
If you use the SFD Engine in your research, please cite:
@software{sabouhi2026sfd,
author = {Sabouhi, Ryan},
title = {Structural Field Dynamics (SFD) Engine},
year = {2026},
version = {1.0.0},
url = {https://github.com/rjsabouhi/sfd-engine}
}See CITATION.cff for machine-readable citation metadata.
- Technical Primer — Conceptual overview and interpretation guide
- Release Notes — Version history and changelog
- Contributing Guide — How to contribute
- Code of Conduct — Community guidelines
- License — Apache License 2.0
v1.0.0 — Initial public release
See RELEASE_NOTES.md for detailed version information.
This project is licensed under the Apache License 2.0. See LICENSE for details.