## 2 Methodology
### Problem Formulation
Convergence is assumed if the global best solution remains within a threshold for a given number of iterations. Empirical results have shown that beyond 100 iterations, the rate of improvement in the objective function decreases significantly, indicating that further iterations yield marginal benefits. To mitigate oscillatory behavior, a dynamic inertia weight is employed where \(\omega\) decreases each iteration, and \(c_{1}\) and \(c_{2}\) are tuned to prevent particle oscillation around local optima. This improves the stability and convergence of the algorithm. The load optimization framework employs the following expressions. * The load balance at time \(t\) is \[P_{\text{grid}}(t)+P_{\text{renewable}}(t)+P_{\text{ battery}}(t)=P_{\text{demand}}(t).\] (9)
* The grid constraint at time \(t\) is \[P_{\text{grid}}^{\text{min}}\leq P_{\text{grid}}(t)\leq P_{\text{grid}}^{\text {max}},\] (10) where \(P_{\text{grid}}^{\text{min}}\) and \(P_{\text{grid}}^{\text{max}}\) are the minimum and maximum allowable power from the grid, respectively, and \(P_{\text{grid}}(t)\) is the power supplied from the grid. * The battery State of Charge (SOC) constraint at time \(t\) is [5] \[f(\mathcal{X})=\alpha\cdot\text{Cost}(\mathcal{X})+\beta\cdot\text{Emissions}( \mathcal{X})-\gamma\cdot\text{Efficiency}(\mathcal{X}), \tag{2}\]0 (11) where \(SOC_{\text{min}}\) and \(SOC_{\text{max}}\) are the minimum (10%) and maximum (90%) allowable charge, respectively. This minimum is based on maximizing the available storage for cost and emission reduction while maintaining battery lifespan. However, in some applications, particularly when batteries are used to improve resilience and reliability, the minimum SOC is higher (25-50%) to ensure sufficient availability. Increasing the minimum will reduce the amount available for daily load optimization but improve the available backup power in critical situations. The tradeoff between economic benefits (lower costs and higher efficiency) and resilience (higher availability for grid disturbances) should be based on operational priorities. * The power of the renewable energy produced from solar panels at time \(t\) is \[f(\mathcal{X})=\alpha\cdot\text{Cost}(\mathcal{X})+\beta\cdot\text{Emissions}( \mathcal{X})-\gamma\cdot\text{Efficiency}(\mathcal{X}), \tag{2}\]1 (12) where \(A_{\text{solar}}\) is the total area of the solar panels, \(G(t)\) is the solar irradiance at time \(t\), and \(\eta_{\text{solar}}\) is the panel efficiency. * The demand prediction for time \(t+1\) is \[f(\mathcal{X})=\alpha\cdot\text{Cost}(\mathcal{X})+\beta\cdot\text{Emissions}( \mathcal{X})-\gamma\cdot\text{Efficiency}(\mathcal{X}), \tag{2}\]2 (13) where \(f_{\text{LSTM-CNN}}()\) is the hybrid LSTM-CNN model used for prediction, \(P_{\text{demand}}(t)\) is the actual load demand at time \(t\), and \(\text{occupancy}(t)\) and \(\text{weather}(t)\) are the corresponding occupancy information and weather conditions. The hyperparameter tuning results for the proposed LSTM-CNN model are given in \[f(\mathcal{X})=\alpha\cdot\text{Cost}(\mathcal{X})+\beta\cdot\text{Emissions}( \mathcal{X})-\gamma\cdot\text{Efficiency}(\mathcal{X}), \tag{2}\]3 They were obtained using Windows 11 on an Intel Core i7-12700K processor with 32 GB RAM and an NVIDIA RTX 3090 GPU. The average training time was 4.2 h. Compared to traditional static methods, this model provides a 15-20% improvement in accuracy. The proposed ML model predicts load demand, carbon emissions, and costs, while the MOPSO algorithm determines operational parameters to balance costs, carbon emissions, and efficiency [15]. They were implemented using Python 3.11.5 with Pandas for data manipulation, NumPy for calculations, and Matplotlib for visualization [4]. The optimization algorithms considered include Genetic Algorithm (GA) [17; 18], MOPSO [15; 19; 20; 21], Simulated Annealing (SA) [21], Reinforcement Learning (RL) [22; 23], and Mixed-Integer Linear Programming (MILP) [24; 25]. Table 2 provides a comparative analysis of these algorithms for load management.