In grid-deficient environments, residential energy systems face severe carbon emission penalties due to mandatory reliance on diesel standby generators during supply interruptions. In Iraq, summer peak loads routinely exceed grid capacity, triggering prolonged generator operation and dramatically increasing household carbon footprints. This study presents a deep Q-network (DQN) reinforcement learning framework for intelligent battery energy storage system (BESS) scheduling, targeting carbon emissions reduction through strategic peak shaving. The DQN agent learns optimal battery dispatch strategies by internalizing diurnal patterns in load and solar generation through temporal state features, enabling anticipatory control without requiring explicit external forecasting models. The system is trained on one-year operational data from a representative Iraqi residential installation and evaluated over the critical summer period (122 days, 35.5% grid unavailability). The results demonstrate a 54.8% CO2 reduction (306.5 kg versus 677.4 kg baseline), a 25.5% reduction in generator runtime, and a 23.7% reduction in operating costs for the studied configuration. The learned policy approaches 89.6% of perfect-foresight MILP performance while executing 35,000 times faster. A reward function sensitivity analysis across five weighting schemes confirms that the 20:1 carbon-to-cost priority ratio optimally balances environmental and economic objectives. Ablation studies quantify the mechanism contributions: anticipatory pre-charging accounts for 58% of the total improvement, discharge optimization for 44%, and real-time PV coordination for 22%. These findings establish DQN-based BESS optimization as a practically deployable decarbonization approach for residential systems in grid-constrained developing regions.
Mohammed et al. (2026) studied this question.