# A Quantum-Behaved Neurodynamic Approach for Nonconvex Optimization with Constraints
## 4 Function Tests
The complexity of this problem depends on the size of \(n\) and the number of minima increases exponentially with the increase of \(n\)._  
To carry out the QNSO algorithm, set the initial parameters of QNSO algorithm: \(M_{1}=0\), \(\gamma=1000\), \(\beta\) decreased from 0.9 to 0.3 on the course of the search, swarm size \(q=20\), tolerance error precision \(\varepsilon=10^{-5}\), the maximum iteration number \(K_{\max}=500\). To establish a reference for comparison with the QNSO algorithm in this paper, we performed experiments with Rastrigrin function in 2, 4 and 10 dimensions, respectively. Some other optimization methods were also examined for performance comparisons, including the latest standard particle swarm optimization (SPSO) [31], the adaptive particle swarm optimization (APSO) [32], the random drift particle swarm optimization (RDPSO) [33], the firefly algorithm (FA) [34], the repair genetic algorithm (RGA) [35], the QPSO [30], and the method in [29]. We set swarm size \(q=20\), tolerance error precision \(\varepsilon=10^{-5}\), the maximum iteration number \(K_{\max}=500\) for all the tested methods. Standard normal distribution was used in RGA as mutation operator. The parameters for QPSO were the same as those in this paper. Other parameters for SPSO, APSO, FA, RDPSO and RGA were the same as those recommended in [31; 32; 33; 34; 35] and these methods used the same fitness value (3) with a large \(\gamma=10^{6}\) to keep optimizations within the feasible range. Tables 1-3 show the computational results, where the best result, the average result, the worst result, the standard deviation (Std.) result of \(f(P_{g})\), and the average number of iterations (No. of Iterations) over 50 experiments are provided. The optimum results are coarsened with boldface in these tables. Obviously, when the particles and the iterations are limited, the general optimization algorithm has obvious deficiencies with the increase of the complexity of the problem, but the method  
Figure 6: Moving trails of the three particles using the QNSO algorithm, where different color lines represent contours corresponding to different values of \(f\) and the corresponding values are shown in Figure 2.  
1. Torsional strength condition is \(\tau_{max}=\frac{T}{W_{n}}\leq\tilde{\tau}\), where \(T\) is the torque received by the round shaft, \(T=9550\frac{P}{n}\), \(W_{n}\) is the torsional section modulus, \(W_{n}=\frac{\pi(D^{4}-d^{4})}{16D}\). 2. Torsional stiffness condition is \(\varphi=\frac{T}{SJ_{p}}\leq\tilde{\varphi}\), where \(\varphi\) is unit length twist angle, \(G\) is shear modulus, \(J_{p}\) is polar moment of inertia, \(J_{p}=\frac{\pi(D^{4}-d^{4})}{32}\). 3. Outer diameter minimum limit condition is \(x\geq d\). Following the above analysis, we summarize the optimization problem as follows:  
\[ \begin{split}\min f(x)&=\frac{\pi}{4}\rho L(x^{2}- d^{2})\times 10^{-6},\\ \text{subject to}& g_{1}(x)&=d-x\leq 0, \\ g_{2}(x)&=\frac{16 xT\times 10^{9}}{\pi(x^{4}-d^{4})}- \tilde{\tau}\times 10^{6}\leq 0,\\ g_{3}(x)&=\frac{32T\times 10^{3}}{S\pi(x^{4}-d^{4})}- \tilde{\varphi}\times\frac{\pi}{180}\leq 0.\end{split}  \tag{12}\]  
For the above problem (12), one can use the \(fmincon\) function in Matlab to obtain a solution \(x^{*}=21.6121\) mm with \(f(x^{*})=8.8896\) kg [36]. To carry out the QNSO algorithm, we set swarm size \(q=5\), parameter \(\beta=\frac{1}{2}\), tolerance error precision \(\varepsilon=10^{-6}\), the maximum iteration number \(K_{\max}=15\), \(M_{1}=0\), and \(\gamma=1000\). The initial values of the position \(X_{i}\in[8,100]\) of particles, \(i=1,2,\cdots,5\), are randomly chosen. We perform 50 realizations and obtain an optimal solution \(x^{*}=21.5965\) mm with \(f(x^{*})=8.8747\) kg, which is slightly better than that obtained in [36]. Figure 7 shows the iteration results of the energy function \(E\), the cost function \(f\) and the solution \(x\) of the best particle among five particles.