# Compliance of Distribution System Reactive Flows with Transmission System Requirements
## 2 Problem Formulation
### Model Formulation  
The power flow equations of the distribution network are represented through the LinDistFlow model [20,22] which is a convex formulation. The set of distribution nodes is denoted by \(\mathcal{I}^{+}\), while the subset \(\mathcal{I}\) does not include the root node. As our network is radial, we can also denote the set of branches as \(\mathcal{I}\). We denote by \(j_{i}\) the branch ending at node \(i\). Finally, we denote by \(a_{i}\) the parent node of node \(i\) and by \(K_{i}\) the set of children nodes of node \(i\). Figure 2 is used to describe the LinDistFlow model. At every time step \(\tau\) of the overall control session \(\mathcal{T}\), we have a new horizon \(T_{\tau}\), where \(t\in T_{\tau}\). Thus, the following optimisation problem is solved:  
\[\min_{\mathbf{q},\overline{Q}_{1},\mathbf{Q},\mathbf{V}} J_{\tau}=\text{objective function (discussed in detail later in this section)} \tag{7}\] \[s.t: q_{i,t}^{min}\leq q_{i,t}\leq q_{i,t}^{max},\ \forall i,t\in\mathcal{I},T_{\tau}\] (8) \[P_{i,t}=P_{i,t}^{L}+\sum_{k\in K_{i}}P_{i+k,t},\ \forall i,t\in \mathcal{I},T_{\tau}\] (9) \[Q_{i,t}=Q_{i,t}^{L}+q_{i,t}+\sum_{k\in K_{i}}Q_{i+k,t},\ \forall i,t\in \mathcal{I},T_{\tau}\] (10) \[P_{i,t}^{2}+Q_{i,t}^{2}\leq\overline{P}_{i}^{2},\ \forall i,t\in \mathcal{I},T_{\tau}\] (11) \[V_{i,t}=V_{i-1,t}-2(r_{i}P_{i,t}+x_{i}Q_{i,t}),\ \forall i,t\in \mathcal{I}^{+},T_{\tau}\] (12) \[\underline{V}_{i}^{2}\leq V_{i,t}\leq\overline{V}_{i}^{2},\ \forall i,t\in \mathcal{I}^{+},T_{\tau}\] (13) \[\hat{P}_{1,\tau}=\frac{(\tau-1)\hat{P}_{1,\tau-1}}{\tau}+\frac{P_ {1,t}}{\tau}\] (14) \[\hat{Q}_{1,\tau}=\frac{(\tau-1)\hat{Q}_{1,\tau-1}}{\tau}+\frac{Q_ {1,t}}{\tau}\] (15) \[\overline{P}_{1,\tau}=\hat{P}_{1,\tau}+\frac{\sum_{t=2}^{T_{\tau} }P_{1,t}}{T_{\tau}-1}\] (16) \[s.t: q_{i,t}^{min}\leq q_{i,t}\leq q_{i,t}^{max},\ \forall i,t\in\mathcal{I},T_{\tau}\]0  
where, as already explained, \(q_{i,t}\) is the reactive power support from DER, and \(\mathit{min},\mathit{max}\) its \(\min/\max\) values. \(P_{i,t}^{L},Q_{i,t}^{L}\) are the active and reactive power injection. \(\overline{F}\) are the complex power line limits and \(\underline{V},\overline{V}\) the voltage limits. \(V_{i}\) is the square of the voltage on each bus \(i\) and \(i-1\), the parent bus of \(i\) with \(r_{i},x_{i},P_{i},Q_{i}\) denoting the resistance, reactance, active and reactive power flow on that line from the parent of \(i\) to \(i\), see \[s.t: q_{i,t}^{min}\leq q_{i,t}\leq q_{i,t}^{max},\ \forall i,t\in\mathcal{I},T_{\tau}\]1 \(\hat{P}_{1,\tau},\hat{Q}_{1,\tau}\)  
\[s.t: q_{i,t}^{min}\leq q_{i,t}\leq q_{i,t}^{max},\ \forall i,t\in\mathcal{I},T_{\tau}\]2 Illustration of part of the distribution network. are the average active and reactive power, respectively, that has been exchanged with the transmission system until time period \(t\) and \(\overline{P}_{1,\tau},\overline{Q}_{1,\tau}\) the projected average power exchange over the entire control session. \(\mathcal{I},\mathcal{I}^{+},\mathcal{K}_{i},T_{\tau}\) are the sets of nodes with and without the parent node, children of node \(i\) and time periods of the optimisation horizon. Equation (8) defines the limits of reactive power injection, Equation (9) describes the power balance on each node, (10) the corresponding reactive power balance, (11) the limits on branch complex power flow, (12) the voltage magnitude on each node and (13) its bounds. Equations (14) and (15) illustrate the state variables \(\overline{P}_{1,t},\overline{Q}_{1,t}\) as the average active and reactive power flow through the root node until time period \(\tau\) and (16) and (17) the projected average over all of the control session. Compared to (1)-(6), one can observe that (3) is missing from (7)-(17). This is because the requirements of Figure 1 are introduced as soft constraints inside the objective function.