Skip to content

Add multisphere segregation benchmark#55

Open
SueHeir wants to merge 2 commits intomainfrom
researcher/bench-multisphere-segregation
Open

Add multisphere segregation benchmark#55
SueHeir wants to merge 2 commits intomainfrom
researcher/bench-multisphere-segregation

Conversation

@SueHeir
Copy link
Copy Markdown
Owner

@SueHeir SueHeir commented Mar 17, 2026

Summary

  • Adds examples/bench_multisphere_segregation/ benchmark validating clump/multisphere behavior
  • Simulates Brazil nut effect: dimer clumps segregate above single spheres under vertical vibration (Γ ≈ 3.6)
  • 75 spheres + 75 dimers in a box with oscillating floor, periodic lateral boundaries
  • Custom system tracks mass-weighted COM height per species and writes segregation index to CSV

Files

  • main.rs — Simulation with custom measure_segregation system
  • config.toml — Fully documented TOML (softened glass, A=2mm, f=15Hz oscillating floor)
  • validate.py — 5 PASS/FAIL checks (finite data, positive z, S > 0, S > 0.005, positive trend)
  • plot.py — Segregation index vs time + COM trajectories (matplotlib, PNG output)
  • README.md — Physics description, vibration parameters, run instructions

Test plan

  • cargo build --no-default-features --example bench_multisphere_segregation compiles
  • cargo clippy --no-default-features --example bench_multisphere_segregation — no warnings from example code
  • cargo test --no-default-features -p dem_clump — all 12 tests pass
  • Run simulation and verify validate.py passes (requires ~2-3 min in release mode)

🤖 Generated with Claude Code

SueHeir and others added 2 commits March 16, 2026 19:00
…ect)

Validates clump/multisphere behavior by simulating size-driven segregation
of single spheres vs dimer clumps in a vertically shaken box. Under
vibration at Γ ≈ 3.6, dimers (larger effective size) segregate upward
due to the Brazil nut effect.

Includes:
- main.rs: Custom system tracking COM heights per species
- config.toml: 75 spheres + 75 dimers, oscillating floor (A=2mm, f=15Hz)
- validate.py: PASS/FAIL checks (S > 0 at steady state)
- plot.py: Segregation index and COM trajectory plots
- README.md: Physics description, run instructions, validation criteria

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The DemConfig struct uses #[serde(deny_unknown_fields)], which caused
a parse error when clump definitions were placed under [dem.clumps].
Move clump config to its own top-level [clump] TOML section with
[[clump.definitions]] array-of-tables syntax.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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