## 3 Solution Methodology
### GAMS Implementation  
GAMS software is a popular optimization tool used in academics and industry to solve large-scale optimization problems in science and engineering [37]. Some of the well-known applications of GAMS software include renewable energy and battery energy storage integration in power and distribution networks [5; 7; 38], optimization of pump and valve schedules in complex large-scale water distribution systems [39], multi-objective optimization of the stack of a thermoacoustic engine [40], and application in DC distribution networks [41; 42]. Figure 1 illustrates the general implementation of an optimization model in GAMS software. It should be noted that, since the software uses advanced optimization techniques, such as branch & bound and interior point methods, to decouple and solve the complete optimization model, the primary requirement in the GAMS implementation corresponds to ensuring a feasible optimization model [32; 43]. **Remark 2**. : _The solution of the optimization model (1)-(9) was reached using the BONMIN solver by varying the number of dispersed generators from 1 to 3 in order to identify the effect on the loadability factor of the network._  
References [32; 43] provide several numerical examples and tips for GAMS beginners and serve as useful guides when consulting particular aspects of GAMS software. The general methodology for solving MINLP models in GAMS software, as depicted in Figure 1, is illustrated here using a numerical example with a grid of 7 nodes taken from Reference [31]. The electrical configuration of this grid is depicted in Figure 2, and information concerning the branches and loads is presented in Table 1. This grid is operated with 23 kV at the substation bus and has a radial configuration. Note that the GAMS implementation uses 1 MVA and 23 kV as power and voltage bases, respectively. The optimization model (1)-(9), when implemented for the 7-bus test feeder, assumes that each generator can produce a maximum power of 2 MW, thus implying the possibility of installing two dispersed sources. The GAMS implementation is illustrated in Listing 1. Note that, in this implementation, the minimum and maximum voltages are set at 0.40, and 1.20; in addition, the \(\beta\)-coefficient is set as 0.30 for this numerical illustration. Figure 1: Main aspects of the solution of an optimization problem in GAMS software. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Node \(i\)** & **Node \(j\)** & \(R_{ij}\) (\(\mathbf{\Omega}\)) & \(X_{ij}\) (\(\mathbf{\Omega}\)) & \(P_{j}\) (**kW**) & \(Q_{j}\) (**kvar**) \\ \hline
1 & 2 & 0.5025 & 0.3025 & 1000 & 600 \\
2 & 3 & 0.4020 & 0.2510 & 900 & 500 \\
3 & 4 & 0.3660 & 0.1864 & 2500 & 1200 \\
2 & 5 & 0.3840 & 0.1965 & 1200 & 950 \\
5 & 6 & 0.8190 & 0.7050 & 1050 & 780 \\
2 & 7 & 0.2872 & 0.4088 & 2000 & 1150 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Branch and nodal parameters for the 7-bus system. Figure 2: Schematic nodal connection of the 7-bus test feeder. The following observations can be isolated from the GAMS implementation illustrated in Listing 1:  
* GAMS software is a mathematical interpreter where the set of equations that described the studied problem is implemented using a very similar syntax. * It has multiple MINLP solvers, and it selects the most adequate solver depending on the internal complexity of the studied model. We have selected the BONMIN solver as it combines both the Branch & Cut method and the interior point method in its approach to solving MINLP problems. * The complete implementation of the model using the nodal admittance matrix implies that this matrix must be calculated and introduced to the model manually. For the 7-bus system, this matrix was calculated using the successive approximation power flow method and introduced in the GAMS model between lines 10 and 30 in Listing 1. Once the GAMS code in Listing 1 is executed, it was found that the dispersed generators for this system are located at nodes 4 and 6 with capacities of 2000 kW and 595 kW, respectively.