## 4 Simulation Results and Discussion
### Implementation of JS-MFO for Solving OPF Problems
Table 12. The optimal active losses affected by JS, MFO, and JS-MFO are 3.35 MW, 3.56 MW, and 3.25 MW, which represent loss percent savings of 49.19%, 46.04%, and 50.67% compared to the base case, respectively. The best solution quality was found with the JS-MFO technique, which yielded the lowest total active power losses and the highest loss percent saving. The optimal total active transmission losses attributed to JS-MFO are 2.94% and 8.58% lower than those obtained by the JS and MFO algorithms. It is clearly illustrated in Figure 9 that the JS-MFO algorithm dominates the JS and MFO algorithms in terms of solution quality and convergence characteristics. Case 5: Minimizing of the total voltage deviation for the RIM 27-bus system:  
The objective function presented in (16) is minimized in case 5 and depicts an optimal solution for the control and state variables shown in Table 12. The RIM 27-bus power system security is enhanced via the minimization of the total voltage deviation \(\mathrm{F_{VD}}\) using JS, MFO, and JS-MFO, signaling reductions of 59.97%, 55.25%, and 62.44%, respectively, compared to the base case. The JS-MFO pointed out the best optimal \(\mathrm{F_{VD}}\) compared to that of JS and MFO. The optimal total voltage deviation achieved by JS-MFO is 0.6144 p.u.,  
\begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline \multirow{2}{*}{**Control Variables**} & \multicolumn{3}{c}{**Case 4**} & \multicolumn{3}{c}{**Case 5**} & \multicolumn{3}{c}{**Case 6**} \\ \cline{2-11}  & **JS** & **MFO** & **JS-MFO** & **JS** & **MFO** & **JS-MFO** & **JS** & **MFO** & **JS-MFO** \\ \hline \(\mathrm{P_{G1(MW)}}\) & 85.67 & 82.044 & 83.6279 & 90.667 & 49.75 & 36.9530 & 77.5546 & 108.26 & 109.0601 \\ \(\mathrm{P_{G3(MW)}}\) & 20.49 & 21.971 & 21.8570 & 20.005 & 50.00 & 49.8027 & 18.176 & 5.553 & 6.5210 \\ \(\mathrm{P_{G1(MW)}}\) & 19.27 & 19.327 & 17.8151 & 11.7898 & 14.42 & 27.6150 & 25.6081 & 29.95 & 10.4073 \\ \(\mathrm{P_{G23(MW)}}\) & 9.345 & 8.581 & 9.0237 & 4.6829 & 9.936 & 3.0152 & 12.6120 & 14.66 & 3.5084 \\ \(\mathrm{P_{G24(MW)}}\) & 33.43 & 35.939 & 35.9926 & 30.700 & 36.00 & 35.9595 & 19.6385 & 10.71 & 23.6076 \\ \(\mathrm{P_{G25(MW)}}\) & 13.48 & 14.073 & 13.3123 & 24.333 & 2.745 & 29.9992 & 29.0962 & 12.86 & 29.9499 \\ \hline \(\mathrm{V_{G1(p-u)}}\) & 0.934 & 0.9618 & 0.9200 & 0.9570 & 0.954 & 0.9559 & 0.9518 & 0.9379 & 0.9445 \\ \(\mathrm{V_{G8(p-u)}}\) & 0.941 & 0.9705 & 0.9271 & 0.9744 & 0.992 & 0.9936 & 0.9647 & 0.9398 & 0.9392 \\ \(\mathrm{V_{G10(p-u)}}\) & 0.938 & 0.9663 & 0.9235 & 0.9648 & 0.966 & 0.9724 & 0.9646 & 0.9500 & 0.949 which is better than that of the JS and MFO algorithms, which correspond to 0.6547 p.u. and 0.732 p.u., respectively. The best performance of the JS-MFO algorithm is verified in Figure 10, illustrating the convergence proprieties of JS-MFO overcoming those of the JS and MFO algorithms. Case 6: Voltage stability enhancement for the RIM 27-bus system:  
The F\({}_{\text{Lmax}}\) voltage stability index is optimized for case 6 in order to enhance voltage stability using the JS, MFO, and JS-MFO algorithms. The stability margin of the RIM 27-bus system is improved using JS, MFO, and JS-MFO, where \(F_{Lmax}\) reaches the optimal values of 0.3861, 0.4201, and 0.3389, respectively. The JS-MFO approach denoted a percent reduction of \(F_{Lmax}\) of 12.22% compared to JSO and 19.33% compared to MFO, which proves the capacity of JS-MFO to overcome the JS and MFO algorithms. It appears from Table 12 that the JS-MFO algorithm outperforms the JS and MFOs in solving the OPF problem. The JS-MFO simulation result provides 12.22% and 19.33% improvements in the stability margin compared to the JS and MFO algorithms, respectively. B.2. Sizing of reactive power compensators for renewable sources  
Table 13 points out the reactive power generation for each optimal state of cases 4, 5, and 6. The reactive power compensator sizing for each renewable energy source in generation buses 8, 10, and 23 is, respectively, \(-17.5/17.5\) MVAR, \(-16/16\) MVAR, and \(-15/15\) MVAR.