Capacitor instantaneous current calculation