# Parameter Extraction of Solar Photovoltaic Model Based on Nutracker Optimization Algorithm
## 3 Noa
### Implementation of NOA  
As shown in the pseudo code of NOA in Algorithm 1, the implementation of NOA in the optimization process requires the initialization of the population in accordance with the set boundaries:  
\[\overset{\rightarrow}{X}_{i,j}^{t}=\left(\overset{\rightarrow}{U}_{j}- \overset{\rightarrow}{L}_{j}\right)\cdot\overset{\rightarrow}{RM}+\overset{ \rightarrow}{L}_{j},i=1,2,\ldots,N,j=1,2,\ldots,D \tag{14}\]  
```
Input: population size N, the lower limits of variables \(\overset{\rightarrow}{L}\), the upper limits of variables \(\overset{\rightarrow}{U}\) the current number of iteration t = 0, and the maximum number of iterations \(T_{max}\). Output: the best solution found.
1. Initialize N nutcracker/solution using Equation (14);
2. Evaluate each solution and find the one with the best fitness in the population
3. \(t=1\); // the current function evaluation//
4.while(\(t<T_{max}\))
5. Generate random numbers \(\sigma\) and \(\sigma_{1}\), between 0 and 1.
6.If\(\sigma<\sigma_{1}\)/* Foraging and storage strategy*//
7.\(\varphi\) is a random number between 0 and 1.
8.for i = 1: N
9.for j = 1: d
10.if\(\varphi>P_{a_{i}}\)/*Exploration phase1*/
11. Updating \(\overset{\rightarrow}{X}_{i}\) using Equation (1)
12.else/*Exploitation phase1*/
13. Updating \(\overset{\rightarrow}{X}_{i}^{t+1}\) using Equation (3)
14.endif
15.endfor
16. Update the current iteration \(t\) by \(t=t+1\)
17.endfor
18.else/*Cache-search and recovery strategy *//
19. Generate RP matrix using Equations (5)-(7).
20. Generate a random number \(\phi\) between 0 and 1.
21.for i = 1: N
22.if\(\phi>P_{a_{2}}\)/*Exploration phase2*/
23. Updating \(\overset{\rightarrow}{X}_{i}^{t+1}\) using Equation (9).
24.else/*Exploitation phase2*/
25. Updating \(\overset{\rightarrow}{X}_{i}^{t+1}\) using Equation (12).
26.endif
27.\(t=t+1\)
28.endfor
29.endwhile
```  
**Algorithm 1**Pseudo-code of NOA.  
Following this, according to the foraging and storage strategies, the nutcracker population performs exploration and exploitation in first stage, and the cache search and retrieval strategies in the second stage. These two strategies are implemented in parallel and have equal probabilities. Every nutcracker represents a solution of the problem. Possible food sources in the first stage and caches in the second stage represent candidate solutions. The fitness function values to be optimized are calculated by selecting new solutions according to the strategies, and the iteration process continues to select better solutions.  
During the initialization process, in addition to the population size, search boundaries, and maximum number of iterations, the NOA also requires presetting two parameters, Alpha: the percentage of attempts to avoid local optima, and \(P_{rb}\): the percentage of explorations of other regions in the search space. In this paper, Alpha = 5% and \(P_{rb}\) = 0.2, chosen in accordance with the recommended values in the original code, to balance the exploration and exploitation processes. In both strategies, exploration and exploitation in the solution space are equally important in regards to following the information-sharing mechanism and mutually coordinating to balance and avoid local optima.