# An Improved Mixed AC/DC Power Flow Algorithm in Hybrid AC/DC Grids with MT-HVDC Systems
## 2 Principles of Power Flow in Power Systems  
### AC Grid Power Flow  
The main objective of the AC PF is to determine the magnitude and angle at each bus of the AC grids. In order to analyze the AC PF in power systems, the following assumptions are considered.  
* The AC transmission networks have fast dynamics compared to the other components. In this regard, AC transmission networks can be represented by algebraic equations.
* Each transmission line and transformer is modeled by an equivalent \(\pi\) model.
* The power in AC grids is balanced.
* The positive sequence parameters on a per-phase basis are assumed.  
Accordingly, the network equations can be written as follows:  
\[\left[\begin{array}{c}\vec{I}_{1}\\ \vec{I}_{2}\\ \vdots\\ \vec{I}_{i}\\ \vec{I}_{n_{AC}}\end{array}\right]=\left[\begin{array}{cccccc}\overline{Y} _{11}&\overline{Y}_{12}&\dots&\overline{Y}_{1i}&\dots&\overline{Y}_{1n_{AC}} \\ \overline{Y}_{21}&\overline{Y}_{22}&\dots&\overline{Y}_{2i}&\dots&\overline{Y}_ {2n_{AC}}\\ \vdots&\vdots&\vdots&\vdots&\vdots&\vdots\\ \overline{Y}_{i1}&\overline{Y}_{22}&\dots&\overline{Y}_{ii}&\dots&\overline{Y }_{in_{AC}}\\ \vdots&\vdots&\vdots&\vdots&\vdots&\vdots\\ \overline{Y}_{n_{AC}1}&\overline{Y}_{n_{AC}2}&\dots&\overline{Y}_{n_{AC}i}& \dots&\overline{Y}_{n_{AC}n_{AC}}\end{array}\right]\left[\begin{array}{c} \overline{V}_{1}\\ \overline{V}_{2}\\ \vdots\\ \overline{V}_{i}\\ \vdots\\ \overline{V}_{n_{AC}}\end{array}\right] \tag{1}\]  
where \(\overline{I}_{i}\) and \(\overline{V}_{i}\,=\,V_{i}e^{|\theta_{i}}\) are the injected current and voltage at the \(i\)th node, \(\overline{Y}_{ii}\) is the self-admittance at the \(i\)th node, \(\overline{Y}_{ij}\) is the mutual admittance between nodes \(i\) and \(j\), and \(n_{AC}\) represents the total number of buses in the AC grid.  
The voltage of each node can be used for solving the equation of \(\left[\overline{I}\right]-\left[\overline{Y_{bus}}\right]\left[\overline{V} \right]=0\). The injected current at the \(i\)th node is related to the injected power and bus voltage at that node and it can be calculated as follows:  
\[\overline{I}_{i}=\frac{P_{i}-jQ_{i}}{\overline{V}_{i}} \tag{2}\]  
Considering the operational constraints in power systems, the PF problem becomes nonlinear, and the nodes in AC grids can be classified into four types:  
* Slack bus where the voltage magnitude (\(V_{i}\)) and angle (\(\theta_{i}\)) are determined.
* PV bus where the active power (\(P_{i}\)) injected to the grid and the voltage magnitude (\(V_{i}\)) are known.
* PQ bus where the active power and reactive power (\(Q_{i}\)) injected into the grid are known.
* MT-HVDC Point of Common Coupling (PCC) bus where different constraints based on the control mode of each converter station are applied.  
From Equation (1), the injected current at the \(i\)th node (without considering the PCC buses of MT-HVDC systems) can be written as follows:  
\[\overline{I}_{i}=\sum_{j=1}^{n_{AC}}\overline{Y_{ij}V_{j}} \tag{3}\]Therefore, the active and reactive power injected to the grid can be derived as follows:  
\[P_{i}=\sum_{j=1}^{n_{A,C}}V_{i}V_{j}\Big{[}C_{ij}\cos\left(\theta_{i}-\theta_{j} \right)+B_{ij}\sin\left(\theta_{i}-\theta_{j}\right)\Big{]} \tag{4}\]  
\[Q_{i}=\sum_{j=1}^{n_{A,C}}V_{i}V_{j}\Big{[}G_{ij}\sin\left(\theta_{i}-\theta_{j }\right)-B_{ij}\cos\left(\theta_{i}-\theta_{j}\right)\Big{]} \tag{5}\]  
where \(\overline{Y}_{ij}=G_{ij}+jB_{ij}\).  
It should be noted that a generator can be either a slack bus or a PV bus, and a load can be a PQ bus with known active and reactive power.