Skip to content

feat(result): warn when simulation may not have reached equilibrium#9

Merged
mcaxtr merged 1 commit intomainfrom
fix/equilibrium-warning
Feb 24, 2026
Merged

feat(result): warn when simulation may not have reached equilibrium#9
mcaxtr merged 1 commit intomainfrom
fix/equilibrium-warning

Conversation

@mcaxtr
Copy link
Copy Markdown
Owner

@mcaxtr mcaxtr commented Feb 24, 2026

What

Adds an is_equilibrated property to SimulationResult and a CLI warning when R(t) is still changing at the end of a simulation.

Why

When comparing distributions with the same mean transmissibility T̄ but very different characteristic time scales (e.g., Exponential vs Gamma(5) with scale=1), the slower distribution may need a significantly larger t_max to reach equilibrium. Without a warning, this produces misleading results — e.g., R∞=0.278 for Gamma(5) vs R∞=0.803 for Exponential at the same T̄=0.2, when the true equilibrium R∞ is ~0.80 for both.

This was found during a replication study of Böttcher & Antulov-Fantulin (2020).

How

  • SimulationResult.is_equilibrated: compares R(t) over its final 10% of time steps. Returns False if delta > 0.01.
  • display_result_statistics(): shows a warning suggesting --t-max increase when not equilibrated.

Impact

  • Zero behavior change — only adds an informational warning
  • 23 lines added, 0 removed
  • No new dependencies

Add is_equilibrated property to SimulationResult that checks whether
R(t) has stabilized in the final 10% of time steps. Display a warning
in both CLI output and web interface when the simulation appears to
still be evolving.

This helps catch a common pitfall when comparing distributions with
very different characteristic time scales at the same mean transmissibility
— the slower distribution may need a larger t_max to reach equilibrium.
@mcaxtr mcaxtr force-pushed the fix/equilibrium-warning branch from 327b142 to de439c0 Compare February 24, 2026 21:48
@mcaxtr mcaxtr merged commit 457ef0d into main Feb 24, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant