## 3 Proposed Approach
### For Single DG Interconnection  
Consider a distribution system shown in Figure 2, assuming that the DG is inserted at bus number \(n\). Hence, the system can be divided into two regions; the first region is from bus \(n\) to the last bus of the system, while the second region is from the second bus (after the slack bus) to the bus before the DG (\(n-1\)). The loads in the first region are preferred to be fed from the DG, in order to minimize the resistance of distribution line which the current passes through, therefore the power losses are minimized in the system. In the second region, the source of the power flowing to each load should be tested, in order to check if it should be fed from the substation or from the DG, depending on the resistance which minimizes the power losses. The last bus in which the resistance of the distribution lines from the \begin{table}
\begin{tabular}{c c} \hline
**DG Type** & **Type Description** \\ \hline Type 1 & DG injecting P and Q \\ Type 2 & DG injecting P and requiring Q \\ Type 3 & DG injecting only P \\ Type 4 & DG injecting only Q \\ \hline \end{tabular}
\end{table} 
Table 1: Major types of DG based on power delivering capability. \begin{table}
\begin{tabular}{c c c c} \hline
**DG Type** & **PF\({}_{DGi}\)** & **Sign** & \(\boldsymbol{c}\) \\ \hline Type 1 & \(0<PF_{\text{DG}}<1\) & \(+1\) & constant \\ Type 2 & \(0<PF_{\text{DG}}<1\) & \(-1\) & constant \\ Type 3 & \(PF_{\text{DG}}=1\) & \(+1\) & \(0\) \\ Type 4 & \(PF_{\text{DG}}=0\) & \(+1\) & \(\infty\) \\ \hline \end{tabular}
\end{table} 
Table 2: The \(c\) Parameters for the major types of DG. Figure 2: Single line diagram of a simple distribution system. substation to this bus is smaller than the resistance of the distribution lines from this bus to the DG can be defined as the critical bus. The load at this bus is fed from both the DG and the substation by a certain ratio which gives minimum power losses in the branches surrounding this bus. Figure 3 represents the flowchart for the proposed algorithm which is used for finding the critical bus when the DG is installed at each bus; also the equations that are used to determine the ratio of power supplied from the DG and substation to the critical bus are presented and derived in the following paragraphs. After determining the critical bus when the DG is installed at each bus, optimal active power and reactive power of the DG that minimize the power losses in the network can be derived and achieved. Consider a distribution system shown in Figure 4 which represents a simple case where the DG is inserted at bus 4, and assumed that the critical bus is found at bus 2, [PERSON]'s current law is applied at each bus and Equations (7) and (8) can be obtained. \[\mathbf{I}_{1}=\mathbf{I}_{L1}-\mathbf{I}_{2} \tag{7}\]  
\[\mathbf{I}_{3}=\mathbf{I}_{L2}+\mathbf{I}_{2} \tag{8}\]  
where \(\mathbf{I}_{\text{ch}}\) is the rms phasor current in the branch \(ch\), and \(\mathbf{I}_{\text{Li}}\) is the rms phasor current at the load connected to the bus \(i\). \[P_{Loss}=3|\mathbf{I}_{2}|^{2}R_{2}+3|\mathbf{I}_{3}|^{2}R_{3}+3|\mathbf{I}_{1}|^{2}R_{1} \tag{9}\]  
\[P_{Loss}=3|\mathbf{I}_{2}|^{2}R_{2}+3|\mathbf{I}_{L2}+\mathbf{I}_{2}|^{2}R_{3}+3|\mathbf{I}_{L 1}-\mathbf{I}_{2}|^{2}R_{1} \tag{10}\]  
where \(P_{Loss}\) is the total power losses, and \(R_{i}\) is the resistance for branch \(i\). Figure 3: Flowchart to obtain the critical bus in any desired region.