## 4 Method: Optimization Using the GD + GR Method  
### Overall Algorithm Description  
In the micro-siting problem, the location of each turbine must be determined to maximize the AEP, which, assuming a fixed number of turbines \(nt\), is equivalent to minimizing the energy losses \(\delta AEP\) due to the wake effect. For clarity, \(\delta AEP/T\), analogous to \(\overline{\delta P}\) will be replaced by U, anticipating the analogy of interpreting \(\overline{\delta P}\) as **potential energy**. Therefore, the problem is formulated as follows:  
\[U\equiv\frac{\delta\text{AEP}}{T}=\overline{\delta P}=\sum_{i=1}^{nt}\overline {\delta P}_{i}=\sum_{i=1}^{nt}\sum_{j\
eq i}^{nt}\delta\overline{P}_{j\to i}\] (33) \[\text{min }U  
Repeat steps 4-6 until no new optimal positions are obtained. Further details will be explained in Section 4.4.
* **Final Tuning** 8. Use the gradient method again to fine-tune the layout. The GD method is used in steps 2, 6 and 8, with details explained below. In all steps, LAPD will be used, as it is faster than LAVD or QAVD and results in the same \(U\) distribution (see Figure 2).  
Figure 4: Frames of the process. Top: several batches in which four new turbines are included, followed by the GD algorithm operating to find their optimal locations. Bottom: iterative suppression of turbines at suboptimal locations and repositioning where \(U\) is minimum.  
Figure 3: Sequence of operations for the OWFLOP with GD search and GR. Crosses and circles are used for suppressed and added turbines, respectively.  
Figure 5 shows the evolution of the farm deficit as the algorithm progresses. In magenta, the evolution of the estimated AEP using LAPD is shown, which is the method actually used during the optimization. In green, the evolution of the AEP estimated using LAVD is shown, which is not used during the optimization but is included in the graph to illustrate that both aggregation methods present parallel evolutions. This parallel evolution is coherent with the fact that LAPD can be used during the optimization process to minimize losses due to the wake effect.  
Most of the iterations correspond to the initial approach (primary GD optimization with progressive incorporation of turbines), in which turbines are added at random positions. When a batch of turbines is added, there is an abrupt increase in the deficit as represented by the peaks. Just after being included, they repel each other due to the strong interactions they suffer, thus reducing their own potential (power deficit) and that of the farm. The figure illustrates this as a descending trend after each peak. The repulsion mechanism seeking the minimization of the potential presents an analogy with the electrostatic force of repulsion, which turns out to be the potential gradient. Therefore, it seems appropriate to use the gradient as a force that determines the movement of the particles/turbines to minimize their potential.  
Once all the turbines have been located, to detect and reallocate the turbines that can cause local optima, the GR mechanism is used to suppress the turbines that cause the greatest power deficit and create a potential map. Then, it tracks the map searching for the optimal location and places a turbine at that particular place. Then, a potential map is recreated to place a new turbine. After completing the repositioning of the suppressed turbines, a second GD is executed. The process (suppression, repositioning and secondary GD) repeats until the best new locations are the same as the previously suppressed ones, which indicates that no further improvement can be obtained.  
Finally, a search is run again using the GD method with a smaller learning rate to adjust the final maximum. It should be said that this third GD search does not lead to a significant improvement in the estimated U.