Calculation of flywheel energy storage