Synthetic exponential decay dataset
Time is drawn from 0 to 14 and the clean trace is 4.2 exp(−0.28 t) + 0.15. Gaussian noise of standard deviation 0.08 sits on top. Seed 3 repeats the curve. It behaves like a sensor settling, and it is not a recording.
What this page generates
Exponential return to a baseline shows up in cooling, discharge, and tracer washout. This page fixes the rate at 0.28 per unit time, the starting amplitude at 4.2, and the floor at 0.15. The time constant is 1/0.28, about 3.57 time units. After one time constant the exponential piece has fallen to about 37 percent of 4.2. After three time constants it is almost gone and the trace sits near the floor, plus noise.
The noise is small next to the drop from about 4.35 at t = 0 to 0.15 at late times, so a log fit of (y − 0.15) is reasonable if you use the clean floor and not a guessed one. Using the noisy y without subtracting 0.15 bends the log plot at late times, because the floor is then a large fraction of the signal. That mistake is worth assigning, and the file contains both columns so the mistake can be shown.
Draws of t are uniform, not a regular sample clock. A real logger would use equal steps. Equal steps are available by editing the input, but the default matches a random observation time. Do not interpret gaps as missing sensor packets. They are the uniform generator.
Generating rule
Decay law
y = 4.2*exp(-0.28*t) + 0.15
Check values
Worked numbers
The earliest time in seed 3 is t = 0.020, where the clean trace is 4.326. The latest time is t = 13.864, where the clean trace has fallen to 0.237, close to the floor 0.15. The rate 0.28 is a property of the formula, not a fit to these two rows.
Parameters and defaults
| Parameter | Default | Range | Effect |
|---|---|---|---|
| t | uniform [0, 14] | finite interval | Observation time. 14 covers about four time constants. |
| samples | 120 | 2 to 20,000 | How many observation times are drawn. |
| Gaussian std | 0.08 | ≥ 0 | Instrument noise, small beside the amplitude 4.2. |
| seed | 3 | unsigned 32-bit | Repeats the times and the noise. |
Python for this seed
Full script with mulberry32() & box_muller() available via Copy Python above
# SYNTHETIC DATA - generated by MockDataLab (mockdatalab.com)
# This file is synthetic and must not be presented as real measurements, clinical data, or results from a physical instrument.
# generator: function-relation
# seed: 3
# formula: y = 4.2*exp(-0.28*t) + 0.15
# samples: 120
# mulberry32() and box_muller() are included when you copy the full script.
SEED = 3
N = 120
rng = mulberry32(SEED)
t = np.empty(N, dtype=np.float64)
y_clean = np.empty(N, dtype=np.float64)
y = np.empty(N, dtype=np.float64)
for i in range(N):
t[i] = (0.0) + ((14.0) - (0.0)) * rng()
y_clean[i] = ((4.2 * math.exp(((-(0.28)) * t[i]))) + 0.15)
noise = 0.0
noise += (0.08) * box_muller(rng)
y[i] = y_clean[i] + noise
columns = ["t","y_clean","y"]
data = np.column_stack([t, y_clean, y])
Exercises
- EXERCISE 01Fit a nonlinear least-squares decay and compare the rate with 0.28.
- EXERCISE 02Show how forgetting the baseline ruins a log-linear plot.
- EXERCISE 03Give a plotting exercise a curve that is monotone in the mean but not in the noisy column.
Questions
What is y at t = 0?
The clean value is 4.2 + 0.15 = 4.35. A random draw of t is rarely exactly 0, so the first row is not that number unless its t is 0.
Is 0.28 a half-life?
No. It is the exponential rate. The half-life is ln(2)/0.28, about 2.48 time units.
Can the noisy trace increase from one row to the next?
Yes. The mean decreases as t increases, but rows are not sorted, and noise can lift a later time above an earlier one.
Related
- a decay multiplied by a cosine
- the same exponential shape as a step response
- change the rate or the baseline
- the decay CSV for seed 3
- Static CSV for seed 3
SYNTHETIC DATA - generated by MockDataLab (mockdatalab.com). Do not present the download as a real measurement.