## 3 Proposed Approach
### For Single DG Interconnection
To obtain the value of \(|\textbf{{I}}_{2}|\) which gives the minimum power losses, the power losses formula is derived as:  
\[\frac{dP_{Loss}}{d|\textbf{{I}}_{2}|}=6|\textbf{{I}}_{2}|(R_{1}+R_{2}+R_{3})+6((| \textbf{{I}}_{L2}|R_{3})-(|\textbf{{I}}_{L1}|R_{1}))=0 \tag{11}\]  
By solving Equation (11), \(|\textbf{{I}}_{2}|\) is obtained as:  
\[|\textbf{{I}}_{2}|=\frac{|\textbf{{I}}_{L1}|R_{1}-|\textbf{{I}}_{L2}|R_{3}}{R_ {1}+R_{2}+R_{3}} \tag{12}\]  
The ratio (\(\Re\)) between \(|\textbf{{I}}_{2}|\) and \(|\textbf{{I}}_{1}|\) can be defined as the ratio of the current fed from the DG to the current fed from the substation and it can be calculated as:  
\[\Re=\frac{|\textbf{{I}}_{2}|}{|\textbf{{I}}_{1}|}=\frac{|\textbf{{I}}_{2}|}{| \textbf{{I}}_{L1}-\textbf{{I}}_{2}|} \tag{13}\]  
The ratio (\(\gamma\)) can be defined as the ratio of the current fed from the DG to the specific load total current and it can be calculated as:  
Figure 2:0  
The ratio (\(\gamma\)) can be also considered as the percentage of the power of the critical bus which is fed from the DG; \(\gamma\) can be also obtained as represented in Equation (16). Figure 2:1  
Figure 2:2  
For the general case when the DG is inserted at a generic bus in the system (bus number \(n\)) and the critical bus is at bus \(m\) (where \(m<n\)), and the total number of buses is N, the following calculations are performed:  
Figure 2:3  
where,  
\[C_{i}= \begin{cases}\sum_{j=i}^{m-1}\textbf{{I}}_{Lj}|&1<i\leq m-1\\ -\sum_{j=i}^{n-1}\textbf{{I}}_{Lj}|&m\leq i<n-1\end{cases}  \tag{18}\]  
The total active power, reactive power, and power factor of the DG which is inserted at bus \(n\) can be calculated by Equations (19)-(21) respectively. \[P_{DGn}=\sum_{i=m+1}^{N}P_{Li}+(\gamma\times P_{Lm}) \tag{19}\]  
Figure 4: Sample of distribution network used for current derivation. \[Q_{DGn}=\sum_{i=m+1}^{N}Q_{Li}+(\gamma\times Q_{Lm}) \tag{20}\]  
\[PF_{DGn}=\cos(\tan^{-1}\!\left(\frac{Q_{DGn}}{P_{DGn}}\right)) \tag{21}\]  
where \(P_{DGn}\), \(Q_{DGn}\), and \(PF_{DGn}\) are the optimal active power, optimal reactive power, and optimal power factor of DG when it is inserted at bus number \(n\) respectively. \(P_{Li}\), \(Q_{Li}\) are the active and reactive power of the load connected to the bus number \(i\). Also, \(P_{Lm}\) and \(Q_{Lm}\) are the active and reactive power of the load connected to the critical bus \(m\). After determining the penetration level of the DG unit, the power losses, which are due to the current supplied from the DG (after the critical bus to the last bus), are added to the penetration level of the DG in order to let the DG to be able to deliver the current to these loads. Then, after assessing the optimal penetration level of the DG at each bus in the network, the optimal location that minimizes the power losses in the network can be evaluated. Finally, the performance of DG-integrated distribution system is investigated and the exact value of the total power losses is calculated based on the accurate model using power flow equations. If the system has a sub-branch, such as the distribution network shown in Figure 5 where the sub-branch is in bus \(s\), the system should be divided into three regions. If the DG is desired to be installed at bus \(sn\), the first region is from bus \(sn\) to bus \(sx\); which is preferred to be fed from the DG. While, the second region is from bus 2 to bus \(s\) and from bus \(s\) to bus \(sI\), in this case the same procedure for the second region in the normal case which is without sub-branches is proceeded. The third region is from bus \(s+1\) to bus \(y\); these three regions are illustrated in Figure 5. In this particular, the resistance of the distribution lines from the substation to bus \(s\) and the resistance of the distribution lines from the DG to bus \(s\) are compared and the minimum resistance between these two resistances is chosen in order to reduce the power losses.