Estimated Cost of Electricity with time horizon for Micro Grids Based on the Policy Response of Demand for Real Price of Energy

The intelligent microgrids are an efficient alternative that allows to supply the demand, decreasing the losses of the electrical system at the same time; the environment and the consumers are the main beneficiaries. This article develops a heuristic based on an energy management model based on the real price of electricity, which will allow end users to encourage the implementation of a policy of response to demand in order to optimize their consumption In order to do this, a micro smart grid is analyzed, with conventional and non-conventional renewable generation. In addition to this, a mechanism of “real energy price” will be implemented as a policy of response to demand, aiming to optimize the costs of energy that will be transferred to users depending on the stratum of which it belongs; these costs will have a short-term horizon with hourly intervals, achieving a reduction in the purchase of energy from the system.


Introducción
The advance on electrical systems research currently presents important innovations, allowing an evolution that will permit greater competitiveness and efficiency in satisfying demand with lower losses, moving from centralized systems to distributed systems close to the load, changing the form of user participation from passive to active, presenting supply and demand opportunities in an electricity market, which requires complex communication systems such as two-way smart meters, using ICT, conventional and non-conventional renewable generation sources, home load managers and electric vehicles (Battistelli, Agalgaonkar y Pal, 2016) (Glover, and CO2 emissions (Barrantes, n. d.;Energía y Sociedad, 2010;Pereira, 2014b;Sudriá, 2007) (Carrión Galarza & González Sánchez, 2019;Ruiz Maldonado & Inga, 2019).

Demand Response
Developing the concept of Demand Response (DR) presented in the introduction, DR is the change in customers' electricity consumption, in response to certain mechanisms or signals related to price, incentives and sometimes, by the direct intervention of the Electric Distribution or Commercialization Company (Eghbal, Saha & Mahmoudi-Kohan, 2011;Kopsidas, Kapetanaki, Levi & Milanovic, 2016;Wang & Paranjape, 2015). The DR mechanisms that currently exist are the following (Energía, 2012;Ghia, 2009): • Real-time pricing: consists of continuously varying rates, generally every hour, according to the cost of electricity in the wholesale market (MEM).
• Time of use lies in varying the rates in certain periods, for example, peak hours, valley hours, etc. This mechanism is currently used in Ecuador.
• Critical Peak Price, is the allocation of a relatively high price in critical situations of operation of an SEP.
• Incentive plans. It is when an E.E. has the ability to disconnect a percentage of a customer's load, in exchange for compensation or credit on behalf of the user. This mechanism is used in critical operating or economic situations.
As shown above, there are mechanisms that must be accepted by the client in order to be implemented (e. g. incentive plans) and others that are carried out unilaterally by the E.E., such as those related to price (Ghia, 2009). At this point, it is important to point out that electricity service in Ecuador is public and has certain principles such as universality, efficiency and quality, among others; in other words, a customer's load cannot be reduced without his or her consent (Ecuador, 2015). Since this study focuses on the DR mechanism of "Real Time Price", it is necessary to predict the consumption ranges of a customer in the period h+1. One prediction methodology is the Markov Chains, which are developed below.

Economical office
The objective of the economic dispatch is to determine the power that each generation unit must produce in order to obtain the minimum cost per kWh (Grainger & Stevenson, 1996). Currently, there are several energy generation technologies, so the dispatch can be preferential or enter the methodology of economic dispatch (Glover, 2012). The preferential dispatch technologies are generally the non-conventional renewables, in which case you pay a fixed cost in $ / kWh, and all the energy produced is dispatched. An example of this case is PV and wind power, provided they do not have energy storage (Battistelli et al., 2016;Glover, 2012). All other plants that do not have preferential dispatch are subject to the economic dispatch methodology which is developed below. To determine the economic dispatch, it is necessary to express a relationship between the production costs of each unit ($/h) and the power output (MW) ; E. M. García Torres & Isaac, 2018; E. M. Meza Cartage-na & García Torres, 2018) (Glover, 2012;Grainger & Stevenson, 1996); The above relationship can often be approximated to a quadratic relationship as shown in equation (1). (1) Where: The cost of the generator is .
The power produced by the generator .
, , are characteristic constants and specific to the equation of each generator .
If equation (1) is derived with respect to power, the unit cost per kWh ($/kWh) is obtained, which is known as the incremental cost ( ), see equation (2). This represents the marginal cost of producing one more unit of power, i.e. one additional kW (Glover, 2012;Grainger y Stevenson, 1996). (2) The last two equations above are for a unit or a power generation plant, however, in the economic dispatch problem, there are several units, each with its own formula of the form of equations (1) and (2). It's obvious to think that, if a unit is generating "D1" kW at a cost " " and another "D2" kW power plant at a cost " "where > If you have to reduce your production, plant 1 will reduce its production and plant 2 will increase its production to reduce costs. This process would be repeated until the = and the system works at minimum cost (Grainger y Stevenson, 1996). Based on the example given in the last paragraph, the optimal economic dispatch is when the incremental costs of all the landau units ( ) are the same, i.e.
After calculating the equal incremental cost for all the generation units, the output power of each generator is obtained, clearing the power ( ) of equation (2) as shown in equation (3). (Battistelli et al., 2016;Glover, 2012;Grainger & Stevenson, 1996).
If the power calculated from equation (6) breaks the maximum or minimum output limits of a generator, this limit is set as the output power of that generator and a new for the remaining generators. As a restriction to the economic dispatch, the sum of the output powers of the plants ( ), must be equal to the power of the load ( ) (Battistelli et al., 2016;Glover, 2012;Grainger y& Stevenson, 1996); this is formulated in equation (4). Additionally, when a plant has preferential dispatching, its output power ( ) is subtracted from the load power, see equation (4).
(4) With the economic dispatch you get the cost of energy for the whole micro network, therefore you have the tariffs that will be applied to the customers, that is, the "Real Time Price". To bring downstream the cost of energy and power it is necessary to define some parameters that characterize the loads in Electrical Distribution Systems (EDS); these are developed below.

Load characterization in electrical distribution systems
To design, plan or calculate costs in an electrical distribution system (EDS), it is necessary to consider the load, individual and collective. Although the load can be identified by means of a measuring instrument, in many cases these records are insufficient or even non-existent. In this sense, there are definitions and parameters to characterize the loads, which are approximations based on generalized information (Caracterización de la Carga en Sistemas Eléctricos de Distribución, n.d.). From the energy point of view, the sum of the integrals of the curves is equal to the integral of . This is formulated in equation (5). Where: T otal energy ( ) of the system.
Energy from the customer's load ( ).
Total number of loads or clients connected in the system.
From the above, the energy utilisation factor ( ), as it will be called in this study, is the relationship between the energy of a load and the total system energy, measured in percentage, as shown in equation (6). (6) In this sense, the sum of the of all system loads is 1 (100%), see equation (7).
Liability factor ( ) The unlike the The use of a load cell allows the characterization of loads from the point of view of power, and not from the point of view of energy. The is defined by equation (8), where is the demand for the load at the same time when the maximum demand of the total load curve occurs ( ); is the maximum demand of the load i in the analyzed time period. Usually, the moment it occurs is not the same when it happens . From this point of view, the is interpreted as the fraction of the maximum of each load with which it The sum of is different from 1 (100 %), unless the peaks of all the loads occur at the same time as the group peak. With the details provided in the theoretical framework, it is sufficient to raise the problem and solution of this study, however, below is a brief explanation of the regulatory framework related to this study, at the level of Electrical Distribution Systems (SED).

Energy management model and solution algorithm
As briefly discussed in the introduction, this study develops an energy management methodology to optimise demand response in micro-smart grids. The DR mechanism used is "Real-time pricing" which was defined in section 2.2 (Eghbal et al., 2011;Pradhan, Balijepalli, & Khaparde, 2014;Roh & Lee, 2015;Wang & Paranjape, 2015). Obviously, the price of energy is obtained by covering the costs of the production chain plus a return, so the price of energy is obtained by knowing the system load and calculating the economic dispatch (Battistelli et al., 2016;Glover, 2012;Grainger & Stevenson, 1996). In order to produce a DR for the clients, it is necessary to define consumption ranges, in power and energy, and a cost of the same for each of these ranges. Thus, the client will manage its demand so that its cost is the lowest, causing the expected result by this mechanism in the consumer (Anvari-moghaddam, Monsef, & Rahimi-kian, 2016;Dong, Yu, Song, Member, & Yang, 2017;Zhang, Li, Sun, & O'Neill, 2016) (Abdi, Dehnavi, & Mohammadi, 2015) Intelligent micro-networking The power grid defined for this study is diagrammed in Figure 1; (Pereira, 2014b)   A boundary meter, to which are connected th power plants and the loads, can be connected to the boundary meter number of generators and amount of loads, One generator is the equivalent upstream of the distribution network; the other generators are DG, photovoltaic, wind, micro hydraulics, etc. Instruments for measuring electrical parameters are installed in: the border meter, in each of the loads and in each of the generators (Moreno-Munoz et al., 2012). This equipment records the information every 10 minutes, according to the regulations and it is transmitted through the telecommunication networks to be stored.

Demand Management
The management is based on the optimization which is a method consists of a single source of energy that is the distribution company therefore the energy that is reduced in peak hours of the demand is energy previously stored in hours of the night and at the level of the distribution company it does not have any surcharge (E. M. Meza Cartagena & García Torres, 2018). The objective function of the optimization is to reduce peak demand and maximize comfort by increasing the number of equipment connected and used. The management system will provide and generate a reduction in energy consumption, taking into account that the recharging of batteries would be established at a certain time and during the night, allowing users to develop their lives with total normality without having to restrict the use of any equipment (Anvari-moghaddam et al, 2016;Dissertation & Philosophy, 2015;Eghbal et al., 2011;García & Rivas, 2013;Kopsidas et al., 2016;Liang, Tamang, Zhuang, & Shen, 2014;Wang & Paranjape, 2015;Zhang et al., 2016). As mentioned above, the problem of energy demand management in a residential area can be developed as a multi-target MINLP model, for which management is applied in a single RSM-G house with respect to the different targets: In the same way are the power offerings of the energies stored in the batteries. Where C is the cost of each kWh of contribution of the batteries, P is the power of each equipment and T is the time of contribution of the batteries. This objective function is subject to the following restrictions battery capacity, maximum input power, depth of battery discharge, battery charging hours.
The second objective function is that which will reduce the peak demand, where j represents the number of customers, which are subject to the activation programmer of the energy supply system, S is the consumption of each inhabitant of a house.
The mixed objective function allows optimizing the equation of the electricity supply-demand balance and all the limitations mentioned above considered in the problem: Where PWT and PPV is the power of the equipment, and PBATT is the power of the batteries, which provide energy (k) to the system in an operation time interval, represented as the tasks in a given time OTD

(13)
By means of Uk(h) which is a binary variable the same that indicates the state of the battery system "k" as a function of the time "h" in its 2 active or deactive states. The tasks imply that some of these need to remain in place without being related to the OTD. (14) The consecutive tasks "j" will depend on the completion of another task "k", as shown in equation 8   (15) The energy demand of each user has a maximum permissible consumption (16) Where M and N are the numbers of the tasks that can be scheduled and those that cannot be scheduled respectively.

Economical office
For the previously calculated dispatch ranges (e.g. 1-4 kW), with divisions (e.g. 10), the economic clearance is calculated for each ranges. The result is costs ($), to produce the energy in each ranges of demand. An example of this result is shown in the Table.1  Table 1 shows a single and different tariff schedule, by consumption range, to be applied in the to every client. It can be seen that each customer is presented with options of consumption ranges, in power and energy; and according to the range in which their consumption is, the unit cost of energy will be applied. For this purpose, an average power representing the energy consumption in one hour is determined. With the hourly historical data, at the time The customer's The average power factor is calculated by relating the average power and the maximum power (Caracterización de la Carga en Sistemas Eléctricos de Distribución, n.d.; Grainger & Stevenson, 1996)  The process of energy management model detailed up to this point allows to obtain tariff sheets by ranges of consumption, unique and different, for each of the clients connected to the micro network. In this way, the DR mechanism of "Real Time Price" is offered to users, encouraging them to manage and optimize their consumption, so that their cost is reduced; consequently, advantages are obtained from the technical and economic point of view of the intelligent microgrid, such as flattening the load curve.

Problem formulation
The problem presented in this document is the non-supply of the demand of a certain sector during the peak hours. This demand is fed by a distributed generator, which supplies the demand in its entirety during the off-peak and half load hours, but the problem occurs during the peak load period, During this period, in order to avoid load disconnection (de-energizing certain users), it is necessary to connect to a system that provides energy to this sector, causing additional costs for the use of energy storage or for the use of energy from thermal power plants that use fossil fuels. García Torres & Isaac, 2018;Meza Cartagena & García Torres, 2018). In view of the problems described above, it is necessary to optimize demand without affecting the comfort of users, in addition to using an energy storage bank. Step 1: Initialise Initialize: Initialize Step 2: Input, output and variable data Probability of the next state of consumption.

Case Study
The energy management model detailed in this study is run every hour; however, and in order to be able to graph, tabulate and compare results, it will be simulated for a 24-hour period. In this sense, and only with the aim of being able to simulate the 24-hour model, the real average and maximum demand (Figure 3 and Figure 4, respectively) of the system is defined, that is, what the customer actually consumed, during 24 hours, at the border meter and of the 3 customers; it is important to highlight that, in the the hourly rate sheets are determined and at the time . The distributed generators are shown in table 2. The first two generators are established as preferential dispatch type, with solar radiation and wind speed data analyzed in the city of Quito with latitude -0° 12' 29.55", longitude -78° 29' 16.55", as presented in Figure 2 (E. M. García Torres & Isaac, 2018;Meza Cartagena & García Torres, 2018). Additionally, three loads are connected to the microgrid of the Microgrid Case StudyDiagram, in Figure 1, 7 generators (GD) are connected, with the characteristics shown in the Table (2"CENACE," n.d.; Glover, 2012;Grainger & Stevenson, 1996). The first two generators are established as preferential dispatch type, with data of solar radiation and wind speed as shown in Figure 2 ("Secretary of Environment of the Municipality of the Quito Metropolitan District," n.d.). Since this study is not an estimation of solar radiation and wind speed, these data are established in (pu). Obviously, in practice, solar radiation and wind speed must be estimated for the hour .    Figure 5 shows the demand estimate at the border meter for the 24 hours simulated, with 10 consumption ranges from the probable minimum to the maximum. For the consumption ranges estimated in Figure 5, the economic dispatch is made. As an example, for the estimated average demand (curve 5 in Figure 5, from bottom to top), the economic dispatch is presented in Figure 6. At hours of solar radiation and wind speed, the preferential economic dispatch of these plants is evident. Most of the time, during the 24 hours, the dispatch is of the hydraulic power stations, because it has a lower cost. As a result of the economic dispatch, the cost of the electric service to attend the demand in that hour is obtained.

Results and analysis
Once the energy ranges (average power, Figure 5) are obtained, they are transformed into maximum power ranges and both ranges/limits (energy and maximum power) are taken downstream to each customer. Figure 7 shows the energy consumption ranges (kWh) taken downstream to customer 1. For each of the consumption ranges shown in Figure 7, the assigned tariff is presented in Figure 8. Evidently, the significant variation in tariffs is due to the fact that thermal power plants must be dispatched at peak times, with their high production cost per kWh. This motivates customers to shift their consumption from these hours to minimize the price paid, contributing to a flattening of the load curve and reducing total network costs, thus achieving the objective of the DR mechanism and the objective of the management model proposed in this study.

Conclusions and recommendations
The application of mechanisms, such as the real price of demand response energy in intelligent micro-network energy management systems based on conventional and non-conventional renewable generation, allows a reduction in electricity consumption of 9.5 % at the peak of the demand curve and 4.5 % at off-peak hours, i.e., 14 % of energy has not been purchased from the electricity system, achieving benefits for users not only in the reduction of payment on the payroll but also contributing to the reduction of CO2 in the environment.
When applying a DR mechanism in an energy market based on tariff sheets it is not possible to appreciate the savings and the reduction in the energy payment schedule, since the subsidies do not allow us to be competitive with the real costs of energy, but if we analyze energy and generate a saving of 14.7 %, if we have a benefit since the losses for the system are lower, that is to say, who wins with these management systems are the energy distribution companies