## 3 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:  
\[r_{DSO,t}=c_{g,nDR,t}-c_{g,DR,t}, \tag{1}\]  
\[r_{AGG,t}=\kappa_{DSO,t}-\kappa_{EUL,t}\, \tag{2}\]  
\[r_{EUL,t}=\kappa_{AGG,t}-\zeta_{DR,t}. \tag{3}\]  
With reference to Equation (3), the dissatisfaction function (\(\zeta_{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.