# A Quantum-Behaved Neurodynamic Approach for Nonconvex Optimization with Constraints
## 4 Function Tests
As seen from the results, the proposed algorithm successfully solves the optimization problem with a fast convergence speed and finds a relative ideal solution within five iterations. Figure 8 depicts the iteration results of the inequality constraint functions and illustrates the ability of the algorithm to deal with constraints. Table 4 shows the best result, the average result, the worst result, and the standard deviation result of \(f(P_{g})\) over 50 realizations. Figure 7: Convergence results of \(E_{i}f\) and \(x\) in Application 1. **Application 2. ** (Heat exchangers [37]) Consider three connected heat exchangers as shown Figure 9, which are used to heat a material temperature from \(100^{\circ}\) to \(500^{\circ}\). Let \(mc_{p}=10^{5}\), where \(m\) is the mass flow rate of the fluid and \(c_{p}\) is the specific heat capacity of the fluid. The heat transfer coefficients of the three heat exchangers are \(K_{1}=120\), \(K_{2}=80\) and \(K_{3}=40\), respectively. For simplicity, the temperature difference \(\triangle t_{m}\) uses arithmetic mean value and the above values are obtained through dimensionless processing. The aim is to minimize the total heat transfer area by selecting the appropriate temperature. The decision variables are \(x=[T_{1},T_{2}]^{\top}\). The restrictions are given by \(100\leq T_{1}\leq 300\) and \(T_{1}\leq T_{2}\leq 400\). It follows from the law of conservation of heat that  
\[mc_{p}(T_{1}-100)=mc_{p}(300-T_{3})\Rightarrow T_{3}=400-T_{1},\] \[mc_{p}(T_{2}-T_{1})=mc_{p}(400-T_{4})\Rightarrow T_{4}=400-T_{2} +T_{1},\] \[mc_{p}(500-T_{2})=mc_{p}(600-T_{5})\Rightarrow T_{5}=100-T_{2}.\] \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Best** & **Average** & **Worst** & **Std.** \\ \hline
8.8747 & 8.8759 & 8.8767 & \(6.62\times 10^{-5}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Statistical analysis of the results in Application 1. Figure 8: Iteration results of \(g_{i}(x)\) in Application 1, \(i=1,2,3\). Figure 9: Flow chart of heat exchangers. The arithmetic mean values of temperature difference of heat exchangers are  
\[\triangle t_{m1} =\frac{300-T_{1}+T_{3}-100}{2}=300-T_{1},\] \[\triangle t_{m2} =\frac{400-T_{2}+T_{4}-T_{1}}{2}=400-T_{2},\] \[\triangle t_{m3} =\frac{600-500+T_{5}-T_{2}}{2}=100.\]  
Therefore, according to the design requirements, the cost function is obtained  
\[f(x)=\frac{10^{5}(T_{1}-100)}{120(300-T_{1})}+\frac{10^{5}(T_{2}-T_{1})}{80(40 0-T_{2})}+\frac{10^{5}(500-T_{2})}{4000}.\]  
To sum up, the optimization problem can be written as  
\[\min f(x)=\frac{10^{5}(x_{1}-100)}{120(300-x_{1})}+\frac{10^{5}(x_{2}-x_{1})}{ 80(400-x_{2})}+\frac{10^{5}(500-x_{2})}{4000},\]  
\[ \begin{split}\text{subject to}\ g_{1}(x)&=100-x_{1} \leq 0,\\ g_{2}(x)&=x_{1}-300\leq 0,\\ g_{3}(x)&=x_{1}-x_{2}\leq 0,\\ g_{4}(x)&=x_{2}-400\leq 0.\end{split}  \tag{13}\]  
In [37], the obtained minimum cost function value is 7049.4191 by using sequence quadratic programming. 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}=6\), \(M_{1}=0\), and \(\gamma=1000\). The initial values of the position \(X_{ij}\in[0,400]\) of particles, \(i=1,2,\cdots,5,j=1,2\), are randomly chosen. Since the problem is relatively simple, after performing the simulation, we can obtain the optimal solution at the first iteration almost every time. We perform 50 realizations and obtain the same results which are shown in Table 5. Figure 10 shows the behavior of particles in the search process in the phase plot by the proposed QNSO algorithm. It can be found that all particles move into the feasible region and reach some local optimal solutions. Figure 10: Moving trails of the particles using the QNSO algorithm in Application 2 (dotted line: feasible region). **Application 3. ** (Crank-rocker mechanism [36]) Consider a crank-rocker mechanism as shown in Figure 11. The anti-clockwise angle is calculated with the frame \(AD\) as the baseline.