Worked Examples
Apply parameter sweeps — Sustainable Catalyst Workbench
Apply parameter sweeps — Sustainable Catalyst Workbench Availability: Implemented source and a local, isolated-router example are TESTED at the pinned Workbench commit. Full application startup, browser interaction, authentication
Apply parameter sweeps — Sustainable Catalyst Workbench
Availability: Implemented source and a local, isolated-router example are TESTED at the pinned Workbench commit. Full application startup, browser interaction, authentication, WordPress execution and deployed behavior remain UNVERIFIED. These articles remain internal drafts with publication blocked.
The selected implementation is the historical v750 simulation runtime. It imports the current canonical version 14.0.0; the README says v10.4.0 and older tests contain historical expectations. Identify this behavior by source commit and route, not by assuming those labels establish installed-release compatibility.
Goal and prerequisites
Run the implemented gain sweep locally and check its output against an analytic reference. This is a verified source-level exercise; no deployed URL or browser button sequence is assumed. Ask a maintainer for an isolated checkout at the pinned source revision and a Python environment that can import its backend modules. Do not alter a production installation.
The local verification environment was Python 3.14.7, NumPy 2.5.4, SciPy 1.18.1, FastAPI 0.162.4, Pydantic 2.14.3 and httpx 0.28.1. Record resolved dependencies when reproducing the exercise. This environment demonstrates the selected computation; it is not a certificate that the full application’s dependency constraints or deployment work.
Run and check the three points
- In the repository root, run
git rev-parse HEADand compare it with the source commit in this article. - Use the prepared interpreter with
backendon its module search path. Copy the following entire example. It directly calls the same sweep implementation used by the route and performs no network request.
PYTHONPATH=backend python - <<'PYCODE'
import math
from app.v750 import SweepRequest, parameter_sweep
payload = {
"baseSimulation": {
"simulationKind": "scalar-dynamic",
"model": {
"model_type": "first_order", "solver": "rk4",
"initial_state": 0, "input_value": 1, "gain": 1,
"time_constant": 1, "duration": 2, "time_step": 0.1
}
},
"parameterPath": "gain", "values": [0.5, 1, 2],
"metric": "final-state", "requestKey": "kb03-sweep-gain"
}
result = parameter_sweep(SweepRequest(**payload))
assert result["runCount"] == 3
assert result["automaticOptimizationPerformed"] is False
for row in result["runs"]:
expected = row["parameterValue"] * (1 - math.exp(-2))
error = abs(row["metricValue"] - expected)
assert error <= 1e-6
assert row["diagnostics"]["finiteTrajectory"]
print(row["parameterValue"], row["metricValue"], error)
print("Sweep record hash:", result["sweepHash"])
PYCODE
- Expect final-state metrics approximately 0.4323322357891047, 0.8646644715782094 and 1.7293289431564187, in input order. The maximum absolute analytic error is approximately 4.90e-7.
- State the units explicitly in your record: x, u and K dimensionless; duration, time_constant and time_step in seconds. The endpoint does not attach or validate those units automatically.
- Change only
time_stepfrom 0.1 to 0.05. Repeat all three points against the same analytic reference. In the verification run the maximum error decreased to approximately 2.94e-8. Save both tables instead of merely accepting a plausible plot. - Retain the complete request, full response, source commit, solver, units, resolved environment, tolerance and failed checks. Compare numerical rows on repeat execution; the local observations had identical numbers but different sweep hashes.
Optional HTTP contract and safeguards
The actual source route POST /simulations/parameter-sweep accepts the same JSON. Its router was tested in a minimal FastAPI app, excluding full-app middleware and authentication. Full startup is blocked by issue #47. An administrator must establish the installed service URL and access policy before any live HTTP exercise; no URL is supplied or verified here.
Use the exact path gain. A tested misspelling, gaim, was accepted but did not alter the model’s effective gain: all three outputs were identical. A success flag alone therefore does not establish that the intended parameter changed. This example explicitly checks known numerical outputs.
Reading the result
Each run has an index, parameterValue, metricValue, simulationRunHash and diagnostics. The sweep also reports minimumMetric and maximumMetric. A larger response is not automatically scientifically better, and the engine does not optimize. Plot K on the horizontal axis and the dimensionless final state at 2 s on the vertical axis only after checking the table. Plot creation/export controls were not tested.
Source evidence, test status and related guides
SweepRequest, parameter_sweep, metric extraction and the actual route; Underlying first-order derivative and RK4 integrator; Parameter path setter; Existing simulation/sweep regressions.
On 2026-11-10, 19 focused local checks passed, including the unchanged test_parameter_sweep_is_bounded_and_does_not_optimize function, using the actual v750 router in a minimal FastAPI app. The full upstream test command could not collect because app.main imports missing app.v10110. tests/test_v750_static.py produced 1 pass and 3 failures from historical release/plugin assertions and missing retired root release artifacts. No source repair or deployed acceptance was performed.
Engineering tracking, checked for existing issues first: startup blocker #47, release-reference inconsistencies #48, and quantity HTTP error handling #49. Issue #49 concerns the separate quantity route; do not assume the same errors occur in every sweep request.
Related: overview, worked how-to, research protocol, developer reference, troubleshooting. Technical/scientific review remains pending and the review owner is unassigned.
