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.
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.
C += L * dt;
C *= pow(coherenceDecay, dt);
C = min(C, maxCoherence);
drainRate *= exp(-C / 12.0);
radius = radius0 * (1.0 + C * 0.009);
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.
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;
const spatialWeight = exp(-dist / regenRadius);
const temporalWeight = exp(-age / memoryTemporal);
const coherenceWeight = exp(event.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.
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.