# Optimal Management of High-Voltage Line Congestions Using Power Source Redispatching
## 3 Description of the Research Methodology
The essence of the method is to determine the vector of nodal flow \(\mathbf{P}\) and its distribution matrix \(\mathbf{A_{\mathrm{u}}}\), which relates nodal flows to specific powers of \(\mathbf{P_{\mathrm{G}}}\) sources, according to the following equation [61]:  
\[\mathbf{A_{\mathrm{u}}}\cdot\mathbf{P}=\mathbf{P_{\mathrm{G}}} \tag{1}\]  
As a result of the inversion, nodal powers are determined, according to the following relationship:  
\[\mathbf{P}=\mathbf{A_{\mathrm{u}}}^{-1}\mathbf{P_{\mathrm{G}}} \tag{2}\]  
Power flowing through branch \(i\)-\(l\), can be determined from the following relation:  
\[P_{il}\approx\frac{P_{il}}{P_{l}^{\Rightarrow}}\cdot\sum_{k\in N}{a^{\prime}} _{uik}\cdot P_{\mathrm{Gk}}=\sum_{k\in N}\left(u_{il,k}\cdot P_{\mathrm{Gk}} \right)=u_{il,1}\cdot P_{\mathrm{G1}}+u_{il,2}\cdot P_{\mathrm{G2}}+\ldots+u_{ il,N}\cdot P_{\mathrm{GN}} \tag{3}\]  
Figure 1: General algorithm of the proposed calculation methodology. Based on this method, the coefficient \(u_{i,k}\) is determined, which is the share of the source connected in node \(k\) in the load of branch \(i\)-\(l\). The coefficient \(u_{i,k}\) is determined from the following relationship [61]:  
\[u_{i,k}=\frac{P_{i\!l}}{P_{i}^{\Rightarrow}}\cdot a^{\prime}u_{ik} \tag{4}\]  
where \(P_{i}^{\Rightarrow}\) means active power flowing through node \(i\), and \(a^{\prime}u_{ik}\) means the expressions of the matrix \(\mathbf{A}_{\mathrm{u}}^{-1}\), which is the inverse matrix of the matrix \(\mathbf{A}_{\mathrm{u}}\), the expressions of which \(a_{uik}\) are determined from the following formula [61]:  
\[a_{uik}= \begin{cases}1,&i=k\\ -\frac{|P_{k}|}{P_{k}^{\Rightarrow}},&P_{k}^{\Rightarrow}\
eq 0\\ 0,&\text{in other cases}\end{cases}  \tag{5}\]  
where \(P_{ki}\) is the active power in branch \(i\)-\(k\) (taken from node \(k\)), and \(P_{k}^{\Rightarrow}\) is the active power flowing through node \(k\). This quantity means the sum of power flows towards node \(k\). For further calculations, the sources whose \(u_{i,k}\) participation coefficients are the largest are selected. In the second step, optimization calculations are performed using one of the meta-heuristic optimization methods. The objective functions (\(F_{\mathrm{obj1}}(\mathbf{x})\), \(F_{\mathrm{obj2}}(\mathbf{x})\)) are proposed to maximize the total power in RESs (the number of which is N), according to the following formulas:  
\[F_{\mathrm{obj1}}(\mathbf{x})=\sum_{j=1}^{N}P_{\mathrm{C}j}=P_{\mathrm{G1}}+P_{ \mathrm{G2}}+\ldots+P_{\mathrm{GN}} \tag{6}\]  
\[F_{\mathrm{obj2}}(\mathbf{x})=\sum_{j=1}^{N}w_{j}\cdot P_{\mathrm{G}j}=w_{1}\cdot P _{\mathrm{G1}}+w_{2}\cdot P_{\mathrm{G2}}+\ldots+w_{N}\cdot P_{\mathrm{GN}} \tag{7}\]  
where \(\mathbf{x}\) is a vector of decision variables that contains the values of active powers (\(P_{Gj}\)) generated in the RESs, and \(w_{j}\) is weights whose values are given later in the article (in Section 4.2). This form of the objective function ensures the maximization of the total power generated in RESs, while eliminating power line overloads. As a result, this means a minimal reduction of the current total generation in RESs. The optimal power distribution is sought, in the sources indicated in the first step, which ensures minimal power limitation. Thus, the load shedding effect is achieved at the lowest possible cost of power redispatching. The optimization task is, therefore, to maximize the objective function by finding the optimal value of the vector \(\mathbf{x}\), as follows:  
\[F_{\mathrm{obj}}(\mathbf{x})\Rightarrow\max \tag{8}\]  
while meeting the equality and inequality constraints according to the following formulas:  
\[