Scientific Question, Model and Experimental Plan
Scientific Python in GX-TXT · Module 10 · Lesson 55
In this final project we compare two decays of the first order simulated on a computer. The didactic question is: will we be able to estimate the decay constants of the two signals from noisy synthetic data?
Objectives
- Formulate model, units and conditions before calculation.
- Declare seed and noise characteristics.
- Establish measurable controls for subsequent lessons.
- Separate simulation and experimental observation.
Protocol
The model is \(y(t)=A\exp(-kt)\). We use 21 equidistant times between 0 and 5 s, initial amplitude \(A=3\,\mathrm{mV}\), constants \(k_A=0{.}5\,\mathrm{s}^{-1}\) and \(k_B=0{.}8\,\mathrm{s}^{-1}\). We will add synthetic normal noise with standard deviation 0.05 mV and seed 2026. The exponential argument is dimensionless because k is in s⁻¹ and t in s.
These values are simulated, not laboratory measurements. A fit on noisy data should not necessarily return exactly the generation parameters. We will check dimensions, units, origin, outcome of the solver and residuals, without deleting data to improve the result.
Execution
Import protocol.py into the corso_python Session, save it and run it in the Runner.

from gxtxt import gxtxt_api_require, gxtxt_context
gxtxt_api_require("DATASET_PUBLICATION_API_v2@2")
gxtxt_api_require("NUMERIC_API_v1@1")
protocol = {"modello": "A * exp(-k * t)", "tempi_s": "0..5 with 21 points",
"ampiezza_mV": 3.0, "k_A_per_s": 0.5, "k_B_per_s": 0.8,
"sigma_mV": 0.05, "seed": 2026}
print("STUDIO DIDATTICO: synthetic data, non-measures")
for display_name, value in protocol.items():
print(display_name, ":", value)
print("Controls: shape, unit, seed, convergence and residual")
print("Environment Runner available:", bool(gxtxt_context()))

The script records the plan as a dictionary and checks the availability of the necessary APIs. In the next lesson, the protocol will be associated with the published Datasets, together with the synthetic origin.
Exercise
- What condition decays more quickly according to the model?
- What units do
A,tandkhave? - Does the seed make these measurements?
Worked solution
- B, because
0.8 s⁻¹is greater than0.5 s⁻¹. - Respectively mV, s and s−1.
- No. The seed documents the pseudorandom generation; the data remains synthetic.