## 3 Solution Methodology
### Slave Stage  
The slave stage corresponds to the heart of the optimization methodology, since it is entrusted with the minimization of the annual energy losses considering daily active and reactive power consumption. This stage also defines the optimal sizes for D-STATOMs, which help determine their annualized investment costs. To develop the slave stage, we assume that the nodes where the D-STATCOMs have been provided by the CBGA in the master stage, i.e., the part of the optimization model associated with the optimal power flow solution (\(z_{1}\) in Equation (1) and constraints defined in Equations (2) to (4) and (8)), can be formulated as a second-order cone programming equivalent. This reformulation is described below:  
To reformulate the nonlinear optimal power flow problem into an equivalent convex problem, we define the following auxiliary variables: \(l_{ijh}=I_{jjh}^{2}\) and \(u_{ih}=V_{ih}^{2}\). These definitions imply that Equations (2) to (4) and (8) take the following form:  
\[z_{1}=C_{k\text{Wh}}T\sum_{h\in\mathcal{H}}\sum_{ij\in\mathcal{L}}R_{ij}l_{jh }\Delta_{h}, \tag{10}\]  
\[p_{ij,t}-R_{ij}l_{ijh}-\sum_{k:(jk)\in\mathcal{L}}p_{jkh}=P_{jh};\{j\in \mathcal{N},\;h\in\mathcal{H}\}, \tag{11}\]  
\[q_{ij}-X_{ij}l_{ijh}-\sum_{k:(jk)\in\mathcal{L}}q_{jkh}=Q_{jh}-q_{j}^{cr}\;\{ j\in\mathcal{N},\;h\in\mathcal{H}\}, \tag{12}\]  
\[u_{jh}=u_{ih}-2\Big{(}R_{ij}p_{ijh}+X_{ij}q_{ijh}\Big{)}+\Big{(}R_{ij}^{2}+X_{ ij}^{2}\Big{)}l_{ijh},\;\{(i,j)\in\mathcal{L},\;h\in\mathcal{H}\}, \tag{13}\]\[l_{ijh}u_{ih}=p_{ijh}^{2}+q_{ijh}^{2},\ \{(i,j)\in\mathcal{L},\ h\in\mathcal{H}\}, \tag{14}\]  
\[\left(V^{\min}\right)^{2}\leq u_{jh}\leq(V^{\max})^{2},\ \{h\in\mathcal{H},\ j\in \mathcal{N}\}, \tag{15}\]  
From the set of Equations (10) to (15), it can be observed that the remainder nonlinear non-convex constraint is related with the power balance definition in Equation (14), due to the product between variables as well as the the equality imposition [20]. However, this constraint can be relaxed using its conic equivalent [21]. To transform this equality constraint into a cone equivalent, we use the hyperbolic relation between two variables as follows:  
\[l_{ij,t}u_{ih}= \frac{1}{4}\left(l_{ijh}+u_{ih}\right)^{2}-\frac{1}{4}\left(l_{ ijh}-u_{ih}\right)^{2},\] \[p_{ijh}^{2}+q_{ijh}^{2}= \frac{1}{4}\left(l_{ijh}+u_{ih}\right)^{2}-\frac{1}{4}\left(l_{ ijh}-u_{ih}\right)^{2}\] \[\left(l_{ijh}+u_{ih}\right)^{2}= \left(2p_{ijh}\right)^{2}+\left(2q_{ijh}\right)^{2}+\left(l_{ ijh}-u_{ih}\right)^{2},\] \[\left\| \begin{array}{c}2p_{ijh}\\ 2q_{ijh}\\ l_{ijh}-u_{ih}\end{array} \right\|= l_{ijh}+u_{ih},\ \{(i,j)\in\mathcal{L},\ t\in\mathcal{T}\}. \tag{16}\]  
It is worth mentioning that the inequality constraint at Equation (16) is still non-convex due to the equality imposition; however, this imposition can be relaxed using a lower-equal symbol, as recommended in [20], which converts this constraint into a convex conic one, as presented below. \[\left\| \begin{array}{c}2p_{ijh}\\ 2q_{ijh}\\ l_{ijh}-u_{ih}\end{array} \right\|\leq l_{ijh}+u_{ih},\ \{(i,j)\in\mathcal{L},\ t\in \mathcal{T}\}. \tag{17}\]  
The optimization model that is addressed in the slave stage is summarized in Equation (17), where it is assumed that the master stage has provided the values of the binary variables \(x_{j}\) (note that inequality constraints at Equations (7) and (9) are also fulfilled during the implementation of the CBGA). \[\min z_{1}=C_{\text{KWh}}T\sum_{h\in\mathcal{H}}\sum_{ij\in\mathcal{L}}R_{ij}l _{ijh}\Delta_{h},\]  
\[p_{ij,t}-R_{ij}l_{ijh}-\sum_{k:(j,k)\in\mathcal{L}}p_{jkh}=P_{jh};\{j\in \mathcal{N},\ h\in\mathcal{H}\},\]  
\[q_{ij}-X_{ij}l_{ijh}-\sum_{k:(j,k)\in\mathcal{L}}q_{jkh}=Q_{jh}-q_{j}^{cr}\ \{j\in\mathcal{N},\ h\in\mathcal{H}\},\]  
\[u_{jh}=u_{ih}-2\Big{(}R_{ij}p_{ijh}+X_{ij}q_{ijh}\Big{)}+\Big{(}R_{ij}^{2}+X_{ ij}^{2}\Big{)}l_{ijh},\ \{(i,j)\in\mathcal{L},\ h\in\mathcal{H}\}, \tag{18}\]  
\[\left\| \begin{array}{c}2p_{ijh}\\ 2q_{ijh}\\ l_{ijh}-u_{ih}\end{array}