A deterministic method of distributed generation hosting capacity calculation: case study of underground distribution grid in Morocco

Global warming has become a significant concern over the past decades. As a result, governments have shifted their policies toward renewable energy sources and environmentally friendly industries. This approach requires a renewal of the electrical networks to accommodate this new intermittent generation (from solar and wind sources) while remaining stable and reliable. In this vision, the notion of hosting capacity has been introduced to define the amount of new distributed generation that an electrical network can host without affecting its stability and reliability. This study proposes a deterministic method based on the π model of cables to estimate the underground feeder's hosting capacity. This method considers reverse power flow, overvoltage, reconfiguration, overloading, and the physical characteristics of lines. It is applied to the Moroccan medium voltage underground radial feeder. Through DIgSILENT power factory software, the power flow analysis is carried out to validate its effectiveness in overcoming overvoltage and cable overload problems. The results validate the relevance of our method, its reliability, its fluidity of application, and its ability to maintain performance indices within the acceptable range.

approach. In section 3, the mathematical models of hosting capacity proposed in the literature are discussed. In section 4, the mathematical model is developed and applied to a 39 buses radial distribution feeder under different cases. Then, the model efficacy is discussed in light of the results obtained from the cases study. In conclusion, remarks and outlooks are highlighted.

HOSTING CAPACITY 2.1. Hosting capacity approach
In computer sciences, the term hosting capacity refers to the ability of a Web server to host numerous access requests. Since 2004, this term has been explored in electrical applications. Endré Even took the lead to evaluate the integration of renewable resources based on the hosting capacity notion [26]. Then, many investigations have been done in this new field.
For a DG, the hosting capacity approach offers a fair and open discussion between investors and DSOs to assure a transparent balancing between their interests [24]. The hosting capacity refers to the maximum amount of DG connected to a given grid without causing any technical problem in a part of or the entire distribution network, as illustrated in Figure 1. Moreover, the introduction of DG will affect power system performances. Every change in power generation and loads can affect the performance indicators. Hence, the performance indices will be the primary tools that quantify the impact of DG on the power system. Connecting a power supply unit in a distribution network is a two-sided coin; it can improve the system's operation as it can deteriorate it. Therefore, system operation degradation is always acceptable if the performance indices are still within their boundaries [16].

Technical criteria limiting DG hosting capacity
The process of calculating HC requires the definition of suitable performance indices. The choice of indices and limits has a significant impact on its value. Thus, the precision of network data is obligatory when planning a DG connection. In general, the process begins with the choice of limiting factors. The most technical limiting factors that the DSOs are based on to assess the HC of a given feeder for DG connection decision are listed in [5]: − Voltage criteria: contains voltage drop, voltage unbalance, and overvoltage. Overvoltage is the frequent criterion used in HC assessment. − Thermal rating criteria: during high generation and minimum load, excess power generated by DG plants flows back to substations through lines and transformers. Both lines and transformers have a maximum current that they can support. Violating its limit causes overheating of these types of equipment. − Protection criteria: the DG interconnection can modify the fault current that the protection devices detect.
Therefore, resizing the circuit breakers is required. − Power quality criteria: wind and solar sources are intermittent, resulting in power quality issues such as voltage fluctuations. Thus, these technologies are connected to the network through electronic power devices, leading to harmonic voltage and current. Because of the issues above-mentioned, DSOs are hesitant to promote new DG connections, except detailed studies are performed. However, such studies delay the DG integration process and make DG owners complain. Hence, simplified methodologies allow DSOs to assess the HC network quickly but reliably. DG planning studies can be classified into different categories without in-depth studies according to the approaches adopted. The HC capacity approach is one of these categories. It aims to size DGs that can be connected to the grid while assuring the quality of service.

Hosting capacity calculation process
Successful integration of DG requires expressing interconnection requirements clearly. Therefore, the calculation of HC is based on several steps to formulate these requirements mathematically. Generally, the calculation of HC proceeds as: i) selection of one or more hosting capacity criteria (already mentioned above); ii) specifying a limit for each performance index according to national rules and or international standards; iii) developing a mathematical model based on the selected performance index/indices; iv) calculating the maximum power that can be injected at a given point; v) checking the limit of the performance index/indices. If it is violated, redevelop the model. Otherwise, validate it; and vi) obtaining the HC capacity.

Mathematical models state of art
DG planning studies can be classified into different categories according to adopted approaches. The HC capacity approach is one of these categories. It aims to size DGs that can be connected to the grid while assuring the quality of service. In these studies, the voltage rise is the frequent criterion considered. This issue may occur when the generation exceeds the local loads. As DGs are connected close to customers' sites, overvoltage will cause significant problems for customers and the whole system [7].
For this reason, studies that adopt the HC approach examine this issue to find the suitable DG capacity that avoids it. In relation, authors in [27] proposed a mathematical model given by (1) to calculate the maximum photovoltaic (PV) power injected into an MV Turkish feeder. The feeder is modelled using a simple single diagram, as shown in Figure 2. The selected criterion is overvoltage, the feeder parameters are taken uniformly along the feeder, and the cable capacity is neglected.
Where is the maximum active power of DG, and are voltages of swing and DG connected point respectively, and = | 1 + | = | + | presents the total admittance of the line.
Authors have taken different assumptions during the formulation process. For example, cables and overhead lines capacitances and loads are ignored. Besides, the authors supposed that the injected PV power has a unity power factor, which is unrealistic since PV panels are connected to the network via inverters that inject or absorb reactive power. Therefore, assumptions make the expression simple and easy to apply but can lead to an under or overestimation of HC. In the same context, the authors of [28] presented a detailed analysis of the sensitivity of photovoltaic HC to several network factors. The model is developed to avoid overvoltage complications when production is more significant than consumption, as shown in (2): where and 0 are respectively the voltage at the PV integrated point and the maximum voltage of the swing bus. and are respectively the resistance and reactance of the Thevenin equivalent impedance at the point of common coupling (PCC). is the angle at the PCC.
the minimum power of the load. Power electronic devices and nonlinear loads are predicted to inject harmonic currents. As long as PV panels are connected to the grid via inverters that inject harmonic currents, voltage wave deformation will happen, and, consequently, voltage rise is expected. The harmonic impact on HC is not addressed in the models mentioned above. However, de Oliveira et al. [23] related the hosting capacity concept to voltage harmonic distortion by introducing the harmonic orders in HC expression. Their model was based on replacing the maximum voltage at PCC with its root mean square (RMS) in (2). The RMS is generally defined as the root square of the sum of squares of each harmonic voltage. They have supposed that loads have an insignificant harmonic impact; (2) can be rewritten as flow: where the ℎ is the voltage magnitude permissible for harmonic order ℎ. Referring to international standards, the individual voltage distortion is required to be below 5% for ℎ ≥ 2 and below 105% for ℎ = 1. The authors have addressed harmonic impact in addition to overvoltage in HC calculation. They have shown t significant risks to applying simple models in HC determination. Therefore, system's HC analysis requires more limiting factors to be considered.
To facilitate the integration of the intermittent (solar and wind), a more general equation was proposed in [6]. This model takes into account the loads and DG generators already connected to the network in the calculation. The model is obtained by applying the reduction method applied to the load flow matrix.
′ denote the final maximum DG capacity, is the maximum capacity of DG for unloaded case; | " |/| " | is the ratio of the short-circuit powers at the integration point and at the point where the load and DG unit have common coupling, and and are the phase angle of DG.
In all these examples, mathematical models are developed for DGs programmed to be at the end of the feeder. Voltage is selected as the primary criterion for developing the models to avoid overvoltage or the voltage rises due to the harmonics. The thermal criteria are ignored in these cases. Thus, they are based on a single diagram containing only the line's impedance since line capacitance is ignored to simplify the calculation. In addition, the characteristics of the single line diagram are uniformly taken. However, it is not the case for a real feeder, in which branches do not necessarily have the same characteristics. Neglecting this point may lead to more technical complexions, most likely thermal overload.

SYSTEM MODELLING 3.1. Case study
Deterministic hosting capacity studies aim to find the maximum distributed generation capacities that can be connected without influencing network performance. All these studies are based on mathematical modelling of technical criteria making HC assessment possible and easy. In most related publications, voltage rise is the critical event considered, and the goal is getting the maximum power that will not cause this event. Focusing on one criterion and assumptions in HC calculation may lead to grave problems after DG integrations like thermal overloading. Therefore, HC estimation requires more limiting factors to be considered.
Almost all distribution grids are underground. According to the reviewing articles, no study addresses the hosting capacity of underground feeders. As their maintenance is complex, their HC determination requires deep analysis. For analyzing the situation related to the subject and obtaining an HC method that takes more limiting factors, an MV feeder of Morocco is addressed for developing the mathematical model. The examined underground network is slightly complex [12]. For economic reasons, the cables used do not possess the same physical characteristics along the feeder. The feeder contains 40 buses, as depicted in Figure 3. They are connected using three different types of underground cables (green, blue, orange): i) the blue has an impedance Z1=0.145+j0.1 Ω/km, a capacitance of C1=400 nF/km, and support 400 A as maximum current; ii) the green has an impedance Z2=0.239+j0.11 Ω/km, a capacitance of C2=300 nF/km, and support 300 A as maximum current; and iii) the orange cable impedance is Z3=0.372+j0.13 Ω/km, its capacitance is equal to C3=300 nF/km, and its maximum current is 225 A.
The π diagram is an approximation of the cable model. This approximation remains correct as long as the cable is not too long. Consequently, the studied feeder is modelled by a single-line diagram in which all the parameters are expressed per unit (p.u). The cables are modelled using the π model, which in the series impedance of the cables is positioned in the middle of half capacitance, as shown in Figure 4. As underground networks are potentially subject to long downtimes in the damage event (several tens of hours), the integration of DG in this type of network can lead to more loaded cables and contributes to the fault current supply. Therefore, grave damages may happen and require more repairing time. In the next section, a mathematical model is proposed to estimate the maximum permissible DG power injected at a given point of this grid and avoid these problems. The calculation considers the overloading of cables/transformers, overvoltage, minimum loads, and revers power flow.

Hosting capacity calculation
The maximum electrical power injection in a given feeder can be formulated considering the feeder parameters and the selected HC criteria. In the model processing, the assumptions are taken as flow: i) the feeder physical parameters are irregularly distributed along with the studied departure; ii) the capacitances of the cables are considered in the calculation; iii) reversing power could occur in the worst-case scenario, the maximum generation and minimum loads. Thus, the connection of DG to a given bus can supply all the ascending and descending loads of that bus; iv) the normal opening point (NOP) is moved for grid reconfiguration to show its effect on the HC; and v) the criterion retained for this model is overvoltage; its limit was 10% of the standard voltage and the overload of the transformer and the cables.
According to Figure 5, the branches are presented as a cascade association of the model in a π of cables and loads. The matrix associated with the π model for the first branch is given by (5), which 1 , 1 , 2 , and 2 are the voltages and currents at the input and output of the model respectively. 12 is the impedance To formulate the mathematical model, the DG is planned to be connected to bus 3. As shown in Figure 4, the DG current circulates to supply the loads upstream and downstream of bus 3. The current injected by DG at bus 3 is formulated as (6): where, I 3 ′ is the current flowing downstream of the injection bus (bus 3), 3 " is the current flowing upstream of the injection bus (bus 3), and 3 is the load current on bus 3. Depending on the matrix given by (5), the currents upstream and downstream the bus 3 can be written as (7): where 1 is expressed as (8) where 1 is expressed as (10) Current and voltage at Bus 2 can be expressed as a function of the current and voltage of the last bus. Likewise, the current and voltage at bus 4 can be described as a function of the current and voltage of the bus that follows it. Accordingly, (7) and (9) can be written as (11), (12): where, 39 , 18 , and 39 are the voltages and currents at the end of departures 1 and 2, respectively. To generalize the mathematical model, let take the integration bus number of DG. , and are successively the numbers of branches existing upstream and downstream of the bus j. The feeder ends can change status when the NOP is displaced. Hence, bus voltage and current the ends are denoted by and , where can take 1 or 2 to represent the line number. The (11), (12), and (6) become: The value of the current flowing through each element of the network (line, cable, or transformer) must not exceed the current ratings of these components. The calculation of the current flow should not exceed these values. Excessive current values can lead to overheating of features and even rupture. So, must be less than current ratings. As the studied system contains branches with different current ratings, the rating current is taken as the lesser maximum current of the three cables, 225 A.

=
. * In (17) represents the maximum power that can be injected in bus j when the generation is higher than the consumption. This scenario can cause a high voltage at the injection bus and surroundings. The permissible overvoltage is 1.1 . , can be rewritten as (17):

RESULTS AND DISCUSSION
First, the maximum power of DG is calculated using the proposed mathematical model as shown in (17) and those existing in the literature (1) to (4) for different locations. DG locations are chosen at the start, middle, and end of the feeders, and the worst scenario (maximum generation minimum load) is addressed. The buses considered are 1, 8, 17, 28, and 39. Models given by (1) to (4) are developed for the DGs, which will be integrated at the end of the feeder. Therefore, these models are not applicable for bus 1, which is at the start of the feeder. However, for the buses located in the middle (buses 8 and 28), the HC is calculated by considering only the branches and the loads up to buses 8 and 28. The line capacitance is ignored in these models. However, the proposed model takes into account all the characteristics of the cables and shows the impact of the capacity on the HC obtained, as shown in Table 1.
In particular, the cable's capacitance in the calculation increases the HC values for all studied buses, which is around 1.3 MVA increases for some buses. The HC value depends essentially on the criteria used and the location of the DG. It differs from one model to the other based on the assumptions and constraints taken. However, our proposed model addresses the problems of overvoltage, cable and transformer overloading, and reverse power flow. For this reason, the HC obtained by our proposed model has the lowest values compared to the others. Therefore, the more criteria studied, the minimum value of HC will be. Power flow analysis is performed using DIgSILENT power factory software to test the effectiveness of the proposed model. The overvoltage and overloading of cable have been cheeked for both cases: connecting the DG and in its absence. The two cases were performed over all the predefined locations for all resulting values of HC given in Table 1. The bus voltages before and after DG integration are presented in Figure 5. Before DG integration, the bus voltages (red line) decrease from the substation to the end of the feeders. Whereas after its integration, the voltage for all DG capacities obtained in Table 1 is raised, especially at the bus where DG is integrated and around it. Consequently, the higher the value of the DG power, the greater the voltage rise.
Voltage for different busses in Figures 6(a) and 6(b) has not reached the overvoltage limit after DG with capacities calculated using the proposed model. The voltage is increased by 4% after connecting DG, which allows more DG integration. However, the rise of voltage in Figures 6(c) to 6(f) is significant for DG  Figure 6(c). So, overvoltage problems are expected if the network under study operates under other conditions (minimum load) or hosts new DG units. All models have respected the overvoltage constraint, but a risk of violating this constraint will probably occur when calculating the HC with those existing in the literature. Being the most common problem after DG integration, the surge has been the most considered constraint when determining a network's ability to accommodate new energy sources. Besides this problem, cable overload can occur, especially as the current increases after connecting the DG. As well as, underground cables failure is costly and time-consuming to fix. Protection systems are designed to protect cables from high current levels present under fault conditions. However, the rise in temperature due to prolonged overload conditions is just as likely to cause cable failure. Thus, introducing DG in an already existing grid may aggravate this failure. Therefore, cable overload becomes a primary constraint to be taken into account during the HC calculation process. However, researchers have always overlooked this problem, even though its effects on the network are significant. As shown in Figure 7, cable loading increases after connecting DG at the studied locations. The DG performed with capacities calculated with the proposed model in Figures 7(a) and 7(b) respect this limit in all cables. Contrariwise, Figures 7(c) to 7(f) show that cables loading exceeds its limit for DGs performed with capacities calculated using the model existing in the literature. Thus, taking into account the reverse flow helps avoid overloading the cables. The proposed model shows its effectiveness in respecting the constraints of hosting capacity. It is noteworthy that the more criteria are taken, the minimum HC will be, but the safely DG integration will be. Overvoltage is the most considered constraint when determining a network's ability to accommodate new energy sources, for a reason being the most common problem after DG integration. Besides this problem, cable overload can occur, especially as the current increases after connecting the DG. As well as, underground cables failure is costly and time-consuming to fix. Protection systems are designed to protect cables from high current levels present under fault conditions. However, the rise in temperature due to prolonged overload conditions is likely to cause cable failure. Thus, introducing DG in an already existing grid may aggravate this failure.
One of the techniques for optimizing the configuration of a radial network is changing the location of NOPs. Network reconfiguration has several advantages, such as minimizing power loss, minimizing overload cases to reduce the number of overloaded equipment, and others. Consequently, the proposed mathematical model succeeds in associating the hosting capacity approach with the reconfiguration of the studied system to facilitate the application of smart grids in future applications.
The NOP of the studied feeder is moved to different places to show its impact on the hosting capacity value. The hosting capacity is calculated using the proposed model at buses 17, 8, and 28 for four cases as: a. Case 1: NOP is placed between buses 18 and 39 (normal place) b. Case 2: NOP is placed on buses 10 and 11 c. Case 3: NOP is placed on buses 28 and 29. Table 2 presents the resulting DG power after applying the mathematical model we developed for the three cases. The hosting capacity depends on the DG and NOP locations. As shown in the Table 2, the DG power of bus 8 has a higher value (13.2384 Mw) when NOP is placed between buses 28 and 29 (case 3). DG at bus 17 has a maximum value (15.1064) when NOP is between buses 10 and 11. While the HC for bus 28 is higher (16.4115) when NOP is placed between buses 10 and 11 (case 2). When changing the location of the NOP, the grid configuration also changes. Consequently, the length of the feeder can be increased or decreased, which explains the various values obtained of HC for the same bus. Therefore, such a study will be helpful for the optimization of DG sizing and location studies and network reconfiguration.
Overvoltage and cables overload are again examined for cases 1, 2, and 3. For all DG locations (bus 8, 17, and 28) and NOP locations, the voltage profiles respect the upper voltage limit, which is 1.1 p.u, as illustrated in Figures 8(a) to 8(c). Thus, the results again confirm the effectiveness of our proposed model to avoid overvoltage problems. Grid reconfiguration via changing NOP emplacement can increase the hosting capacity of the grid as long as the optimal location is selected. The optimal location of NOP can be chosen according to respecting HC constraints. So, cable loading can increase or decrease according to DG and NOP locations. The results in Figures 9(a) to 9(c) show that loading for all cables is still under the limit for all cases.
Our proposed model showed its efficiency in respecting overvoltage and overloading constraints. Moreover, our model is inclusive and easier to apply, and it considers more than one criterion, unlike the existing one in literature. It also considers the reconfiguration of the network to respond to the smart grid transition. Therefore, considering more constraints during HC calculation reduces its value but guarantees more secure DG integration in a given distribution grid. Finally, our model was applied to a real feeder of Morocco, where we studied the variation of the location of NOP and DG impact on the HC. Our results show a significant dependency of HC on the DG and NOP locations.
The integration of DG at three locations with three NOP locations results in voltage profiles and cables loading below their thresholds even for the worst-case (minimum load with maximum generation). The main key to our model efficiency is the voltage maintenance and loading under their limits. However, the maximum power values obtained by the proposed model may not always be exact owing to assumptions made on unknown parameters such as voltage and loads consumption during the modelling stage. Therefore, the hosting capacities obtained should be approximate values. The time variable and real-time generation and load data are required for greater accuracy.

CONCLUSION
In this paper, a mathematical model is developed to estimate the hosting capacity of a DG planned to be integrated into a given grid point. This study aims to get a more comprehensive model that considers overvoltage, reverse power flow, overloading of the cables, grid reconfiguration, and the real parameters of the system under study. The proposed model is based on a real Moroccan underground grid of 39 buses. The proposed mathematical model shows its efficiency compared to others existing in the literature. It is more inclusive and easier to apply. Unlike the existing ones, it considers more than one criterion. Thus, it is more realistic because it is developed from a real feeder of Morocco. The proposed model also considers the reconfiguration of the network to meet the integration of smart grid technologies. The results show a significant dependency of HC on the DG and NOP locations. The integration of DG at three locations with three NOP locations results in voltage profiles below the upper voltage limit during maximum generation and minimum loads case. Maintaining the voltage and loading of the studied system under their limits during the scenario mentioned above proves the efficiency of the proposed model. For all studied cases, the voltage of grid busses and cable loading are within their limits during the high generation and low loads (worst case). Therefore, considering more constraints during HC calculation diminishes its value but guarantees more secure DG integration in a given distribution grid. However, the maximum power values obtained by the proposed model may not always be exact. While the modelling stage, various assumptions were made on unknown parameters such as voltage and loads consumption. Therefore, the hosting capacities obtained should be approximate values. The time variable and real-time generation and load data are required for greater accuracy.