Grid-Tied Distributed Generation Systems to Sustain the Smart Grid Transformation: Tariff Analysis and Generation Sharing

In this paper a novel model is being proposed and considered by ENEL—the largest electric utility in Chile—and analyzed thoroughly, whereby electric power control and energy management for a 60-apartments’ residential building is presented as an example of the utility’s green energy program, part of its Smart Grid Transformation plan to install grid-tied distributed generation (DG) systems, namely microgrids, with solar generation and energy storage in Santiago, Chile. The particular tariffs scheme analysis shown is part of the overall projected tentative benefits of adopting the new scheme, which will require the utility’s customers to adapt their consumption behavior to the limited supply of renewable energy by changing energy consumption habits and schedules in a way that maximizes the capacity and efficiency of the grid-tied microgrid with energy storage. The change in behavior entails rescheduling power consumption to hours where the energy supply capacity in the DG system is higher and price is lower as well as curtailing their power needs in certain hourly blocks so as to maximize DG system’s efficiency and supply capacity. Nevertheless, the latter presents a problem under the perspective of ENEL’s renewable energy sources (RES) integration plan with the electric utility’s grid supply, which, up until now and due to current electric tariffs law, has not had a clear solution. Under said scenario, a set of strategies based on energy homeostasis principles for the coordination and control of the electricity supply versus customers’ demand has been devised and tested. These strategies which consider various scenarios to conform to grid flexibility requirements by ENEL, have been adapted for the specific needs of these types of customers while considering the particular infrastructure of the network. Thus, the microgrid adjusts itself to the grid in order to complement the grid supply while seeking to maximize green supply capacity and operational efficiency, wherein the different energy users and their energy consumption profiles play a crucial role as “active loads”, being able to respond and adapt to the needs of the grid-connected microgrid while enjoying economic benefits. Simulation results are presented under different tariff options, system’s capacity and energy storage alternatives, in order to compare the proposed strategies with the actual case of traditional grid’s electricity distribution service, where no green energy is present. The results show the advantage of the proposed tariffs scheme, along with power control and energy management strategies for the integration of distributed power generation within ENEL’s Smart Grid Transformation in Chile.


Introduction
It is estimated by The International Energy Agency (IEA) that global energy demand will grow by more than 25% to 2040 [1]. Thus, developing nations such as Chile are moving towards Integrated Resource Planning to advance green energy consumption, whereby the estimated demand and installation of distributed grid-connected generation systems are growing at rapid rate [2][3][4][5]. For distributed generation tied to the grid, the use of microgrids may be seen as an efficient solution by means of their flexibility and capacity to supply renewable energies. About 300 microgrid projects have been developed worldwide thus far, adding up to a total capacity exceeding 1.5 GW [6]. Distributed Generation (DG) is defined as "an electric power source connected directly to the distribution network or on the consumer side of the meter" [7]. Albeit important and desirable, in terms of expanding green energy consumption, the introduction of renewable distributed generation raises some issues and has consequences for the electricity supply services' regulation and for the operation by the distribution system's operators. Hence, industry regulation, especially in countries such as Chile, should aim to achieve: (1) a level playing field between centralized and distributed generation and (2) efficient operation of the distribution network [2].
Benefits of distributed generation (DG) for consumers as well as for electric utilities is well documented in the literature [8,9]. The expected huge rise in electrical energy demand in a fast-approaching all-electric modern society scenario brings a set of challenges that can have very significant impact on the availability and demand for resources. Thus, to improve green energy generation, two strategies are outlined in this paper, both aimed at harnessing and maximizing available resources. Moreover, renewable and alternative energy resources integration and sustainability should be the electric sector's regulation's immediate focus. To overcome the challenge in the coming years, the main focus for investment should be on research and development of new technologies to advance such a trend, while pursuing a green revolution in renewables' generation and energy management.
Specially designed microgrids, together with DG [9] resources and independent small-scale systems can be integrated into urban or rural environments which can autonomously generate and store energy. The microgrid can be comprised of small gas turbines, microturbines, fuel cells, wind and solar energy, biomass, and small hydroelectric power, among other energy resources [8]. On the other hand, the technical and economic advantages related to the implementation of DG in distribution networks have been widely investigated, such as the reduction of active and reactive energy losses, improvement in reliability, reduction of blackout probability, and peak hours demand reduction [2]. Nevertheless, the regulatory aspects have not kept pace with technological advancements, as they have not been covered and revised in depth, presenting a hindrance for the industry's plan to advance green energy integration in the electricity distribution sector [10]. On the other hand, research on specific urban challenges, social impact of potential economic benefits drawn by industry policies and regulation needs remain to be an issue that is lagging behind and that should be extensively investigated [3,11].
In a relatively short period, between 2014 and 2020, the expected growth of investment in microgrids for commercial buildings was expected to grow by 94%; for medium size communities it is expected to grow by 199%; for public institutions by 228%; for large military installations by 142%; and finally, the microgrids that supply universities is expected to grow by 115% [12]. Considering these growth rates, some authors propose that microgrids should be treated, in many ways, as a new power system [4], incorporating those elements of analysis that are common to traditional electric power systems, such as stability analysis, frequency control, protection system response, electricity tariffs, and energy quality. The location of this new electric power system will depend largely on the customer's Energies 2020, 13, 1187 3 of 19 location and on the availability of renewable energy sources and fuel resources such as natural gas to be used for small turbines and microturbines, as a perfect, rapid dispatching complement for solar energy generation and supply, including energy storage. This should decrease dependency on the network operator or the authority [8,13].
These new consumers, termed "prosumers" by some authors [14], can become relevant actors in the future electricity distribution scenario and they may require clear signals from the tariffs viewpoint. Indeed, this is advisable so that the behavior of prosumers is aligned with the proper functioning and optimality of the electrical systems. Some authors have suggested establishing demand side management (DSM) systems together with dynamic pricing [15] as part of the solution. Other researchers have done research quite extensively on this very subject, advocating for different schemes of energy consumption and energy sharing made possible by novel energy management and power control systems based on energy homeostasis, providing insight into various forms and scenarios of DSM. Both energy homeostasis and energy sharing are key to these new schemes so as to incentivize the production of renewable energy at different scales, coupled with the grid supply, and under tariff schemes which clearly entice prosumers to enhance their behavior, provided that there are appropriate economic incentives for advancing such schemes not only in the residential sector, but also in the commercial and industrial sectors as well, making them attractive amongst consumers [16][17][18]. As a matter of fact, there are already incentives in Chile, provided by the net metering law 20,571 enacted in 2014 [19], which provides appropriate economic benefits for those willing to install and generate electricity through on-grid distributed generation systems (DGS) although not addressing the tariff differentiation issue. Hence, many people have taken advantage of this law already, allowing prosumers significant savings in their electric bills. In many electric utility service territories, among them in the large metropolitan region of Chile where the country's capital, Santiago is located, there has been a rapid growth in distributed generation projects, both small-to-medium scale as well as some large scale, especially rooftop solar, and solar parks of different sizes and arrangements. This new trend is triggering an array of both legislative and regulatory proposals for changes in rate designs based on economic incentives, designed to reward those that exhibit a more efficient and thriftier power consumption behavior as opposed to those who do not. This is particularly important during certain hourly blocks, and also during several times of the year when electricity demand is very high, and becomes more so with extreme weather conditions in many places.
The chief aim of the electric utility is to clearly identify and characterize electric consumption profiles, particularly amongst residential consumers, so as to be able to distinguish those customers who are more intensive in power consumption during these daily hourly blocks as well as their behavior during specific times of the year, from those who are less intensive and who also exhibit a rather thrifty behavior when it comes to energy consumption [20][21][22]. Those who collaborate and maintain a rather more stable, thrifty, and regular energy consumption-especially during peak hours of the day and also during periods of the year when extreme demand for electricity occurs-are entitled to be rewarded by having a lower electric tariff [15][16][17][18]. This distinct changes in power versus energy consumption are clearly monitored and recorded regularly by the electric utilities in some way or fashion, depending on the particulars of the operations management models and regulations that exist in each country [20][21][22]. Likewise, the Homeostatic Control (HC) system clearly establishes limits in power consumption of the sustainable energy system (SES) within specific hours of the day so as to condition electric consumption behavior on the part of consumers, to keep within the range of green energy bounds present in the DGS' supply and made available by the SES. Stanton (2015), in his Distributed Energy Resources: Status Report on Evaluating Proposals and Practices for Electric Utility Rate Design [23], gives a thorough account of the progress of these ongoing changes in the electricity distribution markets. He argues that some rate design proposals and recent actions are solely focused on solar PV generation and net energy metering (NEM) policies, unveiling a gap in research and in the industry's focal issues, while suggesting that there is a need for exploring an ampler, more diverse and flexible spectrum of both different energy sources in conjunction with the grid supply and differentiated tariff options. The major issues discussed in his paper are: (a) whether NEM customers or others with on-site generation are paying their fair share of the distribution system costs; (b) whether rate designs provide utilities with a reasonable opportunity to earn their regulated rate of return; and (c) whether to what extent, and in which direction, current rate designs might be resulting in cross-subsidies [23]. Bustos et al. (2019) [23] have correctly pointed out that sharp cost reductions of Distributed Energy Resources (DER) will probably drive their deployment without the need for economic incentives-especially in the case of photovoltaic (PV) energy. While this is nowhere in sight at present, at least in countries like Chile and others in Latin America, it is nonetheless foreseeable that such a likely scenario might partially become true given the reduction in hardware prices and the substantial and sustained decrease in solar photovoltaic (PV) generation's marginal cost per kilowatt, although not entirely. The authors argue that Dynamic Grid Parity Models (DGPM) combine learning curves with grid-parity, and add that DGPM are useful to assess the time-evolving competitiveness of generation technologies, but fail to capture the residential end-user's choices and cost-benefit analysis of drawing on DER generation once they become feasible [24]. They propose a robust framework based on a local and optimal microgrid, combined with learning curves to assess the potential penetration of Distributed Energy Resources (DER) in households [24]. Likewise, several other authors [25][26][27][28][29][30] have also done extensive research on the subject of learning curve analysis of solar photovoltaic systems as the chief DER technology being incorporated as an on-grid renewable energy supply to the electric power distribution markets. This is particularly true in the residential sector, as well as research on solar photovoltaic grid parity, addressing the various issues and challenges present as well as the status of different PV markets. The dynamic grid-parity model enables us to estimate where and when sustainable market segments are to be created by implementing PV electricity generation. Grid-parity is a very important milestone for further photovoltaic (PV) diffusion. Thus, grid-parity models are based on the levelized cost of electricity (LCOE), coupled with the experience curve approach. It is important to mention here that the levelized cost of electricity (LCOE) is a rather holistic or integral way of measuring the costs involved in the generation and supply of electricity, and includes the timeline of all the expenditures that go into the production of a kilowatt-hour of energy supply. The cost is levelized over the lifetime of the plant. Several assumptions are made as well as the respective key driving forces of the dynamic grid-parity model, such as the experience curve approach, PV industry growth, PV systems cost are all taken into account. The progress of the dynamic grid-parity model is measured by the learning curve or learning rate (LR) or the so-called progress ratio (PR). That is why the DGPM is firmly founded on the application of learning curves.
The demand variation due to unforeseen circumstances can be counteracted by innovative tariff structured algorithms such as Multi-Time-Of-Use (Multi-TOU) and Multi-Critical-Peak-Pricing (Multi-CPP) [14,25]. Thus, for example, a community-based multi-party microgrid, involving critical loads and generators of multiple owners, becomes part of the business model [31].
Power is the rate at which electrical energy is being produced and consumed and it is measured in kilowatts (kW) or simply watts. An energy system that is generating a certain amount of electric power, which in turn is being consumed by a particular community of residential inhabitants-who may very well have widely different consumption habits and lifetime patterns-has a distinct frequency in Hertz, which in fact acts as a footprint of the power consumption being faced by the energy system albeit electricity consumption is measured in kW-hours, as the kilowatt-hour is commonly used as the standard billing unit for energy delivered and consumed. Hence, electricity consumers usually pay for their electrical energy consumption based on the amount of kilowatt hours (kWh) used-this is the equivalent to 1 kW of power expended over 1 hour of time. The reason for wanting to limit the rate at which energy is consumed, namely power, may vary from time to time and from situation to situation, based on the particular circumstances and/or contingencies being present at any point in time. In the particular case being addressed in this paper, an electric power distribution grid managed and operated by the local electric utility company, say ENEL Distribucion in Chile, has decided at some point in time, acting in accordance with and under the prevision of current and future changes in the law and the regulations governing the electric distribution industry (for example, aimed at advancing the use of renewables and DG, as it is the case in Chile), to incorporate a distributed generation (DG) system-which has been termed here a sustainable energy system or SES-in the form of a medium size microgrid installed in a 60-apartment residential building. This particular microgrid operates grid-tied and has renewable and non-renewable energy sources (typically a gas-operated microturbine and/or a diesel-operated generator) including lithium ion batteries for energy storage.
It is well known in electric power systems engineering that the relationship between electric power consumption and frequency f are inversely related. That is, when electric power consumption in the energy system decreases frequency increases and vice versa, when electric power consumption increases, the frequency in the system decreases. In the case of grid-connected or grid-tied DG system operating in parallel with the grid, if the output power of the DG system (the microgrid) increases according to the load in the terminal of the connection point to the grid, then the frequency of the grid tends to increase. This effect can be detected with the inverter, whose control system requires the permanent tracking of the frequency and the phase angle of the grid voltage. In the model being presented in this paper, where a hybrid tariff scheme is being proposed as a means to incentivize and condition electric power consumption behavior of a particular community in order to achieve a green energy profile consumption, the HC system mixes an hourly rate based on time-of-use (TOU) and an electric tariff based on the imbalance between electric power generation and consumption so as to signal the support for DG system's efficiency and optimality of operation on the part of the consumer.
Power consumption limiting may also be applied as a result of capacity limitations or due to economic reasons. If, for example, a distribution company is facing the need to increase the capacity of a substation because of some urban expansion that imposes high power demand at certain hours of the day, it may prove to be more convenient to stimulate consumers to shift some energy intensive tasks or processes to hours (usually at night) when the substation is not so stressed-for example, a special night tariff may be created to encourage people to use washing machines at night instead of during the day. This will alleviate the total power demand (the rate at which energy is demanded) on the substation and allow the distribution company to postpone investment in new transformers. This is power management-modifying the profile of energy demand to support a particular purpose. In this paper, a hybrid tariff scheme has been proposed, which mixes an hourly rate (TOU) and a tariff based on the imbalance between generation and consumption. For the case study, a group of residential consumers termed a sustainable block™, who inhabit a residential building that has photovoltaic generation and energy storage is analyzed. Simulation shows that for residential customers, the hybrid rate, devised to advance and promote green energy generation and consumption in the urban sector, is cheaper than the hourly or flat rate. This is aimed at encouraging customers' behavior to be aligned with the DG system's capacity and efficiency factors so as to support a rather optimal functioning of the power system.
Some studies aimed at achieving some form of cooperation among customers have been presented, where a distributed management system of electricity demand is designed based on game theory for a group of residential customers. This model proposes a dynamic pricing strategy in which the rate is a function of the global demand of the users. Under this scheme, multiple customers choose time zones where the rate is cheaper, thus meeting their daily needs. In such systems, equilibrium is achieved without intervention of the central operator [32].
In contrast, the work presented in this article has an energy homeostasis algorithm designed with client cooperation and simulations using Matlab are performed and analyzed therein, to assess the performance of the technique and to test its validity. Enel Distribución S.A., the electricity distribution branch of ENEL in Chile, is one of the partners of this research initiative, where the main aim is to advance the development of a microgrid prototype especially designed for residential buildings in Santiago, Chile in the quest for transiting towards a larger share of green energy generation and consumption at the distribution level. Under this scenario and using real client demand data for Energies 2020, 13, 1187 6 of 19 simulation proposes, customers have the option to choose among the different tariff plans, provided that they meet their respective requirements [33].
Therefore, a group of customers with smart metering, distributed energy generation and energy storage units, installed in a 60-apartment building where they dwell, has the option of evaluating these different rates as a single client, being able to access electricity supply with a substantial portion of green energy at more convenient rates as a whole than as a single independent customer, thus seeking to cluster for convenience with the rest of the community. The DG system's energy management would be carried out by a supervisory control based on energy homeostasis [20] that allows to coordinate the different clients, while operating efficiently and moving towards the adoption of truly sustainable hybrid energy systems (SHES) [21,22]. This control strategy should be implemented locally on an acquisition and control device based on digital signal processor (DSP).
The analysis of the most convenient tariffs and cost sharing options among the customers of an apartment building block is performed in this study, which is organized as follows. Section 2 presents the case study and the parties involved with the green energy incorporation scenario being pursued by ENEL. In Section 3 the case of clustered clients is analyzed following two possible criteria for sharing renewable production: equal sharing and merit-based sharing, which entails thriftiness in energy consumption. Section 4 present the case of separate customers and its implications. Simulation results are presented in Section 5. Finally, the paper ends with some concluding remarks in Section 6.

Case Study
The study consists of grouping 60 residential households, which, along with the PV energy plant, comprise a sustainable block™ (SB) for the electric distribution company. This community of clients will be connected to the electrical grid installed and managed by ENEL Distribución. The solar PV plant is especially designed to meet the needs of the community in a percentage of its total electricity consumption needs with renewable energy. As a whole, the DG plant will seek to offer the optimal rate that is possible for the electric utility to provide to its customers, subject to the energy system's conditions and constraints. The arrangement is expected to result in economic benefits (incentives) for the residential consumers of the sustainable block™ in exchange for maintaining a scheme of efficient and sustainable electricity consumption, clearly aligned with the needs of the entire community (aggregate demand). A Lithium ion rechargeable battery bank with liquid thermal control that can achieved 4000-5000 cycles at 100% DOD (Depth of Discharge)was considered for this paper. In order to define the appropriate size, simulations were performed using 0 to 150 kWh.
In the studied case, the selected panel type is a commercial one whose characteristics in standard test conditions (STC) (i.e., irradiance of 1000 W/m 2 , spectral value of 1.5 AM and a temperature of 25 • C) are presented in Table 1. The resulting installed power capacity of the DG plant is 41.58 kW. Energy storage or backup is desired when the local distribution grid is not in operation due to a fault or cannot provide the necessary energy quality. In this operation condition, the storage unit provides reliability, availability, and the required power quality. Considering the aforementioned requirements and characteristics, the introduction of an energy storage unit is a main issue for ENEL. Also important while designing a microgrid are variables such as energy efficiency, duration, power density, and energy density, since they affect the overall storage cost.
In Table 2 below there are some technical characteristics of the two technologies. Lithium battery density is much higher than the battery of Acid-Pb; it also has a voltage per cell of 3.7 V, which decreases the number of cells in series to reach a certain voltage. In this work, the technical characteristics provided by the commercial Tesla Powerwall battery [34] will be adopted for simulation. Please note that DOD stands for Depth of Discharge and SOC stands for State of Charge of batteries.  (1) and (2) for the energy equilibrium of the grid-tied microgrid, which represents the energy homeostasis concept, are given in terms of the total power supply and the energy homeostasis regulation mechanisms discussed in [35]: where x represents the internal state of the energy systems at time t 0 and Energy equilibrium E equilb is dependent upon several factors operating adequately in the SES. Variables u and v represent the specific predictive and reactive homeostasis variables, respectively, which are designed in the HC model. In this work, predictive variable u is equivalent to the PV generated energy and the v variable is represented by the energy measured in the system. These parameters are designed based on extensive data modeling to incorporate as much accuracy in the system's response as possible [35]. SES actions are based on the situational awareness and degree of criticality-both having a distinct power-quality footprint being exhibited by the system. The solution to this challenge has been designed and developed based on energy homeostasis principles [20][21][22][23][24][25][26][27][28][29][30][31][32][33][34][35][36][37] and engineered in form of what has been termed and conceptualized as energy homeostaticity in the literature [16][17][18]. Homeostaticity in energy systems is that property, designed and engineered in the energy system itself, which seeks 1) to restore the system from a systemic imbalance or disruption that has altered its normal or steady state mode of operation, and 2) to bring about a rapid, effective and efficient state of equilibrium between the energy supply and the energy expenditure (consumption by the loads) at all times, whatever the circumstances, to preserve and maintain stability of operation in the energy system. It basically incorporates artificial intelligence and especially designed, community-specific intelligent control algorithms that are built to encompass a HC system [16][17][18]. Thus, the SES is operated as a function of adverse system conditions and environmental challenges being sensed by the energy system and represented by the awareness and criticality variable α. Three variables (u, v, and α) can be used as key constitutive elements of the intelligent algorithms built in the HC system, and as such, are the equivalent of metabolic variables in living organisms like the physiological and endocrine systems variables that affect the energy expenditure and storage of such energy systems [35]. Figure 1 shows a general structure of the control system, with an energy management system (EMS) and power management system (PMS), which will be designed following the homeostatic control strategy. The EMS/PMS receives as input the electric power generation predictions (based one predictive homeostasis data carried out by the HC system's assessment of internal and external variables) [35]. This is done taking into account the photovoltaic generation plant and the electricity consumption ranges in terms of demand side projection in order to decide on the magnitude and the energy flow. In addition, the storage status of the batteries must be monitored. Thus, in addition to pursuing the objective of minimizing operating costs (i.e., minimize money paid monthly for energy), the homeostatic controller will have certain attributes, described in the next subsections.

Battery Management
This defines when and how much energy to charge/discharge. The control system will charge the batteries when the demand is low and will draw energy form the batteries when the tariff of electricity is more expensive so as to provide the savings to the consumers, depending on the electric tariff that is being implemented.

Active Control of the Energy Demand
This is determined by how much energy is consumed by each client of the microgrid as recorded by the smart meters. The aim here is very distinct: to maximize the use of green energy with the microgrid's available generation and supply capacity. Those customers who are not "solidary" or simply choose not to align their electricity consumption with the needs of the rest of the community, will be notified through an interface and/or alarm, and those loads that exhibit constantly high electric power consumption (e.g., washing machine, charger, or heating) will be disconnected by smart switches (Smart plug), leaving them with the grid-only option.

Payment Management
This unit is responsible for prorating payments between users and the electric company. Customers who have low consumption of the microgrid supply (those that exhibit a thrifty consumption behavior), have the right to receive economic compensation (reward). Since overconsumption will be penalized, such reward is made possible by those who have a higher consumption of electrical energy, particularly those that use power consumption more often. This flexible arrangement and its philosophy comprise the backbone or cornerstone of what the authors have termed a sustainable block™, something that is being considered by ENEL Distribución as a means to entice and promote a sustainable and more manageable energy consumption scenario in light of the constraints imposed by DG plants which generate mostly from renewable energy sources. The company's projection is essentially to introduce more flexibility in the energy distribution and consumption, favoring green energy over the grid's supply, and to reinforce a frugal or thrifty electricity consumption behavior in a manner that allows for optimality in the microgrid's operation while, at the same time, allowing for an easier stabilization of the system if it were needed.

Tariff Calculation and Assignation for Clustered Customers
This scenario evaluates a homeostatic control strategy that permits an efficient energy management in a residential building connected to the main grid, with a photovoltaic generation plant installed on it, plus energy storage and an energy management control system that has a homeostaticity model built in. In this work, for the local electric company ENEL Distribución, all the individual

Battery Management
This defines when and how much energy to charge/discharge. The control system will charge the batteries when the demand is low and will draw energy form the batteries when the tariff of electricity is more expensive so as to provide the savings to the consumers, depending on the electric tariff that is being implemented.

Active Control of the Energy Demand
This is determined by how much energy is consumed by each client of the microgrid as recorded by the smart meters. The aim here is very distinct: to maximize the use of green energy with the microgrid's available generation and supply capacity. Those customers who are not "solidary" or simply choose not to align their electricity consumption with the needs of the rest of the community, will be notified through an interface and/or alarm, and those loads that exhibit constantly high electric power consumption (e.g., washing machine, charger, or heating) will be disconnected by smart switches (Smart plug), leaving them with the grid-only option.

Payment Management
This unit is responsible for prorating payments between users and the electric company. Customers who have low consumption of the microgrid supply (those that exhibit a thrifty consumption behavior), have the right to receive economic compensation (reward). Since overconsumption will be penalized, such reward is made possible by those who have a higher consumption of electrical energy, particularly those that use power consumption more often. This flexible arrangement and its philosophy comprise the backbone or cornerstone of what the authors have termed a sustainable block™, something that is being considered by ENEL Distribución as a means to entice and promote a sustainable and more manageable energy consumption scenario in light of the constraints imposed by DG plants which generate mostly from renewable energy sources. The company's projection is essentially to introduce more flexibility in the energy distribution and consumption, favoring green energy over the grid's supply, and to reinforce a frugal or thrifty electricity consumption behavior in a manner that allows for optimality in the microgrid's operation while, at the same time, allowing for an easier stabilization of the system if it were needed.

Tariff Calculation and Assignation for Clustered Customers
This scenario evaluates a homeostatic control strategy that permits an efficient energy management in a residential building connected to the main grid, with a photovoltaic generation plant installed on it, plus energy storage and an energy management control system that has a homeostaticity model built in. In this work, for the local electric company ENEL Distribución, all the individual customers of the building were grouped in what was considered a single load, named SB. These customers ought to reach consensus in order to choose from tariffs that were previously exclusively reserved for the commercial and/or industrial sector [33]. Based on this scenario, supervisory control strategies based on HC adapted to the specific requirements of the clients are applied, in order to obtain an efficient energy management. Such a strategy should encourage a particular behavior of consumers in order to achieve and maintain a more flexible, adaptable, and sustainable state of equilibrium. In this way, both supply and demand respond to each other in a cooperative way with mutual benefit. In this study, only the sharing of power generation and electricity costs will be considered. The investment cost of solar generation system and batteries are neglected.
The electricity tariffs that should be implemented for the SB will be BT-4.3 or AT-4.3, depending on the voltage level. These tariffs are common in the industrial sector, having the lowest price for the electric energy consumed, in addition to a charge for the maximum demand for power in peak hours. For this reason, the control strategy to be implemented should limit demand charges in order to maximize the benefits that can be granted to customers, and at the same time, the main network will operate at a higher efficiency point. On the other hand, these systems can be seen as a complex sociotechnical system, in which energy users must play a crucial role as active loads within the SB in order to make the most out of the renewable supply while always having the grid as a backup option.
The transaction module ( Figure 2) is in charge for assigning the energy quote for each client and calculate the energy flow among clients and the grid. In order to accomplish the aforementioned procedure, criteria A and B could be chosen.
Energies 2020, 13, x FOR PEER REVIEW 9 of 19 strategies based on HC adapted to the specific requirements of the clients are applied, in order to obtain an efficient energy management. Such a strategy should encourage a particular behavior of consumers in order to achieve and maintain a more flexible, adaptable, and sustainable state of equilibrium. In this way, both supply and demand respond to each other in a cooperative way with mutual benefit. In this study, only the sharing of power generation and electricity costs will be considered. The investment cost of solar generation system and batteries are neglected. The electricity tariffs that should be implemented for the SB will be BT-4.3 or AT-4.3, depending on the voltage level. These tariffs are common in the industrial sector, having the lowest price for the electric energy consumed, in addition to a charge for the maximum demand for power in peak hours. For this reason, the control strategy to be implemented should limit demand charges in order to maximize the benefits that can be granted to customers, and at the same time, the main network will operate at a higher efficiency point. On the other hand, these systems can be seen as a complex sociotechnical system, in which energy users must play a crucial role as active loads within the SB in order to make the most out of the renewable supply while always having the grid as a backup option.
The transaction module ( Figure 2) is in charge for assigning the energy quote for each client and calculate the energy flow among clients and the grid. In order to accomplish the aforementioned procedure, criteria A and B could be chosen.

Criteria A: Customers Share the N th Part of Generated Renewable Energy
The diagram in Figure 2 highlights the strategy to be used, where each client owns one N th part of the renewable energy produced and, for simplicity, all clients' charges and discharges the battery

Criteria A: Customers Share the N th Part of Generated Renewable Energy
The diagram in Figure 2 highlights the strategy to be used, where each client owns one N th part of the renewable energy produced and, for simplicity, all clients' charges and discharges the battery equally.
The module begins by discriminating between clients with energy excess or deficit, by using Equation (3): The sum of all the excess, given by Equation (5), corresponds to the total energy available for sale; a fraction of this energy will feed the requirements of the customers with deficit P Pool t and the rest will be injected into the network P inGrid t . The energy contribution of each client will be identified defining a factor according to Equation (6): Then, the energy supplied to customers with energy deficit and injected into the grid by the customers with excess i will be given by Equations (8) and (9), respectively: If Equation (3) is not met, there is a client with an energy deficit. This customer must use energy from the grid P grid t and/or from the excess of other customers with renewable energy P Pool t . The procedure that describes the energy flow under this condition, is depicted in a flow diagram (Figure 2) to supply renewable energy under equality criteria included.

Criterion B: Substantial Renewable Energy Supply According to Customer Merit
The flow diagram of Figure 3 shows the control strategy of the power supply from the microgrid. Following this strategy, customers will get renewable energy as a reward by having an efficient and low consumption that enables to bound the maximum demand.
The algorithm begins by checking if there is enough power from the microgrid to satisfy the demand of the SB by applying Equation (10). If Equation (10) is satisfied, all customers will take energy from the microgrid, achieving 100% of their energy consumption. The excess of energy is injected into the main grid and clients will receive an equal income for that contribution.
If Equation (10) is not met, it is understood that the energy available in the microgrid is not enough to satisfy the demand. Therefore, this energy must be administered and delivered as a reward for clients that have a low consumption during peak hours. The module algorithm designed for peak hours is in charge of organizing the customers according to their energy consumption from lowest to highest. The first m customers will have the right to receive energy from the microgrid in proportion to their consumption, as indicated in Equation (11): where Sum corresponds to the sum of the consumptions of the first m customers. On the other hand, the remaining N − m customers must satisfy 100% of their energy consumption from the utility. Customers who are allowed to receive energy from the microgrid at peak hours will increase an index called, "Homeostatic Index ( f HC )" [36]. This index will be used to distribute the renewable energy in non-peak hours of the next day. In addition, customers will be ranked from higher to lower according to the mentioned index, thus, the first m clients with higher f HC will obtain energy from the microgrid. Due to the high cost of the peak hour demand, the control system must encourage customers to consume during off-peak hours. To meet this goal, the cost of the electricity supply is transferred to consumers through an internal tariff, which differentiates between low and high demands. Figures 3  and 4 illustrate the applied internal tariff; this will be based on the monomic energy price, which consists of a single equivalent price per kWh that considers both the energy and the power charge. Due to the high cost of the peak hour demand, the control system must encourage customers to consume during off-peak hours. To meet this goal, the cost of the electricity supply is transferred to consumers through an internal tariff, which differentiates between low and high demands. Figures 3  and 4 illustrate the applied internal tariff; this will be based on the monomic energy price, which consists of a single equivalent price per kWh that considers both the energy and the power charge.
C mop = t∈h op P grid t ·∆t ·C e + P max t ·C op t∈h op P grid t ·∆t (13) Energies 2020, 13, 1187 12 of 19 C m op = C mp == t∈month P grid t ·∆t ·C e + P max t ·C op + P max pt ·C p t∈month P grid t ·∆t (14) Equations (12) and (13) correspond to the monomic price that should be used at peak hours and off-peak hours, respectively. The monomic price for peak hours (C Mp ) is calculated monthly on the basis of energy consumed in peak hour and take into account the maximum registered power demand in peak hours. On the other hand, the other monomic price for low demand (C Mop ) is calculated in a similar way, yet considering off peak hours. All monomic prices are calculated monthly together with the billing cycle. During the months which do not contain peak hours (October to March), the monomic peak and non-peak costs are the same and the calculation is according to Equation (14). After one year of evaluation (t = 35, 040, ·t = 15 min), the monthly and annual costs are calculated for each client and the BS according to Equations (15)- (19) (prices are shown in [37]).  Please note that ℎ denotes a Winter month (from April to September) and ℎ denotes a Summer month, (from October to March). Hence, the costs are calculated for each season separately as shown in Equations (15) and (16): where the values of is in the order of $0.1 US dollar, yet it depends on the tariff ( is in the same order), and the price of the energy from the grid can get up to $0.15 US dollars. The algorithm is repeated up to 20 years (PV lifetime); each year, a loss of efficiency in photovoltaic panels equal to 0.6% is added and a linear reduction of battery capacity is also considered, so that the final battery capacity is 80%. The depth of discharge of the battery is adjusted so that no intermediate replacements occur.

Separate Customers
Customers are free to choose between different electric rates in the corresponding voltage level. Among the rates offered by the local electricity company, described in a previous section, only BT-1 tariffs and a Flexible Electric Tariff (THR) are competitive for levels and consumption characteristics Please note that month p denotes a Winter month (from April to September) and month op denotes a Summer month, (from October to March). Hence, the costs are calculated for each season separately as shown in Equations (15) and (16): where the values of C inGrid is in the order of $0.1 US dollar, yet it depends on the tariff (C Pool is in the same order), and the price of the energy from the grid can get up to $0.15 US dollars. The algorithm is repeated up to 20 years (PV lifetime); each year, a loss of efficiency in photovoltaic panels equal to 0.6% is added and a linear reduction of battery capacity is also considered, so that the final battery capacity is 80%. The depth of discharge of the battery is adjusted so that no intermediate replacements occur.

Separate Customers
Customers are free to choose between different electric rates in the corresponding voltage level. Among the rates offered by the local electricity company, described in a previous section, only BT-1 tariffs and a Flexible Electric Tariff (THR) are competitive for levels and consumption characteristics of individual customers. In this scenario the option of incorporating a photovoltaic plant in the common roof of the building and an energy storage system is evaluated. Since the energy meter of each customers is operated by the electricity utility, the only option is to deliver the renewable energy to the common services of the building or to the main grid. As illustrated in Figure 5, the meter of the customer will effectively record its electricity consumption but will not discriminate if it is supplied by the main network or the micro-grid, generating a conflict between the Electricity Company and customers of the building.  Therefore, in agreement with current regulations specified in, the convenient strategy is to inject renewable energy into the common services (services used by all the inhabitants of the building, e.g., elevators) of the building and then to the main network. The most common tariff used BT-3; in addition, it was assumed that all the renewable energy is self-consumed. The project income should be calculated as the savings on the electricity common services bill paid by customers on a monthly basis.

Model of the System
The analysis focuses on modeling and simulates a distributed generation (DG) solution for use in a residential sector, which offers efficient management of energy supply and consumption, from a technical-economic point of view. The DG system will be designed to handle, or efficiently manage, the energy in a residential building of average dimensions located in Santiago, Chile (15 floors and 60 apartments), with photovoltaic generation, storage capacity plus an intelligent energy management system based on Homeostatic Control. The building community, composed of 60 apartments of different sizes and different demands will be called, for effect of this work, sustainable block.

Simulation Results
In this section, results obtained by simulations are presented and analyzed. These results validate the Homeostatic control strategy used to manage the energy of the customers, taking into consideration the benefits that they would receive under different alternatives.
A common practice to reduce the maximum demand during peak hours is to charge the batteries from the main grid during the low demand hours based on weather forecasts and algorithms to predict the photovoltaic generation; the aim is to get into peak hours with the batteries fully charged. In this way, the benefits of the electric tariff to be used (BT-4.3 or BT-4.3) are maximized. As an example, Figure 6 depicts the power flows between the different elements during one day considering the existence of a battery and an applying hourly tariff.
Whether the microgrid does or does not have a storage device, in practice, the control system shall be provided with a set of controllable loads that can be remotely disconnected; thus, the Therefore, in agreement with current regulations specified in, the convenient strategy is to inject renewable energy into the common services (services used by all the inhabitants of the building, e.g., elevators) of the building and then to the main network. The most common tariff used BT-3; in addition, it was assumed that all the renewable energy is self-consumed. The project income should be calculated as the savings on the electricity common services bill paid by customers on a monthly basis.

Model of the System
The analysis focuses on modeling and simulates a distributed generation (DG) solution for use in a residential sector, which offers efficient management of energy supply and consumption, from a technical-economic point of view. The DG system will be designed to handle, or efficiently manage, the energy in a residential building of average dimensions located in Santiago, Chile (15 floors and 60 apartments), with photovoltaic generation, storage capacity plus an intelligent energy management system based on Homeostatic Control. The building community, composed of 60 apartments of different sizes and different demands will be called, for effect of this work, sustainable block.

Simulation Results
In this section, results obtained by simulations are presented and analyzed. These results validate the Homeostatic control strategy used to manage the energy of the customers, taking into consideration the benefits that they would receive under different alternatives.
A common practice to reduce the maximum demand during peak hours is to charge the batteries from the main grid during the low demand hours based on weather forecasts and algorithms to predict the photovoltaic generation; the aim is to get into peak hours with the batteries fully charged. In this way, the benefits of the electric tariff to be used (BT-4.3 or BT-4.3) are maximized. As an example, Figure 6 depicts the power flows between the different elements during one day considering the existence of a battery and an applying hourly tariff. Internal electric tariff for microgrid customers is shown in Figure 7. As is described in Figure 6, the battery is used to supply the excess energy consumption that the microgrid cannot supply during peak hours. Internal electric tariff for microgrid customers is shown in Figure 7. This tariff, based on the monomic energy cost, is employed with the aim to achieve an efficient energy consumption and to transfer the gain in energy cost derived from the improved efficiency to the customers. Thus, it can be observed that the energy cost at peak time is considerably higher than that of non-peak hours, hence, customers are induced to adopt a more efficient and productive consumption behavior in terms of the meta system as a whole: the on-grid microgrid, the distribution grid, and the community of residents in the building, which we have termed a sustainable block™. Thus, they are expected to adapt and move part of their consumption to low demand hours, where the energy cost is lower, and in doing so, they will be using the green energy from the microgrid with energy storage included more productively, to its fullest capacity, making the meta system more efficient and productive in terms of consumption versus cost. If, however, there is a shortage of supply from the microgrid for whatever reason, the grid supply will automatically take over as explained, and will supply for the deficit. For non-peak months (January, February, March, October, November and December), there is a flat tariff, where the price for energy is equal no matter the time it is consumed.  Whether the microgrid does or does not have a storage device, in practice, the control system shall be provided with a set of controllable loads that can be remotely disconnected; thus, the maximum demand can be maintained below a specified consumption limit. In addition, customers will be notified automatically that their behavior is not solidary with the needs of the community, and they will be penalized. Thus, the microgrid can be seen as a socio-technical complex system, in which energy users play a crucial role as active loads. This power limitation, despite being convenient, will not be considered under the present study. The implementation of this limitation in the algorithms would constitutes a future work, but it is not necessary for the present experiments.
Internal electric tariff for microgrid customers is shown in Figure 7. As is described in Figure 6, the battery is used to supply the excess energy consumption that the microgrid cannot supply during peak hours. Internal electric tariff for microgrid customers is shown in Figure 7. This tariff, based on the monomic energy cost, is employed with the aim to achieve an efficient energy consumption and to transfer the gain in energy cost derived from the improved efficiency to the customers. Thus, it can be observed that the energy cost at peak time is considerably higher than that of non-peak hours, hence, customers are induced to adopt a more efficient and productive consumption behavior in terms of the meta system as a whole: the on-grid microgrid, the distribution grid, and the community of residents in the building, which we have termed a sustainable block™. Thus, they are expected to adapt and move part of their consumption to low demand hours, where the energy cost is lower, and in doing so, they will be using the green energy from the microgrid with energy storage included more productively, to its fullest capacity, making the meta system more efficient and productive in terms of consumption versus cost. If, however, there is a shortage of supply from the microgrid for whatever reason, the grid supply will automatically take over as explained, and will supply for the deficit. For non-peak months (January, February, March, October, November and December), there is a flat tariff, where the price for energy is equal no matter the time it is consumed. Figures 8 and 9 represent the two different criteria for allocating renewable energy; it is shown that the saving is $178.36 for every customer. The total amount saved for all the 60 apartments is about $10,701.87. The distribution of this saving between the customers depends on the criterion (both are different due to their own rules). Figure 8, defined as criterion A, responds to a logic in which customers own the N th share of renewable energy available, indifferent to their consumption patterns, being able to sell its surplus to other clients and to the network. Figure 9, defined as criterion B, corresponds to the allocation of renewable energy under a scheme based on merit. Customers who have a low consumption during peak hours are entitled to obtain the renewable energy proportionally to their consumption. Choosing between one criterion and another will depend on the degree of commitment that customers may have and their tendency to save energy in order to use more green energy rather than taking more from the grid.
hence, customers are induced to adopt a more efficient and productive consumption behavior in terms of the meta system as a whole: the on-grid microgrid, the distribution grid, and the community of residents in the building, which we have termed a sustainable block™. Thus, they are expected to adapt and move part of their consumption to low demand hours, where the energy cost is lower, and in doing so, they will be using the green energy from the microgrid with energy storage included more productively, to its fullest capacity, making the meta system more efficient and productive in terms of consumption versus cost. If, however, there is a shortage of supply from the microgrid for whatever reason, the grid supply will automatically take over as explained, and will supply for the deficit. For non-peak months (January, February, March, October, November and December), there is a flat tariff, where the price for energy is equal no matter the time it is consumed.   (both are different due to their own rules). Figure 8, defined as criterion A, responds to a logic in which customers own the N th share of renewable energy available, indifferent to their consumption patterns, being able to sell its surplus to other clients and to the network. Figure 9, defined as criterion B, corresponds to the allocation of renewable energy under a scheme based on merit. Customers who have a low consumption during peak hours are entitled to obtain the renewable energy proportionally to their consumption. Choosing between one criterion and another will depend on the degree of commitment that customers may have and their tendency to save energy in order to use more green energy rather than taking more from the grid. Criterion A has more sense to be used in case there is a renewable generation and energy storage in accordance with the consumption of the SB. On the other hand, criterion B might be more sensible to use in case you have a microgrid with a generation well below the needs of customers as a whole, thus, their allocation should be based on merit. Under criterion B, the homeostaticity factor represents a measure of energy efficiency and energy savings, where the clients who accumulate a higher index are the ones who deserve the allocation of renewable energy. For the purpose of this work, this factor was reset daily when simulation was carried out; in a real implementation, this could be reset weekly, monthly, and even annually, so that customers who have a sustained efficient consumption can pay off their consumption with renewable energy. Using the algorithm and combining the renewable energy with storage devices, we were able to estimate savings up to US $12,000 using tariff AT-4.3.

Conclusions
The results show that by using either criterion A or criterion B, more than 40% reduction in annual cost for the customers is achieved, while consuming mostly green energy. Using the described techniques for renewable energy sharing, it is easier to establish and understand how every customer will receive their part of the generated energy, avoiding discordances and problems between them. Moreover, the case of separate (also called non-clustered) customers is considered, with the possibility of keeping their own personal billing separate if they so desire. For this non-clustered case, (both are different due to their own rules). Figure 8, defined as criterion A, responds to a logic in which customers own the N th share of renewable energy available, indifferent to their consumption patterns, being able to sell its surplus to other clients and to the network. Figure 9, defined as criterion B, corresponds to the allocation of renewable energy under a scheme based on merit. Customers who have a low consumption during peak hours are entitled to obtain the renewable energy proportionally to their consumption. Choosing between one criterion and another will depend on the degree of commitment that customers may have and their tendency to save energy in order to use more green energy rather than taking more from the grid. Criterion A has more sense to be used in case there is a renewable generation and energy storage in accordance with the consumption of the SB. On the other hand, criterion B might be more sensible to use in case you have a microgrid with a generation well below the needs of customers as a whole, thus, their allocation should be based on merit. Under criterion B, the homeostaticity factor represents a measure of energy efficiency and energy savings, where the clients who accumulate a higher index are the ones who deserve the allocation of renewable energy. For the purpose of this work, this factor was reset daily when simulation was carried out; in a real implementation, this could be reset weekly, monthly, and even annually, so that customers who have a sustained efficient consumption can pay off their consumption with renewable energy. Using the algorithm and combining the renewable energy with storage devices, we were able to estimate savings up to US $12,000 using tariff AT-4.3.

Conclusions
The results show that by using either criterion A or criterion B, more than 40% reduction in annual cost for the customers is achieved, while consuming mostly green energy. Using the described techniques for renewable energy sharing, it is easier to establish and understand how every customer will receive their part of the generated energy, avoiding discordances and problems between them. Moreover, the case of separate (also called non-clustered) customers is considered, with the possibility of keeping their own personal billing separate if they so desire. For this non-clustered case, Criterion A has more sense to be used in case there is a renewable generation and energy storage in accordance with the consumption of the SB. On the other hand, criterion B might be more sensible to use in case you have a microgrid with a generation well below the needs of customers as a whole, thus, their allocation should be based on merit. Under criterion B, the homeostaticity factor f HCi represents a measure of energy efficiency and energy savings, where the clients who accumulate a higher index are the ones who deserve the allocation of renewable energy. For the purpose of this work, this factor was reset daily when simulation was carried out; in a real implementation, this could be reset weekly, monthly, and even annually, so that customers who have a sustained efficient consumption can pay off their consumption with renewable energy. Using the algorithm and combining the renewable energy with storage devices, we were able to estimate savings up to US $12,000 using tariff AT-4.3.

Conclusions
The results show that by using either criterion A or criterion B, more than 40% reduction in annual cost for the customers is achieved, while consuming mostly green energy. Using the described techniques for renewable energy sharing, it is easier to establish and understand how every customer will receive their part of the generated energy, avoiding discordances and problems between them. Moreover, the case of separate (also called non-clustered) customers is considered, with the possibility of keeping their own personal billing separate if they so desire. For this non-clustered case, the generated energy will be used for common services of the building or directly injected into the grid (when generation is greater than common services consumption). Using these criteria, some problems regarding renewable resources sharing can be solved, encouraging customers to install these systems on their blocks, most of which are residential buildings nowadays.
Finally, it is important to realize the fragility of today's electric power distribution infrastructure, particularly in Chile, where seismic activity is recurrent. Thus, it is crucial that government authorities, industry regulators, and main industry players such as ENEL Distribución in Chile plan ahead and work on a Smart Grid Transformation Roadmap, as Chile is doing, in order to advance and pave the way for electric utilities to embrace grid integrated distributed generators investments. There is much new technology and techniques in the market today to go that route safely [38].