## 2 Microgrid Optimization Scheduling Model
### Grey Wolf Optimization Algorithm Based on Oppositional Gradient  
This paper adds two new features to the traditional GWO algorithm, forming a grey wolf optimizer based on opposing gradients. The first feature is the introduction of a new OBL based program in the OGGWO algorithm for updating the position formula of Omega Wolf, using gradient data to improve the development and exploration skills of the algorithm. The second feature is the introduction of Gaussian walk and Levy flight (LF) in traditional GWO, allowing for random selection of Gaussian walk or Levy flight to update the wolf's position in each iteration. These random walks enhance the randomness of the improved OGGWO model and facilitate exploration. Gaussian walk generates a compact cluster with many small steps and executes an equal number of loops. These small steps are randomly selected, which can help the algorithm avoid local optima and enhance the search capability of the proposed OGGWO model [19]. In this case, OGGWO can randomly switch between Gaussian and LF walks [20]. The mathematical expressions for Gaussian walk and Levy flight are shown in Equations (7) and (8)  
\[ \begin{array}{l}X_{i}^{t+1}=X_{i}^{t}+N(0,\sigma)\\ \\ X_{i}^{t+1}=X_{i}^{t}+Levy(\beta)\end{array}  \tag{7}\]  
where \(N(0,\sigma)\) represents a Gaussian distribution with a mean of 0 and a standard deviation of \(\sigma\), Levy (\(\beta\)) represents a Levy distribution with a parameter of \(\beta\), and \(X_{i}^{t}\) represents the position of the \(i\)-th wolf. Figure 1 illustrates the flowchart of the introduced grey wolf optimization algorithm based on adversarial gradient for multi-target optimization scheduling of wind and thermal storage microgrids. The overall flowchart is as shown above, and the detailed steps are listed below:  
Step 1: The position of grey wolves (search agents) is randomly initialized in the search space. This step further fixes the number of iterations, followed by population size (number of wolves). Step 2: For each search agent, the fitness value is determined as it denotes the distance between prey and the wolf. Step 3: The opposite points are initialized and used to generate the opposite population so as to calculate the fitness values of every individual population. Step 4: Sorting is executed for both current and opposite populations (pop and opop respectively), in line with their fitness values. Step 5: The nP number of the fittest solution is selected out of a combination of current and the corresponding opposite population. Step 6: Based on fitness values, three solutions are found such as best (a), second-best (b) and finally, the third best (d). These solutions correspond to Alpha, Beta, and Delta category wolves, respectively. Step 7: Based on Equation (9), the position of the grey wolves is modified  
\[X_{W}^{i}(t+1)=\gamma\frac{\partial f^{Min}}{\partial X^{i}}\leq\frac{ \partial f}{\partial X_{w}^{i}}(t)<\gamma\frac{\partial f^{Max}}{\partial X^{ i}}\mathit{for}\mathit{i}=1,\cdots,\mathit{m}\mathit{and}\mathit{w}=1,\cdots,n \tag{9}\]  
\[X_{W}^{i}(t)=\mathit{rand}(0,1)\lambda^{i}(t)\bigg{(}\frac{\partial f}{ \partial X_{w}^{i}}(t)\bigg{)},\text{ Otherwise, for i}=1,\cdots,\text{m}\text{ and w}=1,\cdots,n \tag{10}\]  
In this equation, \(i\) corresponds to the index of decision variables in an optimization problem. On the contrary, \(n\) denotes the count of grey wolves. ; \(\frac{\partial f^{Max}}{\partial X^{i}}\) and \(\frac{\partial f^{Min}}{\partial X^{i}}\) correspond to the maximum positive slope and minimum negative rate of change in every dimension at each step of the algorithm. Furthermore, \(\gamma\) represents a continuous parameter determined  
Figure 1: Flowchart of the grey wolf optimizer based on the opposing gradient. in the range \([0,1]\), \(rand(0,1)\) represents a random number with an interval of \((0,1)\).