Mathematical algorithms and computer programs for the determination of equilibrium constants from potentiometric and spectrophotometric measurements