The relationship between energy storage devices and power grids