jze9 7f040c3cf5 Fix two physics bugs the user caught: unbounded field and ignored current limits
1. Iron saturation now in the dynamics (was the "13 Tesla" bug). Flux
   linkage lambda(x,I) = L_air*I + L_iron*overlap(x)*g(I) with
   g(I)=I_sat*tanh(I/I_sat) saturating at the current where iron reaches
   B_sat. Both the circuit back-EMF (dlambda/dx) and the force (coenergy,
   dW'/dx) derive from the SAME lambda, so energy stays conserved (0.025%
   error) AND the field caps at B_sat instead of running to 13 T. Reduces
   to the old 0.5*I^2*dL/dx in the low-current limit. On the config that
   reported 60% efficiency / 11.6 T, it now gives 40% / 1.90 T.

2. Switch surge-current limit is now a hard feasibility constraint: a
   config whose peak discharge current exceeds the switch's pulse rating
   (continuous * surge factor per device kind) is infeasible -- otherwise
   the optimizer "wins" with configs that vaporize their own thyristor
   (e.g. 119 A through a 12 A BT151). Capacitor current stays a warning
   (electrolytics tolerate pulses; DB has continuous not pulse ratings).

Regression tests added for both (field cap near saturation, energy
conservation under strong discharge). 87 tests pass.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-07 01:45:26 +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%