jze9 4d16825f7d Add eddy-current losses in the slug -- the missing loss channel
The user caught the evolution reporting 83.9% efficiency, which is
unphysical (real coilguns are single-digit %). Root cause: the model's
only loss channel was copper resistance; iron had no losses at all, so
the reluctance force came "for free" and the optimizer climbed into that
corner.

Adds eddy-current loss: the solid steel slug acts as a shorted secondary
(1-turn transformer), and its reflected resistance R_eddy = (wM)^2/R_e
is added to the circuit while the slug is inside the coil (x overlap(x)).
Energy now honestly goes to slug heating instead of kinetic. The formula
matches the classical solid-cylinder eddy loss (P ~ sigma*w^2*B^2*a^4),
so it's physically grounded, not tuned to a target. Wired through
schema/JSON (slug resistivity), losses.py, circuit.py, stage.py, and the
GPU batch integrator; energy conservation still holds (0.025%).

Effect: best efficiency 83.9% -> ~47%, and the distribution is now
realistic (median ~0%, most configs single-digit). 47% is still an
optimistic ceiling -- it's the optimizer's single best exploit, and the
model still omits tube friction, air drag, skin-effect field penetration
(skin depth ~0.44mm < slug radius), and timing imperfection. Hysteresis
computed but not in the dynamics (negligible, ~1e-4 J vs eddy). 89 tests.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-07 15:03:45 +05:00

gausse

Симулятор и оптимизатор многоступенчатого электромагнитного ускорителя (coilgun) на реальных, доступных в рознице компонентах.

Полный план и чек-лист этапов — в PLAN.md.

Установка (Docker — основной способ)

docker compose build
docker compose run --rm --entrypoint pytest gausse -q   # тесты
docker compose run --rm gausse sweep --n 1000            # CLI (после реализации Этапа 6)

Результаты (SQLite, отчёты) должны сохраняться в ./results, примонтированный в контейнер как /app/results (см. docker-compose.yml), чтобы переживать пересборку образа.

Установка без Docker (локальная разработка)

python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest
Description
No description provided
Readme 730 KiB
v0.1.0 Latest
2026-07-13 01:38:07 +05:00
Languages
Python 98.9%
Shell 0.9%
Dockerfile 0.2%