*3.2. Constraints*

Two types of constraints are included: technical and economic. Technical constraints include power balances in grid nodes (16), power lines capacity (17) and nodal voltage limitations (18).

$$\sum\_{t \in T} \sum\_{n \in N} \left\{ \sum\_{l \in L} (Load\_{n,l} \ast P\_{l,t}^{DEM}) \right\} - P\_t^{\text{res}} + TS\_t^{\text{cnchungs}} + PF\_{n,w,t} = 0 \tag{16}$$

$$\begin{array}{cccc} \vee & \vee & \vee \\ t \in T & n, w \in N \end{array} \quad - \text{Line.const}\_{n,w} \leq \text{PF}\_{n,w,t} \leq \text{Line.const}\_{n,w} \tag{17}$$

∀ *t* ∈ *T* ∀ *<sup>n</sup>* <sup>∈</sup> *<sup>N</sup>* 0.9 <sup>∗</sup> *Unominal* <sup>≤</sup> *Un*,*<sup>t</sup>* <sup>≤</sup> 1.1 <sup>∗</sup> *Unominal* (18)

In the model, there are also assumed constraints related to the operation of energy storages like: level of charge, which depends on energy exchange between energy storage and node and efficiency of this exchange.

$$m \in \mathcal{N}, \; \forall t \in T \; \mathcal{CL}\_{n,t} = \mathcal{CL}\_{n,t-1} + \eta^{\mathcal{ES}} \ast p\_{n,t}^{do \to S} - \left(\frac{1}{\eta^{\mathcal{ES}}}\right) \ast p\_{n,t}^{\tau \mathcal{ES}} \tag{19}$$

The model assumes that annual energy production minus total losses in lines must be equal or greater than the assumed share (*k*) in the annual demand in the distribution system (20).

$$\sum\_{n \in \mathcal{N}} \left\{ \sum\_{d \in D} E\_{n,d} - \sum\_{t \in T} P\_t^{\text{losses}} \right\} \ge k \ast \sum\_{n \in \mathcal{N}} \left\{ \sum\_{l \in L} \left( \sum\_{t \in T} \boldsymbol{Load}\_{n,l} \ast P\_{l,t}^{\text{DEM}} \right) \right\} \tag{20}$$

## **4. Assumptions**

Since the model includes natural (non-negative integer) and real variables and all functions are linear, the optimization problem is modeled as a Mixed Integer-Linear Programming (MILP). The natural variable *pn,d,r* indicates the type of RES selected from the set of three technologies *D*: PV systems, wind turbines and biogas thermal units (21).

$$D = \langle d\_1, d\_2, d\_3 \rangle = \langle pv, wt, bg \rangle \tag{21}$$

The rated power of each type of the RES is retrieved from the impact assessment to polish regulation on renewable energy sources from 2015 [51], displayed in Table 1**.** In the case of PV, the author realized that due to modular structure, PV systems are fully configurable, although they are assumed as three predefined values, to reduce the calculation effort. Nevertheless, the method allows for the application of any set of parameters.


**Table 1.** Rated power of the renewable energy sources (RES).

There was one assumed type of energy storage with a capacity of 10 kWh, power of 5 kW and efficiency of energy exchange with the grid on the level of 90%.

Generation profiles are divided into three parts of the year: summer, winter and spring/autumn together. For each part of the year, there were created two profiles for WT and PV (high and low generation) based real data retrieved from the website of German and PolishTSOs. Generation profile for BG is assumed as constant for the whole year.

Three types of loads are included: residential, commercial and industrial. Each type of load is also characterized by a different energy consumption profile. Consumption profiles are also divided into three parts of the year and for each part, two profiles were created for working and non-working days. Load location is predefined (Figure 2).

**Figure 2.** Structure of loads connected to the benchmark network model. Own study.

Simulations were carried out for twenty-four representative days which were created as a total combination of generation profiles and consumption profiles, and according to real data, there was an analysis of how many times each combination occurred in the year, and based off of this, the whole year is modeled.

The modified MV benchmark network model consisting of eleven nodes is used for the simulation—Figure 3. Lines are characterized as connections between nodes, and for each of them, capacity and resistance are assumed. There is one exception, which is between nodes one and two and it is a transformer which connects the transmission (node 1) and the distribution system (node 2). The resistance for the transformer is assumed as 0 ohms, because this part of the system is not the aim of this research.

**Figure 3.** Benchmark model of medium voltage distribution network.

Power lines capacity and resistance are taken from the real data—Table 2.


**Table 2.** Power lines parameters.

\* resistance of a power transformer is negligible and assumed as equal to 0.

One of the factors affecting the power balance of the distribution system is power exchange with the transmission system. In this research, it is assumed that power flow is allowed only in one direction—from the transmission to the distribution system. This means that in the period when energy consumption is higher than generation, the difference between them is covered by power supplied by external generation units from the transmission system. However, power cannot flow from the distribution to transmission system. This causes the sum of generation to be lower than the sum of demand in the whole system. This assumption is made arbitrarily and can be removed without affecting the method principle. This will result only with the higher local capacity host for DG.

CAPEX and OPEX (Table 3) depend on the type and the size of a power unit and are assumed on impact assessment to polish the regulation of RES [51].


**Table 3.** Costs of RES installation.
