A Continuous-Time Dynamical Model of Dyadic Affective Interaction: Bistability, Memory, and Negativity Dominance Under Cognitive Saturation
Online supplement for A Continuous-Time Dynamical Model of Dyadic Affective Interaction: Bistability, Memory, and Negativity Dominance Under Cognitive Saturation.
This repository holds the Julia experiment campaign (six model families, full theorem verification) and the Python analysis/plotting scripts that produced the paper's figures.
.
├── Project.toml # Root environment marker (no deps)
├── src/ # Julia: ADMExperiments.jl package
│ ├── ADMExperiments.jl # Package entry point (includes all submodules)
│ ├── Project.toml # Julia deps (DifferentialEquations, DynamicalSystems, etc.)
│ ├── core/ # dimensions, physics, system composition, sampling
│ ├── models/ # Six model families: atomic, kuramoto, hierarchical,
│ │ distance, multicapital, flat
│ ├── metrics/ # Theorem verification + dynamical systems diagnostics
│ │ └── README.md # Full reference: every metric, formula, and paper theorem it verifies
│ ├── run.jl # Main experiment runner (single-pass, all metrics)
│ ├── runner.jl # Core run loop used by run.jl
│ └── run_*.jl # Targeted runs (hysteresis, robustness, solver comparison, etc.)
├── python/
│ ├── analysis/ # Notebooks + scripts (equilibrium, hysteresis, power-law fits,
│ │ robustness/sensitivity figure export)
│ ├── scripts/ # parameter_recovery.py, results_to_csv.py
│ └── pyproject.toml # Python deps (uv-managed): numpy, scipy, matplotlib, pandas, seaborn, jupyter
└── results/ # JSON experiment configs and outputs
├── experiments.json # Full experiment configuration (all families/dimensions)
├── experiments-subset.json
└── experiments_top10.json
Six architectural families are tested, each composing the core 2D valence system (a, b) with optional dimensions (memory weights, capital, spatial distance, oscillator phase): atomic, kuramoto, hierarchical, distance, multicapital, flat. State-space dimensionality ranges from 3D to 13D across the full configuration matrix (13,923 configurations).
cd src
julia --project=. -e 'using Pkg; Pkg.instantiate()' # one-time setup
# Standard metrics (full campaign)
julia --threads=auto --project=. run.jl --json=../results/experiments.json
# Single family only
julia --threads=auto --project=. run.jl --json=../results/experiments.json --family=atomic
# Paper theorem verification instead of standard metrics
julia --threads=auto --project=. run.jl --json=../results/experiments.json --verify
# Resume into an existing output directory
julia --threads=auto --project=. run.jl --json=../results/experiments.json --output-dir=../results-18-06-2026-12-00Output is written to a timestamped results-<dd-mm-yyyy-HH-MM>/ directory at the repo root.
cd python
uv sync # restore pinned environment (uv.lock)
uv run jupyter notebook analysis/analysis.ipynb
uv run python analysis/export_robustness_figures.py
uv run python analysis/export_sensitivity_figures.py
uv run python analysis/phase1_equilibrium.py
uv run python analysis/phase1_hysteresis.py
uv run python analysis/phase1_powerlaw.py
uv run python scripts/parameter_recovery.py
uv run python scripts/results_to_csv.py- Python: managed by uv.
python/uv.lockpins exact versions;uv syncfrompython/reproduces the environment. - Julia: pinned via
src/Manifest.toml(deps declared insrc/Project.toml). Runjulia --project=. -e 'using Pkg; Pkg.instantiate()'fromsrc/to restore the exact package state.
Stochastic experiments (noise resilience, basin sampling, Monte Carlo vulnerability) use a fixed seed of 42 by default, set in src/runner.jl. The --seed flag on targeted scripts (e.g., run_joint_robustness.jl) also defaults to 42.
src/metrics/README.md is the authoritative reference for every verification metric: the formal claim it checks, the mathematical formulation, pass/fail criteria, and which paper theorem or proposition it corresponds to. Use it alongside run.jl --verify to reproduce the theorem-by-theorem validation reported in the paper's appendix.
- Julia: 1.10+ (developed against 1.12.6), with deps in
src/Project.toml(DifferentialEquations.jl, DynamicalSystems.jl, ForwardDiff.jl, JSON3.jl, Optim.jl, StaticArrays.jl, StochasticDiffEq.jl, ArgParse.jl) - Python: 3.11+, managed via uv (see
python/pyproject.toml)