Calculate the potential difference of a capacitor