Calculation of cycle efficiency of energy storage system