Optimal operation framework of customer-premise battery storage for energy charge reduction and primary frequency regulation