From 4f715e8ad6d5f32a8ca561633b03a34997e473e8 Mon Sep 17 00:00:00 2001 From: znetsixe Date: Tue, 19 May 2026 13:01:02 +0200 Subject: [PATCH] fix(reactor schema): timeStep unit was "h" but engine treats input as seconds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit reactor.json declared `timeStep.unit = "h"` and `default = 0.001`, but: - reactor.html labels the field [s] and defaults to 1. - baseEngine.js line 40 converts via (1/86400) — seconds-per-day — meaning the engine internally treats the input as seconds. A reader trusting the schema would have entered an hours value; the engine would then have run the integrator at 1/3600× the intended step, silently producing wrong rates. Schema now matches the actual contract: `unit = "s"`, `default = 1`, `min = 0.001` (1 ms minimum). Description block calls out the seconds→days conversion so future readers don't need to dig. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/configs/reactor.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/configs/reactor.json b/src/configs/reactor.json index 879a4cf..10b9bb1 100644 --- a/src/configs/reactor.json +++ b/src/configs/reactor.json @@ -136,12 +136,12 @@ } }, "timeStep": { - "default": 0.001, + "default": 1, "rules": { "type": "number", - "min": 0.0001, - "unit": "h", - "description": "Integration time step for the reactor model." + "min": 0.001, + "unit": "s", + "description": "Integration time step in seconds. The kinetics engine converts to days internally (timeStep / 86400) before each ASM Euler step; the HTML editor labels this field [s] and tests assume seconds. Do not change the unit without updating baseEngine.js line 40 in the reactor submodule." } } },