Workload-driven frequency-aware battery sizing