Current calculation with capacitor