Capacitor charging when short circuit