# Algorithms for Optimal Power Flow Extended to Controllable Renewable Systems and Loads
## 5 Conclusions  
In this paper, an optimal power flow was developed that takes into account the uncertainties produced by the penetration of renewable energy sources and controllable loads. It was observed that including the Jacobian (First derivatives) and the Hessian (Second derivatives) of the uncertainty cost functions in the optimal power flow model brings great benefits, since it allows the use of analytical techniques for the determination of active and reactive power dispatches. The main benefit of analytical techniques over the metaheuristic techniques used in the state-of-the-art for the solution of the optimal power flow is the reduction of the computation times that was evidenced in all the cases analyzed, as shown in Table 13. Additionally, it was observed that the IPOPT solver did not converge to a solution in several of the systems and scenarios proposed. On the other hand, the Matlab FMINCON solver converged in all cases to a solution. The MIPS solver did not converge in scenario 1 of the nine-node system. On the other hand, heuristic methods were used in order to validate the results obtained through analytical methods and very close responses were achieved for the active power dispatches in the IEEE systems of nine and 57 nodes, as shown in Tables 5-8 and 13. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & & \multicolumn{6}{c}{**Optimization Technique**} \\ \cline{3-7}  & & **DEEPSO** & **Genetic Algorithm** & **FMINCON** & **IPOPT** & **MIPS** \\ \hline Generator 1 (Slack) & \(P_{S}\) [MW] & 135.42 & 133.2 & 135.82 & 135.82 & 135.82 \\  & \(Q_{S}\) [MVAR] & 38.33 & 52.03 & 40.45 & 40.4 & 40.42 \\ Generator 2 & \(P_{S}\) [MW] & 39.07 & 53.98 & 40.04 & 40.03 & 40.03 \\  & \(Q_{S}\) [MVAR] & 49.54 & 28.28 & 50 & 50 & 50 \\ Generator 3 (Eolic) & \(P_{S}\) [MW] & 133.27 & 132.48 & 132.99 & 132.99 & 132.99 \\  & \(Q_{S}\) [MAR] & 32.17 & 25.85 & 26.66 & 26.6 & 26.62 \\  & \(P_{S}\) [MW] & 46.1 & 46.48 & 46.19 & 49.19 & 46.19 \\ Generator 6 (Solar) & \(Q_{S}\) [MVAR] & 5.65 & 14.43 & 6.25 & 6.26 & 6.25 \\  & \(P_{S}\) [MW] & 442.26 & 436.34 & 441.12 & 441.13 & 441.13 \\ Generator 8 & \(Q_{S}\) [MVAR] & 54.17 & 93.94 & 53.39 & 52.89 & 53.15 \\ Generator 9 (Hydraulic) & \(P_{S}\) [MW] & 97.84 & 97.8 & 97.88 & 97.88 & 97.88 \\  & \(Q_{S}\) [MVAR] & 48.88 & -2.68 & 49.16 & 50 & 49.59 \\ Generator 12 & \(P_{S}\) [MW] & 345.58 & 341.63 & 345.45 & 345.44 & 345.44 \\  & \(Q_{S}\) [MVAR] & 28.02 & 50.31 & 30.83 & 30.58 & 30.7 \\ Controllable load 47 & \(P_{S}\) [MW] & 15.05 & 15.03 & 15.06 & 15.06 & 15.06 \\  & \(Q_{S}\) [MVAR] & \(-0.89\) & \(-0.23\) & \(-1\) & \(-1\) & \(-1\) \\ Battery bank 57 & \(P_{S}\) [MW] & 10 & 8.21 & 10 & 10 & 10 \\  & \(Q_{S}\) [MVAR] & 5 & 0.67 & 4.99 & 5 & 5 \\  & \(\mathrm{Slack}\) node voltage [PU] & 1 & 1.001 & 1 & 1 & 1 \\  & \(\mathrm{Execution}\) time [s] & 1326 & 733 & 1.33 & 3.17 & 0.92 \\ \hline Objective function value [MU] & 49,619 & 49,665 & 49,618 & 49,618 & 49,618 \\ \hline \hline \end{tabular}
\end{table} 
Table 13: Results obtained for the 57 node system. However, for the 118-node system, the heuristic methods yielded significantly different dispatch values with respect to the analytical methods; in addition, the dispatches produced by the analytical methods produced a lower value in the objective function. Finally, the presented formulation and its respective solution allow network operators to have a tool to manage the controllable renewable resources found in the network, satisfying the different physical restrictions of the system. In this way, in this paper the marginal costs of uncertainty are used to determine the active power values that a particular generator with uncertainty must deliver to minimize the uncertainty costs. The field of optimization in electrical power systems is in continuous development. In the case of controllable renewable sources and controllable loads, it is possible to extend this analysis to optimal power flows in DC.