Size optimization and power allocation of a hybrid energy storage system for frequency service