## 5 Benders Decomposition Algorithm  
The proposed daily VVC model addressed in this paper is formulated as an MINLP problem. The complexity of solving nonlinear optimization problems with integer variables and a great number of continuous variables motivates us to implement decomposition techniques, such as the Benders decomposition algorithm. The general MINLP problem has been divided by means of the Benders decomposition algorithm into two structures, master and slave, which provides an iterative procedure between both structures in order to achieve an optimal solution [25]. The proposed solution methodology is modeled in GAMS software using the CPLEX solver for solving the Mixed Integer Programming (MIP) of the master problem and the CONOPT solver for solving the Non-Linear Programming (NLP) of the slave problem. The Benders decomposition algorithm is described as follows:  
_Master Problem:_ The master problem decides on tap setting of OLTC, steps of Sh.Cs, and values of binary variables related to the cost of reactive power provided by DGs and WTs in order to minimize the costs of switching operations. The master problem solution is transferred to the slave problem. The objective function of master problem minimizes:  
\[f_{master}=f_{5}+\alpha \tag{51}\]  
Subject to the constraints Equations (46)-(50) and the Benders linear cuts as:  
\[ \begin{split}&\alpha\geq f_{slave}^{(m)}+\sum_{h=1}^{Nh}\sum_{i=1}^{ NSC}\lambda_{l}^{h(m)}\left(CStep_{i}^{h}-CStep_{i}^{h(m)}\right)+\sum_{h=1}^{ Nh}\mu^{h(m)}\left(Tap^{h}-Tap^{h(m)}\right)\\ &+\sum_{k=0}^{2}\sum_{h=1}^{Nh}\sum_{i=1}^{NDG}\gamma_{k,D\epsilon _{i}}^{h(m)}\left(W_{k,D\epsilon_{i}}^{h}-W_{k,D\epsilon_{i}}^{h(m)}\right)+ \sum_{k=0}^{2}\sum_{h=1}^{Nh}\sum_{i=1}^{NWT}\gamma_{k,WT_{i}}^{h(m)}\left(W_ {k,WT_{i}}^{h}-W_{k,WT_{i}}^{h(m)}\right)\\ &\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad \qquad m=1,2,...,v-1\end{split}  \tag{52}\]  
where \(v\) is the iteration counter. The only real variable \(\alpha\) in Equations (51) and (52), which contain the infeasibility costs, is an underestimation of the slave problem costs. The Benders linear cuts, which are updated for every iteration, join the master and slave problems. An additional cut is added to the master problem at each iteration with information about the objective value of slave problem in the previous iteration and the dual variables associated with the decision variables fixed by the master problem in the previous iteration. This information helps the master problem to make a new decision and reach the optimal solution. Because of the absolute (ABS) function included in the master problem, this model expresses a NLP model with discontinuous derivatives (DNLP). The only reliable way to solve a DNLP model is to reformulate it as an equivalent smooth model. The standard reformulation approach for the ABS function is to replace the ABS function with the auxiliary positive variables, g+ and g-, as follows:  
\[|\text{g(X)}|=\text{g}^{+}+\text{ g}^{-} \tag{53}\]  
providing that:  
\[\text{g(X)}=\text{g}^{+}-\text{ g}^{-} \tag{54}\]  
Therefore, the discontinuous derivative from the ABS function has disappeared and the part of the model shown here is smooth. So, the master problem is formulated as a MIP problem. _Slave problem:_ The slave problem formulation is nearly similar to the main problem in that all the integer variables are fixed to given the value obtained by the master problem. However, there could be some cases where the master problem's solution makes the NLP slave problem infeasible. To avoid these cases at each iteration, artificial variables are added to some constraints and embedded in the objective function so that the objective function minimizes the technical infeasibilities of operation [26]. Therefore, the slave problem not only verifies the technical feasibility of the master problem solution but also gives the optimal dispatches of generation units.