On-demand and capacity-based energy storage