Optimization of the Operation of Smart Rural Grids through a Novel Energy Management System

The paper proposes an innovative Energy Management System (EMS) that optimizes the grid operation based on economic and technical criteria. The EMS inputs the demand and renewable generation forecasts, electricity prices and the status of the distributed storages through the network, and solves with an optimal quarter-hourly dispatch for controllable resources. The performance of the EMS is quantified through diverse proposed metrics. The analyses were based on a real rural grid from the European FP7 project Smart Rural Grid. The performance of the EMS has been evaluated through some scenarios varying the penetration of distributed generation. The obtained results demonstrate that the inclusion of the EMS from both a technical point of view and an economic perspective for the adopted grid is justified. At the technical level, the inclusion of the EMS permits us to significantly increase the power quality in weak and radial networks. At the economic level and from a certain threshold value in renewables’ penetration, the EMS reduces the energy costs for the grid participants, minimizing imports from the external grid and compensating the toll to be paid in the form of the losses incurred by including additional equipment in the network (i.e., distributed storage).


Introduction
In the 1990s, the stiff and vertical monopolistic electrical system in Europe experienced a transformation, evolving into a new, more flexible and competitive system based on market aspects [1].In this new reality the electricity producer decided (and still decides) when and how much to produce, and how to plan and implement their plant maintenance programs [1].From then on, the traditional unidirectional grid, generally used to carry power from few and far power plants to many clients, is moving to a new modern grid, that integrates scatter and smaller generators throughout the territory.Consequently, modern electric grids combine scatter and smaller generators (even at consumers' location) with the conventional architecture of the power system [2].As a result, electrical networks are experiencing bidirectional power flows through distribution grids that impose new challenges for network operation.
To properly manage modern grids, new management strategies for network operators are needed [3][4][5] and the implementation of these management tools are transforming grids into Smart Grids (SGs) [6].The term energy management was firstly related to those tools managing the demand in grids [7][8][9].In 1980s the term Demand-Side Management (DSM) was presented by Clark W. Gellings in [7].The DSM focuses on the idea of influencing customers, through a set of interconnected and flexible programs based on energy efficiency, energy conservation and sustainable development.
These programs incentive customers to shift their electricity demand to low energy price periods, and to reduce their overall consumption [8].From this first conception, the field of energy management evolved to include also the supply-side management, thus yielding the general concept of the Energy Management System (EMS), also known as grid energy management or smart energy management system [3,4,[8][9][10][11][12][13].The EMS turned out to optimize the energy usage at different levels: generation, transmission, distribution and consumption, to ensure an efficient, thrifty and sustainable system [8].Literature around the development of EMSs is very extensive.In general terms, and despite the diversity of EMSs, it can be concluded that from the formulation point of view the main optimization objective for EMSs is to find a compromise between generation and demand bids, matching the offer with the demand, while minimizing costs or maximizing profits for the agents involved [12].EMSs are integrated in different architectures, which can be classified mainly as centralized or decentralized (also called distributed) [12,14].The proposed architectures are in turn constituted by different players (or agents) [15].An agent is a software (or hardware) that pursue its objectives, being able to react rapidly to the changes, and negotiate, cooperate and compete with others [12,14,15].
The most common architectures are centralized.They are featured to be completely supervised and managed by a central agent (or agents, thus resulting into a Multi-Agents System (MAS) [14,[16][17][18]), in a master-slave relationship.This requires a high computing capacity and a stable and fast communication system [3,19].The goals for these central agents focus on diverse aspects such as optimizing the generation power scheduling, the DSM and the operation of storage units, all reducing the emissions and improving the power quality.These may be implemented in residential systems [20,21], grid-connected microgrids [16,[22][23][24][25] and isolated systems [22][23][24][25][26]. Centralized MAS architectures can manage large microgrids or distribution grids [17,22,27,28], and even power the system as a whole [29,30].
In contrast, decentralized architectures are a collection of management agents who are usually deployed at local controllers of Distributed Energy Resources (DERs) [14].Typically, distributed architectures are characterized to be faster, more flexible, reliable and independent than centralized ones, resulting into lower risk of system failure (i.e., improved reliability), enhance scalability and with less information between agents [3,14].On the other hand though, coordination between agents is more complex than in centralized architectures, adding complexity to the overall design of the solution.Decentralized architectures may be good options, for instance, in microgrids with a wide range of DER [14,31,32].
In EMSs for distribution grids, management optimizations are primarily expressed addressing economic terms, leaving technical aspects, such as frequency and voltage stability, to other and/or secondary management procedures [27,[33][34][35][36].This is because of the existence of dedicated capacities and markets in networks to answer these needs.In particular, frequency and voltage support in networks are included within the so called ancillary services, and these are provided by contracted generators and large consumers for these purposes [1].The coordination of such services is conventionally managed by the Transmission System Operator (TSO) of the network.However, the inclusion of large amounts of distributed generation in medium and low voltage distribution grids is forcing also Distribution System Operators (DSOs) to develop new tools so as to maintain the required stability and quality in their networks, as the transmission system operator does.This is particularly important in weak or rural distribution networks.Indeed, distributed generation in rural grids can provoke overvoltages in radial lines and this is something to be solved by the DSO, among other technical issues [32,[37][38][39].In fact, the absence of management tools in such networks and the weak infrastructures installed for the few and dispersed consumers make these grids as perfect candidates to experience overvoltages, load unbalances among the three phase distribution system, undesired reactive power flows, harmonics, and unavailabilities due to short-circuits and other types of eventualities, all affecting the power quality and security of supply for customers.Accordingly, the management tools for DSOs, especially in rural grids, should not be only based on economic criteria so as to optimize the grid operation.Instead, they should also perform a power dispatch among the loads and generators in the grid considering other aspects that ensure a proper system stability, quality and reliability.
Addressing the need of developing new tools for the proper management of modern rural distribution grids, this paper proposes a new EMS to be executed by the DSO and that optimizes the grid operation based, simultaneously, on an economic criterion (i.e., the minimization of the global operating costs) and a technical criterion (i.e., the maintenance of the required quality in the service level).The combination of the two optimization criterion resulting in a novel EMS is one of the two contributions of the paper.The proposed EMS adopts a centralized architecture where a central MAS system manages the optimization of the system addressing economic criterion.In addition, technical aspects related to power quality are addressed by distributed management agents through the network at DERs.Such architecture permits us to exploit the main advantages of centralized ones (e.g., easy coordination of the different DERs) with the advantages of distributing some management duties through DERs (e.g., fast reaction against eventualities, enhanced flexibility and scalability of the solution).Altogether, this permits us to effectively address the needs of rural distribution networks.The second contribution is the formulation of diverse quantitative metrics so as to evaluate the performance of the proposed management tools for improving the grid operation.The proposed EMS is to be tested using real data from a rural distribution grid.This grid is actually being used as a demonstration site for the concepts presented in this paper, in the frame of the FP7 European research project Smart Rural Grid.

The Proposed Energy Management System for Rural Grids
The energy management system is composed by diverse agents, which from a top-down approach are: (i) the Global Energy Management System (GEMS); (ii) the Supervisory Control and Data Acquisition (SCADA); (iii) the Local Energy Management Systems (LEMSs); (iv) the Local Controller (LC); (v) Transformer Controllers (TCs) and finally, at the bottom of the structure there are all manageable and controllable equipment.
All of them configure a system in the form of that presented in Figure 1.As can be observed the different agents of the system are distributed into three management levels.At the top level there are the SCADA and the GEMS.Both agents are the responsible of the proper operation of the whole Distribution Network (DN).At the intermediary layer there are LEMSs and LCs.These two types of agents are in charge of the operation of limited parts of the DN.Finally, at the bottom level there are the TCs that manage and control Secondary Substations' (SS) equipment.Depending on the relevance of each SS, an area can collect one or more SSs.
The management agents in Figure 1 are also classified in terms of their programmability (see the color code).In this regard, the SCADA is the agent with the highest level of programmability.It is a rule-based system supervised and managed by the DSO.
Just below the SCADA there are the GEMS and the LEMS.In terms of programmability, these agents determine the series of active and reactive power setpoints for optimizing the whole or part of the rural DN.Also, they calculate, on a one minute basis, the setpoints to manageable and controllable equipment, such as some Distributed Generators (DG), Controllable Distributed Loads (CDL), Diesel Generators (GS) and back-up resources (or, as named, Intelligent Distributed Power Routers (IDPRs), with Battery Energy Storage Systems (BESS)).
The IDPR is a power converter that improves the power quality and if it allocates a BESS, then it also manages energy packages.The main challenge of the IDPR in terms of power quality is to compensate for unbalanced currents (of the three-phases), compensating reactive power and cancelling the harmonic content of currents at coupling point, in a slave mode.Also the IDPR can storages energy from distributed generation and provides it during pick hours or during a supply disruption, since the IDPR is the responsible to restore the supply in the network providing a voltage and frequency of the local set, in a master mode [40,41].Finally, the LCs and TCs are programmable rule-based devices that exchange information and setpoints with the back-up resources, DGs, CDLs, GSs, as well as with control and protection devices.It is important to note that the programmable rule-based systems implemented in LCs and TCs ensure a proper operation during an eventuality in the communications' network.

GEMS
This paper focus on the GEMS agent while managing the whole DN.To do so, this agent optimizes the operation of the network in two main steps.The first step-called economic optimization hereinafter, solves an optimal economic dispatch for the controllable sources and loads in the network.Since economic, the optimization is based on market aspects, availability and cost of DGs and back-up resources.The second step, and from the inputs of the first one, adjusts the active and reactive power dispatch for DGs and back-up resources considering technical aspects such as power losses and voltage variations, thus performing an Optimal Power Flow (OPF) [42].This paper develops these two management steps performed by GEMS under the operational circumstance that the rural grid being managed is not isolated, but connected to the main grid of the rest of the territory.
So more in detail, the GEMS performs the following tasks: (i) generates the consumption and generation forecasts for the whole system and for a time horizon of 24 h; (ii) with this time horizon, executes the global economic optimization; (iii) executes the optimal power flow function of the global economic optimization setpoints and network technical constrains; (iv) outputs a file with the setpoints for controllable sources and loads for the following 24 h, in time steps of 15 min.Such time step is convenient for the integration of GEMS in some electrical markets worldwide [43,44].The following Section 3 develops the presented objectives for GEMS step-by-step.

The Global Energy Management System
This section introduces the GEMS operation.Internally, the GEMS has three different modules addressing its objectives.The first module carries out forecasts.In particular, it determines the generated and consumed forecasts for active and reactive power for each SS.The second module (the Global Economic Optimization (GEO)) processes the price of electricity pool and sends it to SCADA.Also the GEO module calculates through a Mix Integer Lineal Programming (MILP) determines the power setpoints for controllable generators, loads and storages addressing an economic criterion.These setpoints are named global economic setpoints.Finally, these setpoints are processed in the third module of the GEMS, which is called the Global Technical Optimization (GTO) module.The GTO module adjusts through a Non-Lineal Programing (NLP) the global setpoints are according to the technical constraints, applying curtailments if required and adapting the reactive power, in order to smooth voltage variations and reduce the electrical losses.Finally the resulting setpoints, the global technical setpoints are sent to SCADA.The Figure 2 collects the described modules of GEMS and the time horizon for the processes they carry out.The following gives a deeper description of the GEMS.

Forecasts for the Whole System
Currently, the models to forecast the electrical consumption and generation, are tools that are developed for specific areas.They function in several aspects like, economic, weather, industry, population, market, technological development, among others [9].In addition, in the literature there are several techniques that related all these inputs to determine the outputs.Commonly they can be classified into static or dynamic, univariate or multivariate and for the technique that they use.The most simple and frequent techniques are times series and regression models [9].
The aim of the article is not to advance in the knowledge field of the forecast methods.So the required forecasted data for GEMS operation has been derived from real data adding a random variability according real standard deviation.The root-mean-square of the error for simulated forecasted data is 10%.This is consistent with usual error magnitude provided by state-of-the art forecasting methods for wind and sun resources [9].

Global Economic Optimization Formulation
The Global Economic Optimization formulation is a MILP model that pursues DSO's goals.As noted in Figure 2, the GEO is the first optimization block in the GEMS algorithm.Its objective is to solve with an minimum energy cost for grid participants, and this is translated into a quarter-hourly dispatch for distributed resources.For GEO formulation the following hypotheses are considered:

•
It optimizes the dispatch of active power for controllable elements in the network, assuming that the reactive power management is treated by the GTO.

•
It assumes that the DN operates as a three-phase balanced system, so power flows among three phases of the DN are aggregated for optimization purposes.Such a balanced system is ensured by the action of the previously introduced IDPRs.The IDPR makes the unbalanced power flow downstream (i.e., in the low voltage network, where dispersed consumers and generators are located) as an aggregated balanced power flow upstream to be exchanged with the medium voltage DN.
• It also assumes that voltage levels remain in an acceptable range, thanks to the subsequent GTO actuation.

•
It does not take into account the electrical losses of lines and transformers.

•
It takes into account the performance of storage technologies.The efficiency in charging and discharging processes as well as the self-discharge phenomena are considered.

•
The number and consumption of controllable loads is known.

•
The number and output of programmable generators is known.

•
The consumption and generation at SS feeder is aggregated, representing the behaviour of low voltage network.
Following contents present the input data, variables, mathematical constraints and the objective function for the GEO.

The Input Data
The input data for the mathematical problem is divided into sets (see Table 1), constants (see Table 2), costs (see Table 3), load parameters (see Table 4), DG parameters (see Table 5), and BESS (see Table 6).

Variables
In turn, variables of global economic optimization problem are presented and classified into SS and EG variables (see Table 7), DSM variables (see Table 8), DG variables (see Table 9), and battery energy storage system variables (see Table 10).
Proportion of energy consumed by PADG g associated to a SS s at time t (-),

GEO Constraints
In turn constraints are also divided and formulated in four groups, (i) SSs and the EG, (ii) DSMs, (iii) DGs and (iv) BESSs constraints.

(i) SSs and EG constraints
The power balance constraint (1) determine the energy exchanged by each SS.This must be equal to the sum of the energy consumed and generated by customers, and the energy supplied (or consumed) by the storage systems.In addition, this also is bounded by the rated power of the SS transformer in (2).Then, in (3), the sum of all exchanged energy is equal to the difference between the imported and the exported energy from the EG.Finally, imported and exported energy from the EG are limited by the rated power of the EG transformer through (4) and ( 5), also ensuring that when one is positive the other is zero and vice versa.
(ii) DSM constraints The energy consumed, as detailed in the ( 6), is the sum of the energy from non-controllable and controllable distributed loads, as well as the energy not supplied to loads.Typically, CDLs are characterized by their rated power and the time they are consuming energy.These two variables are bounded by Equation (7) (power) and Equation (8) (time).Finally, the Equation ( 9) restricts the consumption of CDLs for the time interval [K l,s TS CDL , K l,s TE CDL ] addressing starting times.
x s,t x l,s,t (iii) DG constraints Equation ( 10) sums the energy generated by all different DG sources.Equation ( 11) fixes the generated and the non generated energy from NCDGs according to forecasts.The generated and non generated energy from SDGs are quantified by Equations ( 12) and ( 13), respectively.Similarly, generated and non generated energy by ADGs are quantified by Equations ( 14) and (15).Similarly to CDL Equations ( 7)-( 9), Equations ( 16)-(19) determine the generated and non generated energy from PDGs in function of their rated power and operating times [K g,s TS PDG , K g,s TE PDG ].Finally, the energy generated by PADGs are determined by Equations ( 20)- (23).The total generation for each SS is determined by Equation (20), and Equation ( 21) limits the output power of PADGs according to their limitations.Further, the fuel consumption per each unit is calculated by Equation (22) and limitations in fuel usage are imposed by Equation (23).
x s,t x s,t x s,t x s,t x s,t x s,t x g,s,t x g,s (iv) BESS constraints Completing the description of the constraints for the problem, BESS-related constraints are introduced in the following.Equation ( 24) defines E BS as the subtraction between the energy consumed and injected to the grid by storages.In turn, these terms are limited by Equations ( 25) and (26), which are function of the rated power of the battery (K b,s

RP BS
).In addition, the State of Charge (SoC) is bounded by Equation (27).The SoC is in function of the capacity of the battery (K b,s C BS ), the initial SoC (K b,s 0SoC BS ), the self-discharge constant (K b,s σ BS ), and the charging and discharging efficiencies, (K b,s ηC BS ) and (K b,s ηD BS ) respectively.
x s,t x b,s,t EC BS ≤ K b,s

The GEO Objective Function
The global economic objective function z GEO has been chosen incorporating diverse criteria.Addressing the obligation for DSOs to cover the demand, the first summation of the objective function calculates the cost for the energy not supplied to DLs (including the non controllable DG).Note that the second to fourth summations are included in order to maximize DGs generation and manage them efficiently.Further, the fifth summation aims to minimize the cost related to fuel usage (including the wasted fuel).Finally, the last summation is added so as to minimize the cost related to energy imported from the EG.

Global Technical Optimization
As noted in Figure 2, the Global Technical Optimization is the last optimization procedure in the GEMS.It receives the outputs from GEO and perform a process based on a NLP that provides the final setpoints for distributed resources according to the DSO's technical constraints.The GTO minimizes losses in the DN guaranteeing the dispatch solved by the GEO.The GTO also adjusts the reactive power from the IDPRs, and also readjust the active power from DGs and BESS in order to keep the voltage within acceptable range.The GTO goes under the following assumptions:

•
The DN voltages and currents are balanced.

•
Consumption and generation profiles are aggregated at each SS's feeder.

•
The electrical loses of medium voltage lines and transformers are considered for optimization purposes.
The following presents the input data, variables, mathematical constraints and the objective function for the GTO.

The Input Data
The input data for the mathematical problem is divided into sets (see Table 11), constants and general (see Table 12), external grid parameters(see Table 13), and secondary substation parameters (see Table 14).

Variables
In turn, variables of global technical optimization problem are presented and classified into voltage and total power variables (see Table 15), EG variables (see Table 16), and SS variables (see Table 17).

Table 15. Summary of variables (voltage and total power variables).
Variable Description Table 16.Summary of variables (EG variables).

Variable Description
x PI EG ∈ R Imported active power from the EG (kW) x QI EG ∈ R Imported reactive power from the EG (kvar)

GTO Constraints
In turn constraints are also divided and formulated in three groups, (i) voltage and total power, (ii) EG, (iii) SS constraints.

(i) Voltage and total power constraints
The voltage for all buses are calculated by Equations ( 31) and (32).
(ii) Constraints related to the EG bus Active and reactive power balances at the EG bus are ensured by Equations ( 33) and ( 34), respectively.The active and reactive power balance for the rest of buses are ensured by Equations ( 35) and (36).Equation (37) establishes that the active and reactive power exchanged with the EG is less than the rated power of the EG transformer.The voltage module and angle of the EG bus is fixed by Equations ( 38) and (39), respectively.
(iii) Constraints related to SS buses An excessive voltage level at SS buses is quantified by Equation (40).The active power generated by DGs is bounded by Equation (41).Similarly, the Equation (42) limits the active power injected from BESSs of IDPRs.The active power term can be negative and this means that the battery is consuming power.Therefore, the DG production could be reduced, the BESSs could dispatch or absorb energy.Finally, the active and reactive power supplied by IDPR is bounded by Equation (43) and the total power exchanged by a SS is bounded by the rated power of transformer through Equation (44).

The GTO Objective Function
The technical objective function z GTO is divided into terms, the first one minimizes the imported energy from EG, thus indirectly minimizing the electrical losses and maximizing the active power generation from distributed resources.The second penalizes any excess or deficit in voltage for all buses through the weighting factor.This factor penalizes an excess of voltage in terms of active power (K VW >> 1). [min]

Study Cases
For GEMS performance evaluation, different computational scenarios and metrics are proposed, and these are presented in the following.

Definition of Computational Scenarios
Twenty computational scenarios are proposed for evaluation.The scenarios are distributed in four blocks:

Case (i):
The DN neither includes IDPRs neither BESSs, nor management tools.

• Case (ii):
The DN is equipped with IDPRs and BESSs, and the GEO, as a management tool.

• Case (iii):
The DN is equipped with IDPRs and BESSs and the GTO, as a management tool.

• Case (iv):
The DN is equipped with IDPRs and BESSs, as well as the GEO and the GTO as management tools.Doing this, it is possible to evaluate the impact in network operational performance of adopting both the energy management algorithms proposed in this paper as well as the IDPRs, as distributed energy storage capabilities.
For each of the above presented blocks, five scenarios are proposed, each proposing different levels of renewables' penetration.In particular, DG penetration varies from 10% to 50% with respect to total contracted power in the network.The DG penetration is bounded in Spain up to 50% of total contracted power by current regulation [45].The adopted DN is located in a rural zone of Catalonia [46].This grid is actually being utilized as a demonstration site for the management tools and power electronics (the IDPR) presented in this paper.These demonstrations are being carried out in the frame of the FP7 European research project Smart Rural Grid. Figure 3 presents a single-phase diagram of this DN.
As can be noted, this is a rural distribution grid including 13 SSs.The consumers are of different types, including DLs, NCDLs and CDLs.The CDLs refers to electrical vehicles, water heaters, refrigerators.A penetration of about 25% of CDLs are integrated in each SS.Moreover, several types of DGs are included in the network: (i) non-controllable DGs (small or micro renewable generation like flow-hydraulic generation, photovoltaics and wind-based generation); (ii) switchable and adjustable DGs (renewable sources governed by microcontroller that regulate their power output; (iii) programmable DGs (fully governable generators such as combined heat and power generation systems); and iv) programmable and adjustable DGs (auxiliary sources like diesel, biomass, gasifiers, waste-to-energy generators).A representative daily profile for aggregated generation and consumption are presented in Figure 4.

Power Quality Indicators and Metrics
This section introduces diverse quality indicators so as to evaluate the impact of including the management tools proposed in this paper.Similarly as for parameters and variables, quality indicators are divided into two groups, (i) secondary substation indicators (I SS ) (see Table 18), and (ii) distribution network indicators (I DN ) (see Table 19).Indicator Description Daily distribution electrical losses (passive elements) (%) Daily electrical consumption of IDPRs (active elements) (%) Daily energy imported from the EG (%) (i) SS related metrics The indicator I s SS 1 expresses through Equation ( 46) the voltage width of the 95% of SS voltage module of a day (x s,t V M ).This metric is formulated as in the EN 50160 standard [47].Note in Equation ( 46) that K V M b is the nominal value of voltage for this bus.Analogously, the SS indicator I s SS 2 is related to the total reactive power over the active power consumption, and the SS indicator I s SS 3 determines the average energy discharged by batteries for each SS.Finally, the SS I s SS 4 expresses how much power is curtailed from the maximum power available from DGs for each SS.

SC
, ∀t 100 (47) (ii) DN related metrics The DN indicator I s DN 1 is calculated from the total electrical losses of the whole DN (from passive elements) divided by the total power consumption.Note that the energy losses from passive elements is determined by the Equation (53).The DN indicator I s DN 2 presents the percentage of the consumption of IDPRs and BESSs respect to the total power consumption.Note that the energy losses from the active elements is determined by the Equation (55).The DN indicator I s DN 3 determines how much power is imported from the EG respect to the total power consumption through Equation (56).

Simulation Results
This subsection depicts the simulation results for the four blocks of scenarios, which in turn include five levels of DG penetration.As a reminder, each of the four cases are characterized by including different energy management tools and energy storage devices.
Graphical results are structured in the following Figures (Figures 5-8).Figure 5 plots the power exchanged (both active and reactive) with the EG for each of the four cases of scenarios.Analogously, Figure 6 plots the power losses.In addition, Figure 7 presents the the voltage in SS 834, 915, 010 and 928. Figure 8 plots the SoC of BESS at SS 834, 915, 010 and 928.

Figure 5.
Active and reactive power exchanged with the EG (first and second column, respectively) for each block (rows) and for all penetrations (colour scale, legend depicted in Figure 4).

Case (iv)
10% of penetration 20% of penetration 30% of penetration 40% of penetration 50% of penetration To sum up, SS and DN indicators, and objective functions (are defined in Sections 3.2 and 3.3) are calculated and presented in Tables 20-22, respectively.Note that there are many SSs, so Table 20 only presents average and peak values from SSs.
Further, it is interesting to note that assessing the impact of forecasting errors for generation and demand in indicators included in the above mentioned tables, additional simulations were performed, in which no forecasting errors were considered.The comparison of the results indicate a little influence in the indicators.For instance, the indicator associated to the usage of batteries (I s SS 3 ) has experienced a variation around 1.97% (so less than 2% on average) from these two simulations.Similarly, the indicator addressing the renewables' curtailment (I s SS 4 ) has varied about 1% on average.Indicators addressing voltage quality (I s SS 1 ), power factor (I s SS 2 ) and power losses (I s DN 1 and I s DN 2 ) has remained almost equal for the two simulations.

Discussion of Results
This section presents a discussion of the optimization results.The optimization is carried out through Julia software [48,49] using the mathematical language called Jump [50] and optimization solvers called Gurobi [51] and Ipopt [52].Then, the obtained data is thread and depicted through mathematical software (Matlab) [53].The discussion of results is in terms of the indicators previously defined, which focus on the secondary substations (SS indicators) and of the rest of the elements of the distribution network (DN indicators).

SS Related Metrics
(i) Voltage quality related metric (I SS 1 ) The voltage metric is directly related with Figure 7.This reflects that the quality of the voltage at the SSs tends to decrease with the distance of these SSs to the point of interconnection with the transmission system.It is remarkable to note that this trend is accentuated if the network is operated from just an economic criterion, i.e., through the GEO (see the results for case (ii) in Figure 7).However, if it is applied the technical operation strategies -the GTO-(see cases (iii) and (iv), the metric I SS 1 results clearly improved with respect to base cases (i.e., case (i) with respect to case (iii); and case (ii) with respect to the case (iv)).This can be clearly observed in Figure 9, upper left subplot.
(ii) Reactive power related metric (I SS 2 ) It is considered that the reactive power is only associated to the loads of the network; generators are operated with an unitary power factor.Therefore, this metric does not depend on the DG penetration level for cases where there is not reactive power management -the GTO-(cases (i) and (ii)).However, when there is reactive power management (cases (iii) and (iv)), there is a dependency between DG penetration and the reactive power metric I SS 2 .This can be reflected in Figure 9, upper right subplot.For low levels of DG penetration, the reactive power management focuses on reducing electrical losses.As a reminder, this reactive power management is performed by the IDPRs, not by DG.Conversely, for DG penetration levels above the threshold level of 30%, from which active power flows through the network are highly variable, the reactive power management is under the criterion of smoothing voltage variations.As a consequence, the reactive power metric decreases.This progressive worsening of metric I SS 2 is also appreciated in Figure 9, upper right subplot.(iii) Battery related metric (I SS 3 ) The battery usage is directly related with the level of DG penetration (see SoC variations for all cases evaluated in Figure 8, clearly showing how batteries are more and more operated with increasing DG penetration levels).For all cases and regardless the usage level of the battery, they are charged with surplus of DG.Still keeping the attention in Figure 8, we can observe two additional aspects.First, for the case in which the network is operated under an economic criterion, i.e., case (ii), the GEO decides to let batteries completely discharged at the end of the day for economic purposes.This way, batteries are charged in sunny hours, with surplus of renewables, and discharged at night, when electricity is costly and there is no surplus of renewables.Second, for the case in which the network is operated also under the technical criterion (i.e., cases (iii) and (iv)), batteries are also operated so as to improve the power quality of the network (for instance to smooth out voltage variations).As a consequence, the usage of the batteries is higher than in the case (ii), specially for DG penetrations above 30%.
(iv) Curtailment related metric (I SS 4 ) The curtailment related metric is directly associated to the level of DG penetration and management tools applied.For low DG penetration levels, the curtailment is not relevant (see Figure 9, bottom right subplot).Conversely, for DG penetration levels above 30%, curtailment is an issue and a matter being dealt by solely the GTO (case (iii)) or both the GTO and the GEO (case (iv)).For the case (iii), and as shown in Figure 9, a noticeable share of DG generation results curtailed with the objective of maintaining a minimum power quality in the network.Note for instance in this regard, that up to 12% of renewables should be curtailed considering a DG penetration level of 50%.For the case (iv), in which the network is operated by both the GTO and the GEO, this latter management algorithm decides to reduce the amount of energy curtailed so as to minimize economic costs of network operation, while still respecting the technical optimization proposed by GTO.

DN Related Metrics
(i) Distribution electrical losses (cables and transformers) (I DN 1 ) Passive losses are proportional to the square of current.As can be observed in Figure 6, they are significant during peaks of demand and/or generation.Also in the above mentioned figure, for the case (i), when the DG penetration level is low the major part of electrical losses are during peak demand hours (i.e., in the morning).Conversely, while the DG penetration level is high, the major part of electrical losses are gathered during the midday (as a result of PV generation).
More in detail, Figure 10, upper left subplot, presents the evolution of metric I DN 1 (so the magnitude of distribution losses) function of DG penetration levels.As can be observed, for low shares (below 30%) and considering the application of the advanced management tool GTO (case (iii) and case (iv)), passive losses become lower than for the base case (case (i)).However, for penetration levels above the threshold of 30%, the actuation of the GTO, which is focused on smoothing voltage variations, affects distribution losses increasing them above the base case.It is important to highlight that active losses remain almost constant during the day.However, in the evening, they experience an increment as a result of the process of batteries discharging.Finally, in case (i) there are not active elements involved, such as IDPRs and BESSs, so there are not associated electrical losses to compute.This electrical consumption is additional to the base case.This is a toll that smart grids have to pay in order to include additional equipment as power electronics and batteries.However, it represents a small percentage of all consumptions, similar to cables and transformers.As can be observed in Figure 10, in general terms, the higher the DG penetration is, the more we utilize batteries and power electronics, and thus the higher the associated losses are.Finally, note that this usage of batteries is mainly bounded at night, since is in this time frame in which batteries are discharged (see Figure 6).It is noted that the dependency with the EG is inversely proportional to DG penetration level.Such dependency with the EG is even lower if the network is managed by the GEO (please compare cases (i) and (ii) in Figure 10 bottom left subplot).From this comparison, it can be observed that I DN 3 is improved up to 10% approximately at most while considering the GEO.This can also be observed in Table 21.Even though this improvement could seem relatively small, the impact of including the GEO as the management tool results much more important in economic terms, as analysed later in Section 5.3.In addition, an important aspect to highlight at this point is the effect of CDLs and PDGs in external grid dependency.The management of such resources permit time shift consumption and generation according to electricity prices.In other words, CDLs consume when there is an energy surplus or when the energy is cheap, and PDGs generate when there is an energy deficit or when it is expensive.The effect on this management is reflected in Figure 9, comparing cases (i) and case (iii) (cases with no management of CDLs and PDGs), with cases (ii) and (iv), in which there is management for such controllable resources.It can be observed how demand peaks are moved to off-peak periods (for instance, see the load peak reduction in the morning for cases with renewables penetration of 10% and 20%).

Evaluation of Objective Functions
(i) The GEO objective function (z GEO ) As a reminder, the GEO tries to minimize the operational costs of the DN.As can be appreciated in Figure 11, left subplot, the costs, i.e., z GEO , decreases as proportional to DG penetration levels for all cases.This makes sense, since less power is imported from the EG.Such trend is even accentuated for cases (ii) and (iv), where the economic management is applied.In addition, it is worth noting that for low DG penetration levels, the cost is slightly higher than for considering high shares due to the toll associated to the losses incurred in batteries and power electronics.It is important to remark that from 30% of DG penetration on, this additional losses are compensated via the savings from the economic management performed by the GEO.Finally, the cost reduction from cases (ii) and (iv) with respect to the case base (case (i)), is almost 45% and 21%, respectively.
(ii) The GTO objective function (z GTO ) As a reminder, the term z GTO is related to the magnitude of the power flows between the DN and the EG, and also to the severity of voltage variations within the DN from the desired values.So from a technical perspective, z GTO should be as low as possible, indicating somehow minimum power losses and voltage deviations.As depicted in Figure 11, right subplot, in general terms z GTO decreases with the DG penetration level.This clearly depicts the progressively dependency reduction with the EG.For the base case though, and also for the case (ii), in which the GTO are not working, there is point, around 40% in DG penetration, that voltage variations are remarkably high, and this makes z GTO to increase.On the other hand, for these scenarios in which the penetration of DG is above 40%, the operation of the GTO keeps such voltage deviations low, thus ensuring a minimum z GTO .

Conclusions
This paper addressed the impact of including different advanced techniques for managing electrical rural grids.These techniques combine the application of ICT tools and power electronics with embedded energy storage capability.The analysis was based on a real grid, in which different scenarios have been evaluated and these are characterized by progressively increasing the penetration of renewable energy generation from a base, current case.In these analyses, the temporal profiles for the demand have been also derived from the current ones, and adopted with a 15 min time step resolution.
The new advanced management techniques included: (i) an algorithm named as GEO, able to dispatch the charge and discharge of the energy storage devices throughout the grid, as well as the controllable loads and programmable energy generation capabilities, all of these from an economic criterion; (ii) an algorithm named as GTO, able to dispatch the charge and discharge the energy storage devices, the programmable energy generation capabilities as well, and all addressing active power flows, as for the GEO, but also the reactive power flows throughout the distribution grid.In this sense, the GTO performs the operation of the network in terms of a technical criterion; and (iii) a new power electronics-based device with embedded energy storage capacity named here as IDPR.This device effectively executes the charge and discharge of the storage capabilities throughout the grid (i.e., batteries), and also performs a proper management of reactive power flows according to GTO setpoints.
The obtained results, in general terms, demonstrate that for the adopted grid as the case study, the inclusion of these advanced management techniques from both a technical point of view (i.e., an improvement of the power quality of the network) and an economic perspective (i.e., a reduction of the costs incurred in importing energy from the exterior of the distribution network), is justified with a penetration of renewables higher than the threshold level of 30%.From this level of penetration on, the reduction of the costs due to the energy imported with the external grid compensates the toll to be paid in the form of the additional losses of the new energy storage devices integrated into the grid.To emphasize, such thereshold level in penetration of renewables is particular for the adopted study case and cannot be generalized.However, the performed management tools and related metrics could be directly applied for analyzing other networks.
Also from this level of penetration on, the inclusion of these new management tools (ICTs and energy storages) does improve the techno-economic operation of the grid.This means that the voltage profiles throughout the network result much more consistent and smoothed, and that the dependency with the external network is much lower than in the case of not considering such management tools.For instance, the included energy storage systems, properly managed by the GTO and the GEO, permit to reduce the operation costs, which are mainly affected by the energy imported from the external grid, from 42.5 e /day (case (i), or base case) to 23.4 e /day (case (ii), GEO working), for the case of 50% of renewables' penetration.Further even, the operating costs of the network as calculated by the sum of the cost of the energy imported from the external grid, the distribution losses and the investments in power electronics as well, result lower while managed by the GEO than in the base case.
More in particular, the inclusion of just the GTO algorithm (not in combination with the GEO) cannot be justified in economic terms.In the same manner, the inclusion of the GEO can be justified from an economic perspective, but not from a technical point of view.The combined actuation of both algorithms yields satisfactory results from both perspectives.
The inclusion of such management tools from a technical perspective can be justified for weak and radial networks concerning long distances, which is the typical case for rural networks.These networks experiences high variations in voltage levels and these become accentuated with the distance from the point of interconnection with the main external grid.These problems are further accentuated with the inclusion of renewables, since voltage variations can be noticeable especially at the end of lines.
Finally, it is worth noting that the analysis proposed in this paper is representative of a case with growing importance of renewables in rural distribution grids.So it is, without any doubt, a timely exercise and in response to the urgent energy transition the electrical power sectors are currently undergoing.

Figure 2 .
Figure 2. Global Energy Management System (GEMS) in detail.
admittance between node b and node c (S), [c, d ∈ N].K c,d YB Imaginary part of admittance between node b and node c (S), [c, d ∈ N].
Rated power of transformer from node c (kVA), [c ∈ N SS ].K c RP BS Rated power of IDPR from node c (kVA), [c ∈ N SS ].K c V M Desired voltage module for SS node c (kV), [c ∈ N SS ].K c PC Active power consumed in node (includes the power consumed by NCDL, CDL and IDPRs) c (kW), [c ∈ N SS ].K c QC Reactive power consumed in node (includes the power consumed by NCDL and CDL) c (kvar), [c ∈ N SS ].K c LPG DG Minimum threshold value for active power generation from DGs (NCDG) at node c (kW), [c ∈ N SS ].K c UPG DG Maximum threshold value for active power generation from DGs (total) at node c (kW), [c ∈ N SS ].K c LPG BS Minimum threshold value for active power generation from BESSs (charging) at node c (kW), [c ∈ N SS ].K c UPG BS Maximum threshold value for active power generation from BESSs (discharging) at node c (kW), [c ∈ N SS ].

Figure 6 .Figure 8 .
Figure 6.In the first column: Power losses of DN passive elements for each case.In the second column: Power losses of DN active elements for each case.

Figure 9 .
Figure 9. Trend of diverse SS related metrics with respect to DG penetration level.

Figure 10 .
Figure 10.Trend of diverse DN related metrics with respect to DG penetration level.

Figure 11 .
Figure 11.The operational costs of the DN for diverse DG penetration levels.

Table 5 .
Summary of input data (Distributed Generators (DG) parameters).Power generated by SDG g from SS s at time t (kW), [g ∈ G S , s ∈ S, t ∈ T].K Power generated by ADG g from SS s at time t NCDGPower generated by NCDG from SS s at time t (kW), [s ∈ S, t ∈ T].

Table 7 .
Summary of variables (secondary substations (SS) and EG variables).
SS ∈ R Energy exchanged by a SS s at time t (kWh), [s ∈ S, t ∈ T] x s,t E DL ∈ R + Energy consumed by all DLs associated to a SS s at time t (kWh), [s ∈ S, t ∈ T] x s,t E DG ∈ R + Energy generated by all DGs associated to a SS s at time t (kWh), [s ∈ S, t ∈ T] x s,t E BS ∈ R Energy provided by all BESSs associated to a SS s at time t (kWh), [s ∈ S, t ∈ T] x t EI EG ∈ R + Energy imported from the EG at time t (kWh), [t ∈ T] x t EE EG ∈ R + Energy exported to the EG at time t (kWh), [t ∈ T] x t B EG ∈ B Boolean variable indicating that the systems is importing energy from the EG at time t (-), [t ∈ T]
CDL ∈ R + Energy consumed by all CDLs associated to a SS s at time t (kWh), [s ∈ S, t ∈ T] x l,s,t B CDL ∈ B Boolean variable indicating that the CDL l associated to a SS s is consuming energy at time t (-), t, [l ∈ L C , s ∈ S, t ∈ T] x s,t ENS DL ∈ R + Energy not supplied to DLs associated to a SS s at time t (kWh), [s ∈ S, t ∈ T]
+ Energy generated by all SDGs associated to a SS s at time t (kWh), [s ∈ S, t ∈ T] x s,t E ADG ∈ R + Energy generated by all ADGs associated to a SS s at time t (kWh), [s ∈ S, t ∈ T] x s,t E PADG ∈ R + Energy generated by all PADGs associated to a SS s at time t (kWh), [s ∈ S, t ∈ T] x s,t ENG NCDG ∈ R + Energy not supplied by NCDGs associated to a SS s at time t (kWh), [s ∈ S, t ∈ T] x g,s,t B SDG ∈ B Boolean variable indicating that the SDG g associated to a SS s is generating energy at time t (-), [g ∈ G S , s ∈ S, t ∈ T] x s,t ENG SDG ∈ R + Energy not generated by SDGs associated to a SS s at time t (kWh), [s ∈ S, t ∈ T] x g,s,t R ADG ∈ R : [0, 1] Proportion of energy generated by the ADG g associated to a SS s at time t (kWh), [g ∈ G A , s ∈ S, t ∈ T] x s,t ENG ADG ∈ R + Energy not generated by ADGs associated to a SS s at time t (kWh), [s ∈ S, t ∈ T] + Energy not generated by PDGs associated to a SS s (kWh), [s ∈ S, t ∈ T] x g,s,t B PADG ∈ R + Boolean variable indicating that the PADG g associated to a SS s is generating energy at
+ Energy consumed by BESS b associated to a SS s at time t (kWh), [b ∈ B, s ∈ S, t ∈ T] x b,s,t ED BS ∈ R + Energy discharged from BESS b associated to a SS s at time t (kWh), [b ∈ B, s ∈ S, t ∈ T] x b,s,t SoC BS ∈ R : [0, 1] State of Charge of BESS b associated to a SS s at time t (-), [b ∈ B, s ∈ S, t ∈ T]

Table 11 .
Summary of input data (sets).
SSSubset of nodes from N that correspond to SSs.N EGSubset of a node from N that corresponds to EG.

Table 12 .
Summary of input data (constants and general parameters).

Table 13 .
Summary of input data (EG parameters).Voltage module of EG node c (kV), [c ∈ N EG ].K VA EG Voltage angle of EG node c (kV), [c ∈ N EG ].K RP EG Rated power of EG transformer from node c (kVA), [c ∈ N EG ].

Table 14 .
Summary of input data (SS parameters).
VE ∈ R Voltage excess for node c (kV), [c ∈ N] x c PG DG ∈ R + Active power generated by DGs in node c (kW), [c ∈ N] x c PG BS ∈ R Active power injected by BESSs in node c (kW), [c ∈ N] x c QG ∈ R Reactive power generated by IDPRs in node c (kvar), [c ∈ N]

Table 20 .
Summary of SS indicators.

Table 21 .
Summary of DN indicators.