Energy storage battery capacity calculation