Reschedule of Distributed Energy Resources by an Aggregator for Market Participation

Demand response aggregators have been developed and implemented all through the world with more seen in Europe and the United States. The participation of aggregators in energy markets improves the access of small-size resources to these, which enables successful business cases for demand-side flexibility. The present paper proposes aggregator’s assessment of the integration of distributed energy resources in energy markets, which provides an optimized reschedule. An aggregation and remuneration model is proposed by using the k-means and group tariff, respectively. The main objective is to identify the available options for the aggregator to define tariff groups for the implementation of demand response. After the first schedule, the distributed energy resources are aggregated into a given number of groups. For each of the new groups, a new tariff is computed and the resources are again scheduled according to the new group tariff. In this way, the impact of implementing the new tariffs is analyzed in order to support a more sustained decision to be taken by the aggregator. A 180-bus network in the case study accommodates 90 consumers, 116 distributed generators, and one supplier.


Introduction
The number of aggregators operating in energy markets has been on the rise since the end of the last decade [1].Companies like Voltalis (Paris, France), REstore (Antwerp, Belgium), and EnerNOC (Boston, MA, USA) are currently major aggregators of flexibility and are the usual participants in energy markets [2].These companies provide tools for energy services (e.g., optimization, monitoring, consultancy) to consumers, which reduces unnecessary or inefficient consumption.The aggregators, after an analysis of the consumer's load profile, conciliates the energy reductions of the consumers with its participation in the energy markets.In this way, a cooperative relation between the aggregators and the resources is achieved.
Demand Response (DR) and distributed generators are the flexibility resources with more interest and development in current power systems, which opens a path for others to raise as well, for instance, electric vehicle and storage units [3,4].Demand response is divided in two types including price and incentive-based where the first corresponds to the response of consumers given a price signal (price variation) and, the latter, to the response of consumers given monetary incentives (tax relief, payment) [5][6][7][8][9][10].These two types of demand response are used by different entities and to distinct consumers.Namely, the grid operators and aggregators use incentive-based while retailers tend to use more price-based strategies.Distributed generators have been significantly promoted in recent years through feed-in tariffs to make these resources more attractive to consumers [11][12][13].Due to this initiative, the number of prosumers (consumers that own generation means) raised significantly in Energies 2018, 11, 713 2 of 15 several countries (e.g., Portugal, Germany, UK).However, the high participation of these resources in energy markets has not yet been achieved mostly because of their small generation capacity and intermittent production.The complement that demand response and distributed generators give to each other provide the aggregator with sufficient tools to manage these resources and allow their indirect participation in energy markets [2,[14][15][16][17][18].

Related Literature
Several energy markets are not adjusted to demand response participation due to the requirements needed to participate either in terms of minimum capacity or event duration.For example, in Finland, secondary reserve has 5 and 10 MW minimum capacity in automatic and manual actuation, respectively [19][20][21].In the same country, it is possible to find more adjusted conditions in the primary reserve with a minimum capacity of 100 kW.Another example is the Californian independent system operator, CAISO (Folsom, CA, USA), with minimum requirement of 100 and 500 kW to consumer's participation [22].In such market approaches, the aggregator or a single entity can deliver the requested reduction amount.In both cases, the market operator is not concerned about the way that consumers are aggregated and enumerated.
The need for an aggregator entity arises as a solution for the participation of small-size consumers when considering that it can create a virtual energy amount that enables enough energy to be negotiated in the market by the aggregator.This participation of the aggregator should ensure that the revenues obtained are sufficient to reward the participating resources while providing profit for the aggregator.In incentive-based programs, resources are remunerated bearing in mind their availability and utilization where it is considered a period that consumers make their loads available to be modified and, in the second, payment is made when load modification is actually done [23,24].These are current approaches for the remuneration of consumers participating in demand response programs.However, for the research in the present paper, the questions are how much to pay to the consumers, how many distinct tariffs to implement, and which consumers should be in each tariff.
Aiming the aggregation and the remuneration of demand response resources, several works appear in the literature with most of them addressing only one of these topics and others addressing both in a single methodology, which are namely previous works from the authors of the present paper [25,26].In fact, most of the recent and relevant literature in demand response, namely review papers, still insist in the demand response opportunities and flexibility options that are more and more evident with the increase of technology that supports demand response by providing examples of practical evidence of DR implementations and identifying the most relevant barriers without referring to possible innovative approaches for aggregation and remuneration [6,27].Most of the identified barriers are related to market structures and incentives regarding the incentivizing consumers to participate in DR programs [28].
In Reference [29], a hierarchical DR architecture is proposed in order to control and coordinate various DR categories.In Reference [30], the author refers to the way that incentivizing DR with flat incentives implies with the revenues of retailers.In fact, in the beginning, DR incentives are needed but in a large implementation, DR must be remunerated by adequate and fair market mechanisms.In Reference [31], DR and generators are compared regarding the actual costs in real markets, which refers to the actual remuneration cost for DR.In Reference [32], the authors deal with the comfort in a building in order to determine the flexibility of consumption.A multi-agent approach is proposed for the bids and auctions establishment.The consumers are assumed to take part of the negotiation.None of the referred works proposed a model that implements the remuneration for DR participation, which consists of addressing the consumers' benefits and offering an advantageous remuneration for them.Moreover, the aggregation is done according to the open call to the previously enrolled consumers.
In Reference [25], the authors proposed a methodology in which aggregation and remuneration is done in an integrated approach in order to support the aggregator decisions.In Reference [26], a complementary approach is defined in order to analyze the profits of the aggregator, which supports the participation in the market by comparing the situations of using or not additional suppliers with DR use.
However, in the previous works, after defining the groups and the tariffs, the aggregation and the remuneration, it was assumed that the operation costs are still minimized.In the present paper, the proposed methodology contributes to making an evaluation of the new optimal scheduling of the resources using the new tariffs.New decision aspects are raised for the aggregator namely because some consumers are lower remunerated with the re-scheduling even if the aggregator operation costs are the same.

Proposed Aggregator
The present paper proposes a methodology to address market participation of an aggregator in energy markets by considering two types of distributed energy resources including demand response and distributed generation.Due to the small size of these resources, a Virtual Power Player (VPP) is considered the aggregator for DR and DG resources making it possible for them to participate in the electricity market.This aggregator defines the groups and the tariffs for each group to be scheduled in each different context or period of the day, which receives incomes from the market and forms the consumers to fulfill their load and paying to DG and DR resources by also obtaining some profits.The DG and DR are scheduled according to the available forecasts that are assumed to be adequately accurate.It is also a task assumed for the VPP to accommodate the deviations of the DG and the DR resources due to their unpredictability.
After an initial schedule of resources, these are aggregated and assigned a tariff for each of the groups formed with these tariffs considered forward when performing the second schedule of resources.This allows the aggregator to schedule resources in line with a group tariff that is applied to all resources in that group and decided whether to participate or not with bids in the energy markets.Aggregation is made through k-means clustering algorithm while the group tariff corresponds to the average price of the resources in the group.
The present section approached the most relevant concepts related to the developed methodology and the activities that it intends to represent.In Section 2, the proposed methodology is presented and explained in detail while Section 3 shows the mathematical formulation used.In Section 4, the case study used to verify the usefulness of the methodology is presented, and finally, in Section 5, the conclusions obtained from the methodology implementation are presented.

Proposed Methodology
The present section details the proposed methodology that can be divided into three stages per scheduling phase, which is illustrated in Figure 1.Phase one is presented in Section 2.1 while phase 2 is presented in Section 2.2.
Energies 2018, 11, x FOR PEER REVIEW 3 of 15 the participation in the market by comparing the situations of using or not additional suppliers with DR use.However, in the previous works, after defining the groups and the tariffs, the aggregation and the remuneration, it was assumed that the operation costs are still minimized.In the present paper, the proposed methodology contributes to making an evaluation of the new optimal scheduling of the resources using the new tariffs.New decision aspects are raised for the aggregator namely because some consumers are lower remunerated with the re-scheduling even if the aggregator operation costs are the same.

Proposed Aggregator
The present paper proposes a methodology to address market participation of an aggregator in energy markets by considering two types of distributed energy resources including demand response and distributed generation.Due to the small size of these resources, a Virtual Power Player (VPP) is considered the aggregator for DR and DG resources making it possible for them to participate in the electricity market.This aggregator defines the groups and the tariffs for each group to be scheduled in each different context or period of the day, which receives incomes from the market and forms the consumers to fulfill their load and paying to DG and DR resources by also obtaining some profits.The DG and DR are scheduled according to the available forecasts that are assumed to be adequately accurate.It is also a task assumed for the VPP to accommodate the deviations of the DG and the DR resources due to their unpredictability.
After an initial schedule of resources, these are aggregated and assigned a tariff for each of the groups formed with these tariffs considered forward when performing the second schedule of resources.This allows the aggregator to schedule resources in line with a group tariff that is applied to all resources in that group and decided whether to participate or not with bids in the energy markets.Aggregation is made through k-means clustering algorithm while the group tariff corresponds to the average price of the resources in the group.
The present section approached the most relevant concepts related to the developed methodology and the activities that it intends to represent.In Section 2, the proposed methodology is presented and explained in detail while Section 3 shows the mathematical formulation used.In Section 4, the case study used to verify the usefulness of the methodology is presented, and finally, in Section 5, the conclusions obtained from the methodology implementation are presented.

Proposed Methodology
The present section details the proposed methodology that can be divided into three stages per scheduling phase, which is illustrated in Figure 1.Phase one is presented in Section 2.1 while phase 2 is presented in Section 2.2.

Phase One
According to Figure 1, phase one is divided into three stages.In the first stage, each resource has an individual price that represents the cost to the aggregator to schedule it in terms of demand response or distributed generation.The optimization model considers demand response programs such as curtailment.The mathematical formulation for the minimization of the aggregator's operation costs is detailed in Section 3. The results of the optimization include the amounts scheduled in generators and the energy to be reduced from the consumers in order for the load-generation relation to be balanced in each of the periods considered.Additionally, the resources for aggregation are obtained from this stage.
In the second stage, the aggregation stage, the resources that have contribution higher than zero in the aggregator's schedule (stage 1), are in the aggregation process.The other resources with zero contribution are not considered in either aggregation and remuneration stages.This ensures that non-participating resources do not affect the results of the aggregation and remuneration and, therefore, neither influence the prices for the participants.This second stage of the methodology uses k-means to obtain the group indexes for each distributed resource.The number of groups to be formed is a parameter that the aggregator can modify in consonance with its operation context.This aggregation analysis is made for each period.The distributed resource types have distinct aggregation processes.However, consumers and generators are not aggregated together.In this way, different data inputs are considered for aggregation in both cases.The clustering stage is very relevant for the groups definition.Normally, the consumers' tariffs are defined for all the consumers of the same type (domestic, commercial, industrial, etc.).In the proposed approach, the aggregator is able to request the simulation of several number of tariff groups, according to the number of DR programs.The clustering algorithm will provide it.
When aggregating consumers, the data input consists of: the energy scheduled in the curtailment program for each consumer, -and the price of these reductions (input parameter of the objective function).
In the case of distributed generators, the data input in the aggregation process is: scheduled energy for each unit, -and individual price (input parameter of the objective function).
The third stage, which is the final stage of phase one, corresponds to computing the group parameters.These can be defined as the relevant features that the aggregator needs to form a bid in the energy markets including average price and total energy scheduled.The number of resources is important information to the aggregator so that it knows the resources in each group.
In conclusion, the results of phase one are the consumers and generators in each group and the tariff for each group.

Phase Two
In the second phase, we have three stages, according to Figure 1.The first stage corresponds to the same procedure performed in the first stage of phase one.The difference is that now, in the first stage of phase two, the prices for the resources entering the scheduling are the ones resulting from stage three of phase one for each group, which involve the resulting tariffs.In this way, after scheduling phase two, the aggregator can compare each period based on the operation costs and conclude if it is or not beneficial to proceed with phase two or adopt the results of phase one.This allows for a more efficient operation of the aggregator by maintaining its capability of market participation.
In the second stage, the resources are aggregated for each period.The clustering algorithm considered is implemented and given as input for the energy schedule and price (these features are considered for both the distributed generators and consumers participating in the demand response program).The information about aggregation is also available for the aggregator in terms of power, tariffs, the number of resources in each group, the resources that participated in the scheduling, and the group assignment.
In the final stage of phase two, the aggregator goes to market considering the groups formed and respective group tariffs as available bids.In addition, the results provided give the aggregator the possibility to check which consumers have been positively or negatively affected by the re-scheduling made in Phase two.In this context, the aggregator must ensure that the bids guarantee fair payment of distributed energy resources and its services.
The provided overall results are relevant for the aggregator to consider in terms of the participation in energy markets even though the present paper doesn't consider the different specific market opportunities that can be available for the aggregator to participate.In fact, the consideration of market negotiation should be accompanied by several involved parties' agreements so that the rest of the grid wouldn't be impaired in its stability and energy quality.
The methodology proposed in the present paper provides a solution for the management of aggregator's activities including the optimal scheduling of resources with an aggregation and remuneration model to complement its participation in market.In fact, the optimization of the energy resources used is made in the present paper in order to support the proposed aggregation and remuneration methodology.It is not intended to be the focus of the paper since it can be found in other previous works [25,26].Also, the clustering algorithm and its input features as used in the present paper have been previously used in Reference [26].It is included in the present paper in order to support the overall proposed methodology framework.In this way, the present paper is innovative by presenting a rescheduling model for the decrease of aggregator's operation costs based on the aggregation and remuneration model applied to distributed resources.Section 3 details the mathematical formulation used to guarantee the resource's optimized scheduling.

Scheduling Formulation
The optimization problem is labeled as mixed-integer linear programming (MILP) since discrete and continuous variables are considered.The scheduling problem is relatively simple considering the program's definition and respective modelling.However, the problem's size implicates an analysis of the best option.The proposed methodology was implemented in TOMSYM™ optimization environment, which was developed in MATLAB™.The algorithm was run in a 64-bit computer system with 16 GB RAM and 2.1 GHz processor.
In Equation (1), the objective function is considered for optimization, which involves the demand response programs mentioned before as well as the distributed generators and external suppliers.This objective function is considered for both schedules (phase one and phase two) of resources.However, in the second, the C DG (p,t) , C red (c,t) , and C cut (c,t) , are updated for certain resources, which include the ones that participated in the aggregation and remuneration processes.The variables of the problem, as presented in the objective function (1) are: Energy schedule for external supplier s, in period t, Energy schedule for distributed generator p, in period t, and Energy schedule for load curtailment in consumer c, in period t.This means that the output of the optimization problem corresponds to the power amounts present in Equation (1).
As mentioned before, the system's balance is insured by defining the constraint represented in Equation (2).This maintains the balance between load and generation, which considers the contributions of demand response and distributed generation.
Energies 2018, 11, 713 6 of 15 The aggregator, when establishing a contract with the resources, specifies an energy amount that both agree or in real-time monitors the resource's availability.In this case, the resource and the aggregator have previously agreed upon a given amount of flexibility for each period.In this way, the external supplier limits are represented by Equation (3), for the distributed generators by Equation ( 4) and for the curtailment program by Equations ( 5) and (6).
P mincut (c,t) This simple mathematical formulation guarantees the correct execution of the aggregator's activities and programs at play.This optimization minimizes the aggregator's cost considering the individual cost (in a first scheduling) and aggregate cost (in a second scheduling) of each resource.
Regarding the aggregation process, this is based on k-means clustering algorithm, which have as inputs the energy scheduled and individual price including the number of groups wanted by the aggregator.The algorithm is based on the minimization of distances between resources and centroids, which is shown in Equation (7).Centroids are points that represent the center of a given group, are initially randomly set, and, in the following iterations, can be computed given a certain rule (e.g., average position of the objects in the group).The distances are then computed for each resource in relation to the centroids (number of centroids equals the number of groups desired) where the nearest are placed in that group.This is an iterative process where resources can change group between iterations.
where T represents a partition matrix (matrix with the group index for each object), M the cluster prototype or centroid matrix, x an object of a given set (this set corresponds to the resources considered), and m the centroid at the given iteration.The binary variable Y assumes the value one when the object j belongs to the cluster i represented by the centroid and zero when otherwise.The k-means algorithm insures that every object considered is assigned to a group and that all groups have at least one object (none are empty).The k-means algorithm is already developed in MATLAB as a function of k-means.This function returns several outputs including group index for each object, centroid matrix over iterations, distances from objects to each centroid, and the sum of distances for each centroid.In this context, only the first output is needed for the proposed methodology.
The remuneration of resources considers an arithmetic average tariff by the group based on the resource's prices in that group.In this way, there is an average price that some consumers will be encouraged to participate while others may be unsatisfied due to low payment bearing in mind their initial individual price.However, price equality is assured for all resources belonging to the same group.Moreover, in a previous work [25], a maximum-based tariff was proposed in which the highest price in the group was represented as the group tariff where consumers were either satisfied to be remunerated at their price request or encouraged to participate since the tariff was higher than the initial price point.

Case Study
The proposed case study is composed of a distribution network with 180 bus [33].In terms of resources, the network has 116 distributed generators, 90 consumers, and a single external supplier.All consumers can participate in the curtailment program and each one has a distinct price, as shown by Figure 2. It is important to note that although the labels in Figure 2 and its axis rises until 88 due to visualization optimization, the chart includes 90 bars as expected with one for each consumer.Realistic case studies are an important part of the proposed methodology effectiveness and adaption, which insure that it outputs valid solutions for both resources and the aggregator.
Realistic case studies are an important part of the proposed methodology effectiveness and adaption, which insure that it outputs valid solutions for both resources and the aggregator.
In generation, the prices are the same for resources of the same type.For instance, all photovoltaic units have an equal price for scheduling.In Table 1, the features of generation resources are presented.In the second column of this table, the installed capacity of each type of generation resource is shown.Moreover, some types of resources have distinct levels of installed power such as in the case of wind and photovoltaic units.In the third column, the number of resources of each resource type are shown and considered for the level of installed power.The last column of the table presents the linear prices of each type of resource in exchange for their contribution for scheduling.Besides the distributed generators, Table 1 also presents the features of the external supplier considered in the same terms of the previous mentioned generators.However, it is important to notice that a dynamic tariff is considered for the external supplier and it is shown in Figure 3.In generation, the prices are the same for resources of the same type.For instance, all photovoltaic units have an equal price for scheduling.In Table 1, the features of generation resources are presented.In the second column of this table, the installed capacity of each type of generation resource is shown.Moreover, some types of resources have distinct levels of installed power such as in the case of wind and photovoltaic units.In the third column, the number of resources of each resource type are shown and considered for the level of installed power.The consumers' curtailment capacity is the same throughout all periods and takes the values as shown in Figure 4.The consumers are classified into five different types including domestic, large commerce, large industrial, medium commerce, and small commerce.
This flexibility is used to manage consumption according to the energy prices of the other resources and the available generation at a given period.This type of approach to demand response (load curtailment programs) is often used in power systems by system operators to balance generation and in times where the security and reliability of the network are at risk.In this way, the aggregator can provide relevant services to the system operator and enabling an indirect participation of distributed energy resources (generators and consumers) in the operation of the system.This section presented the case study evaluated in the present paper and its results are shown in the results section.The proposed case study is adjusted to the operation of an aggregator and represents a realistic approach to the real activities that an aggregator develops.The last column of the table presents the linear prices of each type of resource in exchange for their contribution for scheduling.Besides the distributed generators, Table 1 also presents the features of the external supplier considered in the same terms of the previous mentioned generators.However, it is important to notice that a dynamic tariff is considered for the external supplier and it is shown in Figure 3.
The consumers' curtailment capacity is the same throughout all periods and takes the values as shown in Figure 4.The consumers are classified into five different types including domestic, large commerce, large industrial, medium commerce, and small commerce.The consumers' curtailment capacity is the same throughout all periods and takes the values as shown in Figure 4.The consumers are classified into five different types including domestic, large commerce, large industrial, medium commerce, and small commerce.
This flexibility is used to manage consumption according to the energy prices of the other resources and the available generation at a given period.This type of approach to demand response (load curtailment programs) is often used in power systems by system operators to balance generation and consumption in times where the security and reliability of the network are at risk.In this way, the aggregator can provide relevant services to the system operator and enabling an indirect participation of distributed energy resources (generators and consumers) in the operation of the system.This section presented the case study evaluated in the present paper and its results are shown in the results section.The proposed case study is adjusted to the operation of an aggregator and represents a realistic approach to the real activities that an aggregator develops.This flexibility is used to manage consumption according to the energy prices of the other resources and the available generation at a given period.This type of approach to demand response (load curtailment programs) is often used in power systems by system operators to balance generation and consumption in times where the security and reliability of the network are at risk.In this way, the aggregator can provide relevant services to the system operator and enabling an indirect participation of distributed energy resources (generators and consumers) in the operation of the system.
This section presented the case study evaluated in the present paper and its results are shown in the results section.The proposed case study is adjusted to the operation of an aggregator and represents a realistic approach to the real activities that an aggregator develops.

Results
The scheduling of resources is analyzed considering distinct number of groups to be formed in the aggregation process such as the operation costs obtained in the rescheduling of resources, which are distinct considering the number of groups formed after the first scheduling.
Table 2 presents the results obtained in terms of operation costs and number of resources that changed price from the first to second scheduling.The operation costs obtained in the first scheduling is always the same since the initial conditions are maintained equal.The reschedule depends on the number of groups formed after the first schedule.In Table 2, the evaluated periods are chosen based on the power variation that occurred in the reschedule.This includes periods where there are differences between the first and the second scheduling for the available resources.Moreover, it shows the number of resources where the prices were changed between the first and second scheduling due to the aggregation and remuneration processes implemented after the first scheduling.For instance, in period 11 with a total number of groups equal to 3, a total of 80 distributed generators and 75 consumers changed their price.The value in parentheses represents the number of resources that changed the energy schedule while the value between brackets reflects the number of resources where the energy price was raised and lowered, respectively (number of raised prices, number of lowered prices).For instance, given the previous example, only one distributed generator changed the energy schedule and no consumers changed in the second scheduling.Furthermore, of the 80 distributed generators that changed price, 53 had a raise and 27 had a decrease on the price in the second scheduling.Similarly, out of the 75 consumers, 27 had a raise and 48 had a decrease on the price.Generally speaking, the optimization of individual consumers is expected to provide better results.However, the aggregator is not able to implement one DR program tariff for each consumer.In the first schedule, the consumers are optimized as groups according to their initial tariffs that are defined according to their consumer's types, which is shown in Figure 4.With the reschedule made based on the consumers grouped according to the clustering input features, the groups are now optimized and the optimization results are better for the total number of groups equal to 3. The obtained actual amount of improvement can be seen as a small amount for a single event occurring in a short period of time.However, implementing several DR events during a year can have a great impact on the overall results for the aggregator.
Moving on to the results obtained for the scheduling of resources, a total number of clusters must be chosen and, therefore, the least expensive is picked in which the total number of groups is equal to 3. The initial scheduling results, before the resources are aggregated and a group tariff is assigned to the participant resources, are shown in Figure 5.The scheduling shows the contribution of all the resources considered including the external supplier, distributed generators, and consumers.Figure 6 presented the scheduling of the resources after the aggregating, i.e., stage 1 of phase two where the red outline demonstrates the periods and resource contributions that changed in relation to the initial scheduling.It is possible to see a reduction in terms of external supplier contributions and, consequently, a raise in the distributed generators participation.This variation is also related to the dynamic energy price offered by the external suppliers.Additionally, in both initial and final scheduling, the consumers were supplied without interruption where the "Energy Non-supplied" resource was not implemented.Moreover, this resource is considered the last option to be scheduled since it delimits energy interruptions in the consumers and affects their normal operation.In this way, the use for this is only justified in case of emergency situations where system reliability and security is at risk.In terms of demand response, we see a more or less constant behavior from the consumers with small quantities being used by the aggregator to obtain a valid scheduling of the resources.Figure 7 shows the changes in prices of distributed energy resources between the initial prices and the ones resulting from phase one of the proposed methodology when the total number of groups is 3, which considered the evaluated periods shown in Table 2.For distributed generators (left hand-side graphs), the maximum raise noticed was around 0.019 m.u.(period 20 and 21, as seen in The scheduling shows the contribution of all the resources considered including the external supplier, distributed generators, and consumers.Figure 6 presented the scheduling of the resources after the aggregating, i.e., stage 1 of phase two where the red outline demonstrates the periods and resource contributions that changed in relation to the initial scheduling.It is possible to see a reduction in terms of external supplier contributions and, consequently, a raise in the distributed generators participation.This variation is also related to the dynamic energy price offered by the external suppliers.Additionally, in both initial and final scheduling, the consumers were supplied without interruption where the "Energy Non-supplied" resource was not implemented.Moreover, this resource is considered the last option to be scheduled since it delimits energy interruptions in the consumers and affects their normal operation.In this way, the use for this is only justified in case of emergency situations where system reliability and security is at risk.In terms of demand response, we see a more or less constant behavior from the consumers with small quantities being used by the aggregator to obtain a valid scheduling of the resources.The scheduling shows the contribution of all the resources considered including the external supplier, distributed generators, and consumers.Figure 6 presented the scheduling of the resources after the aggregating, i.e., stage 1 of phase two where the red outline demonstrates the periods and resource contributions that changed in relation to the initial scheduling.It is possible to see a reduction in terms of external supplier contributions and, consequently, a raise in the distributed generators participation.This variation is also related to the dynamic energy price offered by the external suppliers.Additionally, in both initial and final scheduling, the consumers were supplied without interruption where the "Energy Non-supplied" resource was not implemented.Moreover, this resource is considered the last option to be scheduled since it delimits energy interruptions in the consumers and affects their normal operation.In this way, the use for this is only justified in case of emergency situations where system reliability and security is at risk.In terms of demand response, we see a more or less constant behavior from the consumers with small quantities being used by the aggregator to obtain a valid scheduling of the resources.Figure 7 shows the changes in prices of distributed energy resources between the initial prices and the ones resulting from phase one of the proposed methodology when the total number of groups is 3, which considered the evaluated periods shown in Table 2.For distributed generators (left hand-side graphs), the maximum raise noticed was around 0.019 m.u.(period 20 and 21, as seen in  Figure 7 shows the changes in prices of distributed energy resources between the initial prices and the ones resulting from phase one of the proposed methodology when the total number of groups is 3, which considered the evaluated periods shown in Table 2.For distributed generators (left hand-side graphs), the maximum raise noticed was around 0.019 m.u.(period 20 and 21, as seen in the top-right of each graph) in comparison with the initial price while around 0.042 m.u. was noted in period 10 as the maximum decreased.When considering demand response, the maximum increase was around 0.043 m.u.(periods 11 and 21) while around 0.023 m.u. was noticed in period 11 when the maximum decreased.
Table 3 presents the results obtained for the aggregation of resources, which was independently made for distributed generators and consumers participating in the demand response program for period 20.By matching Tables 2 and 3, it is possible to see that an additional generator was included in the aggregation when comparing with verified changes.The reason for this is that this resource was scheduled by the aggregator, but its price was not changed by the aggregation and remuneration processes performed before the second scheduling.Regarding the consumers, all of those who were scheduled by the aggregator and consequently participated in the aggregation and remuneration processes were also affected by price changes.The results for period 20 are presented for a total number of groups equal to 4 in Table 4 to compare group's number influence based on the tables mentioned before.
Similar results to the previous analysis of period 20 for a total number of groups equal to 3, which were obtained for a total number of groups equal to 4.Moreover, changes only occur at the resource's distribution amongst the groups, but patterns that were visible were the same number of resources assigned to a given group and, having one more group to fill in as showed by Table 4, group assignments of certain resources were changed.The choice of these two evaluations, period 20 for a total number of groups equal to 3 and 4, is based on the operation costs obtained (as shown in Table 4) by being the ones with lower costs when compared to the first scheduling.

Conclusions
Aggregators in power systems and energy markets have become more often players in a deregulated environment provided by new legislation promoting the inclusion of distributed energy

Conclusions
Aggregators in power systems and energy markets have become more often players in a deregulated environment provided by new legislation promoting the inclusion of distributed energy resources.Aggregators provide several solutions to the operation of power systems from easing complexity to fading energy transit throughout the network.This last feature is focused on integrating distributed energy resources that are capable of surgically injecting generation and/or load in certain points of the network to facilitate its operation.
The present paper proposed a methodology to support an aggregator in dealing with distributed energy resources with a focus on the rescheduling of resources following aggregation and remuneration processes.The aggregator, after an initial scheduling, aggregates the resources participating in the scheduling and computes a representative tariff for each group of distributed energy resources.The initial tariffs of the participating resources are updated to enter a new scheduling (rescheduling) of the aggregator.With the proposed methodology, the aggregator is able to have enriched information in order to have more balanced decisions regarding the consumer's participation and remuneration for DR programs implementation instead of providing a single final optimal decision.
With the results obtained from the first and second scheduling, the aggregator can compare operation costs and evaluate when is best to choose one or the other.Otherwise, the aggregator would not be aware of the impact of the actual scheduling after the new tariffs application resulting from the proposed methodology.

Figure 3 .
Figure 3. Dynamic tariff considered for the external supplier.

Figure 4 .
Figure 4. Curtailment capacity in all periods by type of consumer.

Figure 3 .
Figure 3. Dynamic tariff considered for the external supplier.

Figure 4 .
Figure 4. Curtailment capacity in all periods by type of consumer.

Figure 4 .
Figure 4. Curtailment capacity in all periods by type of consumer.

Figure 5 .
Figure 5. Scheduling before aggregation and remuneration processes.

Figure 6 .
Figure 6.Scheduling after aggregation and remuneration processes.

Figure 6
Figure6shows that changes in the energy schedule were verified in periods number 10, 11, 20, and 21 when the total number of clusters is equal to 3.Figure7shows the changes in prices of distributed energy resources between the initial prices and the ones resulting from phase one of the proposed methodology when the total number of groups is 3, which considered the evaluated periods shown in Table2.For distributed generators (left hand-side graphs), the maximum raise noticed was around 0.019 m.u.(period 20 and 21, as seen in

Figure 5 .
Figure 5. Scheduling before aggregation and remuneration processes.

Figure 6 .
Figure 6.Scheduling after aggregation and remuneration processes.

Figure 6
Figure6shows that changes in the energy schedule were verified in periods number 10, 11, 20, and 21 when the total number of clusters is equal to 3.Figure7shows the changes in prices of distributed energy resources between the initial prices and the ones resulting from phase one of the proposed methodology when the total number of groups is 3, which considered the evaluated periods shown in Table2.For distributed generators (left hand-side graphs), the maximum raise noticed was around 0.019 m.u.(period 20 and 21, as seen in

Figure 6 .
Figure 6.Scheduling after aggregation and remuneration processes.

Figure 6
Figure6shows that changes in the energy schedule were verified in periods number 10, 11, 20, and 21 when the total number of clusters is equal to 3.Figure7shows the changes in prices of distributed energy resources between the initial prices and the ones resulting from phase one of the proposed methodology when the total number of groups is 3, which considered the evaluated periods shown in Table2.For distributed generators (left hand-side graphs), the maximum raise noticed was around 0.019 m.u.(period 20 and 21, as seen in the top-right

Figure 7 .
Figure 7. Changes in prices for (a) Distributed Generators and (b) Demand Response.

Figure 7 .
Figure 7. Changes in prices for (a) Distributed Generators and (b) Demand Response.

Acknowledgments:
This work has received funding from the NETEFFICITY Project (ANI | P2020-18015), from FEDER Funds through COMPETE program, and from National Funds through FCT under the project UID/EEA/00760/2013.This work was also supported by the European Union's Horizon 2020 Research and Innovation Programme under the Marie Sklodowska-Curie Grant Agreement 641794-DREAM-GO Project.Author Contributions: Pedro Faria raised and developed the overall concept together with Zita Vale, organized the paper and discussed the work and the results with the rest of authors; João Spínola implemented the energy resources optimization model.Conflicts of Interest: The authors declare no conflict of interest.Nomenclature Indexes S Total number of external suppliers P Total number of distributed generators C Total number of consumers T Total number of periods K Total number of clustering groups N Total number of clustering observations Parameters C Sup (s,t)

Table 1 .
Generation resources features.

Table 1 .
Generation resources features.

Table 2 .
Summary of results from rescheduling.