Calculation of capacitor charge change