## 8 Load Optimization and Scheduling
### Scheduling Algorithm
#### 8.1.1 Population Evaluation Functions
\[v_{(i,n)}=\omega v_{(i,n)}^{t}+\big{(}c_{1}rand(1)\times(p_{lb_{(i,n)}}^{t}-x_{ (i,n)}^{t})\big{)}+\big{(}c_{2}rand(1)\times(p_{gb_{(i,n)}}^{t}-x_{(i,n)}^{t}) \big{)} \tag{27}\]  
where \(c_{1}\) and \(c_{2}\) are weights for local \(p_{lb_{(i,n)}}\) and global best \(p_{gb_{(i,n)}}\) positions, \(rand(1)\) is a random variable whose range is \([0,1]\) and the \(\omega\) is the inertia factor. The value of the \(\omega\) is calculated as:  
\[\omega=\omega_{i}+(\omega_{f}-\omega_{i})\times\bigg{(}\frac{i-th_{iter}}{max_ {iter}}\bigg{)} \tag{28}\]  
The position \(x_{i,n}\) of the particles is updated using the following equation. \[x_{(i,n)}^{(t+1)}=x_{((i,n))}^{t}+v_{(i,n)}^{(t+1)} \tag{29}\]  
In our case, we are using the binary version of WDO and PSO; we first convert the \(V\) into binary form using a sigmoid function. \[F_{sig}(v_{(i,n)})=\frac{1}{1+e^{-v_{(i,n)}}} \tag{30}\]where \(v_{(i,n)}\) is the velocity of the \(i\)-th particle in n-dimensions. The final binary value of zero or one is generated after comparing the values obtained from the sigmoid function and a random variable, as given below. \[X_{(i,n)}^{t+1}=\left\{ \begin{array}{ll}1;&\mbox{if $F_{(sig)}$ $v_{(i,n)}^{t+1}\geq rand_{(i,n)}$}\\ 0;&otherwise\end{array} \right.\]  
It is clear from the above expression that binary conversion is probabilistic, because every \(v_{(i,n)}\) value is compared to a random number, which can create disturbance in the optimal value or convergence as shown in Table 3. On the other hand, in Equation 27, random term involvement is completely neglected, which provides more accurate results. The control variables involved in the PSO algorithm are given in Table 5. Figure 3 shows the convergence comparison of the WDO algorithm with sphere and step functions. It is clear from Figure 3 that the WDO algorithm converges after 204 iterations, resulting in zero pressure; while the WDO algorithm diverges even after 500 iterations, which shows the effectiveness of WDO algorithms using the sphere function. In Figure 4, the PSO algorithm converges after 370 iterations when using the sphere function. On the other hand, the PSO algorithm is unable to achieve convergence, even after 500 iterations. Thus, due to the fast convergence, we use the WDO algorithm with the sphere function for initial population evaluation in our proposed technique. Figure 3: Convergence comparison of the WDO algorithm using sphere and step functions. The WDO creates random solutions of \(n\) number of populations (air parcels). Each population consists of a set of different numbers of variables. After evaluating the fitness function, constraint validations and the velocity update, we can obtain the new population that includes both the new and old air parcels. In the next phase, the fitness of the new population will be evaluated and compared to the previous one. Finally, we obtain the final optimal appliance scheduling pattern. Then, in the next step, after obtaining the energy consumption requirements of each appliance, the WDO algorithm first \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Parameter** & **Value** & **Parameter** & **Value** \\ \hline Particle Size & 10 & RT-coefficient & 3 \\ No. of Iterations & 500 & Gravitational const & 0.2 \\ Max-V & 0.4 & Coriolis effect & 0.4 \\ Dimensions & \([-1,\,+1]\) & \(\alpha\) & 0.4 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Control parameters for the WDO algorithm. Figure 4: Convergence comparison of the PSO algorithm using the sphere and step functions. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Parameter** & **Value** & **Parameter** & **Value** \\ \hline Particle Size & 10 & \(c_{1}\) & 2 \\ No. of Iterations & 500 & \(c_{2}\) & 2 \\ Max-V & 0.3 & \(w_{i}\) & 1.0 \\ Dimensions & \([-1,\,+1]\) & \(w_{f}\) & 0.4 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Control parameters for the PSO algorithm. checks the appliance class.