Skip to content

Calibrating the hydration kinetics of a CEM I on measured calorimetry ​

Before this page

A complete CEM I 52.5 N, through its pore solution, and Where the numbers come from for the provenance of a fitted parameter.

A complete CEM I 52.5 N, through its pore solution runs a complete CEM I forward and reads its calorimetry off a certified replay, with the kinetic parameters Parrott and Killoh published in 1984. Its IONIC_CALIBRATION dictionary is an explicit, deliberately unused hook: "the entry exists so that a study which needs the degrees of hydration to follow a reference curve can scale them without touching the rate laws".

This page closes that loop the other way. Given a measured heat curve of a real CEM I, which kinetic parameters reproduce it — and, the harder question, which of them does the measurement actually determine?

The model lives in scripts/hydration_calibration.jl, which this page includes, so the page and the script cannot drift apart.

Kinetic parameters only

ΔₐG⁰, ΔₐH⁰, Cp⁰ and log K come from CEMDATA18 (Lothenbach et al., 2019). They are measured quantities, not free parameters, and moving them to improve a fit would be fabricating chemistry rather than calibrating a model. The Blaine fineness, the water/binder ratio and the temperature are not fitted either, for the plainer reason that the experiment reports them.

1. The data, and the right to use it ​

Provenance and license

The two records are subsets of the Zenodo deposit of (Šmilauer and Reiterman, 2025), licensed CC-BY-4.0, which permits redistribution and adaptation with attribution. The subsets are vendored under data/experimental/; regenerate.jl there rebuilds them byte for byte from the deposit, and LICENSE states the terms.

The depositors ask that their companion article (Šmilauer et al., 2026) be cited. That article is published under CC BY-NC-ND 3.0, so it is cited here and nothing is reproduced from it — no figure, no table, no passage. Only the CC-BY-4.0 data deposit is reused.

julia
using ChemistryLab, DynamicQuantities, OptimaSolver, OrdinaryDiffEq
using Optimization, OptimizationOptimJL, OrderedCollections
using LinearAlgebra, Printf, Statistics, Plots
gr()

include(joinpath(pkgdir(ChemistryLab), "scripts", "hydration_calibration.jl"))

println(CEM_I_TARGET)
println(CEM_I_HOLDOUT)
CalorimetryData(Cizkovice 52.5R, w/b 0.50, Blaine 397 m²/kg, 1.0–262.4 h, 485 points)
CalorimetryData(CEM I 42.5R Ladce-415, w/b 0.45, Blaine 415 m²/kg, 1.2–617.5 h, 458 points)
Data read above: Lavergne2018Lavergne, F. et al. (2018)21 quantities, 22 tables

Lavergne, F., Ben Fraj, A., Bayane, I., Barthélémy, J.-F. (2018). Estimating the mechanical properties of hydrating blended cementitious materials: an investigation based on micromechanics. Cement and Concrete Research 104, 37-60. doi:10.1016/j.cemconres.2017.10.018

Read in checked against the source

Transcribed from the published article (PDF): Tables 3, 4, 7, 9 and 11, pp. 39, 41, 45 and 55, read on the page images and, for Table 7, on the text layer by column; the calorimeter of p. 51; Figs. 1, 4 to 7 and 9(b), pp. 42, 46 to 50 and 52, read exactly from their vector drawings; Figs. 15(a) and 16(a), p. 56, read from their raster image as described in the notes and in the digitization of their tables

The values were in src/kinetics/rate_models.jl before this file existed and agree with the article to the last digit. Table 3 gives the parameters of Parrott and Killoh (1984) as reported by Lothenbach et al. (2008), ref. [30] of the article. The text cites the activation energies of Table 4 to refs. [60, 64], [60] being Maekawa et al. (1999). The pozzolanic kinetics of p. 42, Eqs. (24)-(25), follow Waller (1999), ref. [31], with n and tau adjusted to the SEM analyses of ref. [81]. Table 9 and Table 11 (p. 55) and the calorimeter of p. 51 were in the scripts and pages before this file existed and agree with the article. Table 11 names one mix C75FA525 at w/b = 0.5 and C75FA25 at 0.32; both spellings are kept as printed.

Quantities

namevaluedescriptionwhere
T_ref293.15 KTemperature at which the kinetic parameters apply. Table 3 caption, p. 39 (20 °C); also p. 42 for the pozzolanic reaction
blaine_ref_clinker385 m^2/kgBlaine fineness B0 for which the Parrott-Killoh adjustments are valid. p. 39
waller_n0.7Exponent of the sigmoid in log time of the degree of pozzolanic reaction of a fly ash. fittedp. 42, Eq. (24)
waller_tau_fly_ash80 dCharacteristic time of the pozzolanic reaction of a fly ash of 60 % pozzolanic activity. fittedp. 42, Eq. (24)
waller_blaine_ref400 m^2/kgBlaine fineness of the fly ash to which the pozzolanic kinetics refer. p. 42
waller_Ea83.14 kJ/molActivation energy of the pozzolanic reactions. p. 42
blaine_silica_fume2000 m^2/kgBlaine fineness taken by default for silica fume so that silica fume and fly ash share the same kinetics; a convention, not a measurement (the B.E.T. surface quoted on the same page is about 20 000 m^2/kg). estimatedp. 42
pozzolanic_activity_fly_ash0.6Pozzolanic activity of the fly ash assumed in the adjustment of the sigmoid. p. 42
blaine_cement380 m^2/kgBlaine fineness of the cement. Table 9, p. 55
blaine_limestone_filler462 m^2/kgBlaine fineness of the limestone filler of the blends. p. 51
sand_water_absorption0.009Water absorbed by the dry sand, as a fraction of its mass; the water of Table 11 includes it, so that the paste is at the stated w/b. Table 11 caption, p. 55
calorimeter_heat_capacity380 kJ/KHeat capacity of the semi-adiabatic calorimeter, printed 'about 380 kJ/K'. The package reads the number as 380 J/K: see CALORIMETRY_VESSEL_CP in scripts/ionic_hydration.jl. p. 51
clinker_percent96Clinker in the CEM I 52.5 N of the study, percent by mass of cement. Table 9, p. 55
density_cement3.12 g/cm^3Density of the cement. Table 9, p. 55
gypsum_percent4.6Gypsum in the cement, percent by mass. Table 9, p. 55
heat_loss_a75 J/(h*K)Linear coefficient of the calorimeter's heat loss, from its calibration to NF EN 196-9. p. 51, Eq. (23)
heat_loss_b0.26 J/(h*K^2)Quadratic coefficient of the calorimeter's heat loss; printed 0.260. p. 51, Eq. (23)
limestone_percent3.5CaCO3 in the cement, percent by mass. Table 9, p. 55
bet_silica_fume20000 m^2/kgB.E.T. specific surface of silica fume, 'about 20,000 m2/kg', which the article quotes from its ref. [31], Waller (1999). p. 42
csh_water4Moles of water per mole of silica of the C-S-H formed by the hydration of the clinker, its gel water included. Table 1, p. 38: the C-S-H C1.7SH4, saturated by the caption of Table 2, p. 39
pozzolanic_csh_water3.9Moles of water per mole of silica of the C-S-H formed by the pozzolanic reaction, its gel water included. Table 1, p. 38, and Section 1.4, p. 41: the C-S-H C1.1SH3.9 of the pozzolanic reaction

Tables

parrott_killoh_1984: 4 rows fitted

Table 3, p. 39

phasek1 [1/d]n1k2 [1/d]k3 [1/d]n3
C3S1.50.70.051.13.3
C2S0.51.00.0060.25.0
C3A1.00.850.041.03.2
C4AF0.370.70.0150.43.7
activation_energies: 4 rows

Table 4, p. 41

phaseEa [kJ/mol]Ea_over_R [K]
C3A546500
C3S425000
C4AF323800
C2S212500
cement_bogue: 4 rows

Table 9, p. 55: the Bogue composition of the clinker, percent by mass of clinker

phasepercent
C3S65
C2S11
C3A11
C4AF8
semi_adiabatic_C100_wb050_temperature: 48 rows measured

Fig. 15(a), p. 56: temperature of the C100 mortar at w/b = 0.5 in the semi-adiabatic calorimeter (thick blue line), from its maximum to 3.5 days

read off a figure raster image, the line located column by column by its color and width, mapped through the vector frame of the panel; reading error ± 0.2 K. One pixel is 0.03 K and 0.008 d; the width of the line makes the reading good to about 0.2 K.

time [d]temperature_C
0.6151.17
0.64751.83
0.752.12
0.75352.15
0.80251.8
0.85151.27
0.950.72
0.94950.13
0.99849.49
1.04748.77
1.09648.05
1.1547.28
1.20346.46
1.25245.73
1.30144.91
1.3544.2
1.39943.42
1.44842.7
1.49741.94
1.5541.15
1.60340.34
1.65239.63
1.70138.91
1.7538.21
1.79937.54
1.84836.87
1.89736.23
1.94635.58
2.00334.9
2.05234.32
2.10133.75
2.1533.21
2.19532.7
2.23232.31
2.28931.66
2.33431.19
2.95926.59
3.026.38
3.04926.09
3.09825.79
3.14725.54
3.225.29
3.25425.02
3.30324.81
3.35224.59
3.40124.38
3.4524.18
3.49923.99
semi_adiabatic_mixes_wb032: 8 rows

Table 11, p. 55, mixes at w/b = 0.32

namebinder [g]dry_sand [g]water [g]
C1005661131191
C95L056161173208
C90L106291143211
C85L156451121216
C70L306861055229
C95SF055671080191
C85SF155931030199
C75FA25601963202
semi_adiabatic_mixes_wb050: 9 rows

Table 11, p. 55, mixes at w/b = 0.5 (C85L15 at 0.48)

namebinder [g]dry_sand [g]water [g]
C1003711113196
C95L05503947257
C90L10517924252
C85L15516905258
C70L30566870291
C95SF05510971263
C85SF15536932277
C75FA525546873280
C50FA50580773297
table7_cements: 39 rows

Table 7, p. 45: the Bogue composition of each cement, percent by mass, its calcium sulfates as printed (a number alone is gypsum; CS̅ anhydrite, CS̅H0.5 hemihydrate), its CaCO3 and its Blaine fineness; blaine_estimated marks the values the table prints in parentheses

nameC3SC2SC3AC4AFcalcium_sulfatesCaCO3blaine [m^2/kg]blaine_estimatedsource
A68.025.33.6—3.9—470.0false[101]
B49.125.55.810.74.3—310.0falseXRD-Rietveld p21
C64.516.26.78.73.3—200.0falseBlaine from d50
OPCN71.610.93.710.73.1—376.5falsep106 using [123]
OPCS65.616.48.07.42.6—359.8false[100]
OPC52.518.25.010.90.4+ 2.2CS̅2.5380.0false[102]
CRC67.613.12.78.92.4CS̅H0.5+ 1.2CS̅0.9350.0false—
OPC I53.718.09.17.65.07CS̅H0.5—429.0false[103]
ca58.015.07.78.54.2CS̅—397.0false[31]
c1150.022.012.17.22.7CS̅—343.6false[88], Bogue estimated from chemical composition
c11T51.021.012.17.12.6CS̅—364.0false—
c1245.028.012.67.32.7CS̅—327.6false—
c12T46.027.012.57.12.7CS̅—315.2false—
c1350.026.010.16.52.8CS̅—342.8false—
c1442.532.08.29.22.9CS̅—342.4false—
c1564.510.012.17.53.2CS̅—322.9false—
c1653.521.07.510.72.9CS̅—326.1false—
c16T52.522.07.910.43.1CS̅—311.4false—
c1752.023.010.49.32.9CS̅—398.5false—
c1844.528.013.26.83.1CS̅—326.8false—
c18T44.028.513.26.72.9CS̅—375.6false—
c2140.041.06.49.72.1CS̅—289.1false—
c21T38.040.06.69.72.2CS̅—298.3false—
c2241.533.56.611.72.4CS̅—306.5false—
c2351.024.03.716.62.6CS̅—310.9false—
c2441.029.05.414.83CS̅—369.7false—
c2534.039.04.714.93.2CS̅—328.7false—
c3156.017.010.86.43.8CS̅—579.5false—
c3360.013.010.47.73.9CS̅—527.2false—
c33T57.016.010.47.33.7CS̅—516.9false—
c3464.010.55.710.12.9CS̅—496.9false—
c4120.051.04.515.23.4CS̅—367.9false—
c4227.055.03.58.22.6CS̅—350.1false—
c4325.048.06.213.83.6CS̅—384.6false—
c43A29.052.05.39.33.2CS̅—363.3false—
c5141.039.03.710.02.4CS̅—348.3false—
—41.434.09.87.55—312.0false[87], reported by [63]
H64.48.94.89.11.8+2.1CS̅H0.5+ 1.7CS̅—360.0false[105]
D71.29.58.41.31.4+3.4CS̅4.5400.0false—
table7_additions: 8 rows

Table 7, p. 45: the mineral additions, their composition as printed (S silica, A alumina, CS̅ calcium sulfate, percent by mass, and the pozzolanic activity) and their Blaine fineness

namecompositionblaine [m^2/kg]blaine_estimated
Fly ashS = 57.4, A = 18.2, CS̅= 1.5, activity = 0.4380.0false
SFS = 94.5, activity = 0.92000.0true
cvaS = 49.1, A = 26.5, CS̅ = 0.9, activity = 0.6400.0true
cvbS = 54.4, A = 25, CS̅ = 0.2, activity = 0.6400.0true
cvcS = 55.1, A = 29.7, CS̅ = 0.7, activity = 0.6400.0true
cvdS = 49.2, A = 35.6, CS̅ = 0.9, activity = 0.6400.0true
cveS = 45.9, A = 23.5, CS̅ = 0.9, activity = 0.6400.0true
fsa→dS = 90.9→92, activity = 0.92000.0true
fig1_volume_fractions_estimated: 1258 rows estimated

Fig. 1, p. 42: the volume fraction of each phase of the sealed pastes of Table 9 as a function of the hydration degree of the cement, by the article's model; the plotted cumulative fractions differenced at the vertices both boundaries of a phase share, the air one minus the upper boundary of the capillary water

read off a figure vector drawing, the drawing operators of the PDF read with PyMuPDF: a marker at the crossing of its two centerline segments, a line along its stroke centerline, the axes calibrated by least squares on their major ticks; reading error not quantified. The calibration residual is below 1e-4 of the span of each axis; values rounded to 5 significant digits on a logarithmic axis, to 1e-5 of the tick span on a linear one. A curve keeps the vertices it is drawn with, each at least 0.01 in alpha, or 0.02 decade in time, from the last kept, the first and last always; none is interpolated.

pastephasealphavolume_fraction
plain paste, w/c = 0.5unhydrated cement0.00.3489
plain paste, w/c = 0.5unhydrated cement0.01010.34533
plain paste, w/c = 0.5unhydrated cement0.020190.34176
plain paste, w/c = 0.5unhydrated cement0.030250.3382
plain paste, w/c = 0.5unhydrated cement0.040610.33453
plain paste, w/c = 0.5unhydrated cement0.050850.3309
plain paste, w/c = 0.5unhydrated cement0.060960.32733
plain paste, w/c = 0.5unhydrated cement0.071580.32357
plain paste, w/c = 0.5unhydrated cement0.081860.31993
plain paste, w/c = 0.5unhydrated cement0.09220.31628
plain paste, w/c = 0.5unhydrated cement0.102480.31265
plain paste, w/c = 0.5unhydrated cement0.112560.30908
plain paste, w/c = 0.5unhydrated cement0.123160.30534
plain paste, w/c = 0.5unhydrated cement0.134270.30141
plain paste, w/c = 0.5unhydrated cement0.144990.29763
plain paste, w/c = 0.5unhydrated cement0.155190.29404
plain paste, w/c = 0.5unhydrated cement0.165730.29031
plain paste, w/c = 0.5unhydrated cement0.176610.28647
plain paste, w/c = 0.5unhydrated cement0.187770.28254
plain paste, w/c = 0.5unhydrated cement0.198170.27888
plain paste, w/c = 0.5unhydrated cement0.209880.27476
plain paste, w/c = 0.5unhydrated cement0.220760.27094
plain paste, w/c = 0.5unhydrated cement0.231850.26704
plain paste, w/c = 0.5unhydrated cement0.242010.26347
plain paste, w/c = 0.5unhydrated cement0.252340.25984
plain paste, w/c = 0.5unhydrated cement0.266340.25493
plain paste, w/c = 0.5unhydrated cement0.278210.25077
plain paste, w/c = 0.5unhydrated cement0.289030.24699
plain paste, w/c = 0.5unhydrated cement0.301150.24275
plain paste, w/c = 0.5unhydrated cement0.312130.23891
plain paste, w/c = 0.5unhydrated cement0.325620.23419
plain paste, w/c = 0.5unhydrated cement0.336690.23032
plain paste, w/c = 0.5unhydrated cement0.347780.22644
plain paste, w/c = 0.5unhydrated cement0.358880.22255
plain paste, w/c = 0.5unhydrated cement0.373670.21739
plain paste, w/c = 0.5unhydrated cement0.384750.21352
plain paste, w/c = 0.5unhydrated cement0.395790.20966
plain paste, w/c = 0.5unhydrated cement0.406780.20581
plain paste, w/c = 0.5unhydrated cement0.420140.20115
plain paste, w/c = 0.5unhydrated cement0.430960.19737
plain paste, w/c = 0.5unhydrated cement0.442860.1932
plain paste, w/c = 0.5unhydrated cement0.453440.18951
plain paste, w/c = 0.5unhydrated cement0.463920.18585
plain paste, w/c = 0.5unhydrated cement0.474260.18224
plain paste, w/c = 0.5unhydrated cement0.484480.17867
plain paste, w/c = 0.5unhydrated cement0.495670.17478
plain paste, w/c = 0.5unhydrated cement0.509930.1698
plain paste, w/c = 0.5unhydrated cement0.520690.16606
plain paste, w/c = 0.5unhydrated cement0.531240.16237
plain paste, w/c = 0.5unhydrated cement0.54160.15876
plain paste, w/c = 0.5unhydrated cement0.551750.15522
plain paste, w/c = 0.5unhydrated cement0.562680.15142
plain paste, w/c = 0.5unhydrated cement0.573360.1477
plain paste, w/c = 0.5unhydrated cement0.583790.14407
plain paste, w/c = 0.5unhydrated cement0.593970.14052
plain paste, w/c = 0.5unhydrated cement0.60480.13676
plain paste, w/c = 0.5unhydrated cement0.615320.13309
plain paste, w/c = 0.5unhydrated cement0.625550.12953
plain paste, w/c = 0.5unhydrated cement0.636310.12579
plain paste, w/c = 0.5unhydrated cement0.646750.12216
plain paste, w/c = 0.5unhydrated cement0.656850.11864
plain paste, w/c = 0.5unhydrated cement0.667390.11499
plain paste, w/c = 0.5unhydrated cement0.677560.11146
plain paste, w/c = 0.5unhydrated cement0.688070.1078
plain paste, w/c = 0.5unhydrated cement0.69820.10429
plain paste, w/c = 0.5unhydrated cement0.708590.10067
plain paste, w/c = 0.5unhydrated cement0.719180.097
plain paste, w/c = 0.5unhydrated cement0.729350.09347
plain paste, w/c = 0.5unhydrated cement0.740760.0895
plain paste, w/c = 0.5unhydrated cement0.75110.08592
plain paste, w/c = 0.5unhydrated cement0.761460.08232
plain paste, w/c = 0.5unhydrated cement0.771820.07874
plain paste, w/c = 0.5unhydrated cement0.782130.07516
plain paste, w/c = 0.5unhydrated cement0.792340.07162
plain paste, w/c = 0.5unhydrated cement0.802420.06813
plain paste, w/c = 0.5unhydrated cement0.813110.06442
plain paste, w/c = 0.5unhydrated cement0.823160.06095
plain paste, w/c = 0.5unhydrated cement0.83330.05743
plain paste, w/c = 0.5unhydrated cement0.843440.05392
plain paste, w/c = 0.5unhydrated cement0.853510.05044
plain paste, w/c = 0.5unhydrated cement0.86370.04692
plain paste, w/c = 0.5unhydrated cement0.873910.04338
plain paste, w/c = 0.5unhydrated cement0.884040.03989
plain paste, w/c = 0.5unhydrated cement0.894170.03639
plain paste, w/c = 0.5unhydrated cement0.904180.03293
plain paste, w/c = 0.5unhydrated cement0.914280.02945
plain paste, w/c = 0.5unhydrated cement0.92440.02595
plain paste, w/c = 0.5unhydrated cement0.934430.02249
plain paste, w/c = 0.5unhydrated cement0.944440.01904
plain paste, w/c = 0.5unhydrated cement0.95450.01559
plain paste, w/c = 0.5unhydrated cement0.963140.01261
plain paste, w/c = 0.5calcite0.00.01513
plain paste, w/c = 0.5calcite0.01010.01513
plain paste, w/c = 0.5calcite0.020190.01513
plain paste, w/c = 0.5calcite0.030250.01513
plain paste, w/c = 0.5calcite0.040610.01513
plain paste, w/c = 0.5calcite0.050850.01513
plain paste, w/c = 0.5calcite0.061530.01513
plain paste, w/c = 0.5calcite0.071580.01513
plain paste, w/c = 0.5calcite0.081860.01513
plain paste, w/c = 0.5calcite0.09220.01513
plain paste, w/c = 0.5calcite0.102480.01513
plain paste, w/c = 0.5calcite0.112560.01513
plain paste, w/c = 0.5calcite0.123160.01513
plain paste, w/c = 0.5calcite0.134270.01513
plain paste, w/c = 0.5calcite0.144990.01514
plain paste, w/c = 0.5calcite0.155190.01513
plain paste, w/c = 0.5calcite0.165730.01513
plain paste, w/c = 0.5calcite0.177610.01513
plain paste, w/c = 0.5calcite0.187770.01514
plain paste, w/c = 0.5calcite0.198170.01504
plain paste, w/c = 0.5calcite0.20880.01486
plain paste, w/c = 0.5calcite0.220760.01464
plain paste, w/c = 0.5calcite0.231850.01443
plain paste, w/c = 0.5calcite0.242010.01425
plain paste, w/c = 0.5calcite0.252340.01406
plain paste, w/c = 0.5calcite0.266340.01382
plain paste, w/c = 0.5calcite0.279410.01358
plain paste, w/c = 0.5calcite0.290240.0134
plain paste, w/c = 0.5calcite0.301150.0132
plain paste, w/c = 0.5calcite0.312130.013
plain paste, w/c = 0.5calcite0.326840.01273
plain paste, w/c = 0.5calcite0.337910.01253
plain paste, w/c = 0.5calcite0.349010.01233
plain paste, w/c = 0.5calcite0.369970.01193
plain paste, w/c = 0.5calcite0.385980.01163
plain paste, w/c = 0.5calcite0.397020.0114
plain paste, w/c = 0.5calcite0.408010.01119
plain paste, w/c = 0.5calcite0.420140.01094
plain paste, w/c = 0.5calcite0.430960.01073
plain paste, w/c = 0.5calcite0.442860.0105
plain paste, w/c = 0.5calcite0.453440.01028
plain paste, w/c = 0.5calcite0.463920.01008
plain paste, w/c = 0.5calcite0.476550.00984
plain paste, w/c = 0.5calcite0.486730.00964
plain paste, w/c = 0.5calcite0.498990.00941
plain paste, w/c = 0.5calcite0.509930.0092
plain paste, w/c = 0.5calcite0.520690.00898
plain paste, w/c = 0.5calcite0.531240.00878
plain paste, w/c = 0.5calcite0.54160.00859
plain paste, w/c = 0.5calcite0.551750.00841
plain paste, w/c = 0.5calcite0.562680.00819
plain paste, w/c = 0.5calcite0.573360.008
plain paste, w/c = 0.5calcite0.583790.0078
plain paste, w/c = 0.5calcite0.593970.00762
plain paste, w/c = 0.5calcite0.60480.00742
plain paste, w/c = 0.5calcite0.616180.00722
plain paste, w/c = 0.5calcite0.626390.00702
plain paste, w/c = 0.5calcite0.637130.00683
plain paste, w/c = 0.5calcite0.648320.00663
plain paste, w/c = 0.5calcite0.658380.00645
plain paste, w/c = 0.5calcite0.668850.00626
plain paste, w/c = 0.5calcite0.678980.00608
plain paste, w/c = 0.5calcite0.689440.00592
plain paste, w/c = 0.5calcite0.699520.00574
plain paste, w/c = 0.5calcite0.709860.00555
plain paste, w/c = 0.5calcite0.720410.00538
plain paste, w/c = 0.5calcite0.730520.0052
plain paste, w/c = 0.5calcite0.740760.00503
plain paste, w/c = 0.5calcite0.75110.00485
plain paste, w/c = 0.5calcite0.761460.00468
plain paste, w/c = 0.5calcite0.771820.0045
plain paste, w/c = 0.5calcite0.782130.00434
plain paste, w/c = 0.5calcite0.792340.00417
plain paste, w/c = 0.5calcite0.802420.00401
plain paste, w/c = 0.5calcite0.813110.00384
plain paste, w/c = 0.5calcite0.823160.00368
plain paste, w/c = 0.5calcite0.83330.00352
plain paste, w/c = 0.5calcite0.843440.00336
plain paste, w/c = 0.5calcite0.853510.00321
plain paste, w/c = 0.5calcite0.86370.00305
plain paste, w/c = 0.5calcite0.873910.0029
plain paste, w/c = 0.5calcite0.884040.00275
plain paste, w/c = 0.5calcite0.894170.00259
plain paste, w/c = 0.5calcite0.904750.00245
plain paste, w/c = 0.5calcite0.914790.00231
plain paste, w/c = 0.5calcite0.924860.00217
plain paste, w/c = 0.5calcite0.934960.00204
plain paste, w/c = 0.5calcite0.945110.00191
plain paste, w/c = 0.5calcite0.955150.00177
plain paste, w/c = 0.5calcite0.963140.0017
plain paste, w/c = 0.5gypsum0.00.02333
plain paste, w/c = 0.5gypsum0.010.02171
plain paste, w/c = 0.5gypsum0.020190.02038
plain paste, w/c = 0.5gypsum0.030250.01917
plain paste, w/c = 0.5gypsum0.040610.01797
plain paste, w/c = 0.5gypsum0.050850.01684
plain paste, w/c = 0.5gypsum0.061530.01566
plain paste, w/c = 0.5gypsum0.071580.01451
plain paste, w/c = 0.5gypsum0.081860.0133
plain paste, w/c = 0.5gypsum0.09220.01206
plain paste, w/c = 0.5gypsum0.102480.01083
plain paste, w/c = 0.5gypsum0.112560.00964
plain paste, w/c = 0.5gypsum0.123160.00837
plain paste, w/c = 0.5gypsum0.13340.00715
plain paste, w/c = 0.5gypsum0.144080.00587
plain paste, w/c = 0.5gypsum0.155190.00455
plain paste, w/c = 0.5gypsum0.165730.00329
plain paste, w/c = 0.5gypsum0.177610.00188
plain paste, w/c = 0.5gypsum0.189830.00046

The first 200 of 1258 rows; the file holds them all.

fig4_hydration_degree_measured: 103 rows measured

Fig. 4, p. 46: the hydration degree of each clinker phase of cements A, B and C (Table 7) by XRD/Rietveld analysis

read off a figure vector drawing, the drawing operators of the PDF read with PyMuPDF: a marker at the crossing of its two centerline segments, a line along its stroke centerline, the axes calibrated by least squares on their major ticks; reading error not quantified. The calibration residual is below 1e-4 of the span of each axis; values rounded to 5 significant digits on a logarithmic axis, to 1e-5 of the tick span on a linear one.

cementphasetime [d]alpha
BC3S0.499980.46709
BC3S0.999980.54232
BC3S1.99990.64576
BC3S3.00.7304
BC3S7.00040.74295
BC3S15.00.74608
BC3S30.0010.80251
BC3S100.00.80251
BC3S200.010.82759
BC3S400.030.82759
BC3S799.980.8558
CC3S0.499980.53066
CC3S0.999980.63444
CC3S1.99990.6934
CC3S3.00.7217
CC3S7.00040.74764
CC3S15.00.77123
CC3S30.0010.79009
CC3S100.00.83727
CC3S200.010.85141
CC3S400.030.88443
CC3S799.980.89858
AC3S0.500010.30933
AC3S1.00.40724
AC3S1.99990.54606
AC3S3.00020.67797
AC3S7.00040.80548
AC3S15.00.85566
AC3S30.0010.90359
AC3S100.00.91985
AC3S200.010.93823
AC3S400.030.94299
AC3S799.980.96819
BC3A0.50.06333
BC3A1.00.20334
BC3A2.00.34666
BC3A3.00.56
BC3A7.00021.0
CC3A0.50.32252
CC3A1.00.45031
CC3A2.00.55578
CC3A3.00.62272
CC3A7.00021.0
AC3A0.50.51136
AC3A1.00.60985
AC3A2.00.64015
AC3A3.00.66667
AC3A7.00021.0
BC2S0.499980.17504
BC2S0.999980.27364
BC2S1.99990.33199
BC2S3.00.34004
BC2S7.00040.3501
BC2S15.00.37022
BC2S30.0010.42455
BC2S100.00.60363
BC2S200.010.69015
BC2S400.030.75251
BC2S799.980.84507
CC2S0.499980.14465
CC2S0.999980.18238
CC2S1.99990.18553
CC2S3.00.18868
CC2S7.00040.19182
CC2S15.00.20754
CC2S30.0010.23899
CC2S100.00.48742
CC2S200.010.61007
CC2S400.030.68554
CC2S799.980.72956
AC2S0.500010.09072
AC2S1.00.10483
AC2S1.99990.12903
AC2S3.00020.14314
AC2S7.00040.18548
AC2S15.00.29637
AC2S30.0010.39113
AC2S100.00.55444
AC2S200.010.6371
AC2S400.030.69758
AC2S799.980.82258
CC4AF0.500020.60435
CC4AF1.00.67174
CC4AF2.00010.67391
CC4AF3.00010.68044
CC4AF7.00020.68696
CC4AF15.00.71956
CC4AF30.00.72825
CC4AF100.00.7913
CC4AF200.00.8
CC4AF400.020.82608
CC4AF800.010.84782
BC4AF0.500020.3736
BC4AF1.00.46309
BC4AF2.00010.566
BC4AF3.00010.63759
BC4AF7.00020.66668
BC4AF15.00.66443
BC4AF30.00.6622
BC4AF100.00.67339
BC4AF200.00.67115
BC4AF400.020.67115
BC4AF800.010.70023
fig4_hydration_degree_estimated: 574 rows estimated

Fig. 4, p. 46: the hydration degree of each clinker phase of cements A, B and C (Table 7) by XRD/Rietveld analysis, by the article's model

read off a figure vector drawing, the drawing operators of the PDF read with PyMuPDF: a marker at the crossing of its two centerline segments, a line along its stroke centerline, the axes calibrated by least squares on their major ticks; reading error not quantified. The calibration residual is below 1e-4 of the span of each axis; values rounded to 5 significant digits on a logarithmic axis, to 1e-5 of the tick span on a linear one. A curve keeps the vertices it is drawn with, each at least 0.01 in alpha, or 0.02 decade in time, from the last kept, the first and last always; none is interpolated.

cementphasetime [d]alpha
AC3S0.0982880.08284
AC3S0.111450.09613
AC3S0.124340.10851
AC3S0.138730.12167
AC3S0.155920.13657
AC3S0.175260.15235
AC3S0.196990.169
AC3S0.223080.18761
AC3S0.254440.20822
AC3S0.292270.23091
AC3S0.340740.25702
AC3S0.406030.28789
AC3S0.501910.32629
AC3S1.10470.47029
AC3S1.32610.50204
AC3S1.56870.53023
AC3S1.8290.55506
AC3S2.1320.57889
AC3S2.46750.60069
AC3S2.85570.62156
AC3S3.30480.64153
AC3S3.79690.65964
AC3S4.36230.67693
AC3S5.01190.69341
AC3S5.75820.70909
AC3S6.61530.724
AC3S7.65640.73889
AC3S8.86080.75299
AC3S10.2550.76633
AC3S11.8670.77894
AC3S13.8360.79144
AC3S16.130.80322
AC3S18.9420.81484
AC3S22.2440.82576
AC3S26.3160.83647
AC3S31.3580.84692
AC3S37.3670.8567
AC3S44.8580.86621
AC3S54.2430.87542
AC3S66.0660.8843
AC3S81.0660.89284
AC3S100.180.90101
AC3S124.730.90881
AC3S156.480.91623
AC3S199.130.92347
AC3S255.270.93028
AC3S332.060.93685
AC3S438.260.94312
AC3S586.990.94907
AC3S797.920.95467
AC3S1020.60.95874
BC3S0.0981480.0523
BC3S0.108220.05996
BC3S0.118150.06759
BC3S0.13180.07784
BC3S0.147070.08886
BC3S0.164150.10068
BC3S0.183150.11326
BC3S0.204370.12664
BC3S0.229690.14175
BC3S0.258130.15773
BC3S0.290180.17459
BC3S0.328530.19337
BC3S0.374750.2142
BC3S0.430460.23708
BC3S0.501880.26338
BC3S0.59810.29444
BC3S0.744630.33429
BC3S1.52350.46531
BC3S1.84240.49869
BC3S2.19530.52846
BC3S2.57840.55483
BC3S3.00560.57902
BC3S3.47830.60117
BC3S4.02590.6224
BC3S4.6590.6427
BC3S5.35220.66111
BC3S6.14960.67869
BC3S7.06520.69545
BC3S8.11810.7114
BC3S9.32590.72654
BC3S10.7140.74094
BC3S12.3990.7553
BC3S14.3510.76889
BC3S16.6070.78172
BC3S19.3620.79444
BC3S22.5730.80642
BC3S26.3150.8177
BC3S30.9040.8288
BC3S36.5610.83969
BC3S43.2480.84986
BC3S51.5320.85979
BC3S61.8650.86943
BC3S74.2570.8784
BC3S89.7960.88707
BC3S109.380.89542
BC3S134.190.90342
BC3S165.890.91107
BC3S208.050.91858
BC3S262.850.92567
BC3S334.550.93235
BC3S431.970.93877
BC3S565.960.94492
BC3S752.640.95074
BC3S1020.50.95633
CC3S0.0979860.02682
CC3S0.111430.0321
CC3S0.123430.03696
CC3S0.135730.04212
CC3S0.148150.0475
CC3S0.161740.05359
CC3S0.175280.05981
CC3S0.191310.06736
CC3S0.213470.07753
CC3S0.23820.08846
CC3S0.265780.10015
CC3S0.296630.11265
CC3S0.330950.1259
CC3S0.371960.14089
CC3S0.418070.15676
CC3S0.470010.17351
CC3S0.532120.19215
CC3S0.606920.21283
CC3S0.697220.23556
CC3S0.812920.26169
CC3S0.968610.29251
CC3S1.2060.33218
CC3S2.57810.4706
CC3S3.11740.50362
CC3S3.68760.53186
CC3S4.33080.5579
CC3S5.04880.58178
CC3S5.84290.60361
CC3S6.76250.62453
CC3S7.76930.64352
CC3S8.9260.66169
CC3S10.2560.67902
CC3S11.7820.69551
CC3S13.5370.71122
CC3S15.5520.72616
CC3S18.00.74107
CC3S20.8330.75519
CC3S24.1070.76853
CC3S27.90.78115
CC3S32.5280.79365
CC3S37.9220.80543
CC3S44.530.81703
CC3S52.2990.82794
CC3S61.8650.83862
CC3S73.7260.84905
CC3S87.8470.85878
CC3S105.460.86826
CC3S127.510.87743
CC3S155.320.88628
CC3S190.570.89478
CC3S235.540.90291
CC3S293.280.91067
CC3S367.830.91804
CC3S468.110.92522
CC3S600.10.93199
CC3S780.630.93849
CC3S1020.50.94452
AC3A0.0985560.08102
AC3A0.109010.09079
AC3A0.120750.10137
AC3A0.133750.11263
AC3A0.148190.12461
AC3A0.165340.1382
AC3A0.184460.15256
AC3A0.205840.16773
AC3A0.229680.18364
AC3A0.263890.20468
AC3A0.338290.24297
AC3A0.409040.27307
AC3A0.483910.30052
AC3A0.568210.32759
AC3A0.662450.35426
AC3A0.772350.38176
AC3A0.900420.4101
AC3A1.05740.44067
AC3A1.31650.48256
AC3A1.52360.50942
AC3A1.75050.53404
AC3A1.99640.55652
AC3A2.27690.57813
AC3A2.59730.59893
AC3A2.96210.61883
AC3A3.35380.63685
AC3A3.79720.65411
AC3A4.29920.67062
AC3A4.86760.6864
AC3A5.55220.70232
AC3A6.33190.71746
AC3A7.2220.73186
AC3A8.23640.74552
AC3A9.39350.75849
AC3A10.7940.77147
AC3A12.40.78373
AC3A14.350.79592
AC3A16.6090.80742

The first 200 of 574 rows; the file holds them all.

fig5_hydration_degree_measured: 248 rows measured

Fig. 5, p. 47: the hydration degree of each clinker phase of cements OPCN and OPCS (Table 7), cured at 20 °C for one day and then at the temperature given

read off a figure vector drawing, the drawing operators of the PDF read with PyMuPDF: a marker at the crossing of its two centerline segments, a line along its stroke centerline, the axes calibrated by least squares on their major ticks; reading error not quantified. The calibration residual is below 1e-4 of the span of each axis; values rounded to 5 significant digits on a logarithmic axis, to 1e-5 of the tick span on a linear one.

cementphasetemperature_Ctime [d]alpha
OPCNC3S40.01.99990.62819
OPCNC3S40.04.00010.69765
OPCNC3S40.07.99990.75769
OPCNC3S40.015.00.78834
OPCNC3S40.028.9990.82325
OPCNC3S40.091.0010.87855
OPCNC3S40.0181.00.90334
OPCNC3S40.0360.990.92944
OPCNC3S30.01.99990.59666
OPCNC3S30.04.00010.66718
OPCNC3S30.07.99990.72301
OPCNC3S30.015.00.77047
OPCNC3S30.028.9990.81485
OPCNC3S30.091.0010.89012
OPCNC3S30.0181.00.91385
OPCNC3S30.0360.990.93574
OPCNC3S20.01.99990.54202
OPCNC3S20.04.00010.6304
OPCNC3S20.07.99990.69359
OPCNC3S20.015.00.74735
OPCNC3S20.028.9990.79908
OPCNC3S20.091.0010.87751
OPCNC3S20.0181.00.92015
OPCNC3S20.0360.990.93364
OPCNC3S10.01.99990.49999
OPCNC3S10.04.00010.57156
OPCNC3S10.07.99990.6379
OPCNC3S10.015.00.69271
OPCNC3S10.028.9990.74129
OPCNC3S10.091.0010.84808
OPCNC3S10.0181.00.90755
OPCNC3S10.0360.990.94309
OPCNC3A40.02.00.75191
OPCNC3A40.04.00010.87378
OPCNC3A40.08.00030.90351
OPCNC3A40.015.00.99345
OPCNC3A40.029.0010.99272
OPCNC3A40.091.0010.99231
OPCNC3A30.02.00.62969
OPCNC3A30.04.00010.81503
OPCNC3A30.08.00030.93525
OPCNC3A30.015.00.99187
OPCNC3A30.029.0010.99431
OPCNC3A30.091.0010.99389
OPCNC3A20.02.00.4281
OPCNC3A20.04.00010.71982
OPCNC3A20.08.00030.90192
OPCNC3A20.015.00.99345
OPCNC3A20.029.0010.99589
OPCNC3A20.091.0010.99547
OPCNC3A10.02.00.34398
OPCNC3A10.04.00010.48649
OPCNC3A10.08.00030.6924
OPCNC3A10.015.00.84267
OPCNC3A10.029.0010.99749
OPCNC3A10.091.0010.99707
OPCNC2S40.01.99990.36227
OPCNC2S40.04.00010.42012
OPCNC2S40.07.99990.5214
OPCNC2S40.015.00.69511
OPCNC2S40.028.9990.83331
OPCNC2S40.091.0010.99525
OPCNC2S40.0181.00.99623
OPCNC2S40.0360.990.99374
OPCNC2S30.01.99990.34617
OPCNC2S30.04.00010.40563
OPCNC2S30.07.99990.45861
OPCNC2S30.015.00.56148
OPCNC2S30.028.9990.65461
OPCNC2S30.091.0010.86484
OPCNC2S30.0181.00.95437
OPCNC2S30.0360.990.99535
OPCNC2S20.01.99990.37033
OPCNC2S20.04.00010.39114
OPCNC2S20.07.99990.42641
OPCNC2S20.015.00.49064
OPCNC2S20.028.9990.56445
OPCNC2S20.091.0010.72638
OPCNC2S20.0181.00.8948
OPCNC2S20.0360.990.93899
OPCNC2S10.01.99990.32846
OPCNC2S10.04.00010.36538
OPCNC2S10.07.99990.42641
OPCNC2S10.015.00.42623
OPCNC2S10.028.9990.52259
OPCNC2S10.091.0010.58632
OPCNC2S10.0181.00.75956
OPCNC2S10.0360.990.83434
OPCNC4AF40.02.00.17228
OPCNC4AF40.04.00010.24865
OPCNC4AF40.08.00030.29247
OPCNC4AF40.015.00.34604
OPCNC4AF40.029.0010.34428
OPCNC4AF40.091.0010.30167
OPCNC4AF40.0181.00.4477
OPCNC4AF40.0360.980.64724
OPCNC4AF30.02.00.14789
OPCNC4AF30.04.00010.23076
OPCNC4AF30.08.00030.29085
OPCNC4AF30.015.00.29888
OPCNC4AF30.029.0010.34267
OPCNC4AF30.091.0010.41061
OPCNC4AF30.0181.00.46395
OPCNC4AF30.0360.980.67813
OPCNC4AF20.02.00.10561
OPCNC4AF20.04.00010.17059
OPCNC4AF20.08.00030.19816
OPCNC4AF20.015.00.25499
OPCNC4AF20.029.0010.28737
OPCNC4AF20.091.0010.45452
OPCNC4AF20.0181.00.54037
OPCNC4AF20.0360.980.82285
OPCNC4AF10.02.00.10398
OPCNC4AF10.04.00010.1088
OPCNC4AF10.08.00030.15588
OPCNC4AF10.015.00.18343
OPCNC4AF10.029.0010.22884
OPCNC4AF10.091.0010.44476
OPCNC4AF10.0181.00.56152
OPCNC4AF10.0360.980.83099
OPCSC3S40.01.99990.57639
OPCSC3S40.04.00010.72125
OPCSC3S40.07.99990.78224
OPCSC3S40.015.00.80967
OPCSC3S40.028.9990.82671
OPCSC3S40.091.0010.87142
OPCSC3S40.0181.00.88778
OPCSC3S40.0360.990.92536
OPCSC3S30.01.99990.49666
OPCSC3S30.04.00010.64467
OPCSC3S30.07.99990.77699
OPCSC3S30.015.00.8338
OPCSC3S30.028.9990.86237
OPCSC3S30.091.0010.90499
OPCSC3S30.0181.00.90666
OPCSC3S30.0360.990.93794
OPCSC3S20.01.99990.43372
OPCSC3S20.04.00010.53559
OPCSC3S20.07.99990.68467
OPCSC3S20.015.00.79185
OPCSC3S20.028.9990.84244
OPCSC3S20.091.0010.87877
OPCSC3S20.0181.00.90246
OPCSC3S20.0360.990.93584
OPCSC3S10.01.99990.38653
OPCSC3S10.04.00010.40971
OPCSC3S10.07.99990.5158
OPCSC3S10.015.00.62716
OPCSC3S10.028.9990.75433
OPCSC3S10.091.0010.85778
OPCSC3S10.0181.00.89826
OPCSC3S10.0360.990.94424
OPCSC3A40.02.00.76885
OPCSC3A40.04.00010.82212
OPCSC3A40.08.00030.88022
OPCSC3A40.015.00.89467
OPCSC3A40.029.0010.90909
OPCSC3A40.091.0010.92329
OPCSC3A40.0181.00.92459
OPCSC3A40.0360.980.99847
OPCSC3A30.02.00.67515
OPCSC3A30.04.00010.82212
OPCSC3A30.08.00030.92384
OPCSC3A30.015.00.95285
OPCSC3A30.029.0010.99311
OPCSC3A30.091.0010.99762
OPCSC3A30.0181.00.9973
OPCSC3A30.0360.980.99847
OPCSC3A20.02.00.4764
OPCSC3A20.04.00010.68801
OPCSC3A20.08.00030.8382
OPCSC3A20.015.00.92698
OPCSC3A20.029.0010.99311
OPCSC3A20.091.0010.996
OPCSC3A20.0181.00.9973
OPCSC3A20.0360.980.99685
OPCSC3A10.02.00.32613
OPCSC3A10.04.00010.39394
OPCSC3A10.08.00030.56513
OPCSC3A10.015.00.76864
OPCSC3A10.029.0010.86869
OPCSC3A10.091.0010.99762
OPCSC3A10.0181.00.99892
OPCSC3A10.0360.980.99847
OPCSC2S40.01.99990.20054
OPCSC2S40.04.00010.2599
OPCSC2S40.07.99990.45241
OPCSC2S40.015.00.64332
OPCSC2S40.028.9990.78127
OPCSC2S40.091.0010.93048
OPCSC2S40.0181.00.93048
OPCSC2S40.0360.990.92085
OPCSC2S30.01.99990.19252
OPCSC2S30.04.00010.18289
OPCSC2S30.07.99990.31605
OPCSC2S30.015.00.44599
OPCSC2S30.028.9990.67541
OPCSC2S30.091.0010.85508
OPCSC2S30.0181.00.86951
OPCSC2S30.0360.990.9016

The first 200 of 248 rows; the file holds them all.

fig5_hydration_degree_estimated: 1347 rows estimated

Fig. 5, p. 47: the hydration degree of each clinker phase of cements OPCN and OPCS (Table 7), cured at 20 °C for one day and then at the temperature given, by the article's model

read off a figure vector drawing, the drawing operators of the PDF read with PyMuPDF: a marker at the crossing of its two centerline segments, a line along its stroke centerline, the axes calibrated by least squares on their major ticks; reading error not quantified. The calibration residual is below 1e-4 of the span of each axis; values rounded to 5 significant digits on a logarithmic axis, to 1e-5 of the tick span on a linear one. A curve keeps the vertices it is drawn with, each at least 0.01 in alpha, or 0.02 decade in time, from the last kept, the first and last always; none is interpolated.

cementphasetemperature_Ctime [d]alpha
OPCNC3S40.00.493060.28204
OPCNC3S40.00.606880.31922
OPCNC3S40.00.86810.38437
OPCNC3S40.01.00470.41084
OPCNC3S40.01.08870.45129
OPCNC3S40.01.18850.48853
OPCNC3S40.01.30680.52282
OPCNC3S40.01.37540.53926
OPCNC3S40.01.44760.55457
OPCNC3S40.01.52350.5688
OPCNC3S40.01.61520.58398
OPCNC3S40.01.71250.59815
OPCNC3S40.01.81550.61135
OPCNC3S40.01.93890.62528
OPCNC3S40.02.07060.63826
OPCNC3S40.02.22750.65174
OPCNC3S40.02.39650.66438
OPCNC3S40.02.57790.67619
OPCNC3S40.02.79390.68842
OPCNC3S40.03.02750.69985
OPCNC3S40.03.3050.7116
OPCNC3S40.03.63440.72349
OPCNC3S40.03.99610.73461
OPCNC3S40.04.42650.74586
OPCNC3S40.04.90330.75641
OPCNC3S40.05.47120.76702
OPCNC3S40.06.14960.77762
OPCNC3S40.06.96230.78816
OPCNC3S40.07.94060.7986
OPCNC3S40.09.0580.80837
OPCNC3S40.010.4060.81801
OPCNC3S40.012.0430.82752
OPCNC3S40.014.0390.83684
OPCNC3S40.016.490.84596
OPCNC3S40.019.5070.85485
OPCNC3S40.023.4170.86385
OPCNC3S40.028.3120.87254
OPCNC3S40.034.4870.88091
OPCNC3S40.042.6280.88923
OPCNC3S40.053.070.89719
OPCNC3S40.067.0520.90503
OPCNC3S40.085.3180.91245
OPCNC3S40.0110.190.91968
OPCNC3S40.0144.390.92668
OPCNC3S40.0192.00.9334
OPCNC3S40.0259.030.93981
OPCNC3S40.0354.620.9459
OPCNC3S40.0407.090.94839
OPCNC3S30.00.493060.28204
OPCNC3S30.00.606880.31922
OPCNC3S30.00.86810.38437
OPCNC3S30.01.00470.41083
OPCNC3S30.01.07290.43125
OPCNC3S30.01.14580.45052
OPCNC3S30.01.22370.46873
OPCNC3S30.01.31640.48782
OPCNC3S30.01.41620.50583
OPCNC3S30.01.52350.52284
OPCNC3S30.01.6510.54052
OPCNC3S30.01.78920.55726
OPCNC3S30.01.93880.57309
OPCNC3S30.02.11660.58946
OPCNC3S30.02.31030.6049
OPCNC3S30.02.52220.61958
OPCNC3S30.02.77340.6346
OPCNC3S30.03.04960.6488
OPCNC3S30.03.35360.66228
OPCNC3S30.03.71470.67602
OPCNC3S30.04.11470.68902
OPCNC3S30.04.59110.70218
OPCNC3S30.05.12310.71464
OPCNC3S30.05.75860.7272
OPCNC3S30.06.47230.73904
OPCNC3S30.07.32820.75094
OPCNC3S30.08.35850.7628
OPCNC3S30.09.53320.77397
OPCNC3S30.010.9530.78508
OPCNC3S30.012.6750.79605
OPCNC3S30.014.6680.80638
OPCNC3S30.017.1020.81657
OPCNC3S30.020.0820.82657
OPCNC3S30.023.760.83639
OPCNC3S30.028.3090.84594
OPCNC3S30.033.9810.85524
OPCNC3S30.041.0950.86427
OPCNC3S30.050.0610.873
OPCNC3S30.061.8680.88171
OPCNC3S30.077.0290.89006
OPCNC3S30.096.6160.89805
OPCNC3S30.0122.960.9059
OPCNC3S30.0157.610.91334
OPCNC3S30.0205.030.92059
OPCNC3S30.0270.630.92759
OPCNC3S30.0362.490.93432
OPCNC3S30.0407.080.93682
OPCNC3S20.00.493060.28204
OPCNC3S20.00.606880.31922
OPCNC3S20.00.868120.38437
OPCNC3S20.01.12910.43177
OPCNC3S20.01.35550.4639
OPCNC3S20.01.5920.49137
OPCNC3S20.01.84240.51555
OPCNC3S20.02.11670.53774
OPCNC3S20.02.43180.55918
OPCNC3S20.02.79410.57983
OPCNC3S20.03.18660.59863
OPCNC3S20.03.63470.6167
OPCNC3S20.04.14510.63401
OPCNC3S20.04.72770.65057
OPCNC3S20.05.39190.66639
OPCNC3S20.06.15040.68152
OPCNC3S20.07.01460.69593
OPCNC3S20.08.05810.71039
OPCNC3S20.09.25890.72414
OPCNC3S20.010.6370.73719
OPCNC3S20.012.3090.7502
OPCNC3S20.014.2460.76252
OPCNC3S20.016.6090.77476
OPCNC3S20.019.3630.78629
OPCNC3S20.022.7380.79768
OPCNC3S20.026.7060.80844
OPCNC3S20.031.5930.819
OPCNC3S20.037.6420.82934
OPCNC3S20.045.1910.83946
OPCNC3S20.054.6430.84928
OPCNC3S20.066.560.85881
OPCNC3S20.081.6670.86802
OPCNC3S20.0100.940.87691
OPCNC3S20.0125.670.88544
OPCNC3S20.0157.620.89363
OPCNC3S20.0200.580.9017
OPCNC3S20.0257.140.90936
OPCNC3S20.0334.520.91683
OPCNC3S20.0407.070.92202
OPCNC3S10.00.493060.28204
OPCNC3S10.00.606880.31922
OPCNC3S10.00.86810.38437
OPCNC3S10.01.0040.41071
OPCNC3S10.01.14590.42401
OPCNC3S10.01.31640.43858
OPCNC3S10.01.53460.45545
OPCNC3S10.01.81560.4747
OPCNC3S10.02.19540.49719
OPCNC3S10.02.85580.52915
OPCNC3S10.04.86790.5941
OPCNC3S10.06.06080.61996
OPCNC3S10.07.32870.64165
OPCNC3S10.08.73340.66094
OPCNC3S10.010.330.6787
OPCNC3S10.012.1320.695
OPCNC3S10.014.2480.71059
OPCNC3S10.016.7310.72545
OPCNC3S10.019.6480.7396
OPCNC3S10.023.0720.75303
OPCNC3S10.027.10.7658
OPCNC3S10.031.8230.77789
OPCNC3S10.037.6420.78985
OPCNC3S10.044.5340.80115
OPCNC3S10.053.070.81226
OPCNC3S10.063.6960.82315
OPCNC3S10.076.4770.83339
OPCNC3S10.092.4640.84337
OPCNC3S10.0112.640.85309
OPCNC3S10.0138.190.8625
OPCNC3S10.0170.80.8716
OPCNC3S10.0212.680.88036
OPCNC3S10.0266.70.88877
OPCNC3S10.0339.450.89708
OPCNC3S10.0407.050.90293
OPCNC3A40.00.492860.26642
OPCNC3A40.00.593690.29644
OPCNC3A40.00.702440.3244
OPCNC3A40.00.824810.3519
OPCNC3A40.00.968660.38025
OPCNC3A40.01.04210.4132
OPCNC3A40.01.12930.46471
OPCNC3A40.01.21480.50341
OPCNC3A40.01.31650.53891
OPCNC3A40.01.43710.5715
OPCNC3A40.01.58030.60152
OPCNC3A40.01.66310.61588
OPCNC3A40.01.75040.6292
OPCNC3A40.01.85590.64333
OPCNC3A40.01.96760.65639
OPCNC3A40.02.08580.66852
OPCNC3A40.02.22750.68122
OPCNC3A40.02.3790.69305
OPCNC3A40.02.54060.70409
OPCNC3A40.02.73350.71555
OPCNC3A40.02.94040.72622
OPCNC3A40.03.18670.73721
OPCNC3A40.03.47830.74836
OPCNC3A40.03.79730.75876
OPCNC3A40.04.17550.76926
OPCNC3A40.04.59140.77908
OPCNC3A40.05.08580.78894
OPCNC3A40.05.67470.7988
OPCNC3A40.06.37820.80859
OPCNC3A40.07.22260.81829
OPCNC3A40.08.23740.82781

The first 200 of 1347 rows; the file holds them all.

fig6_hydration_degree_measured: 72 rows measured

Fig. 6, p. 48: the hydration degree of each clinker phase of cements OPC and CRC (Table 7)

read off a figure vector drawing, the drawing operators of the PDF read with PyMuPDF: a marker at the crossing of its two centerline segments, a line along its stroke centerline, the axes calibrated by least squares on their major ticks; reading error not quantified. The calibration residual is below 1e-4 of the span of each axis; values rounded to 5 significant digits on a logarithmic axis, to 1e-5 of the tick span on a linear one.

cementphasetime [d]alpha
OPCC3S0.0416660.0
OPCC3S0.1250.0
OPCC3S0.250.0
OPCC3S0.374970.265131
OPCC3S0.999930.66872
OPCC3S2.00010.742244
OPCC3S2.99980.792112
OPCC3S6.99980.873535
OPCC3S27.9990.826793
CRCC3S0.0416660.0
CRCC3S0.1250.022386
CRCC3S0.250.1131
CRCC3S0.374970.246028
CRCC3S0.999930.592435
CRCC3S2.00010.691203
CRCC3S2.99980.729532
CRCC3S6.99980.794123
CRCC3S27.9990.856825
OPCC3A0.0416670.0
OPCC3A0.1250.04939
OPCC3A0.249990.1474
OPCC3A0.375010.15249
OPCC3A1.00.33365
OPCC3A2.00010.49023
OPCC3A3.00010.5832
OPCC3A6.99981.0
OPCC3A28.0011.0
CRCC3A0.0416670.0
CRCC3A0.1250.0
CRCC3A0.249990.0
CRCC3A0.375010.04613
CRCC3A1.00.24331
CRCC3A2.00010.9954
CRCC3A3.00011.0
CRCC3A6.99981.0
CRCC3A28.0011.0
OPCC2S0.041666-1.0e-6
OPCC2S0.1250.08238
OPCC2S0.250.099259
OPCC2S0.374970.311262
OPCC2S0.999930.450549
OPCC2S2.00010.41859
OPCC2S2.99980.451512
OPCC2S6.99980.45224
OPCC2S27.9990.591876
CRCC2S0.041666-1.0e-6
CRCC2S0.1250.001437
CRCC2S0.250.145456
CRCC2S0.374970.205605
CRCC2S0.999930.242663
CRCC2S2.00010.374756
CRCC2S2.99980.303706
CRCC2S6.99980.280936
CRCC2S27.9990.521314
OPCC4AF0.041667-1.0e-6
OPCC4AF0.125-1.0e-6
OPCC4AF0.249990.014642
OPCC4AF0.375010.097528
OPCC4AF1.00.28225
OPCC4AF2.00010.324993
OPCC4AF3.00010.351115
OPCC4AF6.99980.479038
OPCC4AF28.0010.519594
CRCC4AF0.041667-1.0e-6
CRCC4AF0.125-1.0e-6
CRCC4AF0.24999-1.0e-6
CRCC4AF0.37501-1.0e-6
CRCC4AF1.0-1.0e-6
CRCC4AF2.0001-1.0e-6
CRCC4AF3.00010.104673
CRCC4AF6.99980.192039
CRCC4AF28.0010.422037
fig6_hydration_degree_estimated: 494 rows estimated

Fig. 6, p. 48: the hydration degree of each clinker phase of cements OPC and CRC (Table 7), by the article's model

read off a figure vector drawing, the drawing operators of the PDF read with PyMuPDF: a marker at the crossing of its two centerline segments, a line along its stroke centerline, the axes calibrated by least squares on their major ticks; reading error not quantified. The calibration residual is below 1e-4 of the span of each axis; values rounded to 5 significant digits on a logarithmic axis, to 1e-5 of the tick span on a linear one. A curve keeps the vertices it is drawn with, each at least 0.01 in alpha, or 0.02 decade in time, from the last kept, the first and last always; none is interpolated.

cementphasetime [d]alpha
OPCC3S0.00884510.002769
OPCC3S0.0100010.002773
OPCC3S0.0106810.00305
OPCC3S0.0140940.004581
OPCC3S0.0178070.006434
OPCC3S0.0216950.008559
OPCC3S0.0258540.011014
OPCC3S0.0301370.013724
OPCC3S0.034630.016743
OPCC3S0.0392090.019984
OPCC3S0.0440710.023595
OPCC3S0.0491670.027552
OPCC3S0.0544590.031842
OPCC3S0.0598870.036401
OPCC3S0.0658520.041597
OPCC3S0.0718850.047021
OPCC3S0.078470.053139
OPCC3S0.0850370.059407
OPCC3S0.0921360.06635
OPCC3S0.102830.076579
OPCC3S0.114740.08754
OPCC3S0.128010.099244
OPCC3S0.142830.111736
OPCC3S0.159370.125001
OPCC3S0.179180.140017
OPCC3S0.201390.155863
OPCC3S0.228020.173595
OPCC3S0.260060.193309
OPCC3S0.298750.21508
OPCC3S0.345750.238968
OPCC3S0.409070.267477
OPCC3S0.50190.303221
OPCC3S0.71270.36576
OPCC3S0.98290.422688
OPCC3S1.20590.45787
OPCC3S1.43710.487088
OPCC3S1.68780.512893
OPCC3S1.96740.536557
OPCC3S2.27690.558177
OPCC3S2.63510.578844
OPCC3S3.02750.597598
OPCC3S3.47810.615468
OPCC3S3.99650.632504
OPCC3S4.5910.648659
OPCC3S5.27490.663997
OPCC3S6.06020.678548
OPCC3S6.96240.69233
OPCC3S7.99930.705376
OPCC3S9.25880.718379
OPCC3S10.7140.730627
OPCC3S12.40.742207
OPCC3S14.4570.753664
OPCC3S16.8530.764462
OPCC3S19.7910.775109
OPCC3S23.4150.78558
OPCC3S27.70.795404
OPCC3S33.00.805019
OPCC3S39.6160.814424
OPCC3S47.8990.823569
OPCC3S58.340.832453
OPCC3S71.5980.841066
OPCC3S88.4840.849382
OPCC3S110.970.857664
OPCC3S140.210.865624
OPCC3S179.730.873465
OPCC3S232.130.880957
OPCC3S299.40.887879
OPCC3S410.420.887911
CRCC3S0.00902460.00239
CRCC3S0.0100010.00239
CRCC3S0.0107580.002651
CRCC3S0.014620.004092
CRCC3S0.0187420.005815
CRCC3S0.0231650.007846
CRCC3S0.0278120.010159
CRCC3S0.0326580.012751
CRCC3S0.0377880.015672
CRCC3S0.043110.018869
CRCC3S0.048810.022472
CRCC3S0.0544710.026225
CRCC3S0.0603280.03026
CRCC3S0.0668240.034919
CRCC3S0.0734830.039873
CRCC3S0.0802130.045044
CRCC3S0.0875630.050873
CRCC3S0.0948910.056855
CRCC3S0.102830.063509
CRCC3S0.114750.073472
CRCC3S0.128020.084135
CRCC3S0.142850.095576
CRCC3S0.15940.107792
CRCC3S0.177850.120763
CRCC3S0.199890.13544
CRCC3S0.224730.151002
CRCC3S0.25440.168392
CRCC3S0.288040.186693
CRCC3S0.328570.206974
CRCC3S0.380210.230438
CRCC3S0.446520.257265
CRCC3S0.539970.290009
CRCC3S0.707520.337715
CRCC3S1.06520.409899
CRCC3S1.30710.444911
CRCC3S1.55760.473892
CRCC3S1.82880.499429
CRCC3S2.11650.521737
CRCC3S2.44940.543088
CRCC3S2.81420.562456
CRCC3S3.23320.580913
CRCC3S3.68740.597561
CRCC3S4.20590.613399
CRCC3S4.79710.628452
CRCC3S5.47120.642723
CRCC3S6.240.656257
CRCC3S7.1690.66977
CRCC3S8.2360.68253
CRCC3S9.46290.694586
CRCC3S10.9520.706544
CRCC3S12.6740.717798
CRCC3S14.7780.728934
CRCC3S17.2250.739377
CRCC3S20.2290.74967
CRCC3S23.9310.759763
CRCC3S28.5160.769617
CRCC3S33.9840.778851
CRCC3S40.790.787845
CRCC3S49.3250.796611
CRCC3S60.5220.805414
CRCC3S74.7930.813907
CRCC3S93.1530.822107
CRCC3S110.020.827941
CRCC3S410.450.827994
OPCC3A0.00164490.00493
OPCC3A0.00999990.00495
OPCC3A0.0105250.00526
OPCC3A0.0138910.00732
OPCC3A0.0176820.00973
OPCC3A0.0218540.01249
OPCC3A0.0262260.01548
OPCC3A0.0310260.01885
OPCC3A0.036180.02256
OPCC3A0.0415690.02652
OPCC3A0.0474040.03089
OPCC3A0.0536740.03567
OPCC3A0.0603390.04084
OPCC3A0.0673160.04631
OPCC3A0.0745650.05208
OPCC3A0.0825970.05853
OPCC3A0.0908210.06521
OPCC3A0.0998710.07261
OPCC3A0.109020.08015
OPCC3A0.119030.08844
OPCC3A0.132780.09954
OPCC3A0.148190.11147
OPCC3A0.166540.12501
OPCC3A0.187230.13947
OPCC3A0.210390.15476
OPCC3A0.238250.17199
OPCC3A0.269740.19012
OPCC3A0.36390.23543
OPCC3A0.459760.27171
OPCC3A0.564180.30444
OPCC3A0.687140.33699
OPCC3A0.830950.36933
OPCC3A1.01220.40398
OPCC3A1.25080.44229
OPCC3A1.52350.47793
OPCC3A1.77620.50448
OPCC3A2.05560.52869
OPCC3A2.36150.5507
OPCC3A2.71310.57171
OPCC3A3.1170.59173
OPCC3A3.55510.60977
OPCC3A4.05490.62695
OPCC3A4.62430.64326
OPCC3A5.31280.65959
OPCC3A6.10460.67502
OPCC3A7.01350.68961
OPCC3A8.05760.70338
OPCC3A9.32540.71706
OPCC3A10.7920.72994
OPCC3A12.4910.7421
OPCC3A14.5620.75407
OPCC3A17.1010.76586
OPCC3A20.0820.77692
OPCC3A23.7560.78776
OPCC3A28.3070.79834
OPCC3A33.9810.80863
OPCC3A41.090.81862
OPCC3A50.0470.82829
OPCC3A61.4090.83761
OPCC3A75.9060.84659
OPCC3A94.4960.85522
OPCC3A119.380.86376
OPCC3A151.980.87193
OPCC3A196.180.87991
OPCC3A257.110.8877
OPCC3A301.640.89184
OPCC3A410.410.89186
CRCC3A0.00164490.00426

The first 200 of 494 rows; the file holds them all.

fig7_heat_measured: 756 rows measured

Fig. 7, pp. 49-50: the heat released by pastes at w/c = 0.4 of the cements of Lerch and Ford (Table 7) in isothermal calorimeters; panels (a) to (d), one per ASTM type, print the temperatures as 4, 23, 32 and 40 °C, panel (e), cement c51, as 4.4, 23.9, 32.2 and 40.6 °C, and temperature_C keeps each as printed; the markers carry no legend entry and are attributed to the line of the same color

read off a figure vector drawing, the drawing operators of the PDF read with PyMuPDF: a marker at the crossing of its two centerline segments, a line along its stroke centerline, the axes calibrated by least squares on their major ticks; reading error not quantified. The calibration residual is below 1e-4 of the span of each axis; values rounded to 5 significant digits on a logarithmic axis, to 1e-5 of the tick span on a linear one.

cementtemperature_Ctime [d]heat [J/g]
c114.00.0416816.314
c114.00.1666521.337
c114.00.3333328.866
c114.00.538.493
c114.01.075.73
c114.01.99998128.449
c114.03.0151.46
c11T4.00.041719.242
c11T4.00.1666724.264
c11T4.00.3333131.378
c11T4.00.4999940.169
c11T4.01.0000176.988
c11T4.02.0131.377
c11T4.03.0161.503
c124.00.0416819.663
c124.00.1666529.703
c124.00.3333337.233
c124.00.543.929
c124.01.068.201
c124.01.99998115.056
c124.03.0141.001
c12T4.00.041717.989
c12T4.00.1666727.613
c12T4.00.3333135.142
c12T4.00.4999941.002
c12T4.01.0000165.269
c12T4.02.0111.714
c12T4.03.0140.999
c134.00.0416814.222
c134.00.1666520.5
c134.00.3333330.122
c134.00.541.422
c134.01.076.986
c134.01.99998126.356
c134.03.0158.571
c144.00.0416820.5
c144.00.1666528.866
c144.00.3333341.422
c144.00.552.719
c144.01.089.119
c144.01.99998146.442
c144.03.0179.912
c154.00.0416817.151
c154.00.1666525.104
c154.00.3333333.889
c154.00.542.674
c154.01.082.841
c154.01.99998144.768
c154.03.0171.127
c164.00.0416817.57
c164.00.1666524.685
c164.00.3333334.303
c164.00.545.189
c164.01.084.934
c164.01.99998136.815
c164.03.0159.827
c16T4.00.041716.314
c16T4.00.1666723.846
c16T4.00.3333134.307
c16T4.00.4999944.769
c16T4.01.0000177.402
c16T4.02.0131.795
c16T4.03.0159.41
c174.00.0416819.663
c174.00.1666532.215
c174.00.3333344.771
c174.00.554.811
c174.01.085.771
c174.01.99998123.845
c174.03.0145.186
c184.00.0416815.896
c184.00.1666520.5
c184.00.3333326.774
c184.00.534.303
c184.01.067.782
c184.01.99998120.919
c184.03.0141.838
c18T4.00.041718.407
c18T4.00.1666724.683
c18T4.00.3333133.47
c18T4.00.4999943.513
c18T4.01.0000179.076
c18T4.02.0112.551
c18T4.03.0140.584
c1123.00.0416419.663
c1123.00.1666543.515
c1123.00.33332111.712
c1123.00.5134.304
c1123.00.99999182.419
c1123.02.00001250.62
c1123.02.99999296.646
c11T23.00.0416623.011
c11T23.00.1666639.33
c11T23.00.3333295.395
c11T23.00.5120.078
c11T23.01.00001167.358
c11T23.01.99999248.529
c11T23.02.99999300.411
c1223.00.0416423.43
c1223.00.1666537.656
c1223.00.3333286.608
c1223.00.5112.549
c1223.00.99999165.686
c1223.02.00001232.213
c1223.02.99999285.764
c12T23.00.0416623.429
c12T23.00.1666638.072
c12T23.00.3333284.515
c12T23.00.5111.714
c12T23.01.00001129.704
c12T23.01.99999220.5
c12T23.02.99999267.778
c1323.00.0416417.151
c1323.00.1666553.556
c1323.00.33332102.508
c1323.00.5128.03
c1323.00.99999167.779
c1323.02.00001205.016
c1323.02.99999235.138
c1423.00.0416427.192
c1423.00.1666561.085
c1423.00.33332115.897
c1423.00.5147.697
c1423.00.99999203.76
c1423.02.00001269.868
c1423.02.99999304.594
c1523.00.0416418.407
c1523.00.1666536.814
c1523.00.33332105.856
c1523.00.5188.279
c1523.00.99999237.231
c1523.02.00001290.787
c1523.02.99999319.657
c1623.00.0416416.733
c1623.00.1666537.233
c1623.00.33332104.601
c1623.00.5143.093
c1623.00.99999178.657
c1623.02.00001226.772
c1623.02.99999261.92
c16T23.00.0416617.154
c16T23.00.1666632.212
c16T23.00.3333296.232
c16T23.00.5144.347
c16T23.01.00001183.677
c16T23.01.99999232.21
c16T23.02.99999268.192
c1723.00.0416421.337
c1723.00.1666548.115
c1723.00.33332114.641
c1723.00.5139.327
c1723.00.99999181.586
c1723.02.00001240.579
c1723.02.99999277.816
c1823.00.0416421.337
c1823.00.1666540.163
c1823.00.33332109.2
c1823.00.5142.675
c1823.00.99999191.627
c1823.02.00001249.783
c1823.02.99999292.884
c18T23.00.0416627.194
c18T23.00.1666644.35
c18T23.00.3333284.515
c18T23.00.5102.51
c18T23.01.00001173.636
c18T23.01.99999252.715
c18T23.02.99999304.596
c1132.00.0416719.244
c1132.00.1666878.241
c1132.00.33335142.256
c1132.00.49999176.564
c1132.00.99995245.183
c1132.02.0308.361
c1132.03.00002338.487
c11T32.00.0416918.826
c11T32.00.1666668.617
c11T32.00.33333123.426
c11T32.00.49998157.736
c11T32.00.99999236.396
c11T32.01.99999310.452
c11T32.02.99999342.669
c1232.00.0416723.011
c1232.00.1666849.789
c1232.00.33335114.223
c1232.00.49999142.256
c1232.00.99995199.161
c1232.02.0269.45
c1232.03.00002305.431
c12T32.00.0416923.429
c12T32.00.1666649.373
c12T32.00.33333111.295
c12T32.00.49998142.254
c12T32.00.99999206.269
c12T32.01.99999279.493
c12T32.02.99999320.915
c1332.00.0416716.733
c1332.00.1666876.986
c1332.00.33335124.263
c1332.00.49999142.675

The first 200 of 756 rows; the file holds them all.

fig7_heat_estimated: 4358 rows estimated

Fig. 7, pp. 49-50: the heat released by pastes at w/c = 0.4 of the cements of Lerch and Ford (Table 7) in isothermal calorimeters; panels (a) to (d), one per ASTM type, print the temperatures as 4, 23, 32 and 40 °C, panel (e), cement c51, as 4.4, 23.9, 32.2 and 40.6 °C, and temperature_C keeps each as printed, by the article's model

read off a figure vector drawing, the drawing operators of the PDF read with PyMuPDF: a marker at the crossing of its two centerline segments, a line along its stroke centerline, the axes calibrated by least squares on their major ticks; reading error not quantified. The calibration residual is below 1e-4 of the span of each axis; values rounded to 5 significant digits on a logarithmic axis, to 1e-5 of the tick span on a linear one. A curve keeps the vertices it is drawn with inside the frame of its panel, each at least 0.02 of the panel's diagonal (time over 5 d, heat over 450 J/g) from the last kept, the first and last always; none is interpolated. The few vertices the drawing places just outside the frame, at negative time or heat, are left out.

cementtemperature_Ctime [d]heat [J/g]
c114.00.019880.953
c114.00.099877.449
c114.00.1804815.933
c114.00.2901829.204
c114.00.3612237.878
c114.00.4336446.33
c114.00.5055554.357
c114.00.6340367.556
c114.00.7722880.3
c114.00.9003989.815
c114.00.9829195.107
c114.01.07292100.558
c114.01.16268105.685
c114.01.25086110.432
c114.01.34563115.241
c114.01.44763120.119
c114.01.55742125.054
c114.01.67544130.029
c114.01.78938134.543
c114.01.91094139.083
c114.02.04087143.651
c114.02.17946148.233
c114.02.32766152.833
c114.02.48584157.443
c114.02.65471162.056
c114.02.83506166.675
c114.03.02782171.287
c114.03.23357175.898
c114.03.45328180.495
c114.03.66123184.572
c114.03.88158188.629
c114.04.11513192.673
c114.04.36285196.701
c114.04.62545200.707
c114.04.90382204.694
c114.05.02273206.321
c11T4.00.009990.431
c11T4.00.102588.407
c11T4.00.1925418.89
c11T4.00.2773630.004
c11T4.00.3626941.062
c11T4.00.4505251.824
c11T4.00.5410562.236
c11T4.00.6353372.134
c11T4.00.7325281.6
c11T4.00.8386489.48
c11T4.00.9468296.924
c11T4.01.05685103.954
c11T4.01.16879110.516
c11T4.01.28215116.681
c11T4.01.39682122.491
c11T4.01.5126127.956
c11T4.01.62929133.113
c11T4.01.74682137.973
c11T4.01.86505142.566
c11T4.01.98394146.907
c11T4.02.10333151.024
c11T4.02.2232154.939
c11T4.02.34341158.673
c11T4.02.46398162.248
c11T4.02.58482165.665
c11T4.02.70602168.891
c11T4.02.82743172.011
c11T4.02.949175.02
c11T4.03.07081177.866
c11T4.03.19279180.625
c11T4.03.31489183.29
c11T4.03.43719185.819
c11T4.03.55955188.294
c11T4.03.68206190.658
c11T4.03.80465192.951
c11T4.03.92735195.174
c11T4.04.05011197.309
c11T4.04.17295199.398
c11T4.04.29588201.394
c11T4.04.41888203.359
c11T4.04.54194205.238
c11T4.04.66505207.079
c11T4.04.78816208.896
c11T4.04.9114210.621
c11T4.04.973211.482
c124.00.021260.97
c124.00.109847.622
c124.00.1998816.299
c124.00.4597144.474
c124.00.5399252.589
c124.00.6771665.382
c124.00.7500771.656
c124.00.8247277.744
c124.00.9270584.282
c124.01.0194889.719
c124.01.1128694.904
c124.01.21486100.244
c124.01.31646105.246
c124.01.41637109.871
c124.01.52357114.547
c124.01.63921119.297
c124.01.7634124.086
c124.01.89704128.916
c124.02.02595133.302
c124.02.16356137.71
c124.02.31074142.148
c124.02.46769146.598
c124.02.63533151.063
c124.02.81457155.543
c124.03.0057160.025
c124.03.21003164.509
c124.03.42824168.994
c124.03.66123173.472
c124.03.91177.943
c124.04.17573182.4
c124.04.45954186.839
c124.04.76257191.267
c124.05.02273194.832
c12T4.01.0e-50.0
c12T4.00.108677.237
c12T4.00.207416.447
c12T4.00.3013726.389
c12T4.00.3948136.411
c12T4.00.4899946.176
c12T4.00.5874655.597
c12T4.00.6875164.6
c12T4.00.7899173.199
c12T4.00.8958881.088
c12T4.01.0075787.705
c12T4.01.1206993.953
c12T4.01.2349899.871
c12T4.01.35034105.457
c12T4.01.46669110.729
c12T4.01.58392115.698
c12T4.01.7019120.396
c12T4.01.82051124.84
c12T4.01.9397129.051
c12T4.02.05932133.068
c12T4.02.17937136.888
c12T4.02.29976140.54
c12T4.02.42049144.022
c12T4.02.54157147.328
c12T4.02.66284150.51
c12T4.02.7843153.587
c12T4.02.90602156.5
c12T4.03.0279159.312
c12T4.03.1499162.045
c12T4.03.27211164.631
c12T4.03.39441167.174
c12T4.03.51684169.579
c12T4.03.63937171.943
c12T4.03.76203174.194
c12T4.03.88472176.408
c12T4.04.00756178.511
c12T4.04.13039180.6
c12T4.04.25336182.569
c12T4.04.37634184.535
c12T4.04.49942186.395
c12T4.04.62255188.232
c12T4.04.74569190.019
c12T4.04.86893191.732
c12T4.04.99214193.448
c12T4.05.01247193.73
c134.00.020470.918
c134.00.103587.269
c134.00.1857715.428
c134.00.3032228.836
c134.00.3746936.987
c134.00.446544.805
c134.00.5167652.1
c134.00.6480964.649
c134.00.7893976.759
c134.00.8680782.965
c134.00.9476188.895
c134.01.0268994.492
c134.01.17126103.033
c134.01.26933108.066
c134.01.36556112.711
c134.01.46897117.417
c134.01.58039122.188
c134.01.7002126.999
c134.01.82905131.844
c134.01.95325136.235
c134.02.08601140.651
c134.02.22777145.084
c134.02.37917149.53
c134.02.54086153.988
c134.02.71355158.447
c134.02.89788162.906
c134.03.09496167.362
c134.03.30527171.806
c134.03.52989176.244
c134.03.76974180.657
c134.04.02599185.056
c134.04.29956189.428
c134.04.55832193.295
c134.04.83264197.135
c134.05.02269199.658
c144.00.021690.893
c144.00.112247.12
c144.00.2029415.18
c144.00.3801832.847
c144.00.4563540.015
c144.00.5281446.436

The first 200 of 4358 rows; the file holds them all.

semi_adiabatic_limestone_wb050_temperature: 152 rows measured

Fig. 15(a), p. 56: temperature of the limestone mortars of Table 11 at w/b = 0.5 in the semi-adiabatic calorimeter (thick lines), where the band of each is not covered by another; C95L05 is read near its maximum and from 1.1 to 1.4 days only, the rest of its band lying under those of C90L10 and C85L15; the crosses before about 0.6 d, which overlap between the mixes, are not transcribed

read off a figure raster image, the lines located by color (hue, saturation above 0.25) and told apart by stroke width, the thick measured bands followed column by column with sub-pixel edges; a band covered on one side by a color drawn after it read from its free edge, at half its median extent; overlaps otherwise left out; mapped through the placement of the image and the vector frame of the panel (0 to 5 days, 10 to 70 C); reading error ± 0.15 K. One pixel is 0.14 K and 0.008 d. The colors are attributed from the vector legend, its rows matched in height to the line samples of the image: blue C100, green C95L05, yellow C90L10, orange C85L15, red C70L30, drawn in that order, each over the ones before. Each bin of 0.05 d holds the least-squares line of its readings evaluated at its center. The same reading of the C100 band agrees with semi_adiabatic_C100_wb050_temperature to 0.03 K in root mean square (0.12 K at most), which measures the reproducibility of the reading of one raster, not its accuracy.

mixtime [d]temperature_C
C95L050.662.25
C95L050.6562.95
C95L050.763.06
C95L051.158.1
C95L051.1557.13
C95L051.256.13
C95L051.2555.06
C95L051.354.01
C95L051.3552.98
C95L051.451.94
C90L100.663.4
C90L100.6563.75
C90L100.763.7
C90L100.7563.37
C90L100.862.88
C90L100.8562.26
C90L100.961.47
C90L100.9560.57
C90L101.059.73
C90L101.0558.84
C90L101.157.83
C90L101.1556.8
C90L101.255.72
C90L101.451.06
C90L101.4550.04
C90L101.549.01
C90L101.5548.06
C90L101.647.08
C90L101.6546.18
C90L101.745.29
C90L101.7544.39
C90L101.843.53
C90L101.8542.69
C90L101.941.88
C90L101.9541.14
C90L102.0539.59
C90L102.138.92
C90L102.1538.32
C90L102.237.67
C90L102.2537.01
C90L102.336.34
C90L102.3535.69
C90L102.435.18
C90L102.4534.58
C90L102.830.83
C90L102.930.11
C90L102.9529.76
C90L103.029.34
C90L103.0528.97
C90L103.128.77
C90L103.1528.52
C90L103.228.28
C90L103.2527.99
C90L103.327.68
C90L103.3527.46
C90L103.427.22
C90L103.4526.92
C85L150.761.72
C85L150.7561.61
C85L150.861.25
C85L150.8560.85
C85L150.960.21
C85L150.9559.46
C85L151.058.71
C85L151.0557.93
C85L151.157.04
C85L151.1556.19
C85L151.255.31
C85L151.2554.33
C85L151.353.4
C85L151.3552.49
C85L151.451.55
C85L151.4550.61
C85L151.549.67
C85L151.5548.79
C85L151.647.93
C85L151.6547.08
C85L151.746.28
C85L151.7545.43
C85L151.844.62
C85L151.8543.83
C85L151.942.98
C85L151.9542.26
C85L152.041.57
C85L152.0540.87
C85L152.140.16
C85L152.1539.45
C85L152.238.75
C85L152.2538.06
C85L152.337.46
C85L152.3536.79
C85L152.436.2
C85L152.4535.64
C85L152.535.1
C85L152.5534.57
C85L152.634.08
C85L152.6533.57
C85L152.733.08
C85L152.7532.63
C85L152.832.16
C85L152.8531.72
C85L152.931.29
C85L152.9530.9
C85L153.030.48
C85L153.0530.1
C85L153.129.79
C85L153.1529.4
C85L153.229.09
C85L153.2528.79
C85L153.328.44
C85L153.3528.16
C85L153.427.85
C85L153.4527.57
C85L153.527.28
C70L300.6558.6
C70L300.758.47
C70L300.7558.02
C70L300.857.32
C70L300.8556.59
C70L300.955.69
C70L300.9554.73
C70L301.0552.8
C70L301.249.9
C70L301.2548.91
C70L301.347.93
C70L301.3547.02
C70L301.446.04
C70L301.4545.12
C70L301.544.18
C70L301.5543.3
C70L301.642.47
C70L301.6541.64
C70L301.740.81
C70L301.7539.93
C70L301.839.18
C70L301.8538.4
C70L301.937.61
C70L301.9536.83
C70L302.036.18
C70L302.0535.53
C70L302.134.93
C70L302.1534.34
C70L302.233.74
C70L302.2533.19
C70L302.332.62
C70L302.3532.05
C70L302.431.55
C70L302.4531.09
C70L302.530.63
C70L302.5530.21
C70L302.828.24
C70L302.927.51
semi_adiabatic_wb050_maximum: 8 rows measured

Figs. 15(a) and 16(a), p. 56: the maximum of the measured temperature of each mortar of Table 11 at w/b = 0.5 in the semi-adiabatic calorimeter, read where it is drawn (C100 from Fig. 15(a); C85SF15, whose record ends before its maximum, is left out); time_low and time_high bound the instants where the curve stays within one pixel (0.14 K) of its maximum, the uncertainty of the time

read off a figure raster image, the lines located by color (hue, saturation above 0.25) and told apart by stroke width, the thick measured bands followed column by column with sub-pixel edges; a band covered on one side by a color drawn after it read from its free edge, at half its median extent; overlaps otherwise left out; mapped through the placement of the image and the vector frame of the panel (0 to 5 days, 10 to 70 C); reading error ± 0.2 K. The lines are read as for semi_adiabatic_limestone_wb050_temperature (Fig. 15(a)) and semi_adiabatic_pozzolan_wb050_temperature (Fig. 16(a)), whose notes give the attribution of the colors; one pixel is 0.14 K in Fig. 15(a) and 0.18 K in Fig. 16(a), 0.008 d in both. The maximum is the vertex of a parabola fitted over 0.06 d on either side to the readings of the columns. That of C95L05 is read from the free lower edge of its band, its upper side lying under C90L10, and that of C95SF05 mostly from its free edge, under C85SF15.

mixtemperature_Ctime [d]time_low [d]time_high [d]
C10052.160.7070.6590.741
C95L0563.10.6870.6510.725
C90L1063.780.6690.6270.708
C85L1561.740.7050.6680.741
C70L3058.630.6650.6350.692
C95SF0566.640.5790.5210.62
C75FA2560.380.780.750.807
C50FA5055.790.8250.7750.881
fig9b_heat_measured: 74 rows measured

Fig. 9(b), p. 52: the heat released by the mortar ca55 of Waller (1999), ref. [31] of the article, at w/c = 0.55, at 20, 30 and 50 °C, per gram of cement ca (Table 7); the article cites ref. [31] for isothermal calorimetry; the vertex the drawing places at the origin, at a time of -1e-5 d, is left out

read off a figure vector drawing, the drawing operators of the PDF read with PyMuPDF: a marker at the crossing of its two centerline segments, a line along its stroke centerline, the axes calibrated by least squares on their major ticks; reading error not quantified. The calibration residual is below 1e-4 of the span of each axis; values rounded to 5 significant digits on a logarithmic axis, to 1e-5 of the tick span on a linear one.

temperature_Ctime [d]heat [J/g]
50.00.0291710.999
50.00.0458320.997
50.00.0583431.999
50.00.0666641.997
50.00.0791553.0
50.00.0874962.997
50.00.0958174.0
50.00.1041583.998
50.00.112595.0
50.00.12084104.998
50.00.13333116.0
50.00.14582125.998
50.00.16251137.001
50.00.18331146.999
50.00.20834158.001
50.00.23749167.999
50.00.27499179.001
50.00.32083188.999
50.00.38332200.001
50.00.46248209.999
50.00.56248221.002
50.00.70416231.0
50.00.93332241.998
50.01.60414252.0
50.02.67082262.998
30.00.1083511.996
30.00.1499924.002
30.00.1791736.998
30.00.2041748.997
30.00.2249860.996
30.00.2458472.999
30.00.2666485.002
30.00.2833397.001
30.00.30417109.997
30.00.32914121.996
30.00.35417133.999
30.00.37915146.002
30.00.4125158.001
30.00.45417170.0
30.00.50832183.0
30.00.57916194.999
30.00.66664207.001
30.00.78332219.001
30.00.92083231.0
30.01.06666242.999
30.01.23335256.002
30.01.45414268.001
30.01.75417280.0
30.02.33332291.999
30.04.12085303.999
20.00.1625111.996
20.00.2583324.999
20.00.3166536.998
20.00.3624948.997
20.00.4083360.996
20.00.4458574.0
20.00.4875285.999
20.00.5249897.998
20.00.56248111.001
20.00.60831123.0
20.00.65415134.999
20.00.70416147.999
20.00.76251160.002
20.00.82918172.001
20.00.92083184.0
20.01.04166197.0
20.01.19169208.999
20.01.40416221.002
20.01.73748233.997
20.02.07915245.997
20.02.47918258.0
20.02.99582270.999
20.03.72086282.998
20.04.99586294.997
fig9b_heat_estimated: 119 rows estimated

Fig. 9(b), p. 52: the heat released by the mortar ca55 of Waller (1999), ref. [31] of the article, at w/c = 0.55, at 20, 30 and 50 °C, per gram of cement ca (Table 7); the article cites ref. [31] for isothermal calorimetry, by the article's model

read off a figure vector drawing, the drawing operators of the PDF read with PyMuPDF: a marker at the crossing of its two centerline segments, a line along its stroke centerline, the axes calibrated by least squares on their major ticks; reading error not quantified. The calibration residual is below 1e-4 of the span of each axis; values rounded to 5 significant digits on a logarithmic axis, to 1e-5 of the tick span on a linear one. A curve keeps the vertices it is drawn with inside the frame of its panel, each at least 0.02 of the panel's diagonal (time over 5 d, heat over 500 J/g) from the last kept, the first and last always; none is interpolated. The few vertices the drawing places just outside the frame, at negative time or heat, are left out.

temperature_Ctime [d]heat [J/g]
50.00.0099916.454
50.00.0331267.591
50.00.0450287.741
50.00.05816106.137
50.00.07241123.008
50.00.08819138.958
50.00.11728160.612
50.00.13574171.599
50.00.15481181.623
50.00.19556199.461
50.00.23998214.823
50.00.28804228.224
50.00.34078240.22
50.00.40017251.332
50.00.46655261.604
50.00.53993271.054
50.00.62489280.172
50.00.7232288.939
50.00.82485296.535
50.00.94076303.849
50.01.07297310.878
50.01.23274317.999
50.01.32618321.621
50.01.42668325.163
50.01.53483328.617
50.01.65113331.995
50.01.77629335.296
50.01.91091338.51
50.02.05573341.654
50.02.21156344.717
50.02.37916347.704
50.02.55949350.626
50.02.75348353.467
50.02.9839356.516
50.03.23357359.481
50.03.50416362.369
50.03.79739365.166
50.04.11515367.894
50.04.45952370.545
50.04.83267373.123
50.05.01246374.27
30.00.009993.652
30.00.0380721.534
30.00.0908159.802
30.00.1122672.681
30.00.1347584.805
30.00.1570895.566
30.00.18048105.706
30.00.20583115.653
30.00.23306125.334
30.00.29018143.015
30.00.35345159.491
30.00.40017168.934
30.00.47342181.517
30.00.55595193.607
30.00.6434204.544
30.00.73922214.783
30.00.84312224.295
30.00.96162233.607
30.01.09675242.688
30.01.2509251.532
30.01.42668260.117
30.01.52365264.302
30.01.6272268.417
30.01.73778272.467
30.01.85588276.44
30.01.982280.344
30.02.1167284.174
30.02.26055287.928
30.02.41419291.616
30.02.57826295.224
30.02.75348298.766
30.02.9406302.231
30.03.14045305.631
30.03.35389308.954
30.03.58182312.207
30.03.82523315.395
30.04.11515318.857
30.04.42706322.227
30.04.76258325.525
30.05.01246327.781
20.00.009991.607
20.00.0585816.871
20.00.1280444.988
20.00.1570855.64
20.00.1871965.762
20.00.2182475.358
20.00.2838793.324
20.00.35089108.865
20.00.42427123.464
20.00.50557137.45
20.00.59374150.632
20.00.68715162.832
20.00.76115171.336
20.00.88088182.156
20.01.01205192.45
20.01.1543202.178
20.01.31652211.814
20.01.40598216.576
20.01.50156221.286
20.01.60361225.946
20.01.71256230.554
20.01.82897235.108
20.01.95325239.603
20.02.086244.029
20.02.22776248.396
20.02.37916252.697
20.02.54087256.926
20.02.71353261.085
20.02.89795265.175
20.03.09488269.192
20.03.30524273.139
20.03.52986277.013
20.03.76974280.815
20.04.02594284.539
20.04.29955288.191
20.04.59177291.773
20.04.90381295.282
20.05.01246296.432
semi_adiabatic_pozzolan_wb050_temperature: 80 rows measured

Fig. 16(a), p. 56: temperature of the mortars of Table 11 with silica fume and fly ash at w/b = 0.5 in the semi-adiabatic calorimeter (thick lines), where the band of each is not covered by another; the measured curves of C95SF05 and C85SF15 end near 0.7 d, that of C85SF15 before its maximum (its highest reading, 68.19 °C at 0.644 d); the legend of the figure names C75FA25 the mortar Table 11 names C75FA525; the crosses of the rise are not transcribed

read off a figure raster image, the lines located by color (hue, saturation above 0.25) and told apart by stroke width, the thick measured bands followed column by column with sub-pixel edges; a band covered on one side by a color drawn after it read from its free edge, at half its median extent; overlaps otherwise left out; mapped through the placement of the image and the vector frame of the panel (0 to 5 days, 10 to 90 C); reading error ± 0.2 K. One pixel is 0.18 K and 0.008 d. The colors are attributed from the vector legend, its rows matched in height to the line samples of the image: blue C100, green C95SF05, yellow C85SF15, orange C75FA25, red C50FA50, each drawn over the ones before it where their bands cross. Each bin of 0.05 d holds the least-squares line of its readings evaluated at its center. The C100 band of this figure, the same test as in Fig. 15(a), agrees with its reading there to 0.09 K in root mean square, a shift of one pixel in time.

mixtime [d]temperature_C
C95SF050.666.58
C95SF050.6566.24
C85SF150.5567.59
C85SF150.668.11
C85SF150.6568.17
C75FA250.759.8
C75FA250.7560.28
C75FA250.860.33
C75FA250.8560.07
C75FA250.959.69
C75FA250.9559.23
C75FA251.0558.09
C75FA251.157.28
C75FA251.2554.97
C75FA251.354.01
C75FA251.3553.14
C75FA251.452.17
C75FA251.4551.35
C75FA251.550.46
C75FA251.5549.52
C75FA251.648.65
C75FA251.6547.78
C75FA251.746.86
C75FA251.7546.05
C75FA251.845.31
C75FA251.8544.46
C75FA251.943.59
C75FA251.9542.84
C75FA252.042.08
C75FA252.0541.37
C75FA252.140.71
C75FA252.1539.97
C75FA252.239.27
C75FA252.2538.62
C75FA252.337.95
C75FA252.3537.28
C75FA252.436.62
C75FA252.535.42
C50FA500.7555.34
C50FA500.855.74
C50FA500.8555.73
C50FA500.955.45
C50FA500.9555.08
C50FA501.054.73
C50FA501.0554.06
C50FA501.252.33
C50FA501.2551.65
C50FA501.350.88
C50FA501.3550.24
C50FA501.449.51
C50FA501.4548.81
C50FA501.548.12
C50FA501.5547.42
C50FA501.646.62
C50FA501.6545.94
C50FA501.745.26
C50FA501.7544.51
C50FA501.843.77
C50FA501.8543.01
C50FA501.942.31
C50FA501.9541.65
C50FA502.041.06
C50FA502.0540.47
C50FA502.139.78
C50FA502.1539.13
C50FA502.238.49
C50FA502.2537.9
C50FA502.337.26
C50FA502.3536.69
C50FA502.436.15
C50FA502.4535.61
C50FA502.535.07
C50FA502.5534.54
C50FA502.634.04
C50FA502.6533.61
C50FA502.733.13
C50FA502.7532.65
C50FA502.832.22
C50FA502.8531.77
C50FA502.931.31

Notes

  • The article writes the first author of the 1984 model 'Parrot'; the name is Parrott.
  • p. 42 prints 'E_S,A = 83,14 kJ/mol (E_S,A/R = 100 K)'; the ratio of the two is 1.0e4 K. Only the activation energy is kept here.
  • Table 11: the water accounts for the 0.9 % absorption of the dry sand; the w/b of C85L15 in the first group is 0.48 (asterisk in the table).
  • semi_adiabatic_C100_wb050_temperature is read from Fig. 15(a), which is a raster image (JPEG) under vector axes: the thick blue line of the measured C100 curve was located column by column by its color and its width, in image pixels mapped to the page through the placement of the image, and to time and temperature through the vector frame of the panel (0 to 5 days, 10 to 70 C). The points are averaged over 0.05 d. Before about 0.6 d the measured curve is drawn as crosses that overlap those of the other mixes, and after 3.5 d it lies under them: neither part is transcribed. One pixel is 0.03 K and 0.008 d; the width of the line makes the reading good to about 0.2 K.
Show the code of scripts/hydration_calibration.jl, included above

The file scripts/hydration_calibration.jl on GitHub, at the commit this page was built from:

julia
# =============================================================================
#  hydration_calibration.jl — calibrating OPC hydration kinetics against
#                             measured isothermal calorimetry
#
#  `ionic_hydration.jl` runs a complete CEM I forward and reads its calorimetry
#  off a certified replay, with the *published* Parrott & Killoh (1984)
#  parameters. This script closes the loop the other way: given a measured heat
#  curve, which kinetic parameters reproduce it?
#
#  Only KINETIC parameters are fitted. The thermodynamics — ΔₐG⁰, ΔₐH⁰, Cp⁰,
#  log K — come from CEMDATA18 and are not adjustable: they are measured
#  quantities, and moving them to improve a fit would be fabricating chemistry.
#  Blaine fineness, w/b ratio and temperature are not fitted either, because the
#  experiment reports them.
#
#  The data are the CC-BY-4.0 deposit of Šmilauer & Reiterman (2025); see
#  `data/experimental/README.md` and `data/experimental/LICENSE`.
#
#  Usage:
#      julia --project=scripts scripts/hydration_calibration.jl
#      or, from the REPL:  include("scripts/hydration_calibration.jl")
#
#  This script deliberately does NOT call `Pkg.activate`:
#  `docs/src/examples/hydration_calibration.md` and
#  `test/kinetics/test_calibration.jl` include this file, and the active
#  project is global process state — activating an environment halfway through a
#  documentation build changes it for every `@example` block that follows.
#
#  The coupled stage is expensive — one Gibbs minimization per accepted step,
#  plus a certified replay per output instant. `main()` reports its own cost.
# =============================================================================

using ChemistryLab
using DynamicQuantities
using LinearAlgebra
using OptimaSolver
using Optimization
using OptimizationOptimJL
# `NelderMead` is imported explicitly from Optim.
import OptimizationOptimJL: NelderMead
using OrderedCollections
using OrdinaryDiffEq
using Printf
using SciMLBase
using Statistics

# The forward model, the chemical system and the dissolution reactions are the
# ones of the companion script; nothing about the physics is restated here.
# `@isdefined` tests the module this file is included into, which is not `Main`
# when a documentation page includes it.
@isdefined(run_ionic_hydration) || include(joinpath(@__DIR__, "ionic_hydration.jl"))

# ── the measured data ─────────────────────────────────────────────────────────

"""
    CALORIMETRY_DIR

Directory holding the vendored measured records. Its `README.md` documents the
format and its `LICENSE` the terms — the data are CC-BY-4.0 and **not** covered
by the package license.
"""
const CALORIMETRY_DIR = datapath("experimental")

"""
    CalorimetryData

One isothermal-calorimetry record.

  - `t` — hydration time [s], strictly increasing, **not** starting at zero:
    every calorimeter record begins after thermal equilibration.
  - `qdot` — heat flow [W/g of binder].
  - `Q` — released heat [J/g of binder], counted from `t[1]`, not from mixing.
  - `Qref` — **not a measurement**: the depositors' own fitted curve at the same
    instants, or empty when the file carries none. It is there so a fit can be
    judged against somebody else's on the very same record.
  - `meta` — what the experiment reported and a fit must therefore not touch:
    `cement`, `blaine`, `wb`, `T`, plus `q_before_start` (the heat already gone
    when the record opens) and the provenance fields `source`, `doi`, `license`.

!!! note "Q is counted from the first sample"
    Both the record and the model are referred to `t[1]`. Aligning them there
    rather than at mixing avoids inventing the missing first hour: the induction
    period is exactly what neither the instrument nor a Parrott–Killoh rate law
    describes. `meta.q_before_start` is carried so the *total* heat can still be
    reported, and it is the depositors' own estimate, not a measurement.
"""
struct CalorimetryData{M}
    t::Vector{Float64}
    qdot::Vector{Float64}
    Q::Vector{Float64}
    Qref::Vector{Float64}
    meta::M
end

Base.length(d::CalorimetryData) = length(d.t)

function Base.show(io::IO, d::CalorimetryData)
    return @printf(
        io, "CalorimetryData(%s, w/b %.2f, Blaine %.0f m²/kg, %.1f–%.1f h, %d points)",
        d.meta.cement, d.meta.wb, d.meta.blaine, d.t[1] / 3600, d.t[end] / 3600, length(d.t)
    )
end

"""
    _meta_field(comments, key) -> Union{String, Nothing}

Value of a `# key: value` provenance line, or `nothing`.
"""
function _meta_field(comments, key)
    for line in comments
        clean = strip(lstrip(line, ['#', ' ']))
        startswith(clean, key * ":") || continue
        return strip(clean[(length(key) + 2):end])
    end
    return nothing
end

"""
    _leading_float(s) -> Float64

First number in a string, so that `"397 m2/kg"` and `"20C"` both parse. Returns
`NaN` when there is none.
"""
function _leading_float(s)
    m = match(r"[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?", s)
    return m === nothing ? NaN : parse(Float64, m.match)
end

"""
    read_calorimetry(path) -> CalorimetryData

Read one record: `#` comment lines carrying the provenance and the experimental
conditions, then a comma-separated table headed
`time_h,heat_flow_W_per_g,heat_J_per_g`.

**This is the seam for your own data.** Any file in that shape works. The
comment lines the reader looks for are `cement`, `blaine`, `wb`, `temperature`
and `Released heat up to`; a missing one becomes `NaN` or an empty string rather
than an error, but `blaine` and `wb` are needed by the forward model and their
absence will surface there. A fourth column, if present, is read as somebody
else's fitted curve and never as data.
"""
function read_calorimetry(path)
    comments = String[]
    t_h = Float64[]
    qdot = Float64[]
    Q = Float64[]
    Qref = Float64[]
    for line in eachline(path)
        s = strip(line)
        isempty(s) && continue
        if startswith(s, "#")
            push!(comments, s)
        elseif startswith(s, "time_h")
            continue
        else
            f = split(s, ',')
            length(f) >= 3 || error("malformed data line in $path: $s")
            push!(t_h, parse(Float64, f[1]))
            push!(qdot, parse(Float64, f[2]))
            push!(Q, parse(Float64, f[3]))
            length(f) >= 4 && push!(Qref, parse(Float64, f[4]))
        end
    end
    isempty(t_h) && error("no data rows in $path")

    released = _meta_field(comments, "Released heat up to 45 minutes (J/g of binder)")
    meta = (
        cement = something(_meta_field(comments, "cement"), "unknown"),
        blaine = _leading_float(something(_meta_field(comments, "blaine"), "")),
        wb = _leading_float(something(_meta_field(comments, "wb"), "")),
        T = _leading_float(something(_meta_field(comments, "temperature"), "")) + 273.15,
        q_before_start = released === nothing ? NaN : _leading_float(released),
        source = something(_meta_field(comments, "source file"), basename(path)),
        doi = something(_meta_field(comments, "doi"), ""),
        license = something(_meta_field(comments, "license"), ""),
    )
    return CalorimetryData(t_h .* 3600, qdot, Q, Qref, meta)
end

"""
    CEM_I_TARGET, CEM_I_HOLDOUT

The two vendored records: the CEM I 52.5 R of Čížkovice at w/b = 0.50 and Blaine
397 m²/kg, fitted; and the CEM I 52.5 R of Ladce at w/b = 0.45 and Blaine
415 m²/kg, predicted without refitting.

The holdout is the only unbiased test available here of whether
[`powers_alpha_max`](@ref) and [`blaine_factor`](@ref) carry a calibration
across mixes, which is the claim those two corrections make.
"""
const CEM_I_TARGET = read_calorimetry(
    joinpath(CALORIMETRY_DIR, "smilauer2025-122-cemI-52.5R-cizkovice.csv")
)

"""
    CEM_I_HOLDOUT

The CEM I 52.5 R of Ladce at w/b = 0.45 and Blaine 415 m²/kg, over 26 days —
predicted with the parameters fitted on [`CEM_I_TARGET`](@ref), never fitted
itself. See [`CEM_I_TARGET`](@ref).
"""
const CEM_I_HOLDOUT = read_calorimetry(
    joinpath(CALORIMETRY_DIR, "smilauer2025-116-cemI-52.5R-ladce.csv")
)

"""
    resample_log(data, n; tmax = Inf) -> CalorimetryData

Subset of `data` on `n` log-spaced times, by nearest sample.

A calorimeter samples uniformly in time, which weights a ten-day plateau some
hundred times more heavily than the acceleration peak. Hydration is a decades-of-
time process and the residuals belong on a log grid; `n ≈ 60` carries every
feature of these curves at a hundredth of the forward-solve count.
"""
function resample_log(data::CalorimetryData, n; tmax = Inf)
    hi = something(findlast(<=(tmax), data.t), lastindex(data.t))
    targets = 10 .^ range(log10(data.t[1]), log10(data.t[hi]); length = n)
    idx = sort!(unique!([argmin(abs.(data.t .- τ)) for τ in targets]))
    Qref = isempty(data.Qref) ? Float64[] : data.Qref[idx]
    return CalorimetryData(data.t[idx], data.qdot[idx], data.Q[idx], Qref, data.meta)
end

# ── the clinker, which is assumed and not fitted ──────────────────────────────

"""
    CALIB_CLINKER, CALIB_GYPSUM, CALIB_FILLER

The formulation held fixed through every fit: the CEM I 52.5 N of Lavergne et al.
(2018), Table 9 — C₃S 65 / C₂S 11 / C₃A 11 / C₄AF 8 by mass of clinker, with
4.6 % gypsum and 3.5 % limestone.

!!! warning "The deposit does not report a phase composition"
    It reports the cement type, the Blaine fineness, the w/b ratio and the
    temperature — not the clinker mineralogy. So a composition has to be
    supplied, and the consequence is exact rather than vague: a heat curve
    constrains the *product* of a phase fraction and its reaction rate, never
    the two apart. What is calibrated below is a rate **given this composition**,
    and §"Composition sensitivity" of the documentation page measures what that
    assumption costs.

    This particular composition was chosen because the target record's w/b of
    0.50 and Blaine of 397 m²/kg sit within a few percent of the mix it was
    published for, and because `ionic_hydration.jl` already runs it — so the two
    scripts describe one cement, not two.
"""
const CALIB_CLINKER = IONIC_CEMENT.clinker

"""
    CALIB_GYPSUM

Gypsum, 4.6 % of the binder mass. Fixed; see [`CALIB_CLINKER`](@ref).
"""
const CALIB_GYPSUM = IONIC_CEMENT.gypsum

"""
    CALIB_FILLER

Limestone filler, 3.5 % of the binder mass. Fixed; see [`CALIB_CLINKER`](@ref).
"""
const CALIB_FILLER = IONIC_CEMENT.filler

# ── the induction period, which Parrott & Killoh does not have ────────────────

"""
    INDUCTION_PHASES

Phases whose dissolution the induction factor slows: the two silicates.

The dormant period is a silicate phenomenon — dissolution inhibited at the alite
surface until the etch-pit mechanism opens up, in the reading of
[Scrivener2019](@cite). The aluminate reacts within minutes of wetting, and its
first peak falls before these records even open, so slowing it would be
inventing a delay nobody measured here.
"""
const INDUCTION_PHASES = ("C3S", "C2S")

"""
    induction_factor(τ, m) -> Function

`β(t) = 1 - exp(-(t/τ)^m)`, a dimensionless factor in `[0, 1)` multiplying a
dissolution rate: an induction period of characteristic length `τ` [s] and
sharpness `m`.

# Why this is needed at all

`parrott_killoh_avrami` has **no induction period**. Its Avrami branch is floored
at `PK_AVRAMI_SEED` precisely so that the ODE leaves `ξ = 0` at all, which means
hydration starts the instant the water does. Real cement does not: it has a
dormant hour or several. Measured against the record used here, the unmodified
model has released 23.8 J/g at 2.7 h where the calorimeter saw 4.7, and 63.3 J/g
at 5.7 h against 23.2 — and having spent that heat early it then runs *behind*,
by some 60 J/g at two days, and never recovers.

No rate constant repairs that, because the two errors have opposite signs: a
slower rate improves the early residual and worsens the late one. It is a missing
term, not a mis-set parameter. `β(t)` is that term, in the standard
nucleation-with-induction form, and it is what makes a mechanistic model
comparable with the empirical affinity functions whose second parameter does the
same job implicitly.

`τ` and `m` are kinetic parameters like any other and are fitted.

!!! note "Why `m` is boxed narrowly"
    A large `m` makes `β` a near-step function. That is not stiffness — an
    L-stable method handles stiffness by construction — but it is a rapid,
    localized variation of the right-hand side in *time*, which any adaptive
    integrator has to find by rejecting steps unless it is told where to look.
    [`induction_tstops`](@ref) tells it. `[0.8, 4.0]` is then a statement about
    the physics rather than about the solver: a dormant period that ends over an
    hour or over six, not one that ends instantaneously.
"""
induction_factor(τ, m) = t -> -expm1(-(max(t, zero(t)) / τ)^m)

"""
    induction_tstops(τ, m; n = 9) -> Vector{Float64}

Times spanning the induction transition, for `tstops`.

**Not used by default, and the reason is measured.** `β(t) = 1 - exp(-(t/τ)^m)`
climbs from ≈0 to ≈1 over roughly `τ/4` to `4τ`, a rapid but purely *explicit*
variation of the right-hand side. Forcing steps there looked like the obvious
thing to do — it is the SciML idiom for a localized feature in time — and on this
problem it makes matters worse: 117 steps and 26 ms with these `tstops` against
113 steps and 12 ms without them, on the same trajectory to the same answer. The
adaptive controller locates a three-hour transition inside a 262-hour integration
without help, and the forced steps are simply extra.

Kept because it is the right tool for a *sharper* transition than this one, and
because the negative result is worth being able to reproduce: pass it as `tstops`
to [`stoichiometric_run`](@ref) or [`run_ionic_hydration`](@ref).
"""
induction_tstops(τ, m; n = 9) = collect(τ .* 10 .^ range(-0.6, 0.6; length = n))

# The smoothing of the activation of the ferrite on portlandite, in mol per kilogram of
# binder: small against the 2 mol a paste forms, large against the precision of
# the integration.
const C4AF_CH_GATE = 1.0e-4

"""
    portlandite_gated(base; ε = C4AF_CH_GATE) -> KineticFunc

`base` multiplied by `c/(c + ε)`, `c` the moles of portlandite present (zero
when the reconstruction takes it below): the rate of a reaction that consumes
portlandite stops when there is none, smoothly, as
[Writing a kinetic model](@ref sec-kinetics-syntax) writes a gate.
"""
function portlandite_gated(base; ε = C4AF_CH_GATE)
    return KineticFunc(
        (T, P, t, n, lna, n0) -> begin
            c = max(n["Portlandite"], zero(eltype(n.data)))
            base(T, P, t, n, lna, n0) * c / (c + ε)
        end,
        (T = 293.15u"K", P = 1.0e5u"Pa"), u"mol/s",
    )
end

"""
    damped_rate(base::KineticFunc, β) -> KineticFunc

`base` multiplied by `β(t)`, or `base` unchanged when `β === nothing`.

The same closure-wrapping pattern `ionic_hydration.jl` uses for its per-phase
calibration factors, so the rate laws themselves are never edited.
"""
function damped_rate(base, β)
    β === nothing && return base
    return KineticFunc(
        (T, P, t, n, lna, n0) -> β(t) * base(T, P, t, n, lna, n0),
        (T = 293.15u"K", P = 1.0e5u"Pa"), u"mol/s",
    )
end

"""
    INDUCTION_KEY

Pseudo-phase marking a [`CalibParameter`](@ref) that configures
[`induction_factor`](@ref) rather than a Parrott–Killoh field. Its `field` is
`:τ` (seconds) or `:m`.
"""
const INDUCTION_KEY = "induction"

# ── what is calibrated, and what is deliberately not ──────────────────────────

"""
    CalibParameter

One free parameter: its `name`, the `phase` and Parrott–Killoh field it writes
(`field`), the published `prior`, a `(lo, hi)` box, and `logscale` telling the
optimizer to work in `log` of it.

Rates span decades and must be searched multiplicatively; exponents are O(1) and
must not.
"""
struct CalibParameter
    name::Symbol
    phase::String
    field::Symbol
    prior::Float64
    lo::Float64
    hi::Float64
    logscale::Bool
end

"""
    CALIB_SPEC_FULL :: Vector{CalibParameter}

The six **candidate** parameters — one per mechanism with a distinct signature on
the heat curve — chosen so that none is redundant with another *by construction*.

| θ | phase | mechanism it governs | prior |
|---|---|---|---|
| `k₁_C3S` | alite | Avrami nucleation and growth — the acceleration | 1.5 d⁻¹ |
| `n₁_C3S` | alite | Avrami exponent — the shape of the main peak | 0.7 |
| `k₃_C3S` | alite | power-law shell — where deceleration sets in | 1.1 d⁻¹ |
| `n₃_C3S` | alite | power-law exponent — how hard it decelerates | 3.3 |
| `k₁_C3A` | aluminate | Avrami rate — the sulfate-depletion shoulder | 1.0 d⁻¹ |
| `k₃_C2S` | belite | power-law shell — the multi-day plateau | 0.2 d⁻¹ |

Six is what the *model* offers. [`CALIB_SPEC`](@ref) is what the *measurement*
supports, which is fewer; this list is kept for the analysis that establishes
that, and for anyone whose data support more.

# Excluded before any fitting, and why

  - **Every `Ea`.** These records were measured at one temperature, 20 °C. An
    activation energy is a *temperature* sensitivity; at one temperature it is not
    identifiable, and fitting it would report a number the data cannot contain.
  - **A uniform per-phase multiplier**, of the kind `IONIC_CALIBRATION` offers.
    For alite the rate is `min(α̇₁, α̇₃)`, so `f · min(α̇₁, α̇₃) = min(f·α̇₁, f·α̇₃)`:
    scaling the phase is *exactly* scaling `k₁` and `k₃` together. Fitting both
    would make the problem rank-deficient by construction rather than by accident.
    Use `IONIC_CALIBRATION` **or** the rate-law fields, never both.
  - **`k₂` (Jander diffusion) for alite**, because the data cannot see it.
    Parrott & Killoh reported no diffusion-controlled stage for C₃S, and
    [`parrott_killoh_avrami`](@ref)'s docstring repeats it. The exact sensitivity
    agrees: at the published constants the Jander branch never becomes the
    minimum, and `∂Q/∂log k₂` is zero over the whole record. A central difference
    with a 5 % step would cross the kink of the minimum where the branch comes
    within 5 % of binding, and report about an eighth of `k₁`'s influence. The
    documentation page measures it.
  - **Gypsum and calcite dissolution.** [`ionic_reactions`](@ref) deliberately
    makes them fast so sulfate is available to the minimization from the start
    rather than rate-limiting it. A step that does not limit cannot be calibrated.
  - **The whole thermodynamic database.** Not a parameter. See the file header.
"""
const CALIB_SPEC_FULL = [
    CalibParameter(:k₁_C3S, "C3S", :k₁, 1.5, 1.5 / 4, 1.5 * 4, true),
    CalibParameter(:n₁_C3S, "C3S", :n₁, 0.7, 0.3, 1.3, false),
    CalibParameter(:k₃_C3S, "C3S", :k₃, 1.1, 1.1 / 6, 1.1 * 12, true),
    CalibParameter(:n₃_C3S, "C3S", :n₃, 3.3, 1.5, 6.0, false),
    CalibParameter(:k₁_C3A, "C3A", :k₁, 1.0, 1.0 / 4, 1.0 * 4, true),
    CalibParameter(:k₃_C2S, "C2S", :k₃, 0.2, 0.2 / 4, 0.2 * 4, true),
    CalibParameter(:τ_ind, INDUCTION_KEY, :τ, 4.0 * 3600, 0.2 * 3600, 24.0 * 3600, true),
    CalibParameter(:m_ind, INDUCTION_KEY, :m, 2.0, 0.8, 4.0, false),
]

"""
    CALIB_SPEC :: Vector{CalibParameter}

The parameters actually fitted: the three rate-law parameters of
[`CALIB_SPEC_FULL`](@ref) that a single isothermal heat curve can carry, plus the
two of the dormant period, `τ_ind` and `m_ind`.

Three rate-law parameters, not six, and the reason is measured rather than
assumed. Over the six
candidates the singular values of `∂Q/∂log θ` come out at
`[424, 108, 63.6, 6.46, 1.98, 0.152]` on this record, against a residual standard
deviation of 29 J/g. The standard errors of the six directions in `log θ` are
then 0.07, 0.27 and 0.46 for the first three, and 4.5, 15 and 190 for the others,
which are known to within a factor of 89 at best: the measurement determines
three *combinations* of the six, not six numbers.

Which three is decided by the correlation matrix. Two pairs are close to
collinear:

  - `k₁_C3S` with `n₁_C3S`, correlation −0.96;
  - `k₃_C3S` with `n₃_C3S`, correlation −0.985 — between them they are
    essentially the whole leading singular direction.

Within each pair the data see a combination and not its members, so one per pair
is all that can be fitted. The **rate constant** is the one kept in each: an
Avrami or power-law exponent is a shape parameter of an empirical 1984 fit,
whereas a rate constant is the quantity a different clinker plausibly changes.
`n₁_C3S` and `n₃_C3S` therefore stay at their published values.

The third is `k₁_C3A`, which is separately visible — very nearly the fourth
singular direction on its own — if weakly. `k₃_C2S` is dropped outright: over
eleven days belite carries a weight of 0.001 in the three directions the data see,
which is a quantitative way of saying invisible.

!!! note "A parameter at a bound is not a result"
    Each box spans a factor of four either side of the published value. A fit that
    pins a parameter against a bound is not reporting that value — it is reporting
    that the model cannot make this curve and is saturating whatever it is handed.
    Fitting all six does exactly that, on four of them at once.
    [`box_position`](@ref) is printed with every fit for that reason.
"""
const CALIB_SPEC = CALIB_SPEC_FULL[[1, 3, 5, 7, 8]]

"""
    PK84_PRIOR :: Dict{String, NamedTuple}

The published parameter sets, by phase symbol — the starting point of every fit
and the reference every result is reported against. Aliases `IONIC_PK84` of the
companion script, so the two describe one cement and not two.
"""
const PK84_PRIOR = IONIC_PK84

"""
    to_native(z, spec = CALIB_SPEC) -> Vector{Float64}
    to_search(θ, spec = CALIB_SPEC) -> Vector{Float64}

Map between the unbounded space `z ∈ ℝⁿ` the optimizer searches and native
parameter values inside their boxes.

Two changes of variable, composed. A logistic squashes `ℝ` onto `(0, 1)`, and
`(0,1)` is mapped affinely onto `[lo, hi]` — in `log` of the parameter when it is
a rate, linearly when it is an exponent. Rates span decades and must be searched
multiplicatively; exponents are O(1) and must not.

The point of folding the box into the transform rather than declaring it to the
solver is that *every* optimizer then works unconstrained, derivative-free ones
included, and no iterate can ever leave the physically admissible region. The
price is that a parameter running to a bound shows up as a large `|z|` instead of
an active constraint, which is why [`box_position`](@ref) exists.
"""
function to_native(z, spec = CALIB_SPEC)
    return map(zip(spec, z)) do (p, zi)
        u = 1 / (1 + exp(-zi))
        lo, hi = p.logscale ? (log(p.lo), log(p.hi)) : (p.lo, p.hi)
        w = lo + (hi - lo) * u
        # `clamp` is not decoration. At large |z| the logistic saturates to exactly
        # 1.0, and `exp(lo + (hi - lo))` is then not bit-identical to `p.hi`: the
        # box top came out 4e-15 high on `k₃_C3S`. Harmless as a rate, but the
        # invariant this transform exists to guarantee is that no iterate ever
        # leaves the admissible region, and an invariant that holds to 4e-15 is
        # not an invariant. The test suite caught it.
        return p.logscale ? clamp(exp(w), p.lo, p.hi) : clamp(w, p.lo, p.hi)
    end
end

@doc (@doc to_native)
function to_search(θ, spec = CALIB_SPEC)
    return map(zip(spec, θ)) do (p, v)
        lo, hi = p.logscale ? (log(p.lo), log(p.hi)) : (p.lo, p.hi)
        w = p.logscale ? log(v) : v
        u = clamp((w - lo) / (hi - lo), 1.0e-6, 1 - 1.0e-6)
        return log(u / (1 - u))
    end
end

"""
    box_position(θ, spec = CALIB_SPEC) -> Vector{Float64}

Where each parameter sits in its box, as a fraction in `[0, 1]`.

A value that has run to 0 or 1 is not a result: it says the data pushed the
parameter as far as it was allowed to go, and the box — not the measurement —
decided the answer. Reported alongside every fit for that reason.
"""
function box_position(θ, spec = CALIB_SPEC)
    return map(zip(spec, θ)) do (p, v)
        lo, hi = p.logscale ? (log(p.lo), log(p.hi)) : (p.lo, p.hi)
        return ((p.logscale ? log(v) : v) - lo) / (hi - lo)
    end
end

"""
    prior_vector(spec = CALIB_SPEC) -> Vector{Float64}

The published values, in native units, in the order of `spec`.
"""
prior_vector(spec = CALIB_SPEC) = [p.prior for p in spec]

"""
    apply_parameters(θ, spec = CALIB_SPEC) -> Dict{String, NamedTuple}

The Parrott–Killoh parameter sets with `θ` written into them, everything else
left at its published value.

Rate fields are reunited with their day⁻¹ unit here, which is where they came
from: the search vector carries bare numbers so the optimizer never sees a
`Quantity`.
"""
function apply_parameters(θ, spec = CALIB_SPEC)
    out = Dict{String, NamedTuple}(k => v for (k, v) in PK84_PRIOR)
    for (p, v) in zip(spec, θ)
        p.phase == INDUCTION_KEY && continue
        unitful = startswith(String(p.field), "k") ? v * u"1/d" : v
        out[p.phase] = merge(out[p.phase], NamedTuple{(p.field,)}((unitful,)))
    end
    return out
end

"""
    induction_of(θ, spec = CALIB_SPEC) -> Union{Function, Nothing}

The induction factor `θ` asks for, or `nothing` when `spec` holds no induction
parameters — in which case the model has no induction period, as published.
"""
function induction_of(θ, spec = CALIB_SPEC)
    τ, m = _induction_params(θ, spec)
    τ === nothing && return nothing
    return induction_factor(τ, something(m, 2.0))
end

"""
    induction_tstops_of(θ, spec = CALIB_SPEC) -> Vector{Float64}

The `tstops` of [`induction_tstops`](@ref) for the induction period `θ` asks for,
or empty when it asks for none.
"""
function induction_tstops_of(θ, spec = CALIB_SPEC)
    τ, m = _induction_params(θ, spec)
    τ === nothing && return Float64[]
    return induction_tstops(τ, something(m, 2.0))
end

# The (τ, m) pair a parameter vector carries, or (nothing, nothing).
function _induction_params(θ, spec)
    τ = nothing
    m = nothing
    for (p, v) in zip(spec, θ)
        p.phase == INDUCTION_KEY || continue
        p.field === :τ && (τ = v)
        p.field === :m && (m = v)
    end
    return τ, m
end

"""
    SURROGATE_SOLVER

The integrator used by [`stoichiometric_run`](@ref), chosen by measurement rather
than inherited — the documentation page benchmarks the alternatives.

Measured on the target record, all seven candidates agree on `Q(t_end)` to better
than 0.01 J/g, and the surrogate turns out **not to be stiff**:

| solver | no induction | with induction |
|---|---|---|
| `Tsit5` (explicit) | 0.023 s | 0.023 s |
| `FBDF` (multistep) | 0.023 s | 0.025 s |
| `AutoTsit5(Rosenbrock23)` | 0.023 s | 0.023 s |
| `AutoVern7(Rodas5P)` | 0.025 s | 0.027 s |
| `Rodas5P` | 0.036 s | 0.040 s |
| `Rosenbrock23` | 0.061 s | 0.369 s |

`Rodas5P`, which the other scripts in this directory use, costs 1.6× here for
nothing, and `Rosenbrock23` collapses by a factor of ten once the induction
transition is present. `AutoTsit5(Rosenbrock23())` matches the fastest: SciML's
automatic-switching wrapper runs the explicit `Tsit5` while the problem is
non-stiff and hands over to the stiff `Rosenbrock23` if the detector fires. It
costs nothing when the problem is easy and protects against a parameter set that
makes it hard — which, in an optimizer that will visit hundreds of parameter sets,
is the property that matters.
"""
const SURROGATE_SOLVER = AutoTsit5(Rosenbrock23())

"""
    COUPLED_SOLVER

The integrator used by the coupled mode.

!!! warning "This one is inherited, not measured"
    The surrogate table above is measured; this is not. The coupled mode is a
    different regime — a Gibbs minimization runs on every accepted step, so the
    cost per step dwarfs the cost of taking it, and the right choice is whatever
    needs the fewest steps, which is not what the surrogate benchmark answers.
    `Rodas5P()` is kept because it is what the rest of this repository uses and is
    known to work here, not because it was shown to be best. Measuring it costs one
    coupled solve per candidate, a few minutes, and is worth doing; `forward_Q`
    takes an `ode_solver` keyword precisely so that it can be.

See [`SURROGATE_SOLVER`](@ref).
"""
const COUPLED_SOLVER = Rodas5P()

# ── the forward map ───────────────────────────────────────────────────────────

"""
    STOICH_SPECIES

Species of the fast surrogate model of [`stoichiometric_run`](@ref).
"""
const STOICH_SPECIES = split(
    "C3S C2S C3A C4AF Gp Cal " *
        "Portlandite Jennite ettringite C3AH6 C3FH6 H2O@"
)

const _STOICH_SYSTEM = Ref{Any}(nothing)

"""
    stoichiometric_system() -> ChemicalSystem

The surrogate's chemical system, built once and cached — an optimizer that
rebuilds it per iteration spends most of its time reading JSON.
"""
function stoichiometric_system()
    if _STOICH_SYSTEM[] === nothing
        subs = build_species(datapath("cemdata18-thermofun.json"))
        sp = speciation(subs, STOICH_SPECIES; aggregate_state = [AS_AQUEOUS])
        _STOICH_SYSTEM[] = ChemicalSystem(sp, CEMDATA_PRIMARIES)
    end
    return _STOICH_SYSTEM[]
end

"""
    stoichiometric_run(pk; wb, blaine, clinker, gypsum, filler, tend, ...) -> NamedTuple

The **surrogate**: the same Parrott–Killoh rates, but with the hydrate assemblage
written down by hand instead of chosen by a Gibbs minimization, and therefore no
equilibrium solve at all.

    C₃S  + 103/30 H₂O             → Jennite + 4/3 Portlandite
    C₂S  +  73/30 H₂O             → Jennite + 1/3 Portlandite
    C₃A  + 6 H₂O                  → C₃AH₆
    C₄AF + 2 Portlandite + 10 H₂O → C₃AH₆ + C₃FH₆

Gypsum and limestone are inert here. The rate of the ferrite is gated on the
portlandite present ([`portlandite_gated`](@ref)), which the silicates form: it
cannot take what they have not yet made.

!!! warning "This is a surrogate, and its absolute heat is wrong"
    Imposing the assemblage is exactly what `ionic_hydration.jl` exists to avoid,
    and the price shows up immediately in the released heat. Two reasons, both
    structural rather than a matter of tuning:

    1. **The aluminate cannot go to ettringite.** Writing `C₃A + 3 Gp + 26 H₂O →
       ettringite` is stoichiometrically impossible here: 11 % C₃A needs about
       1.1 mol of gypsum per kilogram of binder and 4.6 % gypsum supplies 0.27,
       so a rate law that reads only C₃A drives the gypsum **negative** and the
       enthalpy with it. The aluminate is therefore sent to hydrogarnet, which
       real cement only reaches after the sulfate is gone.
    2. **Jennite plus portlandite is not what a cement precipitates.** Its
       enthalpy drop per mole of alite is larger than that of the assemblage a
       Gibbs minimization selects, so the surrogate overshoots the measured heat
       several-fold. That gap is measured in the documentation page, and it is the
       quantitative argument for the coupled model.

    So the surrogate is **not** used to calibrate. It is used where it is faithful
    and where being 700 times cheaper matters: exploring the shape of the loss and
    the sensitivity structure at a cost the coupled model cannot match.

Returns `(; cs, state0, kp, sol)`.
"""
function stoichiometric_run(
        pk;
        wb, blaine, clinker = CALIB_CLINKER,
        gypsum = CALIB_GYPSUM, filler = CALIB_FILLER,
        tend, T = 293.15, binder_mass = 1.0,
        reltol = 1.0e-7, abstol = 1.0e-10, induction = nothing,
        ode_solver = SURROGATE_SOLVER, tstops = Float64[], solver_kwargs...,
    )
    cs = stoichiometric_system()
    α_max = powers_alpha_max(wb)
    f_clinker = 1.0 - gypsum - filler

    state0 = ChemicalState(cs; T = T * u"K")
    for (nm, w) in pairs(clinker)
        set_quantity!(state0, string(nm), (binder_mass * f_clinker * w)u"kg")
    end
    set_quantity!(state0, "Gp", (binder_mass * gypsum)u"kg")
    set_quantity!(state0, "Cal", (binder_mass * filler)u"kg")
    set_quantity!(state0, "H2O@", (binder_mass * wb)u"kg")

    s(name) = cs[name]
    rates = Dict{String, Any}(
        ph => damped_rate(
            parrott_killoh_avrami(pk[ph], ph; α_max, blaine = blaine * u"m^2/kg"),
            ph in INDUCTION_PHASES ? induction : nothing,
        ) for ph in ("C3S", "C2S", "C3A", "C4AF")
    )
    # The ferrite takes the portlandite the silicates form. During their dormant
    # period there is none yet, and ungated it consumed up to 0.5 mmol per kg of
    # binder that did not exist, over the first 1.4 h, which the check of the
    # trajectory reports as a failed run.
    rates["C4AF"] = portlandite_gated(rates["C4AF"]; ε = C4AF_CH_GATE * binder_mass)

    specs = (
        (
            "C3S", OrderedDict(s("C3S") => 1.0, s("H2O@") => 103 / 30),
            OrderedDict(s("Jennite") => 1.0, s("Portlandite") => 4 / 3), "C₃S hydration",
        ),
        (
            "C2S", OrderedDict(s("C2S") => 1.0, s("H2O@") => 73 / 30),
            OrderedDict(s("Jennite") => 1.0, s("Portlandite") => 1 / 3), "C₂S hydration",
        ),
        (
            "C3A", OrderedDict(s("C3A") => 1.0, s("H2O@") => 6.0),
            OrderedDict(s("C3AH6") => 1.0), "C₃A hydration to hydrogarnet",
        ),
        (
            "C4AF", OrderedDict(s("C4AF") => 1.0, s("Portlandite") => 2.0, s("H2O@") => 10.0),
            OrderedDict(s("C3AH6") => 1.0, s("C3FH6") => 1.0), "C₄AF hydration",
        ),
    )

    rxns = map(specs) do (ph, reactants, products, label)
        r = Reaction(reactants, products; symbol = label)
        r[:rate] = rates[ph]
        return r
    end

    kp = KineticsProblem(
        cs, collect(rxns), state0, (0.0, tend); equilibrium_solver = nothing,
    )
    ks = KineticsSolver(; ode_solver, reltol, abstol, tstops, solver_kwargs...)
    return (; cs, state0, kp, sol = integrate(kp, ks))
end

"""
    forward_Q(θ, data; mode = :surrogate, spec = CALIB_SPEC, kwargs...)
        -> Vector{Float64}

Released heat [J/g of binder] at `data.t`, referred to `data.t[1]` exactly as the
record is.

`mode` is `:surrogate` (fast, imposed assemblage) or `:coupled` (the model of
`ionic_hydration.jl`: dissolution plus one Gibbs minimization per accepted step,
read back through a certified replay). Both go through
[`heat_release`](@ref) — never `cumulative_heat` — because under partial
equilibrium the hydrates are precipitated by the minimization and only the
enthalpy difference between certified states sees their heat.

Returns a vector of `NaN` if the solve fails, which [`calorimetry_loss`](@ref)
turns into a penalty rather than an exception.
"""
function forward_Q(
        θ, data; mode::Symbol = :surrogate, spec = CALIB_SPEC,
        ode_solver = nothing, kwargs...,
    )
    pk = apply_parameters(θ, spec)
    induction = induction_of(θ, spec)
    solver = something(
        ode_solver, mode === :surrogate ? SURROGATE_SOLVER : COUPLED_SOLVER
    )
    tend = data.t[end]
    run = try
        if mode === :surrogate
            stoichiometric_run(
                pk; wb = data.meta.wb, blaine = data.meta.blaine,
                tend, T = data.meta.T, induction,
                ode_solver = solver, kwargs...
            )
        elseif mode === :coupled
            run_ionic_hydration(;
                wb = data.meta.wb, clinker = CALIB_CLINKER,
                gypsum = CALIB_GYPSUM, filler = CALIB_FILLER,
                blaine = data.meta.blaine * u"m^2/kg", tend,
                pk_params = pk, induction,
                induction_phases = INDUCTION_PHASES,
                ode_solver = solver, kwargs...
            )
        else
            throw(ArgumentError("mode must be :surrogate or :coupled, got :$mode"))
        end
    catch err
        # A parameter point the physics cannot follow (an equilibrium that does
        # not converge, a logarithm of a negative amount) is an infeasible point
        # of the search and scores `NaN`. Anything else is a defect and is
        # raised: caught here, a failure of the forward model on dual numbers
        # came back as `NaN` with zero partials, a silently null gradient.
        err isa Union{ErrorException, DomainError} || rethrow()
        return fill(NaN, length(data.t))
    end

    SciMLBase.successful_retcode(run.sol) || return fill(NaN, length(data.t))
    _, Q, _ = heat_release(run.sol, run.kp; times = data.t)
    # heat_release works on the 1 kg binder basis of the state; the records are
    # normalized per gram.
    return Q ./ 1000
end

"""
    forward_curves(θ, data; mode, spec, kwargs...) -> (Q, qdot)

Released heat [J/g] **and** heat flow [W/g] at `data.t`, from one forward solve.

`heat_release` returns both — `(times, Q, q̇)`.

!!! warning "Adding q̇ to the loss was tried, and it makes things worse"
    The reasoning looked sound: cumulative heat integrates the position of the
    acceleration peak away, so a loss on `Q` alone discards the timing information
    a kinetic calibration most needs. Measured on the target record it is false.
    Fitting `Q + q̇` rather than `Q` alone took the residual on `Q` from 24.4 to
    27.6 J/g and the `τ_ind`–`k₁_C3S` correlation from 0.982 to **0.994**.

    Here `q̇` is the exact rate of the certified states, not a centered difference
    of `Q` over the output grid, which is log-spaced over two and a half decades
    and so coarse near the peak. Neither a matched differencing of model and
    measurement (it re-weights the residuals on `Q` rather than adding
    information) nor the *instrument's* `q̇` at 77 s sampling on a grid four
    times finer near the peak (0.24 h against 0.91 h) changes the outcome: 27.8
    J/g and 0.994.

    So the `τ_ind`–`k₁_C3S` degeneracy is **structural in the rate law**, not an
    artifact of the observable or its discretization. Both parameters act on the
    same feature — when, and how fast, the acceleration happens — and calorimetry
    cannot separate them.

    What the flow residual *does* give is the dormancy timescale in absolute terms:
    every flow-informed fit puts `τ` at 5.2-5.4 h against the 3.1 h of a `Q`-only
    surrogate fit, and the coupled `Q`-only fit independently gives 5.6 h. Three
    methods agreeing, at the cost of the `Q` residual. That is why the fit is on `Q`
    alone, and why the flow is worth carrying anyway.

Returns `(NaN…, NaN…)` on a failed solve, which [`calorimetry_loss`](@ref) turns
into a penalty.
"""
function forward_curves(
        θ, data; mode::Symbol = :surrogate, spec = CALIB_SPEC,
        ode_solver = nothing, kwargs...,
    )
    pk = apply_parameters(θ, spec)
    induction = induction_of(θ, spec)
    solver = something(
        ode_solver, mode === :surrogate ? SURROGATE_SOLVER : COUPLED_SOLVER
    )
    nan = fill(NaN, length(data.t))
    run = try
        if mode === :surrogate
            stoichiometric_run(
                pk; wb = data.meta.wb, blaine = data.meta.blaine,
                tend = data.t[end], T = data.meta.T, induction,
                ode_solver = solver, kwargs...,
            )
        elseif mode === :coupled
            run_ionic_hydration(;
                wb = data.meta.wb, clinker = CALIB_CLINKER,
                gypsum = CALIB_GYPSUM, filler = CALIB_FILLER,
                blaine = data.meta.blaine * u"m^2/kg", tend = data.t[end],
                pk_params = pk, induction,
                induction_phases = INDUCTION_PHASES,
                ode_solver = solver, kwargs...,
            )
        else
            throw(ArgumentError("mode must be :surrogate or :coupled, got :$mode"))
        end
    catch err
        # As in `forward_Q`: only a point the physics cannot follow scores `NaN`.
        err isa Union{ErrorException, DomainError} || rethrow()
        return (nan, nan)
    end
    SciMLBase.successful_retcode(run.sol) || return (nan, nan)
    _, Q, qdot = heat_release(run.sol, run.kp; times = data.t)
    return (Q ./ 1000, qdot ./ 1000)
end

"""
    peak_time(data) -> Float64

Time [s] of the maximum measured heat flow, after the aluminate shoulder.

The search starts at 2 h so the sulfate shoulder, which is a different peak, cannot
be mistaken for the silicate one. On the target record it returns 10.6 h.

!!! warning "Pinning `τ_ind` from this was tried, and it fails"
    The hope was to break the 0.994 correlation between `τ_ind` and `k₁_C3S` by
    determining `τ` from the peak instead of fitting it. Taking
    `τ = 0.55 × t_peak` = 5.8 h and fitting the remaining four parameters gave a
    residual of 28.9 J/g against 24.4 for the five-parameter fit, with `m_ind`
    driven to its floor, `k₃_C3S` to its ceiling, and a condition number of 1e18 —
    numerically singular. The model cannot reach the data with `τ` held there, so
    the other parameters saturate trying.

    Two things were wrong. The factor 0.55 was chosen by comparing against the `τ`
    of the **coupled** fit while the surrogate's own optimum wants 3–5 h, so the
    apparent agreement was between two different models and established nothing.
    And a defensible version would use no factor at all: it would compute where the
    model's own heat-flow peak falls as a function of `τ` and invert that — a
    one-parameter numerical inversion, which has not been done.

    Kept because the peak time is a useful diagnostic to *report*, and because the
    negative result should stay reproducible.
"""
function peak_time(data)
    ok = findall(>=(2 * 3600), data.t)
    isempty(ok) && return data.t[argmax(data.qdot)]
    return data.t[ok[argmax(data.qdot[ok])]]
end

# ── the loss ──────────────────────────────────────────────────────────────────

"""
    LOSS_PENALTY

Value returned for a failed forward solve. Large enough that no optimizer walks
towards it, finite so none of them dies on it.
"""
const LOSS_PENALTY = 1.0e4

"""
    calorimetry_loss(θ, data; mode, spec, shape = false) -> Float64

Root-mean-square residual on the released heat, in **J/g of binder**.

Absolute and unweighted, on purpose. Isothermal calorimetry has an approximately
absolute error — the depositors of these data quote a database-wide 4.11 J/g
standard deviation for their own four-parameter fit, and the international round
robin of [Wadso2016](@cite) puts inter-laboratory scatter at a comparable
scale — so an absolute residual matches the instrument, and the loss can be read
directly against those figures instead of being a dimensionless score. The time
weighting lives in the log-spaced grid of [`resample_log`](@ref), not in the norm.

# `shape = true`

Compare `Q(t)/Q(t_end)` instead of `Q(t)`, rescaled by the measured `Q(t_end)` so
the number stays in J/g and stays comparable.

This exists for the surrogate, and only for it. The surrogate's assemblage is
imposed, so its *level* is wrong by construction — some 9 % low on this record —
and a fit on the absolute heat would spend its parameters compensating for a bias
no rate constant is responsible for. On the normalized curve it is judged on what
it can actually get right, the timing, which is exactly what makes it a useful
starting point for the coupled search.
"""
function calorimetry_loss(
        θ, data; mode::Symbol = :surrogate, spec = CALIB_SPEC, shape::Bool = false,
    )
    Qm = forward_Q(θ, data; mode, spec)
    any(isnan, Qm) && return LOSS_PENALTY
    iszero(Qm[end]) && return LOSS_PENALTY
    shape || return sqrt(mean(abs2, Qm .- data.Q))
    return data.Q[end] * sqrt(mean(abs2, Qm ./ Qm[end] .- data.Q ./ data.Q[end]))
end

# ── calibration ───────────────────────────────────────────────────────────────

"""
    CalibrationResult

What a fit returns: the fitted parameters `θ` in native units, the `loss` reached
(RMSE in J/g of binder), the `loss0` at the starting point, the `trace` of every
objective evaluation, the `box` positions of [`box_position`](@ref), the number
of forward solves `nevals`, and the wall-clock `seconds`.

`trace` is kept because it is the only direct evidence that a derivative-free
search converged rather than stopped: the documentation page plots it.
"""
struct CalibrationResult
    θ::Vector{Float64}
    loss::Float64
    loss0::Float64
    trace::Vector{Float64}
    box::Vector{Float64}
    nevals::Int
    seconds::Float64
    mode::Symbol
    spec::Vector{CalibParameter}
end

function Base.show(io::IO, r::CalibrationResult)
    println(
        io, "CalibrationResult(:", r.mode, ")  RMSE ", round(r.loss; digits = 3),
        " J/g  (from ", round(r.loss0; digits = 3), ")"
    )
    println(io, "  ", r.nevals, " forward solves in ", round(r.seconds; digits = 1), " s")
    for (p, v, b) in zip(r.spec, r.θ, r.box)
        flag = (b < 0.02 || b > 0.98) ? "  ← AT A BOUND, not identified" : ""
        @printf(
            io, "  %-8s %10.4g   (prior %8.4g, %5.1f %% of box)%s\n",
            p.name, v, p.prior, 100b, flag
        )
    end
    return nothing
end

"""
    calibrate(data; mode, θ0, spec, optimizer, maxiters) -> CalibrationResult

Fit `spec` to `data` by minimizing [`calorimetry_loss`](@ref) through
`Optimization.jl`.

The search is **unconstrained** in the squashed coordinates of
[`to_native`](@ref), so a derivative-free method needs no box support and cannot
leave the admissible region either way.

# Gradients

The objective is differentiated by forward mode (`AutoForwardDiff()`): a run is
differentiable with respect to the parameters its rate laws capture, the
equilibrium partition of each step through the implicit-function theorem at its
certified answer. A gradient-based `optimizer` may therefore be passed. The
default stays `NelderMead`, the method the stored calibration
(`CALIBRATED_THETA`) was produced with, so that `main()` reproduces it.
"""
function calibrate(
        data;
        mode::Symbol = :surrogate,
        θ0 = prior_vector(),
        spec = CALIB_SPEC,
        optimizer = NelderMead(),
        maxiters = 400,
        shape::Bool = false,
    )
    trace = Float64[]
    z0 = to_search(θ0, spec)
    loss0 = calorimetry_loss(θ0, data; mode, spec, shape)

    objective = function (z, _p)
        L = calorimetry_loss(to_native(z, spec), data; mode, spec, shape)
        push!(trace, L)
        return L
    end

    t0 = time()
    f = OptimizationFunction(objective, AutoForwardDiff())
    sol = solve(OptimizationProblem(f, z0, nothing), optimizer; maxiters)
    seconds = time() - t0

    θ̂ = to_native(sol.u, spec)
    return CalibrationResult(
        θ̂, calorimetry_loss(θ̂, data; mode, spec, shape), loss0,
        trace, box_position(θ̂, spec), length(trace), seconds, mode, collect(spec),
    )
end

"""
    CEM_I_DEPOSIT_RECORDS

The fourteen plain CEM I records of the Šmilauer & Reiterman deposit, as the file
stems `data/experimental/regenerate.jl` would need in its `RECORDS` list.

Only two are vendored — the target and the holdout. The rest are one edit away, and
they are the raw material for the joint fit of
[`multirecord_loss`](@ref).

| file stem | class | w/b | Blaine (m²/kg) | duration (h) |
|---|---|---|---|---|
| `100-CEM I 32.5 R Ozarow-330` | 32.5 R | 0.45 | 330 | — |
| `103-CEM I 42.5 Rsc Mokra-256` | 42.5 Rsc | 0.45 | 256 | 357 |
| `105-CEM I 42.5 Rsc Mokra-306` | 42.5 Rsc | 0.45 | 306 | 307 |
| `106-CEM I 42.5 N Mokra-264` | 42.5 N | 0.45 | 264 | 307 |
| `109-CEM I 42.5 Rsc Mokra-320` | 42.5 Rsc | 0.45 | 320 | 378 |
| `114-CEM I 32.5 R Ladce-250` | 32.5 R | 0.45 | 250 | 617 |
| `115-CEM I 42.5 R Ladce-339` | 42.5 R | 0.45 | 339 | 617 |
| `116-CEM I 52.5 R Ladce-415` | 52.5 R | 0.45 | 415 | 617 |
| `122-CEM I 52.5 R Cizkovice-397` | 52.5 R | 0.50 | 397 | 262 |
| `158-CEM I 42.5 Rsc Mokra-312` | 42.5 Rsc | 0.40 | 312 | 407 |
| `163-CEM I 42.5 Rsc Hranice-340` | 42.5 Rsc | 0.45 | 440 | 384 |
| `172-CEM I 42.5 R Rohoznik-390` | 42.5 R | 0.40 | 390 | 423 |
| `179-CEM I 42.5 Rsc Mokra-263` | 42.5 Rsc | 0.40 | 263 | 359 |
| `202-CEM I 42.5 R Mokra-409` | 42.5 R | 0.40 | 409 | 862 |

!!! warning "They are not one cement measured fourteen times"
    Five plants, four strength classes, w/b from 0.40 to 0.50 and fineness from
    250 to 440 m²/kg. `blaine_factor` and `powers_alpha_max` are supposed to carry
    a rate law across the last two; the first two it cannot carry, because the
    clinker composition differs and the deposit does not report it. A joint fit
    therefore estimates **one** kinetic parameter set for **fourteen different
    clinkers**, and whatever composition scatter exists gets absorbed into the
    kinetics. That is a weaker assumption than it sounds only because the
    alternative — one parameter set per record — is what already failed to
    transfer.
"""
const CEM_I_DEPOSIT_RECORDS = [
    "100-CEM I 32.5 R Ozarow-330", "103-CEM I 42.5 Rsc Mokra-256",
    "105-CEM I 42.5 Rsc Mokra-306", "106-CEM I 42.5 N Mokra-264",
    "109-CEM I 42.5 Rsc Mokra-320", "114-CEM I 32.5 R Ladce-250",
    "115-CEM I 42.5 R Ladce-339", "116-CEM I 52.5 R Ladce-415",
    "122-CEM I 52.5 R Cizkovice-397", "158-CEM I 42.5 Rsc Mokra-312",
    "163-CEM I 42.5 Rsc Hranice-340", "172-CEM I 42.5 R Rohoznik-390",
    "179-CEM I 42.5 Rsc Mokra-263", "202-CEM I 42.5 R Mokra-409",
]

"""
    multirecord_loss(θ, records; mode, spec, weights) -> Float64

Root-mean-square residual over **several** records at once, in J/g of binder.

One parameter set, many cements. Each record contributes its own forward solve at
its own w/b, fineness and temperature — all three read from its own metadata — and
the residuals are pooled. `weights` defaults to one per record; pass the reciprocal
of a record's variance if some are trusted more than others.

# Why this is the fix for the failure of §7 of the documentation page

Fitting one record gave five parameters a residual to absorb that was specific to
that cement, and the absorbed part did not transfer: the calibrated set was worse
than the published one on a record it had not seen. A joint objective removes the
opportunity. The parameter count stays at five while the data multiplies, so the
`τ_ind`–`k₁_C3S` degeneracy is constrained by fourteen different peak positions
rather than one, and transferability is what is being *optimized* rather than what
is being *tested afterwards*.

**This has not been run.** See [`multirecord_recipe`](@ref) for what it costs and
how to launch it.
"""
function multirecord_loss(
        θ, records; mode::Symbol = :coupled, spec = CALIB_SPEC,
        weights = ones(length(records)),
    )
    total = 0.0
    wsum = 0.0
    for (w, d) in zip(weights, records)
        Qm = forward_Q(θ, d; mode, spec)
        (any(isnan, Qm) || iszero(Qm[end])) && return LOSS_PENALTY
        total += w * mean(abs2, Qm .- d.Q)
        wsum += w
    end
    return sqrt(total / wsum)
end

"""
    calibrate_multirecord(records; mode, θ0, spec, optimizer, maxiters, weights)
        -> CalibrationResult

[`calibrate`](@ref) against [`multirecord_loss`](@ref) instead of a single record.

**Not run in this repository.** [`multirecord_recipe`](@ref) prints what it would
cost and the four lines that launch it.
"""
function calibrate_multirecord(
        records; mode::Symbol = :coupled, θ0 = prior_vector(), spec = CALIB_SPEC,
        optimizer = NelderMead(), maxiters = 120, weights = ones(length(records)),
    )
    trace = Float64[]
    z0 = to_search(θ0, spec)
    loss0 = multirecord_loss(θ0, records; mode, spec, weights)
    objective = function (z, _p)
        L = multirecord_loss(to_native(z, spec), records; mode, spec, weights)
        push!(trace, L)
        return L
    end
    t0 = time()
    f = OptimizationFunction(objective, AutoForwardDiff())
    sol = solve(OptimizationProblem(f, z0, nothing), optimizer; maxiters)
    seconds = time() - t0
    θ̂ = to_native(sol.u, spec)
    return CalibrationResult(
        θ̂, multirecord_loss(θ̂, records; mode, spec, weights), loss0,
        trace, box_position(θ̂, spec), length(trace), seconds, mode, collect(spec),
    )
end

"""
    multirecord_recipe(; n_records = 14, n_instants = 20, maxiters = 120)

Print, without running anything, what the joint fit costs and exactly how to
launch it.

The estimate is anchored on a measurement rather than a guess: on the machine used
here — two cores — one coupled forward solve on 20 log-spaced instants took about
35 s, and the single-record fit of [`CALIBRATED_THETA`](@ref) needed 152 objective
evaluations for five parameters.
"""
function multirecord_recipe(; n_records = 14, n_instants = 20, maxiters = 120)
    per_solve = 35.0
    evals = 1.7 * maxiters                      # NelderMead, measured ratio
    hours = n_records * per_solve * evals / 3600
    println("Joint fit over $n_records records, $n_instants instants, $maxiters iterations")
    @printf("  one solve      ≈ %.0f s   (measured, two cores)\n", per_solve)
    @printf("  one evaluation ≈ %.0f s   (%d records)\n", n_records * per_solve, n_records)
    @printf("  ≈%.0f evaluations  ⇒  ≈ %.1f h wall clock\n", evals, hours)
    println()
    println("Step 1 — vendor the records. `data/experimental/regenerate.jl` holds a")
    println("  `RECORDS` list of (source stem, output stem, role) triples; extend it")
    println("  with the stems of `CEM_I_DEPOSIT_RECORDS` and run:")
    println("      julia data/experimental/regenerate.jl")
    println("  It downloads the CC-BY-4.0 deposit once and writes one CSV per record.")
    println()
    println("Step 2 — load them and launch. Four lines:")
    println("      records = [resample_log(read_calorimetry(p), N_RESIDUALS_COUPLED)")
    println("                 for p in readdir(CALORIMETRY_DIR; join = true)")
    println("                 if endswith(p, \".csv\")]")
    println("      r = calibrate_multirecord(records; maxiters = $maxiters)")
    println()
    println("Step 3 — read the result the way §5 of the page reads a fit:")
    println("      report_fit(r, records[1]; label = \"joint\")")
    println("      id = local_identifiability(r.θ, records[1]; mode = :coupled)")
    println("  The number to watch is not the residual. It is whether")
    println("  corr(τ_ind, k₁_C3S) has come down from 0.994 — that is what fourteen")
    println("  different peak positions are supposed to buy, and if it has not, the")
    println("  degeneracy is structural and a second observable is the only way out.")
    println()
    println("Run it detached; it outlives a terminal session:")
    println("      nohup julia --project=scripts -e 'include(\"scripts/hydration_calibration.jl\");")
    println("            multirecord_recipe()' > joint.log 2>&1 &")
    return nothing
end

# ── identifiability ───────────────────────────────────────────────────────────

"""
    sensitivity_matrix(θ, data; mode, spec) -> Matrix

`∂Q/∂log θⱼ` at each instant of `data`, exact, by forward-mode differentiation
through the run (`ChemistryLab.log_sensitivity`): the columns are in units of
J/g per *relative* change in the parameter, so they are comparable across a rate
and an exponent.

Costs one forward run on dual numbers. `spec` may be **wider** than the one that
was fitted, provided `θ` is extended to match — that is how a parameter's
sensitivity is shown to be negligible without spending an optimization on it."""
function sensitivity_matrix(θ, data; mode::Symbol = :surrogate, spec = CALIB_SPEC)
    return ChemistryLab.log_sensitivity(q -> forward_Q(q, data; mode, spec), θ)
end

"""
    local_identifiability(θ, data; mode, spec, relstep)
        -> (; J, U, S, V, cond, rank, correlation, stderr, rmse, noise)

Local identifiability of `θ` from `data`, by `ChemistryLab.identifiability`.

`S` holds the singular values of `∂Q/∂log θ`. A ratio `S[1]/S[end]` of a few
means every direction is constrained; several orders of magnitude means the data
determine a *combination* of parameters and not the parameters, and `V[:, end]`
names which combination. `correlation` is the parameter correlation matrix from
`(JᵀJ)⁻¹`, and `stderr` the approximate relative standard errors
`σ√diag((JᵀJ)⁻¹)`, with `σ` (`noise`) the residual standard deviation on the
`n − p` degrees of freedom the parameters leave.

These are the *linearized* errors at one point. They are reported to say which numbers in a
fit deserve to be quoted, not as confidence intervals.

`rank` comes from the package and is the number of directions the measurement
constrains, those whose standard error in `log θ` is below one
(`identifiable_rank`). On the six candidates here it answers three, which is the
conclusion this script reached by hand before the rule existed.
"""
function local_identifiability(θ, data; mode::Symbol = :surrogate, spec = CALIB_SPEC)
    # Delegated: `ChemistryLab.identifiability` IS this calculation, lifted out
    # of this script and generalized. It costs one run on dual numbers and one
    # on plain ones for the residual.
    id = ChemistryLab.identifiability(
        q -> forward_Q(q, data; mode, spec), θ;
        observed = data.Q, names = [string(cp.name) for cp in spec],
    )
    return (;
        id.J, id.U, id.S, id.V, cond = id.condition, id.rank,
        id.correlation, id.stderr, id.rmse, id.noise,
    )
end

# ── driver ────────────────────────────────────────────────────────────────────

"""
    N_RESIDUALS_COUPLED

Number of log-spaced instants the coupled loss is evaluated on.

The coupled forward solve is dominated by the certified replay and the enthalpy
sums, both linear in this number, so the grid is the main cost. Twenty
instants over two and a half decades is eight per decade, which resolves every
feature of these curves.
"""
const N_RESIDUALS_COUPLED = 20

"""
    N_RESIDUALS_SURROGATE

As [`N_RESIDUALS_COUPLED`](@ref), for the surrogate, which is cheap enough not to
care.
"""
const N_RESIDUALS_SURROGATE = 60

"""
    COUPLED_ITERS

Iteration budget for the coupled search. `main` measures and prints the cost of a
single solve before spending this many of them.
"""
const COUPLED_ITERS = 60

"""
    CALIBRATED_THETA :: Vector{Float64}

The result of the coupled calibration on [`CEM_I_TARGET`](@ref), in the order of
[`CALIB_SPEC`](@ref).

Stored rather than recomputed because the search costs of the order of two hours,
which does not belong in a documentation build or a test suite. `main()`
reproduces it.

# The run that produced it

152 objective evaluations of `NelderMead` on 20 log-spaced instants, coupled
mode, from the published Parrott–Killoh values with `τ = 4 h`, `m = 2` as the
starting point. The residual went `17.48 → 13.04 J/g`, and every parameter
finished **interior** to its box — at 61, 50, 37, 70 and 86 % of it — so the box
did not choose any of these numbers.

| θ | fitted | published | ratio |
|---|---|---|---|
| `k₁_C3S` | 2.043 d⁻¹ | 1.5 | 1.36 |
| `k₃_C3S` | 1.583 d⁻¹ | 1.1 | 1.44 |
| `k₁_C3A` | 0.687 d⁻¹ | 1.0 | 0.69 |
| `τ_ind` | 20 228 s = 5.6 h | (none published) | — |
| `m_ind` | 3.56 | (none published) | — |

!!! warning "These numbers fit one record and do not transfer to another"
    On the holdout — a nominally same-class CEM I at a different w/b and
    fineness, predicted without refitting — the calibrated parameters are
    **worse** than the published ones: 47.0 against 40.7 J/g. The calibration
    improved the record it was fitted to by 25 % and degraded the one it had not
    seen by 16 %.

    That is not a surprise once the identifiability is read. At the optimum
    `k₁_C3S` and `τ_ind` are correlated at **0.994** — a longer dormant period
    followed by a faster rate makes very nearly the same curve — and the
    approximate relative standard errors are 1181 %, 29 %, 140 %, 461 % and 238 %.
    Only `k₃_C3S` is determined to better than a factor of a few. What the fit
    found is one or two combinations plus a target-specific residual, and the
    target-specific part is precisely what does not generalize.

    The remedy is not a better optimizer. It is either fewer parameters — fix
    `τ_ind` from the measured position of the main peak instead of fitting it
    against `k₁_C3S` — or a second observable, which is what §10 of the
    documentation page argues.
"""
const CALIBRATED_THETA = [
    2.0430166816339432, 1.5830829931535122, 0.6872659858977794,
    20228.44148315133, 3.55870720991354,
]

"""
    MEASURED_IDENTIFIABILITY

The two identifiability analyses of the documentation page, stored rather than
recomputed.

Each costs two coupled runs, one on dual numbers for the sensitivity and one for
the residual: five and a half minutes for the candidates and nearly three at the
optimum, which have no business inside a documentation build. `main()` recomputes both, and
[`local_identifiability`](@ref) is the one function involved; what is stored here
is only its output.

  - `candidates` — at the published parameters, over the six rate-law parameters
    of [`CALIB_SPEC_FULL`](@ref) named in `names`, on 30 log-spaced instants. This
    is the analysis that decided how many parameters to fit.
  - `optimum` — at [`CALIBRATED_THETA`](@ref), over the five of
    [`CALIB_SPEC`](@ref), on 20 instants. This is the analysis that explains why
    the fit does not transfer.

`S` are the singular values of `∂Q/∂log θ`, `V` its right singular vectors as rows
per parameter, `correlation` the parameter correlation matrix from `(JᵀJ)⁻¹`,
`noise` the residual standard deviation on the `n − p` degrees of freedom, and
`stderr` the approximate relative standard errors it gives. The noise level is
the RMSE scaled by `√(n/(n − p))`, as `local_identifiability` returns it.
"""
const MEASURED_IDENTIFIABILITY = (
    candidates = (
        # Spelled out, NOT derived from `CALIB_SPEC_FULL`. Deriving them is how this
        # went wrong once: the stored matrices are 6x6, from when that list held six
        # entries, and adding `τ_ind` and `m_ind` to it later left the names 8 long
        # against 6x6 data — which the documentation build caught as a plotting
        # error rather than as the desynchronization it was. Stored numbers must
        # carry their own labels.
        names = [:k₁_C3S, :n₁_C3S, :k₃_C3S, :n₃_C3S, :k₁_C3A, :k₃_C2S],
        rmse = 25.9354, noise = 28.9967, cond = 2784.4,
        S = [424.41, 107.88, 63.619, 6.4596, 1.9803, 0.15242],
        column_norms = [49.11, 96.26, 209.1, 373.0, 33.93, 12.83],
        stderr = [14.4529, 9.3736, 3.4226, 5.5191, 4.5813, 189.912],
        V = [
            -0.0475 -0.3658 -0.3312 -0.0756 -0.8644 -0.0366
            -0.1601 -0.5399 -0.5562 -0.3747 0.4818 0.0312
            0.4539 -0.6693 0.5848 -0.0477 0.0377 0.0176
            -0.8747 -0.2273 0.4245 0.0419 -0.0208 -0.0289
            -0.0055 -0.2738 -0.2423 0.9219 0.1282 0.003
            0.0301 -0.0095 -0.0079 -0.0082 0.0484 -0.9983
        ],
        correlation = [
            1.0 -0.9595 -0.6128 0.5279 -0.4394 0.4788
            -0.9595 1.0 0.7515 -0.6793 0.2256 -0.6299
            -0.6128 0.7515 1.0 -0.9854 0.1299 -0.9798
            0.5279 -0.6793 -0.9854 1.0 -0.116 0.9969
            -0.4394 0.2256 0.1299 -0.116 1.0 -0.1224
            0.4788 -0.6299 -0.9798 0.9969 -0.1224 1.0
        ],
    ),
    optimum = (
        names = [:k₁_C3S, :k₃_C3S, :k₁_C3A, :τ_ind, :m_ind],
        rmse = 13.1018, noise = 15.1287, cond = 101.0,
        S = [120.15, 64.481, 13.779, 6.5067, 1.1896],
        stderr = [11.8072, 0.2884, 1.4034, 4.6141, 2.3802],
        V = [
            -0.3115 0.0648 -0.1685 -0.0946 0.9281
            -0.2422 -0.963 0.1161 0.0188 0.009
            -0.3548 0.1986 0.8484 0.3345 0.0552
            0.8427 -0.1646 0.3634 0.0105 0.3613
            0.0906 -0.0432 -0.3261 0.9374 0.0697
        ],
        correlation = [
            1.0 0.3857 0.4795 0.9941 0.3578
            0.3857 1.0 0.553 0.4377 0.2228
            0.4795 0.553 1.0 0.5575 0.5938
            0.9941 0.4377 0.5575 1.0 0.3631
            0.3578 0.2228 0.5938 0.3631 1.0
        ],
    ),
)

"""
    report_stored_identifiability(m, label)

Print a stored [`MEASURED_IDENTIFIABILITY`](@ref) entry in the same shape
[`report_identifiability`](@ref) prints a freshly computed one.
"""
function report_stored_identifiability(m, label)
    @printf(
        "%s — %d parameters, residual RMSE %.2f J/g (σ = %.2f J/g), condition number %.4g\n",
        label, length(m.names), m.rmse, m.noise, m.cond
    )
    println("singular values: ", join((@sprintf("%.4g", v) for v in m.S), "  "))
    _report_directions(m.S, m.noise)
    println("approximate relative standard errors:")
    for (n, e) in zip(m.names, m.stderr)
        @printf("   %-10s %8.0f %%\n", n, 100e)
    end
    return nothing
end

# The standard error of each singular direction in `log θ`, the noise level over
# its singular value, and how many are known to better than a factor e
# (`identifiable_rank`).
function _report_directions(S, σ)
    println("standard error of each direction, in log θ: ", join((@sprintf("%.2g", σ / v) for v in S), "  "))
    @printf("directions determined to better than a factor e: %d of %d\n", identifiable_rank(S; noise = σ), length(S))
    return nothing
end

"""
    rule(title)

A section heading in the style of the other scripts in this directory.
"""
rule(title) = println("\n── ", title, " ", "─"^max(0, 74 - length(title)))

"""
    report_fit(r, data; label)

Print a fit: the residual against the depositors' own 4.11 J/g yardstick, then
each parameter with its prior, its ratio to the prior, and its position in its
box.
"""
function report_fit(r::CalibrationResult, data; label = "fit")
    @printf(
        "%s (%s): RMSE %.2f → %.2f J/g over %d instants, %d solves, %.1f s\n",
        label, r.mode, r.loss0, r.loss, length(data.t), r.nevals, r.seconds
    )
    println("   parameter      fitted      prior    ratio    box")
    for (p, v, b) in zip(r.spec, r.θ, r.box)
        flag = (b < 0.02 || b > 0.98) ? "  ← at a bound, not identified" : ""
        @printf(
            "   %-10s %10.4g %10.4g %8.2f %5.0f %%%s\n",
            p.name, v, p.prior, v / p.prior, 100b, flag
        )
    end
    return nothing
end

"""
    report_identifiability(id, spec = CALIB_SPEC)

Print the singular spectrum of `∂Q/∂log θ`, the least-constrained direction and
the approximate relative standard errors.
"""
function report_identifiability(id, spec = CALIB_SPEC)
    @printf(
        "residual RMSE %.2f J/g (σ = %.2f J/g);  condition number of ∂Q/∂log θ = %.3g\n",
        id.rmse, id.noise, id.cond
    )
    println("singular values: ", join((@sprintf("%.3g", v) for v in id.S), "  "))
    _report_directions(id.S, id.noise)
    println("least-constrained direction (right singular vector of the smallest value):")
    for (p, c) in zip(spec, id.V[:, end])
        @printf("   %-10s %+7.3f\n", p.name, c)
    end
    println("approximate relative standard errors:")
    for (p, e) in zip(spec, id.stderr)
        @printf("   %-10s %8.1f %%\n", p.name, 100e)
    end
    return nothing
end

"""
    main()

The whole exercise, in the order the argument runs: look at the data, try the
published parameters, show why the hydrate assemblage cannot be imposed, find out
what the measurement can constrain, calibrate the coupled model, then predict a
record it never saw.

Expect an hour or so. The calibration is a derivative-free search over a model
that costs tens of seconds per evaluation, and `main` prints that cost before
spending it.
"""
function main()
    target = resample_log(CEM_I_TARGET, N_RESIDUALS_COUPLED)
    target_fine = resample_log(CEM_I_TARGET, N_RESIDUALS_SURROGATE)
    holdout = resample_log(CEM_I_HOLDOUT, N_RESIDUALS_COUPLED)
    θ0 = prior_vector()

    rule("the data")
    println("target : ", CEM_I_TARGET)
    println("holdout: ", CEM_I_HOLDOUT)
    @printf(
        "source : %s\n         doi %s, %s\n",
        CEM_I_TARGET.meta.source, CEM_I_TARGET.meta.doi, CEM_I_TARGET.meta.license
    )
    @printf(
        "both records open at ~1 h, with %.1f J/g already gone by then (the\n",
        CEM_I_TARGET.meta.q_before_start
    )
    println("depositors' estimate, not a measurement), so model and record are both")
    println("referred to the first sample rather than to mixing.")

    rule("the published parameters, untouched")
    t0 = time()
    Q_prior = forward_Q(θ0, target; mode = :coupled)
    t_coupled = time() - t0
    @printf("one coupled solve on %d instants: %.1f s\n", length(target.t), t_coupled)
    @printf(
        "Q(%.0f h): %.1f J/g computed, %.1f J/g measured  (%+.1f %%)\n",
        target.t[end] / 3600, Q_prior[end], target.Q[end],
        100 * (Q_prior[end] / target.Q[end] - 1)
    )
    @printf("RMSE over the curve: %.2f J/g\n", calorimetry_loss(θ0, target; mode = :coupled))
    if !isempty(target.Qref)
        println("for comparison, the depositors' own fitted affinity model, on this very")
        @printf(
            "record: Q(end) %.1f J/g (%+.1f %%), RMSE %.2f J/g\n",
            target.Qref[end], 100 * (target.Qref[end] / target.Q[end] - 1),
            sqrt(mean(abs2, target.Qref .- target.Q))
        )
    end
    println("The total heat is already right to a couple of percent, with parameters")
    println("fitted in 1984 to other cements. What a calibration has to earn is the")
    println("timing, and that is where the residual lives.")

    rule("why the assemblage cannot be imposed")
    t0 = time()
    Q_surr = forward_Q(θ0, target_fine; mode = :surrogate)
    t_surr = time() - t0
    @printf("one surrogate solve: %.3f s — %.0f× cheaper\n", t_surr, t_coupled / t_surr)
    println("   instant      surrogate      coupled     measured")
    for (lab, h) in (("6 h", 6), ("24 h", 24), ("end", 0))
        i = h == 0 ? lastindex(target.t) :
            something(findfirst(>=(h * 3600 - 1), target.t), lastindex(target.t))
        j = h == 0 ? lastindex(target_fine.t) :
            something(findfirst(>=(h * 3600 - 1), target_fine.t), lastindex(target_fine.t))
        @printf("   %-8s %11.1f %12.1f %12.1f\n", lab, Q_surr[j], Q_prior[i], target.Q[i])
    end
    println("Imposing Jennite plus portlandite, and sending the aluminate to hydrogarnet")
    println("because the sulfate cannot stretch, misses the level by a margin no rate")
    println("constant is responsible for. Fit its SHAPE and the parameters saturate their")
    println("bounds instead, which says the imposed assemblage produces a curve the")
    println("Parrott-Killoh family cannot make. So the surrogate is a demonstration, not")
    println("a preconditioner, and everything below runs on the coupled model.")
    rS = calibrate(
        target_fine; mode = :surrogate, θ0, spec = CALIB_SPEC_FULL,
        maxiters = 800, shape = true,
    )
    report_fit(rS, target_fine; label = "surrogate, shape only, six parameters")

    rule("what the measurement can constrain")
    # The six rate-law candidates of `MEASURED_IDENTIFIABILITY.candidates`, on its
    # thirty instants, so that what is printed here is what is stored there.
    spec6 = [only(filter(cp -> cp.name == nm, CALIB_SPEC_FULL)) for nm in MEASURED_IDENTIFIABILITY.candidates.names]
    println("two coupled runs for the six-parameter sensitivity, one on dual numbers")
    println("and one for the residual — the expensive diagnostic")
    idF = local_identifiability(
        prior_vector(spec6), resample_log(CEM_I_TARGET, 30); mode = :coupled, spec = spec6,
    )
    report_identifiability(idF, spec6)
    println("\n   parameter   ‖∂Q/∂log θ‖ (J/g)   weight in the leading 3 directions")
    for (i, p) in enumerate(spec6)
        @printf("   %-10s %14.4g %25.2f\n", p.name, norm(idF.J[:, i]), sum(abs2, idF.V[i, 1:3]))
    end
    println("\nfitted: ", join(string.(getfield.(CALIB_SPEC, :name)), ", "))
    println(
        "held at published values: ", join(
            string.(
                setdiff(
                    getfield.(CALIB_SPEC_FULL, :name), getfield.(CALIB_SPEC, :name)
                )
            ), ", "
        )
    )

    rule("the calibration")
    @printf(
        "budget: %d iterations × ≈%.0f s per solve\n", COUPLED_ITERS, t_coupled
    )
    r = calibrate(target; mode = :coupled, θ0, maxiters = COUPLED_ITERS)
    report_fit(r, target; label = "coupled")
    println("θ̂ = ", repr(r.θ), "   # paste into CALIBRATED_THETA")

    rule("identifiability at the optimum")
    id = local_identifiability(r.θ, target; mode = :coupled)
    report_identifiability(id)

    rule("the holdout, predicted and not fitted")
    @printf(
        "%s: w/b %.2f (target %.2f), Blaine %.0f (target %.0f) m²/kg, %.0f h\n",
        holdout.meta.cement, holdout.meta.wb, target.meta.wb,
        holdout.meta.blaine, target.meta.blaine, holdout.t[end] / 3600
    )
    for (label, θ) in (("published", θ0), ("calibrated", r.θ))
        @printf(
            "   %-11s RMSE on the holdout: %8.2f J/g\n",
            label, calorimetry_loss(θ, holdout; mode = :coupled)
        )
    end
    println("\nThe only machinery carrying the fit across the two mixes is")
    println("`powers_alpha_max(w/b)` on the hydration cap and `blaine_factor` on the rate.")

    return (;
        target, target_fine, holdout, prior = θ0, fit = r, surrogate_fit = rS,
        identifiability = id, identifiability_full = idF,
        Q_prior, Q_surrogate = Q_surr,
    )
end

if abspath(PROGRAM_FILE) == @__FILE__
    main()
end

Each file states the four things a calibration must take as given rather than fit:

julia
for (label, d) in (("target", CEM_I_TARGET), ("holdout", CEM_I_HOLDOUT))
    @printf(
        "%-8s %-22s  w/b %.2f  Blaine %3.0f m²/kg  T %.2f K\n",
        label, d.meta.cement, d.meta.wb, d.meta.blaine, d.meta.T
    )
end
target   Cizkovice 52.5R         w/b 0.50  Blaine 397 m²/kg  T 293.15 K
holdout  CEM I 42.5R Ladce-415   w/b 0.45  Blaine 415 m²/kg  T 293.15 K

The heat flow and the released heat, on a log time axis because hydration is a decades-of-time process and a linear axis hides the first day inside a pixel:

julia
th(d) = d.t ./ 3600

p1 = plot(
    th(CEM_I_TARGET), CEM_I_TARGET.qdot .* 1000;
    label = "target — 52.5 R, w/b 0.50", xscale = :log10,
    xlabel = "time (h)", ylabel = "heat flow (mW/g of binder)", lw = 2,
)
plot!(p1, th(CEM_I_HOLDOUT), CEM_I_HOLDOUT.qdot .* 1000;
    label = "holdout — 52.5 R, w/b 0.45", lw = 2, ls = :dash)

p2 = plot(
    th(CEM_I_TARGET), CEM_I_TARGET.Q;
    label = "target", xscale = :log10, xlabel = "time (h)",
    ylabel = "released heat (J/g of binder)", lw = 2, legend = :topleft,
)
plot!(p2, th(CEM_I_HOLDOUT), CEM_I_HOLDOUT.Q; label = "holdout", lw = 2, ls = :dash)

plot(p1, p2; layout = (1, 2), left_margin = 8Plots.mm, bottom_margin = 8Plots.mm, size = (950, 410))

Three properties of these records shape everything that follows.

They do not start at zero. Both open after the calorimeter's thermal equilibration, at 1.02 h and 1.21 h. The depositors estimate that 12 J/g had already been released by then. Rather than invent the missing hour — the induction period is precisely what neither the instrument nor a Parrott–Killoh rate law describes — model and record are both referred to the first sample, and the 12 J/g is carried in the metadata for reporting totals.

There is one temperature. Everything was measured at 20 °C. An activation energy is a temperature sensitivity; at a single temperature it is not identifiable, and a fit that reported one would be reporting a number the data cannot contain. Every Ea therefore stays at its published value. A reader who wants a fitted Ea needs a second temperature: Jägle et al. (2025) is a CC-BY-4.0 way to one, at 20 °C and 35 °C on CEM I 42.5 R and 52.5 R, at the cost of a 341 MB download covering only the first 24 hours.

There is no phase composition. The deposit (Šmilauer and Reiterman, 2025) reports the cement type, the fineness, the w/b ratio and the temperature — not the clinker mineralogy. §5 measures what that costs.

2. The published parameters, untouched ​

The formulation is the CEM I 52.5 N of Lavergne et al. (2018) Table 9, the same one the pore-solution page runs: C₃S 65 / C₂S 11 / C₃A 11 / C₄AF 8 by mass of clinker, 4.6 % gypsum, 3.5 % limestone. It was chosen because the target record's w/b of 0.50 and Blaine of 397 m²/kg are within a few percent of the mix it was published for.

The coupled forward solves this page needs are performed by this build, through scripts/precomputed.jl, which memoizes them per process so that the two pages asking for the same trajectory compute it once. The calls are shown where they belong, unexecuted, because showing the call and running it twice would be the same computation written down twice.

julia
target = resample_log(CEM_I_TARGET, N_RESIDUALS_COUPLED)
θ0 = prior_vector()
Q_prior = forward_Q(θ0, target; mode = :coupled)       # ~6 min
Q_fit = forward_Q(CALIBRATED_THETA, target; mode = :coupled)
julia
include(joinpath(pkgdir(ChemistryLab), "scripts", "precomputed.jl"))

# Six coupled 28-day trajectories stand behind this page -- the published
# parameters and the fitted ones on two records, and the alite content moved
# either way. They share nothing, so they are computed together instead of one
# at a time; on a single-threaded session this is the same work in the same
# order. Every `read_precomputed` below is then a cache hit.
warm_precomputed(["calibration_target", "calibration_holdout",
                  "calibration_sensitivity"])

cal = read_precomputed("calibration_target")

target = resample_log(CEM_I_TARGET, N_RESIDUALS_COUPLED)
θ0 = prior_vector()
Q_prior = cal.columns["Q_prior"]

for line in cal.provenance
    println("  ", line)
end
  CEM I 52.5 R Cizkovice, w/b 0.50 -- the calibration target -- measured against published and calibrated
  computed by this documentation build -- no stored result is read
  ChemistryLab version: 0.43.1, OptimaSolver version: 0.12.0
  commit: a5caa4c
  20 log-spaced instants over 10.93 days
  w/b 0.50, Blaine default, 20 C, 1 kg of binder
  clinker (mass fractions): (C3S = 0.65, C2S = 0.11, C3A = 0.11, C4AF = 0.08)
  measured data: Smilauer & Reiterman (2025), Zenodo
    10.5281/zenodo.15212785, CC-BY-4.0
  Q_prior: published Parrott-Killoh parameters, untouched
  Q_fit:   CALIBRATED_THETA of scripts/hydration_calibration.jl
Show the code of scripts/precomputed.jl, included above

The file scripts/precomputed.jl on GitHub, at the commit this page was built from:

julia
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# The coupled trajectories the documentation plots, COMPUTED BY THE BUILD.
#
# A warm equilibrium costs 17 ms, so computing them is affordable, and worth the
# build time: a stored result is a claim about code that may since have changed.
#
# `read_precomputed` keeps its name and its return shape, so the pages that read
# it did not change. What changed is where the numbers come from.
#
# MEMOIZED, and that is not an optimization detail: Documenter runs every
# `@example` block of the whole site in ONE process, and a page asks for the
# phase history and the calorimetry of the same run as two separate tables. Two
# calls, one integration.

using Printf
using DynamicQuantities
using Logging
using Base: @lock

# `@isdefined`, not `isdefined(Main, ...)`: a documentation page includes these
# files into its own module, where a test against `Main` never sees the first
# inclusion and every definition was made again, docstrings included.
@isdefined(run_ionic_hydration) ||
    include(joinpath(@__DIR__, "ionic_hydration.jl"))
@isdefined(forward_Q) ||
    include(joinpath(@__DIR__, "hydration_calibration.jl"))

"""
Sampling of the reported instants.

Log-spaced because hydration is a decade-wise process: a uniform grid spends its
resolution on the plateau and none on the acceleration peak.
"""
const N_INSTANTS = 40

const TEND_DOC = 28 * 86400.0
const TIMES_DOC = 10 .^ range(log10(0.05 * 86400), log10(TEND_DOC); length = N_INSTANTS)

# The CEM I 52.5 N of Lavergne et al. (2018), Table 9 (`IONIC_CEMENT`, read by
# `ionic_hydration.jl` from data/literature/Lavergne2018.json).
const DOC_CLINKER = IONIC_CEMENT.clinker

# One entry per coupled case the documentation plots.
const IONIC_CASES = Dict(
    "ionic_opc" => (
        filler = IONIC_CEMENT.filler,
        label = "CEM I with 3.5 % limestone filler",
    ),
    "ionic_nolimestone" => (
        filler = 0.0,
        label = "the same paste with the limestone removed",
    ),
)

const _CACHE = Dict{String, Any}()
const _CACHE_LOCK = ReentrantLock()

"""
    _cached(f, key) -> value

`get!(f, _CACHE, key)`, safe to call from several tasks at once.

The function comes **first**, as it does in `get!`, so that the call sites keep
their `do` blocks: `_cached(key) do ... end` passes the block as the first
argument, and a signature with the key first is a `MethodError` waiting for the
first caller. That is not hypothetical — it cost a documentation build.

The lock is held only while the dictionary is touched, never while `f` runs: a
coupled trajectory takes minutes, and serializing on it would defeat the whole
point of computing them concurrently. Two tasks asking for the *same* key at the
same instant would therefore both compute it -- which is why `warm_precomputed`
below asks for each key exactly once, and in the order that makes the one
dependency between them a cache hit.
"""
function _cached(f, key::AbstractString)
    # `Some` rather than the value itself, so that a stored `nothing` counts as
    # a hit. Nothing stored here is `nothing` today; relying on that would be a
    # trap for whoever adds the first thing that is.
    hit = @lock _CACHE_LOCK (haskey(_CACHE, key) ? Some(_CACHE[key]) : nothing)
    hit === nothing || return something(hit)
    v = f()
    @lock _CACHE_LOCK (_CACHE[key] = v)
    return v
end

"""
    _par_map(f, xs) -> Vector

`map(f, xs)`, on as many threads as the session was started with.

The trajectories are independent -- separate systems, separate solver buffers,
separate ODE states -- so this changes wall time and nothing else. The six
coupled 28-day runs of the calibration page (`warm_precomputed`), compilation
included, in a fresh Julia 1.13.4 session on a two-core machine:

| | wall time |
|:--|--:|
| one thread | 113.7 s |
| two threads | 87.3 s |

The globals the solve path mutates are a warning switch, a warning counter, and
the memo of compiled functions each thermodynamic factory keeps (every
trajectory builds its species, and the factories are shared). That memo is
locked, because concurrent insertions of the first trajectories would corrupt it.

With one thread the calls run one after the other. Either way the result is a
`Vector{Any}`: `map` would ask the compiler for the return type of `f` to type
its result, and for `read_precomputed`, whose branches reach every coupled
trajectory, that question kept Julia 1.13.4 in type inference for more than
twenty minutes before a single trajectory started.
"""
function _par_map(f, xs)
    Threads.nthreads() == 1 && return Any[f(x) for x in xs]
    return fetch.([Threads.@spawn f(x) for x in xs])
end

"""
    _provenance(what; instants, window, extra) -> Vector{String}

What a figure can say about where its numbers came from: the package version,
the commit, the sampling and the composition. The block
describes a run this build performed.
"""
function _provenance(what; instants, window, extra = String[])
    commit = try
        readchomp(`git -C $(pkgdir(ChemistryLab)) rev-parse --short HEAD`)
    catch
        "unknown"
    end
    ver = try
        string(pkgversion(ChemistryLab))
    catch
        "unknown"
    end
    osver = try
        string(pkgversion(OptimaSolver))
    catch
        "unknown"
    end
    return vcat(
        [
            what,
            "computed by this documentation build -- no stored result is read",
            "ChemistryLab version: $ver, OptimaSolver version: $osver",
            "commit: $commit",
            @sprintf("%d log-spaced instants over %.2f days", instants, window / 86400),
            "w/b 0.50, Blaine default, 20 C, 1 kg of binder",
            "clinker (mass fractions): $(DOC_CLINKER)",
        ],
        extra,
    )
end

"""
    _ionic_case(tag) -> NamedTuple

Integrate one paste and replay it on `TIMES_DOC`, returning the phase history
and the calorimetry together — they come from one trajectory and one certified
replay, and splitting them into two calls would integrate twice.
"""
function _ionic_case(tag::AbstractString)
    return _cached("case:" * tag) do
        case = IONIC_CASES[tag]
        run = run_ionic_hydration(;
            wb = 0.5, clinker = DOC_CLINKER, gypsum = IONIC_CEMENT.gypsum,
            filler = case.filler, tend = TEND_DOC,
        )

        # How many instants are PROVED optimal, not merely converged. Taken from
        # `speciated_states` itself, which decides it per instant and warns;
        # re-deriving it here would be a second opinion with no authority over
        # the first. The warning goes to a buffer so it
        # does not also reach the page twice, and its text is kept.
        logbuf = IOBuffer()
        states = Logging.with_logger(Logging.SimpleLogger(logbuf, Logging.Info)) do
            speciated_states(run.sol, run.kp; times = TIMES_DOC)
        end
        logged = String(take!(logbuf))
        m = match(r"(\d+) of (\d+) replayed instants could not be certified", logged)
        n_uncertified = m === nothing ? 0 : parse(Int, m.captures[1])
        n_certified = length(TIMES_DOC) - n_uncertified

        times, fracs, pore_pH, poro = ionic_phase_history(run, TIMES_DOC; states = states)
        tcal, Q, qd = heat_release(run.sol, run.kp; times = TIMES_DOC, states = states)

        return (;
            run, states, times, fracs, pore_pH, poro, tcal, Q, qd,
            n_certified, label = case.label,
        )
    end
end

_table(columns, header, provenance) = (; columns, provenance, header)

function _ionic_phases_table(tag)
    c = _ionic_case(tag)
    groups = sort(collect(union(keys.(c.fracs)...)))
    columns = Dict{String, Vector{Float64}}("time_s" => collect(c.times))
    for g in groups
        columns[g] = [get(c.fracs[i], g, 0.0) for i in eachindex(c.times)]
    end
    columns["pore_pH"] = collect(c.pore_pH)
    columns["poro_liquid"] = [p.liquid for p in c.poro]
    columns["poro_void"] = [p.void for p in c.poro]
    columns["poro_total"] = [p.total for p in c.poro]
    header = vcat(
        ["time_s"], groups, ["pore_pH", "poro_liquid", "poro_void", "poro_total"]
    )
    prov = _provenance(
        "$(c.label) -- volume fractions of the phase families, pH, porosity";
        instants = length(c.times), window = TEND_DOC,
        extra = [
            "certified: $(c.n_certified) of $(length(TIMES_DOC)) replayed " *
                "instants proved optimal against the KKT conditions",
        ],
    )
    return _table(columns, header, prov)
end

function _ionic_heat_table(tag)
    c = _ionic_case(tag)
    columns = Dict{String, Vector{Float64}}(
        "time_s" => collect(c.tcal),
        "Q_J_per_g" => c.Q ./ 1000,
        "heat_flow_W_per_g" => c.qd ./ 1000,
    )
    prov = _provenance(
        "$(c.label) -- isothermal calorimetry at 20 C, per gram of binder";
        instants = length(c.tcal), window = TEND_DOC,
    )
    return _table(columns, ["time_s", "Q_J_per_g", "heat_flow_W_per_g"], prov)
end

const CALIBRATION_CASES = Dict(
    "calibration_target" => (
        record = :target,
        label = "CEM I 52.5 R Cizkovice, w/b 0.50 -- the calibration target",
    ),
    "calibration_holdout" => (
        record = :holdout,
        label = "CEM I 52.5 R Ladce, w/b 0.45 -- the holdout, never fitted",
    ),
)

function _calibration_table(tag)
    return _cached(tag) do
        case = CALIBRATION_CASES[tag]
        record = case.record === :target ? CEM_I_TARGET : CEM_I_HOLDOUT
        data = resample_log(record, N_RESIDUALS_COUPLED)
        # Two coupled trajectories of the same record, one on the published
        # parameters and one on the fitted ones. They share nothing, so they run
        # concurrently when the session has the threads for it.
        Q_prior, Q_fit = _par_map(
            θ -> forward_Q(θ, data; mode = :coupled),
            (prior_vector(), CALIBRATED_THETA),
        )
        columns = Dict{String, Vector{Float64}}(
            "time_s" => collect(data.t),
            "Q_measured" => collect(data.Q),
            "Q_prior" => collect(Q_prior),
            "Q_fit" => collect(Q_fit),
            "Q_depositors_fit" => collect(data.Qref),
        )
        prov = _provenance(
            "$(case.label) -- measured against published and calibrated";
            instants = length(data.t), window = data.t[end],
            extra = [
                "measured data: Smilauer & Reiterman (2025), Zenodo",
                "  10.5281/zenodo.15212785, CC-BY-4.0",
                "Q_prior: published Parrott-Killoh parameters, untouched",
                "Q_fit:   CALIBRATED_THETA of scripts/hydration_calibration.jl",
            ],
        )
        return _table(
            columns,
            ["time_s", "Q_measured", "Q_prior", "Q_fit", "Q_depositors_fit"],
            prov,
        )
    end
end

"""
    _sensitivity_table() -> table

The clinker sensitivity of the calibration page: the same fitted rate constants
with the alite content moved by ±20 %, far more than a Bogue or a QXRD analysis
is uncertain by. Three coupled runs.
"""
function _moved_clinker(δ)
    c = CALIB_CLINKER.C3S * (1 + δ)
    scale = (1 - c) / (1 - CALIB_CLINKER.C3S)
    return (
        C3S = c, C2S = CALIB_CLINKER.C2S * scale,
        C3A = CALIB_CLINKER.C3A * scale, C4AF = CALIB_CLINKER.C4AF * scale,
    )
end

"""
    _sensitivity_Q(clinker, data) -> Vector

Released heat [J/g] at `data.t` from one coupled run on `clinker`.

Everything except the clinker is held at what the calibration itself used --
the fitted rate constants and the fitted induction period. It is the same call
`forward_Q` makes, with the clinker as its only freedom, so the δ = 0 row is the
fit whose sensitivity is measured and its RMSE is the fit's RMSE.
"""
function _sensitivity_Q(clinker, data)
    run = run_ionic_hydration(;
        wb = data.meta.wb, clinker, gypsum = CALIB_GYPSUM,
        filler = CALIB_FILLER, blaine = data.meta.blaine * u"m^2/kg",
        tend = data.t[end], pk_params = apply_parameters(CALIBRATED_THETA),
        induction = induction_of(CALIBRATED_THETA),
        induction_phases = INDUCTION_PHASES, ode_solver = COUPLED_SOLVER,
    )
    _, Q, _ = heat_release(run.sol, run.kp; times = data.t)
    return Q ./ 1000
end

function _sensitivity_table()
    return _cached("calibration_sensitivity") do
        data = resample_log(CEM_I_TARGET, N_RESIDUALS_COUPLED)
        # δ = 0 IS the calibrated fit, and the target table has already computed
        # it. Reading it back rather than integrating it again saves one coupled
        # trajectory of the build and, more to the point, guarantees that the
        # reference row of this table is the very curve the page plots.
        Q0 = _calibration_table("calibration_target").columns["Q_fit"]
        moved = _par_map(δ -> _sensitivity_Q(_moved_clinker(δ), data), (-0.2, 0.2))

        δs = Float64[]
        c3s = Float64[]
        qend = Float64[]
        rmse = Float64[]
        for (δ, Q) in ((0.0, Q0), (-0.2, moved[1]), (0.2, moved[2]))
            push!(δs, δ)
            push!(c3s, _moved_clinker(δ).C3S)
            push!(qend, Q[end])
            push!(rmse, sqrt(sum(abs2, Q .- data.Q) / length(data.Q)))
        end
        prov = _provenance(
            "sensitivity of the fit to the alite content";
            instants = length(data.t), window = data.t[end],
            extra = [
                "the fitted rate constants are held at CALIBRATED_THETA;",
                "only the clinker composition moves, the rest rescaled to close",
            ],
        )
        return _table(
            Dict{String, Vector{Float64}}(
                "delta_C3S" => δs, "C3S" => c3s,
                "Q_end_J_per_g" => qend, "RMSE_J_per_g" => rmse,
            ),
            ["delta_C3S", "C3S", "Q_end_J_per_g", "RMSE_J_per_g"],
            prov,
        )
    end
end

"""
    read_precomputed(name) -> (; columns, provenance, header)

One coupled trajectory of the documentation, computed on demand.

`columns` maps a column name to its vector, `provenance` is a block of lines
saying what produced the numbers — package and solver versions, commit, sampling,
composition — and `header` is the column order. The name and the shape are what
they were when these tables were read from stored CSV files, so a page written
against that interface is unchanged.

The result is **cached for the process**, which matters because Documenter runs
the whole site in one: a page asking for a run's phase history and its
calorimetry gets one integration, not two.
"""
function read_precomputed(name::AbstractString)
    tag = endswith(name, ".csv") ? name[1:(end - 4)] : String(name)
    endswith(tag, "_phases") && return _ionic_phases_table(tag[1:(end - 7)])
    endswith(tag, "_heat") && return _ionic_heat_table(tag[1:(end - 5)])
    haskey(CALIBRATION_CASES, tag) && return _calibration_table(tag)
    tag == "calibration_sensitivity" && return _sensitivity_table()
    return error(
        "unknown coupled trajectory \"$name\". Known: " *
            join(
            sort(
                vcat(
                    [k * "_phases" for k in keys(IONIC_CASES)],
                    [k * "_heat" for k in keys(IONIC_CASES)],
                    collect(keys(CALIBRATION_CASES)),
                    ["calibration_sensitivity"],
                ),
            ), ", ",
        ),
    )
end

"""
    warm_precomputed(tags)

Compute the coupled trajectories behind `tags` concurrently, before the page
asks for them one at a time.

Documenter expands a page block by block in a single process, so a page that
reads three tables integrates three trajectories strictly in series even though
they share nothing at all — separate systems, separate solver buffers, separate
ODE states. Warming them together puts them on as many threads as the session
was started with, and every later `read_precomputed` is then a cache hit. On one
thread it is the same work in the same order, so it can never be a pessimization.

Two orderings are forced, and both are about not computing the same trajectory
twice:

  - `<case>_phases` and `<case>_heat` are **one** run, so only one of each pair
    is warmed;
  - `calibration_sensitivity` reads the fitted curve of `calibration_target`, so
    it is warmed last, after that curve is in the cache.
"""
function warm_precomputed(tags)
    first_wave = String[]
    seen = Set{String}()
    sensitivity = false
    for t in tags
        if t == "calibration_sensitivity"
            sensitivity = true
        else
            key = replace(String(t), r"_(phases|heat)$" => "")
            key in seen || (push!(seen, key); push!(first_wave, String(t)))
        end
    end
    _par_map(read_precomputed, first_wave)
    sensitivity && read_precomputed("calibration_sensitivity")
    return nothing
end

"""
    coupled_states(tag) -> Vector{ChemicalState}

The certified speciations of one coupled run, at the reported instants.

A page that only plots needs the columns; one that computes a property of the
PASTE — its heat capacity, say, for a semi-adiabatic temperature — needs the
states themselves. They come from the same memoized run as the tables, so asking
for them costs nothing beyond the integration that has already happened.

`tag` is the run, not the table: `"ionic_opc"`, not `"ionic_opc_phases"`.
"""
coupled_states(tag::AbstractString) = _ionic_case(tag).states

"""
    phase_families(tbl) -> Vector{String}

The phase-family columns of a phase-history table, in a fixed order chosen so a
stacked plot reads from the anhydrous grains at the bottom to the pore water at
the top — the order the classical hydration diagram uses.

Families absent from the table are skipped, so the same order serves a paste
with limestone and one without.
"""
function phase_families(tbl)
    order = [
        "anhydrous", "gypsum", "calcite",
        "C-S-H", "CH", "AFt", "AFm", "hydrogarnet", "FH3",
        "water", "void",
    ]
    return [f for f in order if haskey(tbl.columns, f)]
end

"""
    family_colors() -> Dict{String,Symbol}

One color per phase family, fixed here so that every figure in the
documentation uses the same one for the same phase — a reader should not have to
re-read the legend between two plots.
"""
function family_colors()
    return Dict(
        "anhydrous" => :grey40, "gypsum" => :khaki, "calcite" => :tan,
        "C-S-H" => :steelblue, "CH" => :seagreen, "AFt" => :orchid,
        "AFm" => :mediumpurple, "hydrogarnet" => :peru, "FH3" => :indianred,
        "water" => :lightskyblue, "void" => :white,
    )
end
What the solvers reported while computing these trajectories
julia
@printf(
    "Q(%.0f h) = %.1f J/g computed against %.1f J/g measured  (%+.1f %%)\n",
    target.t[end] / 3600, Q_prior[end], target.Q[end],
    100 * (Q_prior[end] / target.Q[end] - 1)
)
@printf("RMSE over the curve: %.2f J/g\n",
    sqrt(sum(abs2, Q_prior .- target.Q) / length(target.Q)))
@printf(
    "the depositors' own fitted affinity model, same record: %.1f J/g (%+.1f %%), RMSE %.2f J/g\n",
    target.Qref[end], 100 * (target.Qref[end] / target.Q[end] - 1),
    sqrt(mean(abs2, target.Qref .- target.Q))
)
Q(262 h) = 388.5 J/g computed against 376.0 J/g measured  (+3.3 %)
RMSE over the curve: 17.47 J/g
the depositors' own fitted affinity model, same record: 388.9 J/g (+3.4 %), RMSE 5.15 J/g

That is worth pausing on. The total heat is already right to a couple of percent, with parameters fitted in 1984 to other cements and no adjustment whatsoever — and closer at the endpoint than the four-parameter empirical model the depositors fitted to this very record. What a calibration has to earn here is therefore not the level but the timing, and that is where the residual lives:

julia
p1 = plot(
    th(target), target.Q; label = "measured", xscale = :log10, lw = 2,
    xlabel = "time (h)", ylabel = "Q (J/g of binder)", legend = :topleft, marker = :circle,
    ms = 2.5,
)
plot!(p1, th(target), Q_prior; label = "coupled, published PK84", lw = 2)
plot!(p1, th(target), target.Qref; label = "depositors' affinity fit", lw = 1.5, ls = :dot)

p2 = plot(
    th(target), Q_prior .- target.Q; label = "coupled, published PK84",
    xscale = :log10, lw = 2, xlabel = "time (h)", ylabel = "residual (J/g)",
    legend = :bottomleft,
)
plot!(p2, th(target), target.Qref .- target.Q; label = "depositors' affinity fit",
    lw = 1.5, ls = :dot)
hline!(p2, [0]; label = "", c = :black, lw = 0.7)

plot(p1, p2; layout = (1, 2), left_margin = 8Plots.mm, bottom_margin = 8Plots.mm, size = (950, 410))

3. Why the hydrate assemblage cannot simply be written down ​

The coupled model costs tens of seconds a solve, almost all of it in the certified replay and the enthalpy sums. A derivative-free search over six parameters needs of the order of a hundred solves, so a cheap stand-in is worth having. The obvious one is to keep the same rate laws and write the hydrate assemblage down by hand, which is what stoichiometric_run does — and what the pore-solution page exists to avoid.

The first attempt at it fails outright, and the failure is instructive. C₃A + 3 Gp + 26 H₂O → ettringite is the textbook reaction, and it is stoichiometrically impossible in this mix: 11 % C₃A demands about 1.1 mol of gypsum per kilogram of binder and 4.6 % gypsum supplies 0.27. A rate law that reads only C₃A does not know that, so it drives the gypsum negative and the enthalpy with it — the released heat came out at 1609 J/g against a measured 376. Writing a reaction down does not make the sulfate balance hold.

So the surrogate sends the aluminate to hydrogarnet instead, which real cement only reaches once the sulfate is gone, and leaves gypsum and limestone inert. What that gives, and what it costs:

julia
Q_surr = forward_Q(θ0, target; mode = :surrogate)

println("   instant      surrogate      coupled     measured")
for (lab, h) in (("6 h", 6), ("24 h", 24), ("end", 0))
    i = h == 0 ? lastindex(target.t) : findfirst(>=(h * 3600 - 1), target.t)
    @printf("   %-8s %11.1f %12.1f %12.1f\n", lab, Q_surr[i], Q_prior[i], target.Q[i])
end
   instant      surrogate      coupled     measured
   6 h             63.0         78.0         52.9
   24 h           176.3        200.5        223.2
   end            347.0        388.5        376.0
julia
plot(
    th(target), target.Q; label = "measured", xscale = :log10, lw = 2, marker = :circle,
    ms = 2.5, xlabel = "time (h)", ylabel = "Q (J/g of binder)", legend = :topleft,
    size = (620, 380),
)
plot!(th(target), Q_prior; label = "coupled — assemblage chosen by Gibbs", lw = 2)
plot!(th(target), Q_surr; label = "surrogate — assemblage imposed", lw = 2, ls = :dash)

The surrogate is low, and low by a margin no rate constant is responsible for: Jennite plus portlandite is not the assemblage a cement precipitates, and its enthalpy per mole of alite is not that of the mixture a Gibbs minimization selects. That is a level error, structural and roughly constant in relative terms.

There is a second failure, subtler and worth reporting. Fit the surrogate to the normalized curve Q(t)/Q(t_end) — timing only, where the level error cannot reach — and its parameters run to whatever bounds they are given:

julia
rS = calibrate(
    resample_log(CEM_I_TARGET, N_RESIDUALS_SURROGATE);
    mode = :surrogate, θ0 = prior_vector(CALIB_SPEC_FULL), spec = CALIB_SPEC_FULL,
    maxiters = 800, shape = true,
)
report_fit(rS, resample_log(CEM_I_TARGET, N_RESIDUALS_SURROGATE);
    label = "surrogate, shape only, six parameters")
surrogate, shape only, six parameters (surrogate): RMSE 22.55 → 11.57 J/g over 60 instants, 1789 solves, 75.4 s
   parameter      fitted      prior    ratio    box
   k₁_C3S          2.509        1.5     1.67    69 %
   n₁_C3S         0.3463        0.7     0.49     5 %
   k₃_C3S          6.285        1.1     5.71    83 %
   n₃_C3S          5.999        3.3     1.82   100 %  ← at a bound, not identified
   k₁_C3A          0.958          1     0.96    48 %
   k₃_C2S         0.2307        0.2     1.15    55 %
   τ_ind       1.331e+04   1.44e+04     0.92    61 %
   m_ind           3.692          2     1.85    90 %

That is not the data speaking. It says the imposed assemblage produces a curve shape the Parrott–Killoh family cannot match, so the optimizer saturates anything it is handed trying.

Which settles what the surrogate is for. It is not a preconditioner and it is not where the parameters are chosen: an argument about identifiability drawn from a model with the wrong chemistry would be an argument about the wrong model. It is used for exactly two things, both legitimate — the comparison above, which is the quantitative case for letting a Gibbs minimization pick the assemblage, and the one rate-law property of §4 that does not depend on the assemblage at all. Everything downstream runs on the coupled model.

calorimetry_loss(...; shape = true) is that normalized residual, rescaled by the measured total so it stays readable in J/g. It is kept in the API because it is the right loss whenever a model's level is known to be biased and its timing is not.

4. The candidate parameters, and what is excluded before any fitting ​

Six candidates, one per mechanism with a distinct signature on the curve: k₁_C3S moves the acceleration, n₁_C3S reshapes the main peak, k₃_C3S and n₃_C3S set where and how hard the deceleration bites, k₁_C3A the sulfate-depletion shoulder, k₃_C2S the multi-day plateau. §5 asks how many of the six the measurement can actually carry; this section rules out what can be ruled out before looking at the data at all.

julia
println("   parameter    phase   field     prior        box")
for p in CALIB_SPEC_FULL
    @printf(
        "   %-10s %-7s %-6s %8.4g   [%.4g, %.4g]%s\n",
        p.name, p.phase, p.field, p.prior, p.lo, p.hi, p.logscale ? "  (log)" : ""
    )
end
   parameter    phase   field     prior        box
   k₁_C3S     C3S     k₁          1.5   [0.375, 6]  (log)
   n₁_C3S     C3S     n₁          0.7   [0.3, 1.3]
   k₃_C3S     C3S     k₃          1.1   [0.1833, 13.2]  (log)
   n₃_C3S     C3S     n₃          3.3   [1.5, 6]
   k₁_C3A     C3A     k₁            1   [0.25, 4]  (log)
   k₃_C2S     C2S     k₃          0.2   [0.05, 0.8]  (log)
   τ_ind      induction τ      1.44e+04   [720, 8.64e+04]  (log)
   m_ind      induction m             2   [0.8, 4]

The exclusions are as much of the design as the inclusions, and each has a reason that is structural rather than empirical.

A uniform per-phase multiplier is excluded because it is exactly redundant. For alite the rate is min(α̇₁, α̇₃), so

that is, scaling the phase is scaling k₁ and k₃ together. Fitting the multiplier alongside the rate-law fields would make the problem rank-deficient by construction rather than by accident. Use IONIC_CALIBRATION or the rate-law fields, never both.

k₂_C3S is excluded, because the data cannot see it. Parrott and Killoh (1984) reported no diffusion-controlled stage for C₃S, and parrott_killoh_avrami's docstring repeats it (Lothenbach et al., 2008) — so the expected sensitivity is zero. Measuring it:

Checked on the surrogate, and legitimately so: whether a mechanism limits the rate is a property of the rate law, not of the hydrate assemblage.

julia
spec_k2 = [
    CalibParameter(:k₁_C3S, "C3S", :k₁, 1.5, 1.5 / 4, 1.5 * 4, true),
    CalibParameter(:k₂_C3S, "C3S", :k₂, 0.05, 0.005, 0.5, true),
]
J_k2 = sensitivity_matrix(
    [1.5, 0.05], resample_log(CEM_I_TARGET, N_RESIDUALS_SURROGATE);
    mode = :surrogate, spec = spec_k2,
)
d_fine = resample_log(CEM_I_TARGET, N_RESIDUALS_SURROGATE)
for (p, col) in zip(spec_k2, eachcol(J_k2))
    early = findall(<=(6 * 3600), d_fine.t)
    @printf(
        "   ∂Q/∂log %-9s max |·| = %8.4g J/g   (before 6 h: %8.4g)\n",
        p.name, maximum(abs, col), maximum(abs, col[early])
    )
end
┌ Warning: the heat flow returned by heat_release of a run on dual numbers is computed on the values of the run and carries no derivative.
└ @ ChemistryLab ~/work/ChemistryLab.jl/ChemistryLab.jl/src/kinetics/calorimetry.jl:308
   ∂Q/∂log k₁_C3S    max |·| =    18.73 J/g   (before 6 h:    18.73)
   ∂Q/∂log k₂_C3S    max |·| =        0 J/g   (before 6 h:        0)

Zero, over the whole record. The Jander term is α̇₂ = k₂(1-ξ)^{2/3}/(1-(1-ξ)^{1/3}), which falls as ξ grows, but at the published constants it never becomes the minimum of the three branches, so the released heat does not depend on k₂ at all, as Parrott and Killoh (1984) reported. A ten times smaller k₂ makes the branch bind, and the sensitivity then sees it.

The derivative is exact. A central difference with a 5 % step would cross the kink of the minimum wherever the Jander branch comes within 5 % of binding, and print about an eighth of k₁'s influence: it would measure the step, not the model.

Gypsum and calcite dissolution are excluded because ionic_reactions deliberately makes them fast, so that sulfate reaches the minimization from the start instead of rate-limiting it. A step that does not limit cannot be calibrated.

5. What the data can constrain ​

Before fitting anything it is worth asking what six numbers a single heat curve can carry. The answer is a property of the model, so it has to be computed on the coupled model — and that costs two coupled runs, one on dual numbers for the sensitivities and one for the residual, several minutes. This page does not spend them. The call is one line, main() in the script makes it, and what follows renders its stored output:

julia
spec6 = [only(filter(cp -> cp.name == nm, CALIB_SPEC_FULL)) for nm in MEASURED_IDENTIFIABILITY.candidates.names]
id = local_identifiability(
    prior_vector(spec6), resample_log(CEM_I_TARGET, 30); mode = :coupled, spec = spec6,
)
report_identifiability(id, spec6)
julia
id = MEASURED_IDENTIFIABILITY.candidates
report_stored_identifiability(id, "the six candidates, at the published parameters")
the six candidates, at the published parameters — 6 parameters, residual RMSE 25.94 J/g (σ = 29.00 J/g), condition number 2784
singular values: 424.4  107.9  63.62  6.46  1.98  0.1524
standard error of each direction, in log θ: 0.068  0.27  0.46  4.5  15  1.9e+02
directions determined to better than a factor e: 3 of 6
approximate relative standard errors:
   k₁_C3S         1445 %
   n₁_C3S          937 %
   k₃_C3S          342 %
   n₃_C3S          552 %
   k₁_C3A          458 %
   k₃_C2S        18991 %
julia
nm = string.(id.names)
p1 = scatter(
    1:length(id.S), id.S; yscale = :log10, label = "", marker = :circle, ms = 6,
    xlabel = "index", ylabel = "singular value of ∂Q/∂log θ",
    title = "sensitivity spectrum", titlefontsize = 10,
)
p2 = heatmap(
    nm, nm, id.correlation; clims = (-1, 1), c = :RdBu, xrotation = 45,
    title = "parameter correlation", titlefontsize = 10,
)
plot(p1, p2; layout = (1, 2), size = (950, 450), bottom_margin = 9Plots.mm)

julia
println("how much each parameter moves the curve, and where the information sits:")
for (i, n) in enumerate(id.names)
    @printf(
        "   %-10s  ‖∂Q/∂log θ‖ = %9.4g J/g   leading-3 weight %5.2f\n",
        n, id.column_norms[i], sum(abs2, id.V[i, 1:3])
    )
end
how much each parameter moves the curve, and where the information sits:
   k₁_C3S      ‖∂Q/∂log θ‖ =     49.11 J/g   leading-3 weight  0.25
   n₁_C3S      ‖∂Q/∂log θ‖ =     96.26 J/g   leading-3 weight  0.63
   k₃_C3S      ‖∂Q/∂log θ‖ =     209.1 J/g   leading-3 weight  1.00
   n₃_C3S      ‖∂Q/∂log θ‖ =       373 J/g   leading-3 weight  1.00
   k₁_C3A      ‖∂Q/∂log θ‖ =     33.93 J/g   leading-3 weight  0.13
   k₃_C2S      ‖∂Q/∂log θ‖ =     12.83 J/g   leading-3 weight  0.00

The singular values span three and a half orders of magnitude. Divided into the noise level σ, the residual standard deviation on the 24 degrees of freedom the six parameters leave to thirty instants, they give the standard error of each direction in log θ: 0.07, 0.27 and 0.46 for the first three, then 4.5, 15 and 190, so that the last three are known to within a factor of 89 at best (identifiable_rank). That is not a defect of the optimizer: it is the physics of the measurement. A single scalar observable, integrated over time, cannot separate six mechanisms that all act on the same curve. What the data determine is three combinations, and the "leading-3 weight" column says where those three live.

The correlation matrix says which combinations. Two pairs are close to collinear — k₁_C3S with n₁_C3S (−0.96), and k₃_C3S with n₃_C3S (−0.985), the latter pair being essentially the whole leading singular direction. Within a pair the measurement sees a combination and not its members, so one per pair is all that can be fitted. Belite sits at a weight of 0.001: over eleven days it is invisible, which is a number rather than an impression.

So the six candidate rate-law parameters collapse to three that the measurement can carry. CALIB_SPEC holds those three plus the two of the dormant period, τ_ind and m_ind, which §3 showed to be a missing mechanism rather than a tunable one; CALIB_SPEC_FULL keeps all six candidates for exactly the analysis above:

julia
println("fitted (CALIB_SPEC):")
for p in CALIB_SPEC
    @printf(
        "   %-10s %-6s prior %8.4g   box [%.4g, %.4g]\n",
        p.name, p.phase, p.prior, p.lo, p.hi
    )
end
println("held at published values: ", join(
    string.(setdiff(
        getfield.(CALIB_SPEC_FULL, :name), getfield.(CALIB_SPEC, :name)
    )), ", "
))
fitted (CALIB_SPEC):
   k₁_C3S     C3S    prior      1.5   box [0.375, 6]
   k₃_C3S     C3S    prior      1.1   box [0.1833, 13.2]
   k₁_C3A     C3A    prior        1   box [0.25, 4]
   τ_ind      induction prior 1.44e+04   box [720, 8.64e+04]
   m_ind      induction prior        2   box [0.8, 4]
held at published values: n₁_C3S, n₃_C3S, k₃_C2S

The rate constant is the member kept in each pair, and deliberately: an Avrami or power-law exponent is a shape parameter of an empirical fit from 1984, whereas a rate constant is the quantity a different clinker plausibly changes. The third parameter, k₁_C3A, is separately visible — very nearly the fourth singular direction on its own — if weakly.

This is also why every fit below prints each parameter's position in its box. A parameter driven to a bound is not a result: it says the data pushed it as far as they were allowed to and the box, not the measurement, chose the answer.

6. The calibration ​

A derivative-free search over the coupled model. It is not run in this page: at tens of seconds a solve and of the order of a hundred solves it is an hour of computation, which does not belong in a documentation build. main() in the script runs it; its result is stored as CALIBRATED_THETA and the run that produced it — grid, budget, residual reached — is recorded in CHANGELOG.md. Reproducing it is one call to main().

Gradients

The objective is differentiable by forward mode, AutoForwardDiff(): a run is differentiable with respect to the parameters its rate laws capture, the equilibrium partition of each step through the implicit-function theorem at its certified answer. A gradient-based optimizer can be passed. NelderMead remains the default because it is the method CALIBRATED_THETA was produced with, and main() reproduces it.

julia
θ̂ = CALIBRATED_THETA
Q_fit = cal.columns["Q_fit"]

@printf("%-12s %10s %10s %8s\n", "parameter", "calibrated", "published", "ratio")
for (p, v) in zip(CALIB_SPEC, θ̂)
    @printf("%-12s %10.4g %10.4g %8.2f\n", p.name, v, p.prior, v / p.prior)
end
@printf(
    "\nRMSE  published %.2f J/g   →   calibrated %.2f J/g   (depositors' fit %.2f J/g)\n",
    sqrt(mean(abs2, Q_prior .- target.Q)), sqrt(mean(abs2, Q_fit .- target.Q)),
    sqrt(mean(abs2, target.Qref .- target.Q))
)
parameter    calibrated  published    ratio
k₁_C3S            2.043        1.5     1.36
k₃_C3S            1.583        1.1     1.44
k₁_C3A           0.6873          1     0.69
τ_ind         2.023e+04   1.44e+04     1.40
m_ind             3.559          2     1.78

RMSE  published 17.47 J/g   →   calibrated 13.10 J/g   (depositors' fit 5.15 J/g)
julia
p1 = plot(
    th(target), target.Q; label = "measured", xscale = :log10, lw = 2, marker = :circle,
    ms = 2.5, xlabel = "time (h)", ylabel = "Q (J/g of binder)", legend = :topleft,
)
plot!(p1, th(target), Q_prior; label = "published PK84", lw = 2, ls = :dash)
plot!(p1, th(target), Q_fit; label = "calibrated", lw = 2)

p2 = plot(
    th(target), Q_prior .- target.Q; label = "published PK84", xscale = :log10, lw = 2,
    ls = :dash, xlabel = "time (h)", ylabel = "residual (J/g)", legend = :bottomleft,
)
plot!(p2, th(target), Q_fit .- target.Q; label = "calibrated", lw = 2)
plot!(p2, th(target), target.Qref .- target.Q; label = "depositors' fit", lw = 1.2, ls = :dot)
hline!(p2, [0]; label = "", c = :black, lw = 0.7)

plot(p1, p2; layout = (1, 2), left_margin = 8Plots.mm, bottom_margin = 8Plots.mm, size = (950, 410))

7. The holdout ​

The one test available here that the fit cannot pass by construction: take the parameters from the target and predict a different record, at a different w/b and a different Blaine fineness, without refitting anything. The only machinery carrying them across is powers_alpha_max(w/b) on the hydration cap and blaine_factor(blaine) on the rate — which is exactly the claim those two corrections make.

julia
holdout = resample_log(CEM_I_HOLDOUT, N_RESIDUALS_COUPLED)
@printf(
    "holdout: w/b %.2f (target %.2f), Blaine %.0f (target %.0f) m²/kg, %.0f h\n",
    holdout.meta.wb, target.meta.wb, holdout.meta.blaine, target.meta.blaine,
    holdout.t[end] / 3600
)

hold = read_precomputed("calibration_holdout")
Qh_prior = hold.columns["Q_prior"]
Qh_fit = hold.columns["Q_fit"]
@printf("   published  RMSE %7.2f J/g\n", sqrt(mean(abs2, Qh_prior .- holdout.Q)))
@printf("   calibrated RMSE %7.2f J/g\n", sqrt(mean(abs2, Qh_fit .- holdout.Q)))
holdout: w/b 0.45 (target 0.50), Blaine 415 (target 397) m²/kg, 617 h
   published  RMSE   40.63 J/g
   calibrated RMSE   47.04 J/g
julia
plot(
    th(holdout), holdout.Q; label = "measured (holdout)", xscale = :log10, lw = 2,
    marker = :circle, ms = 2.5, xlabel = "time (h)", ylabel = "Q (J/g of binder)",
    legend = :topleft, size = (620, 380),
)
plot!(th(holdout), Qh_prior; label = "published PK84", lw = 2, ls = :dash)
plot!(th(holdout), Qh_fit; label = "calibrated on the target", lw = 2)

The calibration does not transfer, and that is the result ​

Read that table before anything else on this page. The calibrated parameters are worse on the holdout than the published ones — the fit improved the record it saw by about a quarter and degraded the record it had not seen by about a sixth.

It would be easy to present this as a near miss and move on. It is not a near miss, it is the expected outcome of a five-parameter fit to one scalar curve, and §5 predicted it. At the optimum k₁_C3S and τ_ind are correlated at 0.994: a longer dormant period followed by a faster rate produces very nearly the same heat curve, so the pair is one direction and not two numbers. The approximate relative standard errors are 1181 %, 29 %, 140 %, 461 % and 238 % — only k₃_C3S is determined to better than a factor of a few. What the search found is one or two genuine combinations plus a residual specific to this cement, and it is the cement-specific part that fails to generalize.

So the parameters in CALIBRATED_THETA are not offered as better Parrott–Killoh values for a CEM I. They are offered as a worked demonstration that a heat curve does not determine five kinetic parameters, and that the way to find that out is local_identifiability before the fit rather than a holdout after it.

Two remedies, neither of them a better optimizer:

  1. Fit fewer. Fix τ_ind from the measured position of the main heat-flow peak — an independent, near-direct observation of when the dormant period ends — and fit k₁_C3S against it rather than with it. That breaks the 0.994.

  2. Measure something else. Bound water by thermogravimetry, or phase amounts by QXRD as in Jansen et al. (2012), constrains the assemblage where a single integrated heat cannot. §10.

And the holdout file carries a note of its own

In the deposit (Šmilauer and Reiterman, 2025), the file named 116-CEM I 52.5 R Ladce-415.csv carries Cement name: CEM I 42.5R Ladce-415 internally. Which of the two applies cannot be decided from the deposit, so the holdout may be a different strength class from the one its filename claims — and then its clinker composition differs from the one assumed here, and some part of the discrepancy belongs to that rather than to the kinetics. It weakens the holdout as evidence; it does not rescue the fit, whose own error bars already say the same thing.

7b. The fix that was not run, and how to run it ​

The failure above is a fitting-procedure failure, and three ways out were considered. Two were tried and are recorded here as negative results; the third is implemented but deliberately not executed, because it is an overnight computation and this page has to build.

Two that were tried and do not work ​

Adding the heat flow to the loss. The reasoning looked sound — cumulative heat integrates the peak position away, so Q alone discards the timing. It is false, and three experiments were needed to see why, which is worth setting out because the first two explanations were wrong.

lossgridRMSE on Qcorr(τ_ind, k₁_C3S)fitted τ
Q only60 pts24.40.98153.1 h
Q + model q̇60 pts27.60.99405.3 h
Q + matched slopes60 pts27.60.99415.3 h
Q only300 pts24.60.98153.1 h
Q + instrument q̇300 pts27.80.99425.2 h
Q + instrument q̇, w = 3300 pts28.50.99365.4 h

The correlations of this table were computed from central differences. At the stored optimum, exact derivatives move the same correlation from 0.9937 to 0.9941: differences of that size do not change what the table says.

The first explanation was discretization: a q̇ taken as a centered difference of Q over the output grid, which near the 10-hour peak is spaced 0.91 h apart, is a smeared version of what the instrument resolves at 77 s (heat_release returns the exact rate of the certified states). Matching the operators — differencing the measurement the same way — changes nothing, because that differencing is a linear map on the same numbers: a residual on the differenced curve is a linear combination of the residuals on Q, so it re-weights information instead of adding any.

The second explanation was the grid. Using the instrument's own q̇ on 300 points, where the spacing near the peak is 0.24 h, changed nothing either.

So the conclusion is stronger than a failed experiment: the τ_ind-k₁_C3S degeneracy is structural in the rate law. Both act on the same feature of the curve — when, and how fast, the acceleration happens — and calorimetry cannot separate them, integral or differential, coarse or dense. No weighting of a single scalar observable will.

There is a positive result inside the same table. Every flow-informed fit puts τ at 5.2-5.4 h where the Q-only fit says 3.1 h, and the coupled Q-only fit independently gives 5.6 h. Three methods agree on a dormant period of five to five and a half hours, and the Q-only surrogate is the outlier. So the flow does determine the dormancy timescale, at the price of the Q residual and without decorrelating τ from k₁. That is the evidence behind the round τ = 5 h that ionic_hydration.jl uses as its uncalibrated default.

Pinning τ_ind from the measured peak. peak_time puts the main heat-flow peak at 10.6 h. Fixing τ = 0.55 × t_peak = 5.8 h and fitting the other four gave 28.9 J/g against 24.4, with m_ind at its floor, k₃_C3S at its ceiling and a condition number of 10¹⁸ — numerically singular. And the factor 0.55 was never independent: it was chosen against the τ of the coupled fit while the surrogate's own optimum wants 3–5 h, so the apparent agreement compared two different models. A defensible version would invert the model's own peak position as a function of τ rather than use a factor at all.

The one that should work, and exactly how to launch it ​

Fit one parameter set to many records. The deposit (Šmilauer and Reiterman, 2025) holds fourteen plain CEM I records — CEM_I_DEPOSIT_RECORDS lists them with their w/b, fineness and duration — across five plants and four strength classes. The parameter count stays at five while the data multiplies fourteen-fold, so the τ–k₁ degeneracy is constrained by fourteen peak positions instead of one, and transferability becomes what is being optimized rather than what is tested afterwards.

multirecord_loss and calibrate_multirecord implement it. multirecord_recipe prints the cost and the launch sequence:

julia
multirecord_recipe()
Joint fit over 14 records, 20 instants, 120 iterations
  one solve      ≈ 35 s   (measured, two cores)
  one evaluation ≈ 490 s   (14 records)
  ≈204 evaluations  ⇒  ≈ 27.8 h wall clock

Step 1 — vendor the records. `data/experimental/regenerate.jl` holds a
  `RECORDS` list of (source stem, output stem, role) triples; extend it
  with the stems of `CEM_I_DEPOSIT_RECORDS` and run:
      julia data/experimental/regenerate.jl
  It downloads the CC-BY-4.0 deposit once and writes one CSV per record.

Step 2 — load them and launch. Four lines:
      records = [resample_log(read_calorimetry(p), N_RESIDUALS_COUPLED)
                 for p in readdir(CALORIMETRY_DIR; join = true)
                 if endswith(p, ".csv")]
      r = calibrate_multirecord(records; maxiters = 120)

Step 3 — read the result the way §5 of the page reads a fit:
      report_fit(r, records[1]; label = "joint")
      id = local_identifiability(r.θ, records[1]; mode = :coupled)
  The number to watch is not the residual. It is whether
  corr(τ_ind, k₁_C3S) has come down from 0.994 — that is what fourteen
  different peak positions are supposed to buy, and if it has not, the
  degeneracy is structural and a second observable is the only way out.

Run it detached; it outlives a terminal session:
      nohup julia --project=scripts -e 'include("scripts/hydration_calibration.jl");
            multirecord_recipe()' > joint.log 2>&1 &

What a joint fit assumes, and it is not small

Fourteen records are not one cement measured fourteen times. Five plants, four strength classes, w/b from 0.40 to 0.50, fineness from 250 to 440 m²/kg. blaine_factor and powers_alpha_max are meant to carry a rate law across the last two; the clinker composition they cannot carry, because it differs between plants and the deposit (Šmilauer and Reiterman, 2025) does not report it. So a joint fit estimates one kinetic parameter set for fourteen different clinkers, and the composition scatter is absorbed into the kinetics.

That is a real weakness. It is preferable only because the alternative — one parameter set fitted to one record — is the thing that already failed to transfer, and because the diagnostic to check is specific: whether corr(τ_ind, k₁_C3S) comes down from 0.994. If it does not, the degeneracy is structural, and no amount of calorimetry will fix it — a second observable will, which is §10.

8. What the composition assumption costs ​

The deposit (Šmilauer and Reiterman, 2025) gives no mineralogy, so a composition was supplied. The consequence is exact rather than vague: a heat curve constrains the product of a phase fraction and its reaction rate, never the two apart. Perturbing the alite content and looking at what moves makes that concrete.

julia
for δ in (-0.20, 0.20)
    c = CALIB_CLINKER.C3S * (1 + δ)
    scale = (1 - c) / (1 - CALIB_CLINKER.C3S)
    clinker = (C3S = c, C2S = CALIB_CLINKER.C2S * scale,
               C3A = CALIB_CLINKER.C3A * scale, C4AF = CALIB_CLINKER.C4AF * scale)
    run = run_ionic_hydration(; wb = target.meta.wb, clinker, gypsum = CALIB_GYPSUM,
        filler = CALIB_FILLER, blaine = target.meta.blaine * u"m^2/kg",
        tend = target.t[end], pk_params = apply_parameters(θ̂),
        # The fitted induction period is part of the model being perturbed:
        # without it the δ = 0 row would differ from the fit whose sensitivity
        # is reported.
        induction = induction_of(θ̂), induction_phases = INDUCTION_PHASES,
        ode_solver = COUPLED_SOLVER)
    _, Q, _ = heat_release(run.sol, run.kp; times = target.t)
end

Two more full coupled runs — two, not three: the δ = 0 row is by construction the calibrated fit, so it is read from the curve this page already plots rather than integrated a second time. They are computed alongside the rest, concurrently, and read back here:

julia
sens = read_precomputed("calibration_sensitivity")
@printf("%-10s %8s %14s %12s\n", "ΔC₃S", "C₃S", "Q(end) J/g", "RMSE J/g")
for i in eachindex(sens.columns["delta_C3S"])
    @printf("%+9.0f %% %8.3f %14.1f %12.2f\n",
        100 * sens.columns["delta_C3S"][i], sens.columns["C3S"][i],
        sens.columns["Q_end_J_per_g"][i], sens.columns["RMSE_J_per_g"][i])
end
ΔC₃S            C₃S     Q(end) J/g     RMSE J/g
       +0 %    0.650          399.9        13.10
      -20 %    0.520          388.0        14.92
      +20 %    0.780          403.1        11.64

A twenty-percent change in the alite content — far more than the uncertainty on a real Bogue or QXRD analysis — moves the fit by a modest amount, because the calibrated rates absorb most of it. Read the right way round, that is the limitation: the fitted numbers are rates given this composition, and they are not transferable to a cement whose mineralogy is known to be different. A reader who has an oxide analysis should go through the Bogue calculation instead of accepting this default.

9. Doing this with your own data ​

Three steps, and no part of the machinery is specific to these two records.

  1. Write a CSV in the format documented in data/experimental/README.md: # comment lines carrying at least blaine, wb and temperature, then a table headed time_h,heat_flow_W_per_g,heat_J_per_g. A fourth column, if present, is read as somebody else's fitted curve and never as data.

  2. Point read_calorimetry at it. That is the whole seam. Everything downstream reads data.meta.

  3. Edit CALIB_SPEC. Each entry names a phase, a Parrott–Killoh field, a prior and a box. Add or remove rows; nothing else needs to change.

julia
my_data = read_calorimetry(
    joinpath(CALORIMETRY_DIR, "smilauer2025-116-cemI-52.5R-ladce.csv")
)
my_spec = [
    CalibParameter(:k₁_C3S, "C3S", :k₁, 1.5, 1.5 / 4, 1.5 * 4, true),
    CalibParameter(:k₃_C3S, "C3S", :k₃, 1.1, 1.1 / 4, 1.1 * 4, true),
]
my_target = resample_log(my_data, 40)
r_mine = calibrate(
    my_target; mode = :surrogate, θ0 = prior_vector(my_spec),
    spec = my_spec, maxiters = 300, shape = true,
)
report_fit(r_mine, my_target; label = "two rate constants, surrogate, shape only")
two rate constants, surrogate, shape only (surrogate): RMSE 19.07 → 9.08 J/g over 40 instants, 301 solves, 11.5 s
   parameter      fitted      prior    ratio    box
   k₁_C3S         0.6945        1.5     0.46    22 %
   k₃_C3S          1.829        1.1     1.66    68 %

That runs on the surrogate and on shape alone, because it is a page and has to finish. A real study replaces mode = :surrogate, shape = true with mode = :coupled and waits — and, before doing so, runs local_identifiability on the candidate set, because the number of parameters a heat curve supports is a property of the curve and will not be three for everybody.

If your data span more than one temperature, the activation energies become identifiable and belong in CALIB_SPEC — add CalibParameter(:Ea_C3S, "C3S", :Ea, 42_000.0, 20_000.0, 70_000.0, true) and give calorimetry_loss a sum over records rather than one. That is the single most valuable extension to this page, and it is blocked only by data, not by the code.

10. Limitations, each with its cause ​

  • The composition is assumed, because the deposit (Šmilauer and Reiterman, 2025) does not report it. Only the products of a rate and a phase fraction are identifiable. §8 measures the cost.

  • The activation energies are not fitted, because one temperature cannot determine a temperature sensitivity. They stay at published values.

  • The outer loop is derivative-free by choice, not by necessity. The run is differentiable with respect to its parameters (log_sensitivity and identifiability take their derivatives through it, by forward mode), and a gradient-based fit is available; the stored calibration keeps the method it was produced with.

  • The errors are linearized at one point. local_identifiability reports σ√diag((JᵀJ)⁻¹) at the optimum, which says which numbers deserve to be quoted — not a confidence interval. A profile likelihood would, at a hundred times the cost.

  • The heat is heat_release. Under partial equilibrium the hydrates are precipitated by the Gibbs minimization, and the heat is the enthalpy the states lose. cumulative_heat follows that enthalpy along the in-run partition, which is not certified; heat_release replays each instant through a certified speciation, and is the one a fit should read.

  • Five parameters against one scalar observable, three rate constants and the two of the dormant period. §5 is not a formality: the six rate-law candidates support three combinations, the two exponents dropped are not "known" but invisible here, and §7 shows what happens when the dormant period's two are fitted alongside a rate they are collinear with. If a fit is wanted that determines parameters individually rather than in combination, the answer is a second observable — bound water by thermogravimetry, phase amounts by QXRD as in Jansen et al. (2012) — not a larger CALIB_SPEC.

  • The page costs several minutes to build. Six coupled forward solves for the sensitivity in §5, one each for the prior and the fit, two for the holdout and two for the composition sensitivity, at tens of seconds apiece. That is the price of a diagnostic computed rather than quoted.

Where to go next ​

The correlations calorimetry leaves unresolved call for a second measurement, the bound water of Bound water of CEM I 52.5 N and slag pastes, and the thermogram it integrates to. The rate laws and the provenance of their parameters are discussed in Rate laws, and every parameter in them.