Closed forms are separate code from the bisection solver that draws the curve.
| Indicator | End V (mL) | Error |
|---|
End point = first volume where pH reaches the indicator's pKIn; error is relative to the nearest equivalence point k·Veq1.
The curve is not a fitted shape. At every volume the pH is the root of the exact charge balance:
[H⁺] + CbVb/Vt = Kw/[H⁺] + (CaVa/Vt) ∑ i·αi([H⁺]), with Vt = Va + Vb.
αi is the fraction of the acid carrying i negative charges, built from the Ka values (for a diprotic acid α1 = K1h / (h² + K1h + K1K2)). The left side minus the right side falls monotonically as pH rises, so one bisection finds the unique root.
Veq1 = CaVa/Cb; the k-th proton is consumed at k·Veq1.pH = pKa + log([A⁻]/[HA]) gives pH ≈ pKa, valid when the acid is neither very strong nor very dilute.[H⁺] = (−Ka + √(Ka² + 4KaCa))/2.1/(1 + 10^(pKIn − pH)); the eye sees the change roughly over pKIn ± 1.Simplifications. Concentrations instead of activities (real pH at 0.5 M differs by a few hundredths to tenths); 25 °C, Kw = 1.0×10-14; CO2 absorption, temperature drift and the indicator's own acid-base load are ignored; NaOH is fully dissociated; the burette scale is rescaled to the chosen volumes. The pKa values in the presets are typical textbook numbers (acetic 4.76, phosphoric 2.15/7.20/12.35, carbonic 6.35/10.33, hydrocyanic about 9.2) and the indicator pKIn values are typical ones; check a reference table for precise work. Indicator colours are artistic approximations. For a triprotic acid the third equivalence (pKa3 about 12) is hidden by the water buffer, which the model reproduces.