Capacitor power generation and grid connection