# Energy-Efficient Resource Allocation for Downlink Non-Orthogonal Multiple Access Systems
## 3 Proposed Algorithm
### Power Allocation Algorithm
#### 3.2.2 Modified Particle Swarm Optimization (MPSO)  
Firstly, for the basic particle swarm, we improve the inertia weight. In the basic particle swarm optimization algorithm, the inertia weight \(\omega\) is a fixed constant. However, the value of fixed inertia weight \(\omega\) has certain limitations on the optimization ability of the algorithm [35]. At the beginning of the iteration, the global search speed of the algorithm needs to be accelerated, so the large inertia weight needs to be used. In addition, at the end of the iteration, particle swarm optimization usually needs to use a small inertia weight to enhance the local search ability. Through this strategy, the coordination between global search and local optimal search can be enhanced. For this reason, we propose a strategy of dynamic adjustment of inertia weight. The improved inertia weight parameter is modified as  
\[\omega=\omega_{\text{min}}+(\omega_{\text{max}}-\omega_{\text{min}})*\text{e} ^{-\frac{t}{t_{\text{max}}/10}}+\sigma*\text{B}(p,q) \tag{19}\]where \(\omega_{\max}\) and \(\omega_{\min}\) are the maximum and minimum values of inertia weight, respectively. \(t\) represents the current number of iteration. In this equation, \(\omega_{\min}+(\omega_{\max}-\omega_{\min})*\mathrm{e}^{-\frac{t}{t_{\max}/10}}\) are changed by the exponential function \(\mathrm{e}^{-\frac{t}{t_{\max}/10}}\). By adding this item, the inertia weight of the early stage can be made larger. With the continuous iteration of particle swarm, the inertia weight can be reduced nonlinearly. In the third term, \(B\) is a random number generator in MATLAB, which can generate random numbers in accordance with beta distribution and \(p=1\), \(q=3\). The beta distribution can be used to adjust the overall value distribution of \(\omega\). \(\delta\) is the inertia adjustment factor, which is added to control the deviation degree of inertia weight. Secondly, we no longer use a fixed constant for the acceleration coefficient. It must be mentioned that in the initial stage of particle search, the ideal particle state should be traversed in the solution space as far as possible to obtain the diversity of particles. At the end of the search, the particle should maintain a constant velocity to avoid the interference of the local extremum. In order to obtain better algorithm performance, this chapter will adopt the time-varying acceleration coefficient (TVAC) [36]. \[c_{1}=(c_{\max}-c_{\min})\times\frac{t}{t_{\max}}+c_{\min} \tag{20}\]  
\[c_{2}=(c_{\min}-c_{\max})\times\frac{t}{t_{\max}}+c_{\max} \tag{21}\]  
Figure 2: Flow chart of particle swarm optimization. In the process of the acceleration factor change, \(c_{\text{max}}\) and \(c_{\text{min}}\) are used in the initial search, which makes the particles less affected by other particles in the population and enhances the global search ability. With the progress of iteration, the decrease in \(c_{\text{max}}\) and the increase in \(c_{\text{min}}\) are more conducive to the optimal solution. Thirdly, we combine the advantages of differential evolution algorithm to introduce mutation and crossover operation. Particle swarm optimization is prone to decreasing population diversity and falling into the local optimization in the late iteration. Considering that the differential evolution algorithm has the advantages of tracking and adjusting the search in time, in order to increase the diversity of the population, we combine it with particle swarm optimization algorithm to achieve co evolution. Mutation and crossover operations are added to update the position of particles, and the position update expression is  
\[u_{i,j}= \begin{cases}x_{r_{1},j}+F\big{(}x_{r_{2},j}-x_{r_{3},j}\big{)}&\text{ rand }<C_{R}\\ x_{r_{1},j}&\text{rand }\geqslant C_{R}\end{cases}  \tag{22}\]  
where \(x_{r_{1}}\), \(x_{r_{2}}\), \(x_{r_{3}}\) are random individuals and \(r_{1}\
eq r_{2}\
eq r_{3}\
eq i\in[1\dots M]\). \(F\) is a scalar value, and we take \(F=0.5\).