## 2 Problem Formulation  
### Modeling of DSTATCOM  
In radial distribution systems, each receiving bus is supplied by a single sending bus. Figure 1 illustrates a section wherein the DSTATCOM is planned to be installed:  
The voltage value at the receiving node is computed using [PERSON]'s voltage law (KVL), as follows:  
\[V_{i+1}\angle\theta_{i+1}=V_{i}\angle\theta_{i}-\left(r_{i,i+1}+jx_{i,i+1} \right)I_{i,j+1}\angle\delta_{i,i+1} \tag{1}\]  
where the bus voltages for nodes \(i\) and \(i+1\) are represented by \(V_{i}\) and \(V_{i+1}\), and the associated phase angles for these nodes are given by \(\theta_{i}\) and \(\theta_{i+1}\). \(I_{i,j+1}\) represents the current flowing from node \(i\) to node \(i+1\), and its phase angle is denoted by \(\delta_{i,i+1}\). The resistance and reactance for this branch are indicated by \(r_{i,i+1}\) and \(x_{i,i+1}\), respectively.  
After the DSTATCOM installation, the candidate bus's voltage profile and all other buses will change to a new value, as shown in Figure 2.  
Consequently, the updated KVL equation for the compensated bus may be expressed as follows:  
\[V^{\prime}{}_{i+1}\angle\theta^{\prime}{}_{i+1}=V_{i}\angle\theta_{i}-\left(r _{i,i+1}+jx_{i,i+1}\right)\times\left[I_{i,i+1}\angle\delta_{i,i+1}+I_{DSTAT} \angle\psi\right] \tag{2}\]  
The DSTATCOM may generate or consume reactive power but does not contribute to active power in steady-state conditions. Consequently, the current injected by the DSTATCOM is in quadrature with the voltage of the compensated bus. This relationship is illustrated in the Vector Representation of Voltage and Current Phasors shown in Figure 3. The correlation can also be expressed in the following equation:  
\[\psi=\theta^{\prime}{}_{i,i+1}+\frac{\pi}{2} \tag{3}\]  
Figure 1: Before installing DSTATCOM.  
Figure 2: After installing DSTATCOM.  
In this study, DSTATCOM is treated as a current source. When the voltage magnitude of the DSTATCOM is greater than that of the compensated node, the current flows toward the node. Conversely, if the voltage magnitude of the DSTATCOM is less than the compensated node's voltage, the current flows in the opposite direction. The expression for the injected current of the DSTATCOM is expressed as follows:  
\[I_{DSTAT}=\left(\frac{-jQ_{DSTAT}}{V_{DSTAT}}\right)^{*}=\left|\frac{Q_{DSTAT}} {V_{DSTAT}}\right|\angle\theta^{\prime}_{i,i+1}+\frac{\pi}{2} \tag{4}\]  
Assuming the magnitude of the DSTATCOM voltage \(V_{DSTAT}\) to be 1.0 p.u., the only unknown variable in Equation (4) is \(\theta^{\prime}_{i,i+1}\). Determining its value requires substituting Equation (4) into Equation (2). After some algebraic manipulations [14], the result is:  
\[X_{1}=\left[\frac{K_{1}\Big{(}1-C_{2}\Big{|}\frac{Q_{DSTAT}}{V_{DSTAT}}\Big{|} \Big{)}+K_{2}C_{1}\Big{|}\frac{Q_{DSTAT}}{V_{DSTAT}}\Big{|}}{\Big{(}1+C_{2} \Big{|}\frac{Q_{DSTAT}}{V_{DSTAT}}\Big{|}}\Big{)}^{2}+C_{1}C_{2}\Big{|}\frac{Q _{DSTAT}}{V_{DSTAT}}\Big{|}^{2}\right]\times\left[\frac{1}{V^{\prime}_{i+1}}\right] \tag{5}\]  
\[X_{2}=\left[\frac{K_{2}\Big{(}1+C_{2}\Big{|}\frac{Q_{DSTAT}}{V_{DSTAT}}\Big{|} \Big{)}+K_{2}C_{1}\Big{|}\frac{Q_{DSTAT}}{V_{DSTAT}}\Big{|}}{\Big{(}1+C_{2} \Big{|}\frac{Q_{DSTAT}}{V_{DSTAT}}\Big{|}}\Big{)}^{2}+C_{1}C_{2}\Big{|}\frac{Q _{DSTAT}}{V_{DSTAT}}\Big{|}^{2}\right]\times\left[\frac{1}{V^{\prime}_{i+1}}\right] \tag{6}\]  
where:  
\(K_{1}=\Re\{V^{\prime}_{i,i+1}\angle\theta^{\prime}_{i,i+1}-(r_{i,i+1}+jx_{i, i+1})\times l^{\prime}_{i,i+1}\angle\delta_{i,i+1}\}\)  
\(K_{2}=\Im m\{V^{\prime}_{i,i+1}\angle\theta^{\prime}_{i,i+1}-(r_{i,i+1}+jx_{i, i+1})\times l^{\prime}_{i,i+1}\angle\delta_{i,i+1}\}\)  
\(C_{1}=-r_{i,i+1}\), \(C_{2}=-x_{i,i+1}\).  
The value of \(\theta^{\prime}_{i+1}\) may be determined by using either Equation (7) or Equation (8).  
\[\theta^{\prime}_{t+1}=\cos^{-1}(X_{1}) \tag{7}\]  
\[\theta^{\prime}_{t+1}=\sin^{-1}(X_{2}) \tag{8}\]