Calculate the charge of the capacitor