ELEC · Practical Guide 09 — Fit only h in the ODE model with the S2 source
Register the model and fit h to the 100 rpm nitrogen data with the S2 source and all other parameters fixed. Inspect the resulting curve and provenance.
ELEC project · Practical GX-TXT guide 9 of 16.
Reproduction target: GX-TXT DEV112-P013. The original screenshots and recorded results document the historical ELEC session. A rerun on P013 has yet to be verified.
Module: Curve Fitter / Script Library
Learning objective: Fit only h in the ODE model with the S2 source
Prerequisites / input: Seven 100 rpm N centres and registered ODE model
Expected output: h-only calibration conditional on S2
Scientific background and reference results
This example uses the nitrogen-free effective S2 source as a fixed assumption, rather than a measurement of gross chlorine production. The Fitter estimates only reaction_strength (h) on the 100 rpm N curve. S2 standard deviations are not automatically weights. Reproduce on a copy with new IDs; P013 is NOT_RUN.
Step-by-step procedure
- In Curve Fitter open a copy of Workspace
S2 source h-only — 100 rpm, or use Add Dataset curve forhal_fig3b_100rpm_seven_interior_unweighted.measurement_1.curves. Select x/y, all seven rows, and disable translations. - Under Models → Declare Script Library model… choose
session:elec_assay_chlorine_public_ode_model_011, entrypointelec_assay_chlorine_public_ode_N. For a new declaration assign an unused callable ID, distinct from historicalassay_s2_fixed_h_100rpm_011. Declare, in order,reaction_strength,source_f,loss_per_min,oxidant_demand_nu,initial_N_mg_L,M_N_g_mol,current_A,volume_m3,F_C_mol,reference_time_s; units1,1,1/min,1,mg/L,g/mol,A,m^3,A*s/mol,s. - Fill in the following parameters. Only
reaction_strengthis free, with bounds0and1; for the others both bounds equal the value and Fixed is active. Predictormin, responsemg/L.
| Parameter | Value | Unit | Fixed |
|---|---|---|---|
| reaction_strength | 0.05335295399640882 | 1 | no |
| source_f | 0.4460235769955215 | 1 | yes |
| loss_per_min | 0 | 1/min | yes |
| oxidant_demand_nu | 1.5 | 1 | yes |
| initial_N_mg_L | 10 | mg/L | yes |
| M_N_g_mol | 14.0067 | g/mol | yes |
| current_A | 0.12 | A | yes |
| volume_m3 | 0.0002 | m^3 | yes |
| F_C_mol | 96485.33212 | A*s/mol | yes |
| reference_time_s | 6 | s | yes |
The mask in declared order is 0,1,1,1,1,1,1,1,1,1. Fraction source_f is the value of existing scalar Dataset s2_source_f_100rpm_01; check its origin and units before transcription.

- Use Apply, select the model, then Preview fit. Examine residuals and statistics before Accept and publication with a new ID. Historical result
hal_fig3b_assay_s2_fixed_h_100rpm_011has h approximately0.03928129500594746and RMSE0.21260451565227792 mg N/L. h is an effective parameter in the adopted model, rather than an independently identified chemical constant. - The fixed fraction derives from S2’s 100 rpm row
5.9 g*m^-3*min^-1, through2*F*V*p/(M*I), withF=96485.33212 [A*s/mol],V=0.0002 [m^3],M=70.906 [g/mol],I=0.12 [A]. The unit engine handles minutes and seconds: do not add a manual factor of 60. Other stirring speeds require their own declarations.

The historical declaration and model source retain complete fields. The result alone does not identify the mechanism.
Working materials
Figure 3 digitized datasets (CSV) · Model and constraint datasets (CSV) · ELEC working files (ZIP)
Other steps of this project
- ELEC 02 — Model hierarchy: effective kinetics, transfer and identifiability
- ELEC 03 — From fits to constraints: what does the chlorine balance reveal?
- ELEC 01 — What does the experiment measure? Nitrogen, chlorine and pH
- ELEC 07 — Sources, conclusions and tests that could distinguish the mechanisms
- ELEC 04 — Kinetics, speciation and transport: from local reaction to reactor response
- ELEC 06 — Where the numbers came from: GX-TXT, GNU Octave and reproducibility