Electrode potential calculation