Spectrophotometric determination of pH and its application to determination of thermodynamic equilibrium constants