## 2 Formulation of the Power Flow Problem
### Solidly Grounded Case
However, Equation (9) needs to be organized, since vectors with currents \(i_{dE}^{pn}\) and \(i_{dC}^{pn}\) are dependent of the demanded voltages, as given in (6) and (7). Let us define the following vectors and matrices:  
\[V_{d}^{pn}= \begin{pmatrix}v_{2}^{p}\\ v_{2}^{n}\\ \vdots\\ v_{L}^{p}\\ \varphi_{L}^{\bar{n}}\end{pmatrix} ,\ P_{d}^{pn}= \begin{pmatrix}P_{2}^{p}\\ P_{2}^{n}\\ \vdots\\ P_{L}^{p}\\ \varphi_{L}^{\bar{n}}\end{pmatrix} ,\ P_{d}^{p-n}= \begin{pmatrix}P_{2}^{p-n}\\ P_{2}^{n-p}\\ P_{2}^{n}\\ \vdots\\ P_{L}^{p-n}\end{pmatrix}  \tag{10}\] \[\mathbf{J}= \begin{pmatrix}1&0&\ldots&0&0\\ 0&1&\ldots&0&0\\ \vdots&\vdots&\ddots&\vdots&\vdots\\ 0&0&\ldots&1&0\\ 0&0&\ldots&0&1\end{pmatrix} ,\ \mathbf{M}= \begin{pmatrix}0&1&\ldots&0&0\\ 1&0&\ldots&0&0\\ \vdots&\vdots&\ddots&\vdots&\vdots\\ 0&0&\ldots&0&1\\ 0&0&\ldots&1&0\end{pmatrix}  \tag{11}\]  
where \(P_{d}^{p-n}\in\mathbb{R}^{(2l-2)\times 1}\) is the vector of bipolar constant-power loads, \(P_{d}^{pn}\in\mathbb{R}^{(2l-2)\times 1}\) is a vector that contains monopolar constant-power terminals, and \(\mathbf{J}\in\mathbb{R}^{(2l-2)\times(2l-2)}\) and \(\mathbf{M}\in\mathbb{R}^{(2l-2)\times(2l-2)}\) are the identity matrix and an auxiliary matrix that allow the calculation of the voltage differences for bipolar constant-power terminals. Equations (10) and (11) allow the generalization of the currents in (6) and (7), as presented below:  
\[i_{dE}^{pn} =2\operatorname{diag}^{-1}\left(V_{d}^{pn,t}\right)P_{d}^{pn}- \operatorname{diag}^{-2}\left(V_{d}^{pn,t}\right)\operatorname{diag}\left(P_ {d}^{pn}\right)V_{d}^{pn,t+1} \tag{12}\] \[i_{dC}^{pn} = \begin{bmatrix}2\operatorname{diag}^{-1}\left(\left(\mathbf{J}- \mathbf{M}\right)V_{d}^{pn,t}\right)P_{d}^{pn-np}-\\ \operatorname{diag}^{-2}\left(\left(\mathbf{J}-\mathbf{M}\right)V_{d}^{pn,t} \right)\operatorname{diag}\left(P_{d}^{pn-np}\right)\left(\mathbf{J}- \mathbf{M}\right)V_{d}^{pn,t+1}\end{bmatrix}  \tag{13}\]  
where \(\mathbf{V}_{d}^{pn,t}\) is a linearized vector with the voltage at the iteration \(t\). If Equations (12) and (13) are replaced in Equation (9), then a recursive power flow formula is derived for the bipolar power flow problem with the neutral cable solidly grounded, as presented in Equation (14). \[ \begin{bmatrix}-G_{ds}^{pn}V_{s}^{pn}-G_{dd}^{pn}V_{d}^{pn,t+1}+\operatorname{ diag}^{-2}\!\left(V_{d}^{pn,t}\right)\operatorname{diag}\!\left(P_{d}^{pn}\right)V_{d}^{pn,t+1} +\\ \operatorname{diag}^{-2}\!\left(\mathbf{J}-\mathbf{M}\right)V_{d}^{pn,t} \operatorname{diag}\!\left(P_{d}^{pn-np}\right)\!\left(\mathbf{J}-\mathbf{M} \right)V_{d}^{pn,t+1}-\\ 2\operatorname{diag}^{-1}\!\left(V_{d}^{pn,t}\right)P_{d}^{pn}-2\operatorname{ diag}^{-1}\!\left(\mathbf{J}-\mathbf{M}\right)V_{d}^{pn,t}\right)P_{d}^{pn-np} \end{bmatrix} =0 \tag{14}\]  
Finally, if we rearrange Equation (14) to obtain a general expression for \(V_{d}^{pn,t+1}\), the following general power flow formula is reached:  
\[V_{d}^{pn,t+1}=-\!\left[G_{\exp}^{pn}\left(V_{d}^{pn,t}\right)\right]^{-1} \begin{bmatrix}G_{ds}^{pn}V_{s}^{pn}+2\operatorname{diag}^{-1}\!\left(V_{d}^{ pn,t}\right)P_{d}^{pn}-\\ 2\operatorname{diag}^{-1}\!\left(\left(\mathbf{J}-\mathbf{M}\right)V_{d}^{pn, t}\right)P_{d}^{pn-np}\end{bmatrix} , \tag{15}\]  
where  
\[G_{\exp}^{pn}\!\left(V_{d}^{pn,t}\right)= \begin{bmatrix}G_{dd}^{pn}- \operatorname{diag}^{-2}\!\left(V_{d}^{pn,t}\right)\operatorname{diag}\!\left( P_{d}^{pn}\right)-\\ \operatorname{diag}^{-2}\!\left(\left(\mathbf{J}-\mathbf{M}\right)V_{d}^{pn,t }\right)\operatorname{diag}\!\left(P_{d}^{pn-np}\right)\!\left(\mathbf{J}- \mathbf{M}\right)\end{bmatrix} \]  
Note that the recursive power flow Formula (15) is evaluated from the initial point \(t=0\) by assigning the voltage at each node that is equal to the substation bus until the convergence criterion is met:  
\[\max\!\left\{\left\|\left|V_{d}^{pn,t+1}\right|-\left|V_{d}^{pn,t}\right| \right\|\right\}\leq\varepsilon, \tag{16}\]  
where \(\varepsilon\) is the acceptable tolerance.