How to calculate the rated capacity of a battery pack