Demand charges and Time-of-use pricing are fundamental elements of contemporary electricity markets, introducing complexities in the operation of microgrids. Time-of-use pricing incentivizes energy consumption during off-peak hours, while demand charges impose fees based on peak power usage, significantly impacting electricity costs for both residential and commercial users. This research investigates the potential of battery energy storage systems to mitigate these costs by reducing demand charges and facilitating energy arbitrage. A significant challenge in determining optimal battery size lies in the uncertainties associated with building load predictions. Therefore, the study addresses critical uncertainties in load forecasts driven by climate change and occupant behavior. A novel stochastic framework is proposed that integrates these uncertainties into building load forecasts and considers demand charges in the optimization process. By employing the K-medoids clustering method in conjunction with the Bayesian information criterion, the framework achieves a remarkable reduction in computation time of 75.4% to 87.4%, while preserving essential load variability. The stochastic framework results in an overall cost reduction of 5.7%, alongside a 13.3% increase in the optimal battery size. Furthermore, implementing the proposed framework leads to a peak demand reduction of up to 25.8%.
QC 20251211