Maximizing Demand Response Aggregator Compensation through Optimal RES Utilization: Aggregation in Johannesburg, South Africa

: This paper examines the role of demand response aggregators in minimizing the cost of electricity generation by distribution utilities in a day-ahead electricity market. In this paper, 2500 standard South African homes are considered as end users. Five clusters (and aggregators) are considered with 500 homes in each cluster. Two cases are analysed: (1) Utilization of renewable energy sources (RES) is implemented by the distribution supply operator (DSO), where it meets excess demand for end users during peak hours by purchasing electricity from the renewable sources of the energy market, and (2) Utilization of RES is implemented by end users alone, and it is assumed that every household has one plug-in electric vehicle (PEV). The aggregators then compete with each other for the most cost-e ﬀ ective energy usage proﬁle; the aggregator with the least energy demand wins the bid. In both cases, energy pricing is estimated according to the day-ahead energy market. A typical day during winter in Johannesburg is considered for the simulation using a genetic algorithm (GA). Results obtained demonstrate the e ﬀ ectiveness of demand response aggregators in maximizing the beneﬁts on both sides of the electricity supply chain.


Introduction
Demand response (DR) aggregators have received a lot of attention in recent years due to their effectiveness in maximizing both capacity and energy gains for both end users and distribution service operators (DSOs) [1][2][3]. Aggregators serve two important purposes. (1) they provide optimal demand side management (DSM) services to DSOs, resulting in a financial bonus from the DSO, and (2) they ensure a reduction in the electricity bill of end users, which encourages them to participate actively in DR programs [4,5]. As renewable and alternative energy sources become more affordable, it is becoming more cost-effective to combine them with conventional methods of energy supply [6]. Therefore, we intend to examine the impact of these energy sources on the gains for end users and DSOs for two scenarios: first, when they are utilized by the DSO, and then when they are utilized by the end user. The role of the DR aggregator in connecting DSOs and end users is depicted in Figure 1.
An ideal DSM scenario is when demand follows generation [7]. In such a case, the load usage profile by end users does not negatively impact energy supply costs incurred by the DSO. However, this is not always the case, since end user loads have varying demands at different time slots within a day, and some of these demands have a negative impact on the DSO from both a capacity and cost perspective. In this work, we consider both load shifting and load curtailment schemes aimed at maximizing cost savings to the DSO, while simultaneously ensuring maximum benefits to end users, without completely sacrificing their comfort. Therefore, inelastic loads are considered for load Appl shifting, while elastic loads are considered for load curtailment. With regard to the end user's appliance demand, energy use per appliance for a typical day is determined according to the active occupancy approach [8]. For this paper, a typical day is assumed to be a winter day in Johannesburg, South Africa. For day-ahead scheduling, the consumers present their projected energy demands for the following day. The DSO or aggregators then take these demands and present them to market operators who then provide an hourly cost profile for the day ahead to the DSO or aggregators. In this paper, it is assumed that both the DSO and aggregators are price-takers. Therefore, they play no role in determining day-ahead market price for hourly electricity demand. Also, it is assumed that the DSO is not a profit-making entity such that additional profit beyond operating costs is used to provide compensation to end users via the DR aggregator.
Renewable energy sources (RES) have become an important contributor of alternative energy to both end users and DSOs. This additional energy supply has enhanced the conventional power grid by providing additional energy during peak periods [9]. In this paper, we consider the utilization of both the battery energy storage system (BESS) and solar panels by DSOs; end users use rooftop solar panels and plug-in electric vehicles with V2G (vehicle-to-grid) capability. RES have an advantage because they have a very low operating cost compared to conventional energy supply systems. This advantage is considered in this paper by attempting to optimize a multiparameter objective function with a genetic algorithm. Therefore, the aim of this paper is to examine the impact of optimal utilization of RES on the maximization of compensation accruing to DR aggregators (and consequently to end users) in cases where RES are utilized by the end users, and also by the DSO. The rest of the paper is organized as follows: Section 2 discusses existing research describing the role of DR aggregators in multi-level energy optimization. Section 3 details the proposed methodology for implementing the DR aggregator energy cost optimization model. Section 4 presents and discusses results obtained from the cost optimization objective function using genetic algorithm. Section 5 concludes the paper.  Renewable energy sources (RES) have become an important contributor of alternative energy to both end users and DSOs. This additional energy supply has enhanced the conventional power grid by providing additional energy during peak periods [9]. In this paper, we consider the utilization of both the battery energy storage system (BESS) and solar panels by DSOs; end users use rooftop solar panels and plug-in electric vehicles with V2G (vehicle-to-grid) capability. RES have an advantage because they have a very low operating cost compared to conventional energy supply systems. This advantage is considered in this paper by attempting to optimize a multi-parameter objective function with a genetic algorithm. Therefore, the aim of this paper is to examine the impact of optimal utilization of RES on the maximization of compensation accruing to DR aggregators (and consequently to end users) in cases where RES are utilized by the end users, and also by the DSO. The rest of the paper is organized as follows: Section 2 discusses existing research describing the role of DR aggregators in multi-level energy optimization. Section 3 details the proposed methodology for implementing the DR aggregator energy cost optimization model. Section 4 presents and discusses results obtained from the cost optimization objective function using genetic algorithm. Section 5 concludes the paper.

Materials and Methods
There has been a steady increase in the use of DR aggregators to maximize benefits to DSOs, independent service operators (ISOs), and end users in recent years. In [10], a system of aggregator remuneration was proposed using two clustering algorithms: hierarchical and fuzzy c-means clustering. In this paper, the virtual case study considered 2592 operator scenarios involving 548 distributed generators, and 20,310 consumers. The aim was to maximize gains to both distributed generation (DG) Appl. Sci. 2020, 10, 594 3 of 20 operation and consumers based on both real-time pricing (RTP) and incentive-based DR programs, while simultaneously minimizing DG operating costs. In [11], a customer incentive pricing (CIP) program was proposed using a heuristic optimization approach. The simulation system comprised 5555 residential consumer households with 56,642 schedulable appliances using an RTP strategy. Simulation was done over a 24 h period and optimization was done to maximize financial benefits to both the aggregator and the end user.
In [12], a DR aggregator was proposed for wholesale energy markets as a mixed-integer linear programming model using a stochastic bi-level mathematical program. The model was formulated for both RTP and day-ahead (DA) markets considering load curtailment. The aim was to investigate the financial benefits to the aggregator by deployment of DR contracts; results show positive gains to DR aggregators, and consequently to end users. In [13], a tri-level framework was proposed, consisting of an independent system operator (ISO) at the top layer, demand response aggregators at the middle layer, and consumers at the bottom layer. The framework was modelled as two bi-level optimization models detailing the interaction between the ISO and the aggregator, and also between the consumers and the aggregator. The proposed model was tested on the IEEE 9-bus and IEEE 118-bus test systems. The objective of the upper layer model was profit maximization for the DR aggregator, while that of the lower layer was profit maximization for both the ISO and consumers.
The satisfaction of participating DR consumers was the focus of the research in [14]. The proposed model determined financial rewards to be offered to consumers while maximizing aggregator profit. Results showed that financial rewards to consumers for participating in DR programs reduced as they aspired to increase their level of satisfaction.
In [15], the potential of DSM to optimally balance energy supply in a fully renewable European power system was investigated. An optimal mix of wind and solar photovoltaic (PV) was considered as backup for the conventional grid. The DSM was implemented as an alternative to the renewable energy mix; it was reported from simulation results that DSM utilization reduced the need for backup energy on the continent by one-third of the current capacity. In [16], the author reviewed business models for energy efficiency and demand response providers. These models were based on the different segments of the electricity market, namely system operation, generation, transmission, and distribution, as well as retail and load. The results of this research revealed three key findings among others: (1) There are more feasible business models related to the retailer segment of the energy market compared to generation and transmission segments (2) DR has more feasible business models compared to energy efficiency (3) Most of the analysed business models are reinforced by renewable energy penetration.
In [17], a decision-making model for a demand aggregator as a load-serving entity (LSE) was proposed. The LSE maximized profit in an uncertain day-ahead market by optimal scheduling of interruptible loads as well as efficient charging and discharging of plug-in electric vehicles (PEVs). The optimization approach was Karush-Kuhn-Tucker (KKT) with duality theory. Results obtained demonstrated the effectiveness of the LSE in maximizing end user gains including through augmenting consumer demand through PEV utilization during peak energy pricing periods. An end user-friendly, 'prosumer'-based economic energy model was proposed in [18]. This model was based on the constant elasticity of substitution utility function, which allowed demand flexibility based on end user consumption preference. In particular, the proposed model was based on three types of consumer behaviour: highly flexible, semi-flexible, and low-flexibility. Two control parameters were used to describe the DR model for the consumers. One measured the willingness of the consumer to actually participate in DR, while the other considered the lifestyle of the consumer. Unit energy pricing was based on a residential sector in North Dakota, USA. From results obtained, the two control parameters utilized during the shoulder period between peak and off-peak periods resulted in a flattened demand profile for consumers participating in DR.
Finally, in [19], a multi-objective energy management system was modelled for a single-house residential microgrid based on DR considering smart appliances. This case study was based on a single-zone, low energy house in Sydney, Australia. This grid-connected microgrid was controlled by Appl. Sci. 2020, 10, 594 4 of 20 the utility (as the master) with distributed energy resources (DERs) as the slave. Three DER sources were considered, namely solar PV, wind turbine, and battery energy storage system (BESS). Simulation was done using real-time pricing (RTP). From the obtained results, the proposed model improved demand profile by 33% and 40% for hot and cold weather conditions, respectively, compared to the conventional energy management system. Similar research can be found in [20][21][22][23][24][25][26][27][28][29][30][31].
The main contribution of this research involves the combination of both DR and RES through the use of aggregators. In the context of the South African energy distribution system, the penetration of renewable energy sources (such as wind and solar photovoltaics (PV)) is minimal compared to the contribution of conventional sources. However, in the past 2 years since January 2018, up to 1000 electric vehicles (EVs) have been sold across South Africa. This accounts for a 167% increase in EV sales since January 2018 [32]. The province of Gauteng (where Johannesburg is located) accounts for half of the total number of EVs on South African roads. Also, with over 90 EV charging stations currently in Gauteng (with plans by both government and automotive companies to further increase this number), the authors are of the opinion that a combination of EVs and DR is one promising solution to the ailing energy distribution network in South Africa.
It is clear that the concept of smart grids has led to the possibility of maximizing gains and incentives to all three levels of the power system supply chain. Also, the role of DR aggregators is vital in ensuring that a system is realised in which end users play an active role in power system optimization. This paper proposes a three-level framework with competition among DR aggregators with the most cost-effective cluster emerging the winner, while considering the benefits of utilization of RES on both the DSO and end user levels.

Proposed Methodology
The scope of this paper involves comparing the capability of a DR aggregator to maximize financial gain to both the DSO and end user while considering their utilization of renewable energy sources for peak periods. The authors advise readers to view the Abbreviations section at the end of the paper for the list of parameters for a better understanding of parameters used in all equations in this section. In this paper, we also assume that RES utilized by the end user are rooftop solar panels and plug-in hybrid electric vehicles with vehicle-to-grid (V2G) capability. The DSO utilizes the capacity of a solar farm, and a battery energy storage system. The similarity of the RES for both utility and end users will enable a comparison of performance and cost savings for both utility and end user scenarios. The DR aggregator has two main functions in the context of this paper:

1.
To provide demand side management services to the DSO, which results in a financial reward from the DSO.

2.
To ensure that end users reduce their electricity bill, which provides incentive for them to participate more actively in demand response programs.
Therefore, financial rewards to the DSO, DR aggregator, and end users are described by the following equations: With reference to Equation (3), the dissatisfaction function (ζ DR,t ) is generally considered to be convex as a result of the proportional relationship between the level of dissatisfaction and the deviation from the end users' energy consumption pattern without participation in DR programs [7]. The dissatisfaction level must be included in the end user compensation due to the fact that load shifting or curtailment involves some inconvenience to the end users since they have to shift elastic demand to off-peak periods within the day when the unit cost of electricity is comparatively lower. The energy use profile for the 2500 homes under consideration is based on the assumption that there are five DR aggregators, with each aggregator monitoring 500 homes. The energy use profile is based on the assumption that 100 homes in each cluster have two adult occupants, while the other 400 homes have up to six occupants, all of whom operate household loads. This occupancy profile is adopted based on the average size of households in South Africa with and without children, respectively. The idea of active occupancy [8] is adopted in this paper since we assume that demand is based on appliance use by occupants who are both at home and awake. The likelihood of an appliance being used is modelled as an increasing, non-linear function with regard to the number of active occupants. The active occupancy model also considers cases where an appliance is used by more than one occupant during a given time slot. The appliance schedule for the apartment being considered is detailed in Table 1. With regard to the dissatisfaction function, we also consider an inelasticity parameter which indicates the level of discomfort that the DR program causes to the end user. From the schedule in Table 1, the inelasticity parameter is applied to all appliances in the apartment (with the exception of the refrigerator). If the inelasticity parameter of a given appliance is small, it means that shifting operation of that appliance would cause minimum dissatisfaction to the end user, and vice versa. We will now consider the DSO-aggregator-end user scenario for the two cases specified.

Utilization of RES by the DSO
The total daily demand by end users (2500 households) is assumed to be 50 MW. The energy usage data for a single household is obtained from taking the average daily consumption (per hour) per appliance for the house over a period of 1 month in winter. It is assumed that 20% of the total daily demand will be supplied by RES to compensate for demand during peak hours. Therefore, 5 MW is purchased from solar farms, while an additional 5 MW is supplied by a BESS installed by the DSO. This paper does not consider the installation costs of the BESS in the cost analysis. The cost of electricity generated by the DSO is obtained according to: From Equation (4), it is clear to see that utilization of RES is beneficial to the DSO since excess energy demand from non-participation in DR programs is obtained from the renewable energy sources. First priority for utilization of RES during peak hours is given to the BESS since the DSO does not pay for energy generated. In other words, the cost of energy purchased from solar farms remains zero until the combined capacities of the conventional grid and BESS are exceeded.
With regard to the BESS, parameters specifying state-of-charge (SoC) of the battery bank are described in the following [34]: The solar panel parameters are specified according to [35]:

Utilization of RES by End Users
The end users utilize rooftop solar panels and a plug-in hybrid electric vehicle with V2G capability. The solar panel characteristics are assumed to be similar to those specified in Section 3.1. With regard to the day-ahead market, there are operating procedures for the electric vehicles (EVs) for each end user depending on whether the EV is charging or discharging within a given time slot within the day [36]: where This system of bidirectional energy flow between the grid and the EVs provides a symbiotic relationship between both the grid and EVs. This provides incentives to EV users to pool the collective capacities of their vehicles together in order to maximize energy cost savings through the DR aggregator. In other words, the aggregator uses the benefits of V2G capability for the benefit of both the end users and the DSO. The optimal EV scheduling by the DR aggregator is specified according to [36]: (P EV,up (t) + P EV,down (t) + P SR ) where Equation (17) maximizes the reward to the end user with the EV as advised by the DR aggregator. Here we consider the effect of EV battery degradation over time as well as the maximum power discharged by the battery within a given time slot due to commuting, considering unplanned vehicle trips. Equations (18) and (19) specify the conditions for EV up-and down-regulator capacity (for vehicle-to-grid and grid-to-vehicle modes respectively).
With respect to maintaining EV battery health over charging cycles, Equations (18) and (19) ensure that charging is scheduled such that there are rest intervals between charge cycles. This ensures that charging is done without undue stress on battery cells [36]. In general, the concept of DR aggregation involves maximization of benefits to all stakeholders in the energy distribution chain. Therefore, with regard to ensuring the battery health of EVs, effective charging is a priority since the EV battery is the most expensive single component in the vehicle.
Equation (17) is subject to the following constraints: P min draw,m,j (t)(1 − Ch m,j (t)) = 0, Appl. Sci. 2020, 10, 594 Equations (20)-(23) specify constraints for monitoring the charging status of the EV battery in each aggregator cluster. Nominal power drawn from the EV battery is maintained at acceptable levels by ensuring that maximum power is drawn when the battery is at ≥70% of full capacity, and minimum power is drawn when the battery is at ≤30% of full capacity. This state is maintained when the EV is either commuting or charging. Constraints in Equations (24)-(31) address the situation in which the EV is in V2G mode. We consider the day-ahead forecast of energy price/KWh to ensure maximum financial returns to the end user. In addition, they ensure that maximum and minimum allowable power limits of the EV battery are not violated even in the presence of uncertainties such as unplanned trips for the EV.
With respect to Equations (28)- (30): Equation (38) helps to monitor EV battery charge retention efficiency for maintenance purposes. In order to ensure zero energy sum with respect to end user participation in DR for the period, we ensure that the following relationship is maintained: where D DR t is total energy demand using DR, D nDR t is total energy demand before participating in DR, E S,DR t is total energy savings after participating in DR.

Objective Function Specification for Compensation Optimization
The aim of compensation optimization is to maximize cost benefit to the DSO, aggregator, and end user as defined by Equations (1)-(3). In this case, maximization of energy cost savings for the DSO will result in increased compensation to the DR aggregator, and consequently, increased reward to the end users for participating in DR programs. The objective function will take the form of a problem in which the DSO operation costs are minimized, while the compensation to the DR aggregator (and consequently the profit to the end users) is maximized. The objective function is described by: subject to: 0 ≤ ω ≤ 1 (DSO reward maximization coefficient), ω j ≥ 0 (represents DSO reward to aggregator j), The day-ahead market under the DR program is structured to obtain the aggregator with the most rewarding energy utilization profile using the following steps: i.
Initialization of DSO savings, aggregator compensation, and end user reward. ii.
Estimation of appliance scheduling threshold by each aggregator. iii.
Aggregators announce the unit reward schedule for each time slot within the given day. iv.
Demand of each user within the aggregator is determined as well as the deviation from reference usage limits specified in (ii) and (iii). v.
The operator announces the total demand for each aggregator cluster. vi.
The aggregator with the most cost savings is selected as the winner of the bid and removed from the competition.
With regard to Step iv, it is necessary to describe a disutility factor [7] which determines the level of deviation of a given appliance from the end user s reference energy level without DR program.
where D k,t is disutility factor of appliance k at time slot t, I k is the inelasticity coefficient of appliance k. Usually, I k ≥ 0. The closer the value of I k is to 1, the greater the level of dissatisfaction to the end user. d k,t is energy demand of appliance k with DR, d k,t is energy demand of appliance k without DR. The algorithm for implementing the demand response competition among the five aggregators is optimized using a genetic algorithm (GA), and is detailed in Algorithm 1. The parameter settings for implementing the GA are specified in Table 2.

Results and Discussion
The effects of flat pricing versus implementation of demand response programs and renewable energy sources by both end users and the DSO on total energy consumption can be seen in Figure 2. In general, it can be seen that the cumulative consumption peaks are between 4:00 a.m. and 5:00 a.m. This is due to the fact that consumers switch on geysers to heat water for bathing and in some cases washing within this time interval in a typical winter day in Johannesburg. In Figure 2a, the end user consumption profile can be seen to increase sharply during peak periods of the winter day. However, with implementation of both DR and RES by end users and the DSO, the energy use profile begins to flatten (Figure 2b,c). In Figure 2c, the energy profile is very flat during peak hours due to the fact that the electric vehicles are mostly in V2G mode during these periods. This demonstrates the effectiveness of plug-in electric vehicles as an alternative source of energy since excess energy generated by the battery during charging is fed back into the grid during V2G mode. Therefore, from this research, end user utilization of DR programs and RES is more beneficial to the DSO. The inelasticity coefficient is used to describe the cost of electricity demand for all the end users in Figure 3. This is important because this analysis depicts how load shifting and curtailment strategies benefit both end users and the DSO. In particular, it highlights the importance of the DR aggregator as a middleman between the end users and the DSO. Since the DR aggregator receives information from the DSO regarding optimal energy usage strategies as informed by energy operators in the DA markets, it can be seen that this results in less money being spent as the end users increase their participation in DR programs. It can also be seen that the end users implementation of RES is more beneficial as the discomfort level of the end users increases. The cost savings for end user implementation of RES is 27.7%, while that for DSO implementation is 23%.
It is also important to examine the unit energy savings for various hours within the winter day based on our knowledge of the unit cost of energy during peak and off-peak periods of the winter day ( Figure 4). According to City Power energy rates, peak and off-peak unit energy charges are 374.01 c/KWh and 108.11 c/KWh, respectively [37]. Again, we see that unit energy savings from the DA market are higher for end user utilization of DERs compared to DER utilization by the DSO. In particular, for the peak hour of 14:00, unit savings for the DR aggregator for DSO and end user DER utilization is 13.3% and 21%, respectively. At this time of day, it is assumed that the households with six occupants have at least three children of school age. Therefore, as they return home, they begin to operate appliances which will cause demand to increase. Overall, DR programs and DER utilization increase financial benefits to end users and aggregators.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 11 of 18 information from the DSO regarding optimal energy usage strategies as informed by energy operators in the DA markets, it can be seen that this results in less money being spent as the end users increase their participation in DR programs. It can also be seen that the end users′ implementation of RES is more beneficial as the discomfort level of the end users increases. The cost savings for end user implementation of RES is 27.7%, while that for DSO implementation is 23%. It is also important to examine the unit energy savings for various hours within the winter day based on our knowledge of the unit cost of energy during peak and off-peak periods of the winter day ( Figure 4). According to City Power energy rates, peak and off-peak unit energy charges are 374.01 c/KWh and 108.11 c/KWh, respectively [37]. Again, we see that unit energy savings from the DA market are higher for end user utilization of DERs compared to DER utilization by the DSO. In particular, for the peak hour of 14:00, unit savings for the DR aggregator for DSO and end user DER utilization is 13.3% and 21%, respectively. At this time of day, it is assumed that the households with six occupants have at least three children of school age. Therefore, as they return home, they begin to operate appliances which will cause demand to increase. Overall, DR programs and DER utilization increase financial benefits to end users and aggregators.    Figure 5 shows the ability of the GA to optimize the parameters of Equation (40) subject to specified constraints. It can be seen that the search particles gradually settle on the optimal solution over the specified number of feature evaluations. The convergence measure indicates the distance between the initial solution and the final optimal solution. A steady reduction in distance is an indication of good performance by the GA.  Figure 5 shows the ability of the GA to optimize the parameters of Equation (40) subject to specified constraints. It can be seen that the search particles gradually settle on the optimal solution over the specified number of feature evaluations. The convergence measure indicates the distance between the initial solution and the final optimal solution. A steady reduction in distance is an indication of good performance by the GA. Figure 5 shows the ability of the GA to optimize the parameters of Equation (40) subject to specified constraints. It can be seen that the search particles gradually settle on the optimal solution over the specified number of feature evaluations. The convergence measure indicates the distance between the initial solution and the final optimal solution. A steady reduction in distance is an indication of good performance by the GA. In order to further investigate the maximization of compensation benefits to both end users and aggregators by utilization of RES, we use the following approach: we model the DSO operation cost ( , ( ( , ))) and the financial reward to each one of the five aggregators as a Bayesian network ( Figure 6). With respect to the DSO, aggregators are considered to be independent of each other since user demand is mutually exclusive for each aggregator cluster. However, the  In order to further investigate the maximization of compensation benefits to both end users and aggregators by utilization of RES, we use the following approach: we model the DSO operation cost (c t,DSO (P op (ω, t))) and the financial reward to each one of the five aggregators as a Bayesian network ( Figure 6). With respect to the DSO, aggregators are considered to be independent of each other since user demand is mutually exclusive for each aggregator cluster. However, the interconnectedness with regard to financial reward for each aggregator is as a result of the competition among the DR aggregators in the day-ahead market. We therefore assume parameter independence according to Equation (45) describes the Bayesian hypothesis prior of all parameters within the network. The probability of maximum aggregator reward (r AGG,max,j ) with respect to the DSO cost savings is determined as Equation (46) is used to generate a plot of maximum aggregator reward for both cases involving utilization of RES, and is shown in Figure 7. From the results obtained, it can be seen that the probability of maximum aggregator reward is higher for every hour within the winter day when RES are utilized by the end user, as compared to when renewable sources are utilized by the DSO.
work is to demonstrate that aggregation maximizes benefits to end users by maximizing benefits to the DSO. In other words, minimizing operating cost of the DSO maximizes its financial benefits, which in turn results in maximal reward to the aggregators, and consequently the end users. The Bayesian network shown in Figure 6 represents an estimation of the probability of maximal financial reward to the end users through the maximization of the parameters , , , , and . The results of this estimation are shown in Figure 7.  With respect to the parameter , the cost function utilized is based on the life cycle cost of the battery energy storage system (BESS) used for DR by the DSO. It is assumed that all batteries in the bank are manufactured by the same source. The relationship used to describe is as below: where is the total lifetime cost of the BESS, is the initial capital cost of the BESS, is the battery bank maintenance cost, is the cost of replacement of the batteries in the bank, is the disposal cost of batteries in the bank, is the energy cost.
With respect to (energy cost parameter), we consider the cost of energy based on time-of-use  The DSO's operations cost determines the financial reward to each aggregator. The aim of this work is to demonstrate that aggregation maximizes benefits to end users by maximizing benefits to the DSO. In other words, minimizing operating cost of the DSO maximizes its financial benefits, which in turn results in maximal reward to the aggregators, and consequently the end users. The Bayesian network shown in Figure 6 represents an estimation of the probability of maximal financial reward to the end users through the maximization of the parameters Θ 1 , Θ 2 , Θ 3 , Θ 4 , and Θ 5 . The results of this estimation are shown in Figure 7.
With respect to the parameter Θ, the cost function utilized is based on the life cycle cost of the battery energy storage system (BESS) used for DR by the DSO. It is assumed that all batteries in the bank are manufactured by the same source. The relationship used to describe Θ is as below: where c TLC is the total lifetime cost of the BESS, c i is the initial capital cost of the BESS, c m is the battery bank maintenance cost, c r is the cost of replacement of the batteries in the bank, c d is the disposal cost of batteries in the bank, c e is the energy cost. With respect to c e (energy cost parameter), we consider the cost of energy based on time-of-use as provided by City Power for a typical winter day [37]. For each of the aggregator parameters (Θ 1 , Θ 2 , Θ 3 , Θ 4 , Θ 5 ), we consider the utilization of RES by end users within each aggregator cluster. In particular, we consider battery degradation cost C deg,m,j for the EVs in each cluster.

Conclusions
This paper has investigated the effects of DR programs and utilization of RES on financial compensation to the DSO, aggregator, and end users in a day-ahead energy market. Results obtained have shown the benefits of demand response and incorporation of renewable energy resources by both the DSO and end users. The aim of this research has been, among others, to highlight the positive impact of both demand response programs and the incorporation of renewable energy sources into the energy mix from a financial perspective. In particular, a case study of a single residential home with up to six occupants in Johannesburg, South Africa is considered. The aim of this simulation is to highlight the promising potential of DR to augment the ageing and struggling electricity distribution system in South Africa. In particular, there has been an increased uptake of EVs across the country in recent years. This research aims to encourage greater utilization of the potential of EVs to contribute significantly to the energy mix in South Africa. This has been highlighted by the encouraging simulation results obtained when renewable energy sources are adopted by both DSO and end users. The paper has also highlighted the importance of DR aggregators in maximizing benefits to both the DSO and end users as compared to other energy pricing schemes, such as dynamic pricing. From the results obtained, it can be seen that the following aggregator purposes have been achieved: i.
Effective demand side management services have been provided to the DSO. This can be proved by the reduction in consumption of end users, which translates to cost savings for the DSO. ii.
Cost savings in terms of both total electricity demand and unit energy as end users participate in DR programs.
The above have also resulted in flattening of the load profile for consumers, which results in greater energy savings during peak hours.
Therefore, from the research aim and objectives, the following conclusions can be made: i. DR aggregators have a positive impact in terms of maximizing financial benefits to both the DSO and end users. In particular, they ensure both unit energy savings and reduction in demand for end users while flattening the energy use profile during peak hours. ii.
Aggregators have maximized the benefits of incorporating renewable energy sources on both the DSO and end user side of the energy supply chain. Competition among aggregators results in the most cost-effective implementation of RES for both the DSO and end users. iii.
From the perspective of the end user, the financial benefits of participating in DR programs are significant in spite of the inconvenience caused by load shifting and curtailment. This is an incentive for end users to participate more actively in DR programs. iv.
The effect of plug-in electric vehicles has been observed as an improvement in load demand profile for end users during off-peak periods since they are largely in V2G mode.
While this paper has considered competition among five DR aggregators in the DA market, it has not considered the effect of variation of either the number or cluster size of the aggregators in the competition. We have also considered a day in the winter season since the energy demand is usually higher. However, it would be interesting to investigate the robustness of the proposed approach for the summer season as well. These will form the basis of future research.

Conflicts of Interest:
The authors declare no conflict of interest.

RES parameters µ nDR
DSO reward coefficient without demand response µ sol DSO reward coefficient due to energy purchased from solar farm µ BESS DSO reward coefficient due to energy available from battery energy storage system ω t SoC of battery at current time step ω t+1 SoC of battery at next time step η c Battery charging efficiency η d Battery discharging efficiency β d Battery self-discharge rate φ sd Self-discharging time step φ t c Battery charging time step α c Battery charging rate p c,t Battery charging power p d,t Battery discharging power φ t d Battery discharging time step p c,t,max Battery maximum allowed charging power level p d,t,max Battery maximum allowed discharging power level δ c,t Battery charging status (0 = discharging, 1 = charging) δ d,t Battery discharging status (0 = charging, 1 = discharging) p sol PV module supplied power V T s PV module thermal voltage I S out PV module output current n c Number of PV module cascaded cells K Boltzmann constant T PV module irradiated temperature ϕ e PV module electronic charge V o PV module output voltage I S Solar cell series current R S Solar cell series resistance θ d Diode quality factor R r Solar cell parallel resistance P min real,m,j (t) Minimum real power requirement for EV m in aggregator j at time t t i Time slot duration a Optimal power charging coefficients b 1 , b 2 Nominal power charging coefficients Ch m, j (t) Charging status of EV m in aggregator cluster j at time t (0 = commuting, 1 = plug-in) S m,j (t) SoC of battery for EV m in aggregator cluster j at time t

RES parameters
B c,m, j Battery capacity of EV m in aggregator cluster j at time t η m, j Efficiency of charger for EV m in aggregator cluster j at time t p m, j (t) Optimal operational setpoint of EV m in aggregator j at time t p max,m Maximum power demand of EV m at time t P EV,up (t) Up regulator capacity by aggregator at time t P EV,down (t) Down regulator capacity by aggregator at time t P SR Responsive reserve capacity by aggregator S op,m, j (t) Operational setpoint of EV m in aggregator cluster j at time t P dis,m, j (t) Power discharged by battery of EV m in aggregator cluster j at time t P e (t) Energy price at time t B deg,m, j (t) Battery degradation for EV m in aggregator cluster j at time t P min draw, m,j (t) Minimum additional power draw of EV m in aggregator j at time t P max draw, m,j (t) Maximum additional power draw of EV m in aggregator j at time t P maxdraw,m, j (t) Maximum power draw of EV m in aggregator cluster j at time t P op,m, j (t) Estimated operating point of EV m in aggregator cluster j at time t P red SR,m, j (t) Expected reserve capacity response for EV m in aggregator cluster j at time t S i,m,j (t) Initial SoC of EV m in aggregator cluster j at time t Tri-level distribution service parameters r DSO,t Financial reward to DSO for winter day r AGG,t Financial reward to DR aggregator for winter day r EU,t Financial reward to end user for winter day c g,nDR,t Cost of electricity generation accruing to DSO without DR implementation c g,DR,t Cost of electricity generation accruing to DSO with DR implementation κ DSO,t Compensation received from DSO κ EU,t Compensation paid to end users κ AGG,t Compensation received from DR aggregator ζ DR,t Dissatisfaction (coefficient) c t,DSO (P op (ω, t)) DSO operating cost c t,AGG δ comp,AGG (t) Financial reward to DR aggregator δ comp,EU (t) Financial compensation to end user f comp,m, j (t) Compensation factor for EV m in aggregator cluster j at time t (compensating for unplanned trips) C deg,m,j Degradation cost of battery for EV m in aggregator cluster j θ m, j (t) Discharge due to battery efficiency of EV m in aggregator cluster j at time t L DA,max Maximum forecast day-ahead net load L DA (t) Forecast day-ahead net load at time t L DA,min Minimum forecast day-ahead net load