Design scheme for energy storage system capacity optimization