Calculation of capacitor energy storage size