Capacity of battery packs connected in series and parallel