Coherence–Rupture–Regeneration (CRR) Framework

Mathematical Foundation for Bubble Dynamics

What you're seeing: Each bubble is a CRR agent that accumulates coherence, undergoes rupture, and influences future bubbles through a memory field. The simulation implements the complete canonical formalism with proper Dirac delta rupture physics.

Operator 1: Coherence Density

L(x, ẋ, t) = ffilm(h) · fage(t) · fstructure · fkinetic(v) · fblanket
The coherence density measures how stable the bubble is at each moment. It's the product of five factors: film thickness optimality, age decay, structural bonding (foam vs isolated), velocity damping, and Markov blanket enhancement.
// Code Implementation: const filmStability = exp(-pow(log(film / 280e-9), 2)); const ageStability = exp(-age / 35.0); const structuralBonus = inFoam ? plateauBonus : 1.0; const kineticStability = exp(-velocity.length() * 5.0); const blanketBoost = hasBlanket ? 1.3 : 1.0; L = filmStability * ageStability * structuralBonus * kineticStability * blanketBoost;

Operator 2: Coherence Accumulation

C(x, t) = ∫0t L(x, τ) dτ     with decay:   dC/dt = L − γC
Coherence C is the time-integral of the density L. It accumulates when the bubble is stable (high L) and decays exponentially. High coherence stabilizes the film and resists rupture.
// Code Implementation: C += L * dt; // Integration: accumulate C *= pow(coherenceDecay, dt); // Exponential decay C = min(C, maxCoherence); // Saturation limit // Coherence feeds back into physics: drainRate *= exp(-C / 12.0); // Slows drainage radius = radius0 * (1.0 + C * 0.009); // Inflates bubble

Operator 3: Regeneration Kernel

R[χ](x, t) = ∫ φ(x, τ) · exp(C(τ)/Ω) · Θ(t−τ) dτ
When a bubble ruptures, it's recorded in the memory field φ(x,τ) with its position, coherence, and timestamp. New bubbles query this field and inherit weighted coherence and rupture risk. The exponential weighting exp(C/Ω) means high-coherence ruptures have exponentially stronger influence.
// Code Implementation: function getRegeneration(pos, now) { let inheritedC = 0, inheritedRisk = 0; for (const event of memoryField.events) { const dist = pos.distanceTo(event.pos); const age = (now - event.t) / 1000; if (age < 0) continue; // Θ(t-τ) causality // Regeneration kernel weights: const spatialWeight = exp(-dist / regenRadius); const temporalWeight = exp(-age / memoryTemporal); const coherenceWeight = exp(event.C / Ω); // ← exp(C/Ω) const weight = spatialWeight * temporalWeight * coherenceWeight; inheritedC += event.C * weight; } return { inherited: inheritedC, risk: inheritedRisk }; }

Dirac Delta Rupture: δ(t−t₀)

Rupture impulse: ρ(x) · δ(t−t₀) propagates as crack wave through thin film
At rupture time t₀, a Dirac delta perturbation is applied instantaneously at the rupture point. This creates a discretized wave that propagates radially through the coherence field at finite velocity, causing crack formation and film retraction. The wave amplitude decays with distance and is modulated by local coherence density.
// Enhanced Dirac Delta Implementation: // 1. Instantaneous impulse at t=t₀ creates rupture epicenter // 2. Crack wave propagates radially: v = sqrt(σ/ρh) ≈ 10-20 m/s // 3. Wave amplitude: A(r,t) = A₀·exp(-r/λ)·δ(t-r/v) // 4. Film retracts following crack front // 5. Coherence field locally collapses: C(x,t) → 0 at crack

Rupture Detection

Rupture occurs when:   C(t) / h0 < θcrit   or   h(t) < hmin   or   ρrisk > ρmax
Bubbles can fail through five mechanisms: (1) physical threshold (film too thin), (2) CRR degradation (coherence too low for current film state), (3) contagion (inherited high rupture risk), (4) senescence (age), or (5) boundary escape.

Markov Blankets (Collective Coherence)

Cshared = ⟨C⟩ + β·√n + γ·min(tblanket/10, 1)
When bubbles touch, they form a Markov blanket—a statistical ensemble that shares coherence. The shared coherence grows sublinearly with size (√n scaling) and increases with blanket age. Members receive coherence boosts and reduced rupture risk.

Live CRR Simulation

Choose mode: blow bubbles or pop them with a pin

System Metrics

Bubbles
0
Foam Clusters
0
Avg Coherence
0.0
Ruptures
0
M-Blankets
0
Memory Events
0
System Initializing...

Core CRR Parameters

Ω (Temperature) 16.0
Coherence Decay 0.972
Rupture Threshold 0.15
Memory Radius 0.50

Foam Physics

Plateau Bonus 2.0
Cohesion Strength 0.95
Contact Gap 0.70
Buoyancy 0.018
Wind Strength 0.042

Visual & Flow

Bubble Size Min 0.08
Bubble Size Max 0.13
Flow Speed 0.85
Iridescence Intensity 1.40
Colour Saturation 1.65