Expose xenon reactivity impact on dashboard

This commit is contained in:
Codex Agent
2025-11-23 23:15:21 +01:00
parent 2c3f9e3b45
commit 7f2b193dca
3 changed files with 21 additions and 1 deletions

View File

@@ -1,3 +1,5 @@
import pytest
from reactor_sim.neutronics import NeutronDynamics
from reactor_sim.state import CoreState
@@ -32,3 +34,12 @@ def test_poisons_accumulate_under_power():
dynamics.update_poisons(state, dt=100.0)
assert state.iodine_inventory > 0.0
assert state.xenon_inventory > 0.0
def test_xenon_penalty_caps():
dynamics = NeutronDynamics()
state = _core_state()
state.xenon_inventory = 50.0
assert dynamics.xenon_penalty(state) == 0.03
state.xenon_inventory = 5.0
assert dynamics.xenon_penalty(state) == pytest.approx(0.01)