Energy storage battery optimizes microgrid configuration