Energy storage circuit and grid interface