## 4 Problem Formulation and Numerical Modelling
### Objective Function  
This section discusses the objective function formulation to achieve the desired objectives such as minimization of energy cost, PADR, energy consumption, carbon emission, and user discomfort. These objectives can be achieved by scheduling the consumer's appliances into the off-peak hours using the GWDO-based ECS. The objective function in Equation (12) is modeled and defined as follows.  
\[\min(Cost+CO_{2}+Delay+PADR) \tag{12}\]where \(Cost\), CO\({}_{2}\), \(Delay\), and \(PADR\) represent cost, carbon emission, user discomfort, and PADR, respectively. As these objectives have different dimensional units, their addition is made possible by normalization, dimensionality, and a weighted sum approach subject to the constraints and goal of the optimization problem, as in [92]. Each objective used in Equation (12) is defined separately as follows.  
\[Cost=\sum_{\tau=1}^{T}\left(\sum_{a_{i}\in_{A\text{m}}}\left(\gamma_{R}(\tau,a_ {i})\times\rho(\tau)\right)\right. \tag{13}\]  
The energy cost is modeled and defined in Equation (13). It shows the cost paid by user for the consumed energy.  
Equation (14) mathematically defines PADR, which is the ratio of peak load demand to average load demand. The PADR metric determines users' load operating during peak hours to show whether the users' load is high or low. Reducing PADR ensures efficient scheduling of appliances from peak hours to off-peak hours. Thus, shifting load from on- to off-peak hours leads to the minimization of energy cost, carbon emission, and peak energy consumption.  
\[PADR=\frac{\max_{\tau\in T}(\gamma_{R}(\tau,a_{i}))}{\frac{1}{T}\sum_{\tau=1}^{ T}\gamma_{R}(\tau,a_{i})}\leq E_{\max} \tag{14}\]  
The CO\({}_{2}\) is carbon emission, defined in Equation (15), \(\delta\) represents the energy price per kWh equal to USD 0.2, \(\theta\) is a carbon emission factor equal to 0.37, and \(m\) is the number of months.  
\[CO_{2}=\frac{\gamma_{R}(\tau,a_{i})}{\delta\times\theta\times m} \tag{15}\]  
_Delay_ used in Equation (12) represents the waiting time of an appliance after scheduling, which is defined in Equation (16).  
\[Delay=(sum(abs(t_{A1}-t_{A2})))/sum(t_{A2}) \tag{16}\]  
The objective function defined in Equation (12) is subjected to the following constraints, which are defined as follows.  
\[E_{\min}\leq E\leq E_{\max} \tag{17}\]  
\[\gamma_{\tau}=\epsilon_{pi}+\epsilon_{pni}+\epsilon_{c} \tag{18}\]  
\[\gamma_{\tau}\leq grid_{capacity} \tag{19}\]  
\[\sum_{\tau=1}^{T}\tau^{msct}=\sum_{\tau=1}^{T}\tau^{sct} \tag{20}\]  
Equation (17) shows that home energy consumption must be bounded between the lower and upper limits \(E_{min}\) and \(E_{max}\), respectively, which ensures that the peak loads and average loads cannot be the same. Equation (18) shows home energy consumption before and after the scheduling must be the same to ensure a fair comparison. Likewise, Equation (19) ensures that home energy consumption does not exceed the grid generation capacity, providing reliable power grid operation. Equation (20) illustrates that the length of appliances' operation time is not affected by the scheduling process, i.e., it must be the same before and after scheduling.