# Compliance of Distribution System Reactive Flows with Transmission System Requirements
## 2 Problem Formulation  
### Problem Definition  
According to the TSO requirement, reactive power flow \(Q\) via the primary DN substation (110 kV to 21 kV) should be confined within some specified limits, as shown in Figure 1. This limitation is applied to the hourly average reactive power exchange. This means that at the end of an hourly period the average reactive power through the root node of the DN (\(\overline{Q}_{1}\)), is constrained according to Figure 1. The upper and lower limits of \(\overline{Q}_{1}\) are a function of the corresponding average active power (\(\overline{P}_{1}\)). In case these limits are violated, the DSO is penalised. The reactive power exchanged between the TN and the DN is affected by the reactive power consumed or produced by the loads, generating DERs, and the capacitance of the lines which is usually small in overhead lines, but significant in cables at low load. We assume that the DSO is allowed to control the reactive power absorbed/injected by DERs. Usually, grid codes mandate that DERs provide reactive power support, and this support does not entail additional costs to DSOs. Moreover, the DSO has to consider the physical constraints of the network, namely, line and voltage limits. We model the network using the LinDistFlow Equation [20]. The reactive power exchange requirements define an hourly time period for which the control goal is set. This period, lasting one hour, is called a **control session** and each day has 24 such sessions. Each of them is divided into a set, denoted by \(\mathcal{T}\), of time steps indexed by \(\tau\). Thus, \(\tau\in\{1,\ldots,|\mathcal{T}|\}\) or, equivalently, \(\tau\in\mathcal{T}\). In this study, there are 12 time steps in an hour. One control action is performed at every time step, i.e., one action every 5 min. Figure 1: TSO guidelines regarding power exchange with a DN. Input stands for exporting power from the distribution to the transmission and output stands for export [10]. The overall optimisation goal is to minimise the violation of the hourly average reactive power exchange limits, which are imposed by the TSO requirements of Figure 1[10]. First, we outline the basic characteristics of the problem with the help of Equations (1)-(6). We further denote by \(q_{i,\tau}\) the decision variable which represents the DER reactive power support at node \(i\) and time step \(\tau\). A generic description of the overall problem is the following:  
\[\min_{\mathbf{q}}\left(\overline{Q}_{1}\text{ limits violation}\right) \tag{1}\] \[\text{network equations}\] (2) \[\Phi^{\min}(\overline{P}_{1})\leq\overline{Q}_{1}\leq\Phi^{\max} (\overline{P}_{1})\] (3) \[\overline{P}_{1}=\frac{1}{|\mathcal{T}|}\sum_{\tau\in\mathcal{T}} P_{1,\tau}\] (4) \[\overline{Q}_{1}=\frac{1}{|\mathcal{T}|}\sum_{\tau\in\mathcal{T}} Q_{1,\tau}\] (5) \[q_{i}^{\min}\leq q_{i,\tau}\leq q_{i}^{\max},\ \forall i\in \mathcal{I},\tau\in\mathcal{T} \tag{6}\]  
where bold letters denote vectors. \(P_{1,\tau}\) and \(Q_{1,\tau}\) are the active and reactive power exchange through the root node of the DN, respectively. \(\overline{P}_{1}\) and \(\overline{Q}_{1}\) are their average values over the control session (here, an hour). \(\Phi^{min}\) and \(\Phi^{max}\) are functions of \(\overline{P}_{1}\) that define the limits on reactive power exchange and are dictated by Figure 1. Finally, \(q_{i}^{min}\) and \(q_{i}^{max}\) are the lower and upper limits of the reactive power support output of DER at node \(i\). Please note that model (1)-(6) serves as an aid for explaining key parts of the model and is not to be confused with the main model.The objective function of the problem is not discussed at this point, as it will be elaborated later in this section, but is based on a transformation of constraint (3).