How to calculate the current of capacitor