Acid-Base Titration Bench

Scenario

Bench settings

Live readout

pH (exact charge balance)- [H+] (mol/L)- Total volume (mL)- Fraction titrated (x Veq1)- Region- Indicator In- fraction-

Independent checks (closed forms)

Closed forms are separate code from the bisection solver that draws the curve.

Experiment: which indicator ends where?

IndicatorEnd 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 science

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.

  • Equivalence volume: Veq1 = CaVa/Cb; the k-th proton is consumed at k·Veq1.
  • Half-equivalence of a weak acid (Henderson-Hasselbalch): pH = pKa + log([A⁻]/[HA]) gives pH ≈ pKa, valid when the acid is neither very strong nor very dilute.
  • Initial weak-acid pH: [H⁺] = (−Ka + √(Ka² + 4KaCa))/2.
  • Indicator HIn ⇌ H⁺ + In⁻: the In⁻ fraction is 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.