Evaluation of Substrate and pH Profiles in Anaerobic Granular Sludge by Microelectrodes and Mathematical Model