Automated spectrophotometric titrations