ELEC · Practical Guide 09 — Fit only h in the ODE model with the S2 source

by Giux Electrochemistry, GX-TXT 3 min read

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

  1. In Curve Fitter open a copy of Workspace S2 source h-only — 100 rpm, or use Add Dataset curve for hal_fig3b_100rpm_seven_interior_unweighted.measurement_1.curves. Select x/y, all seven rows, and disable translations.
  2. Under Models → Declare Script Library model… choose session:elec_assay_chlorine_public_ode_model_011, entrypoint elec_assay_chlorine_public_ode_N. For a new declaration assign an unused callable ID, distinct from historical assay_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; units 1,1,1/min,1,mg/L,g/mol,A,m^3,A*s/mol,s.
  3. Fill in the following parameters. Only reaction_strength is free, with bounds 0 and 1; for the others both bounds equal the value and Fixed is active. Predictor min, response mg/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.

S2 model declaration
Lower part of the historical private declaration: bounds and Fixed mask, rather than a P013 screenshot. · Retained original GX-TXT/ELEC documentation image; source and hash in metadata. Atrashkevich et al. (2025), DOI 10.1016/j.watres.2025.123732 for any publication pixels. View at full resolution
  1. 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_011 has h approximately 0.03928129500594746 and RMSE 0.21260451565227792 mg N/L. h is an effective parameter in the adopted model, rather than an independently identified chemical constant.
  2. The fixed fraction derives from S2’s 100 rpm row 5.9 g*m^-3*min^-1, through 2*F*V*p/(M*I), with F=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.
100 rpm S2 result
Historical comparison of the 100 rpm calibration, conditional on the fixed S2 source. · Retained original GX-TXT/ELEC documentation image; source and hash in metadata. Atrashkevich et al. (2025), DOI 10.1016/j.watres.2025.123732 for any publication pixels. View at full resolution

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)

#Curve Fitter #differential equations #Electrochemistry #GX-TXT #ODE

Other steps of this project