A Novel Prosumer-Based Energy Sharing and Management ( PESM ) Approach for Cooperative Demand Side Management ( DSM ) in Smart Grid

Increasing population and modern lifestyle have raised energy demands globally. Demand Side Management (DSM) is one important tool used to manage energy demands. It employs an advanced power infrastructure along with bi-directional information flow among utilities and users in order to achieve a balanced load curve and minimize demand-supply mismatch. Traditionally, this involves shifting the electricity demand from peak hours to other times of the day in an optimized manner. Multiple users equipped with renewable resources work in coordination with each other in order to achieve mutually beneficial energy management. This, in turn, has generated the concept of cooperative DSM. Such users, called prosumers, consume and produce energy using renewable resources (solar, wind etc.). Prosumers with surplus energy sell to the grid as well as to other consumers. In this paper, a novel Prosumer-based Energy Sharing and Management (PESM) scheme for cooperative DSM has been proposed. A simulation model has been developed for testing the proposed method. Different variations of the proposed methodology have been experimented with different criteria. The results show that the proposed energy sharing scheme achieves DSM purposes in a useful manner.


Introduction
Global energy demands are increasing day by day and most of this demand is currently met using non-renewable sources.Traditional power systems are centralized and depend primarily on large scale power plants based on coal, nuclear, petroleum and natural gas etc.However, non-renewable energy sources are limited and produce Green House Gas (GHG) emissions which can eventually cause unpleasant and precarious climate changes [1,2].Therefore, most governments and researchers around the world are focusing on renewable energy sources such as solar, water, wind etc. Consumers are also being encouraged to produce energy from renewable sources and to store the excessive energy for future usage or to provide it back to the utility grid for the sake of financial benefit.These trends become clearer in the "literature review" section of this work.
The business model of conventional grid depends on the interaction between distribution and transmission but the consumer is not actively involved.Dynamic requirements involving end users, such as Demand Side Management (DSM), lead to a more interactive system, namely smart grid [3,4].
The smart grid is characterized with a bi-directional flow of energy and information and involves an advanced power system along with integrated communication infrastructure [5].The smart grid concept aims at providing a sustainable, secure and economic power supply with the active involvement of consumers.
Smart grid applications for energy management include Advanced Metering Infrastructure (AMI) and Home Energy Management System (HEMS).AMI is the communication infrastructure enabling two-way communications among utilities and users [6,7], while HEMS is used to optimize home energy using different operations and algorithms [8].AMI and HEMS are employed to manage the increasing demand efficiently.Information coming from the smart meters indicates how, when, and where consumers can manage their electricity usage [9,10].There are different methods for managing the peak demand including Demand Response (DR) programs offered by utilities according to the requirements of different periods of day.Demand Side Management (DSM) is the mechanism used to implement DR programs.
DSM is an important tool used for load shifting to off-peak hours in order to fulfill the energy demand as well as minimize the energy cost.Shifting the load to off-peak hours results in a balanced power production curve.This in turn reduces the need for expensive and GHG emitting plants.One way of implementing DSM is by introducing price dependent time slots and reducing energy consumption in peak hours [8,11].DSM comprises of two major elements [12]:

•
Load shifting: Load shifting can be done using the DR program which can shift the load in peak hours to off peak hours on a long-term or short-term basis.

•
Energy efficiency and conservation: This is required in order to influence the consumers to reduce the energy usage for the sake of financial benefit.
The advantages of DSM include reduction in utility bills, reduction in GHG emissions and cost saving by avoiding installation of new power plants.
Note that DSM is a smart grid application aimed at energy conservation and load balancing.As we will see in later sections, prosumer-based energy management influences the users to generate more energy.This in turn helps in achieving the above mentioned DSM purposes.
Renewable energy produced by consumers can be shared/sold to other consumers and the grid; this sharing of energy converts a consumer into prosumer [3].Prosumers not only consume energy but also sell/share excessive energy generated by renewable energy sources with the grid and/or with other consumers in a community as shown in Figure 1.This phenomenon helps to address the environmental, social and economic concerns related to increasing energy demand.To manage the prosumers in an energy sharing network, smart grid, with its communication infrastructure, allows consumers to form communities according to their energy consumption behavior [4].
This paper presents a novel Prosumer-based Energy Sharing and Management (PESM) scheme for cooperative DSM.Although implemented for a six-user scenario, the scheme is generic and applicable to any number of users.The rest of the paper is organized into four further sections.Section 2 is dedicated to related work on prosumer-based energy sharing.The proposed scheme along with associated scenarios is elaborated in Section 3. Section 4 presents simulations of the proposed scheme as well as analysis of the results.Conclusions are drawn in Section 5.This paper presents a novel Prosumer-based Energy Sharing and Management (PESM) scheme for cooperative DSM.Although implemented for a six-user scenario, the scheme is generic and applicable to any number of users.The rest of the paper is organized into four further sections.Section 2 is dedicated to related work on prosumer-based energy sharing.The proposed scheme along with associated scenarios is elaborated in Section 3. Section 4 presents simulations of the proposed scheme as well as analysis of the results.Conclusions are drawn in Section 5.

Related Work
Prosumer-based energy sharing and management methods, as shown in the literature, are mainly focused on studying prosumer behavior as well as building smart energy markets and prosumer communities.Silva et al. [13] conducted a survey which described the general feeling and awareness about the benefits and challenges associated with interaction of prosumers with other grid players.This survey demonstrated the willingness of the prosumers to discuss and coordinate with other prosumers and form prosumer groups.In addition, it was shown that prosumers were willing to communicate with the grid and to be part of efforts directed to achieve green energy, which, is very encouraging for the research community.
Game theory is a promising optimization method relevant to an environment involving multiple competing players (users, prosumers etc.).Zhang et al. [14] present a game-theoretic mechanism for managing the interaction of various energy market players including prosumers.A game-theory based framework is proposed and the performance is evaluated using numerical methods.The references in this work provide various other examples of game-theory based prosumer management techniques.
Multi-agent system approach provides flexibility in scenarios requiring distributed management.Lukovic and Kovac [15] propose a multi-agent system architecture for prosumer management.The dependence of various prosumers on the level of integration and automation, based on existing information and communication systems, is identified.A decision support mechanism makes this approach beneficial from the market success viewpoint.
Cost optimization is an integral part of any energy management system.Sun et al. [16] classify various prosumer operational modes and propose different optimization strategies.A comparison with pure consumer and pure producer model is also presented.
Luna et al. [17] present an energy management system (EMS)-based prosumer management idea.The EMS schedules energy flow for clusters of participating prosumers both in islanded and cooperative mode.
The smart energy market can play an important role in optimizing prosumer energy transactions and creating balance in demand and supply.For instance, Karnouskos [18] presents an energy

Related Work
Prosumer-based energy sharing and management methods, as shown in the literature, are mainly focused on studying prosumer behavior as well as building smart energy markets and prosumer communities.Silva et al. [13] conducted a survey which described the general feeling and awareness about the benefits and challenges associated with interaction of prosumers with other grid players.This survey demonstrated the willingness of the prosumers to discuss and coordinate with other prosumers and form prosumer groups.In addition, it was shown that prosumers were willing to communicate with the grid and to be part of efforts directed to achieve green energy, which, is very encouraging for the research community.
Game theory is a promising optimization method relevant to an environment involving multiple competing players (users, prosumers etc.).Zhang et al. [14] present a game-theoretic mechanism for managing the interaction of various energy market players including prosumers.A game-theory based framework is proposed and the performance is evaluated using numerical methods.The references in this work provide various other examples of game-theory based prosumer management techniques.Multi-agent system approach provides flexibility in scenarios requiring distributed management.Lukovic and Kovac [15] propose a multi-agent system architecture for prosumer management.The dependence of various prosumers on the level of integration and automation, based on existing information and communication systems, is identified.A decision support mechanism makes this approach beneficial from the market success viewpoint.
Cost optimization is an integral part of any energy management system.Sun et al. [16] classify various prosumer operational modes and propose different optimization strategies.A comparison with pure consumer and pure producer model is also presented.
Luna et al. [17] present an energy management system (EMS)-based prosumer management idea.The EMS schedules energy flow for clusters of participating prosumers both in islanded and cooperative mode.
The smart energy market can play an important role in optimizing prosumer energy transactions and creating balance in demand and supply.For instance, Karnouskos [18] presents an energy market-based architecture that provides DSM involving domestic and commercial prosumers.The distributed approach in the architecture provides intelligent participation in energy management by all the stakeholders.Another example is shown by Shimizu et al. [19] where a multi-stage demand-supply balancing mechanism optimizes the combinations of available generators and demands.The mechanism allows distributed generators (including those on prosumer premise) to be incorporated in overall supply in order to achieve the desired balance.
Another realistic approach is to organize the prosumers into different communities.Mamounakis et al. [20] present a prosumer energy management platform based on dynamic community creation and organization.Aggregator companies are at the center of this idea.While such a dynamic system results in efficient energy management, individual prosumers have to depend heavily on the aggregator companies.Rathnayaka et al. [21], present an approach which manages prosumers in a smart grid environment, which deals with the prosumers management based on goal oriented prosumer communities.An architecture has been proposed using three processes: community formation, its growth, and overall management.Rathnayaka et al. [1], describe four challenges related to goal oriented prosumer community groups for smart grid.The challenges, along with the proposed strategies are given in Table 1.
Table 1.Prosumer community challenges and proposed solutions.

Definition of prosumer groups
Community coordinator gets the energy sharing profiles from interested prosumers who want to join the community groups.Segmentation of the profiles is done by clustering i.e., prosumers are divided into different categories according to profiles and criteria/characteristics.

Prosumer recruitment
This can be done by evaluating new prosumers.Dynamic identification of the new prosumers is done for sustainable group formation and its scalability.

Goal definition
Different conflicting objectives of energy sharing process can be negotiated in order to define achievable goals.

Members' Ranking
Prosumers are ranked by multiple evaluation criteria in order to find the influential members as discussed by Rathnayaka et al. [22] Any energy management system will suffer if the consumers/prosumers behavior is not taken into account.Rathnayaka et al. [23], identify prosumers' energy-related behavior in order to achieve the optimal prosumer community building/categorizing on the basis of different parameters.Authors have analyzed in detail the internal and external parameters that influence the energy sharing behavior of prosumers.Internal parameters are related to the prosumers' operating domain which directly influences the amount of energy that can be shared with the smart grid.External parameters refer to different domains which are not directly related to the prosumers' environment, such as incentives by utilities.On the basis of detailed analysis, the authors have proposed a multi-agent model for creation of optimal prosumer communities, which consists of two parts: prosumer home module and community operation module.The modular approach helps managing energy exchange among communities in an intelligent manner.Rathnayaka et al. [22] have proposed a methodology to find the influential prosumers in prosumer community groups.The methodology involves prosumer assessment and ranking on the basis of multiple evaluation criteria.These criteria consist of different processes in order to determine influence of different prosumers on overall energy efficiency and cost effectiveness.Ciuciu et al. [3], have proposed an energy sharing mechanism on the basis of DR decision system that employs smart metering and social web technologies.The system introduces a framework which collects data on Internet of Smart Meters and studies the behavior of communities in making decisions regarding the energy sharing process.
Menniti et al. [24], propose a DR program based on combining the prosumers into an Energy District (ED) which is connected to the central control unit known as aggregator.The purpose of aggregator is to minimize the reverse energy flow at an MV/LV substation which results in cost minimization of the ED.For this purpose, auction is introduced in the ED; this effectively overcomes the problem of estimating ED prosumers' responsiveness.A similar work is presented by Brusco et al. [25]; an energy management scheme is proposed which deals with prosumer-based ED involving a central control entity.DR has been proposed for maximizing the ED utility and reducing the reverse energy flow at point of delivery.The scheme has been proved efficient and effective using the example of Italian residential housing area.
The role of Information and Communication Technologies (ICTs) in smart grid applications is imperative.The smart energy management systems heavily rely on ICTs.Fiorentino et al. [26] provide a mechanism for managing various consumers and prosumers, enabling integrated operation of distributed energy resources, with the help of ICTs.The mechanism takes into account generation, consumption and future load forecast in a flexible manner and helps in implementing the DSM.Smart devices such as smart appliances, smart sensors, smart storages, smart meters etc., at the users' premises as well as grid or community wide software and network infrastructure are essential requirements for implementing the ICT based energy management systems [21,27,28].The ICT-based energy management system has been termed as Internet of Energy (IoE) by some researchers [27].
Prosumers are important stakeholders and contributors to the smart grid and it is imperative to manage prosumer energy production, sale and consumption in an intelligent manner.Using the AMI and Automatic Meter Reading (AMR) infrastructure, prosumer energy management not only enhances grid capability to create the demand-supply balance, and hence reduced power outages and improved power quality, but also helps mitigate the carbon footprints associated with the fossil fuel based large scale production.The latter comes from the fact that most of the prosumers use renewable clean energy resources such as solar and wind etc. [29,30].
It is clear from the above literature review that numerous methods have been proposed for smart energy markets and prosumer community building/management.Prosumer interaction at an individual level within a community is hardly touched upon by researchers.In this paper we aim to fill this gap.Note that this work optimizes the energy sharing for a single community.The same mechanism may be used to optimize energy management within multiple communities separately.The results can then be used for inter-community energy sharing optimization.We present a novel Prosumer-based Energy Sharing and Management (PESM) methodology which optimizes energy sharing among prosumers in a community.The aim is to allocate maximum possible surplus energy (extra energy available to some users) to the users with a shortage.Furthermore, price of the surplus energy has also been taken into account.Binary Integer Programming (BIP) has been used to solve the optimization problem.The PESM gives priority to the prosumers with a shortage based on different criteria.Details of the proposed scheme are described in the subsequent section.

Proposed Scheme for Prosumer-Based Energy Sharing
As indicated in the last section, there are numerous examples in the literature where inter-community energy management and sharing mechanisms are presented.However, prosumer-based intra-community energy sharing is a research area hardly pondered upon.We present a novel optimization-based methodology which incorporates various issues related to prosumer energy management.These issues include optimal utilization of surplus energy in order to minimize shortages, price control, prioritizing the users with shortages according to different criteria etc.
In this section, details of the proposed PESM methodology have been elaborated.The PESM scheme incorporates multiple prosumers i.e., users who consume as well as generate energy.Although several different architectures are possible, we assume that prosumers are connected to grid and with one another using a local control center as shown in Figure 2. Users normally have renewable energy resources for generation.Typically, some of these users have a shortage of energy at any given time while others have surplus energy.The proposed scheme is devised accordingly and provides a mechanism of sharing surplus energy of some users with those in need.The scheme minimizes demand-supply mismatch and prioritizes users with shortages based on different criteria.We assume that some sort of storage facility is available to the prosumers.Inclusion of the storage in optimization process is one of the possible future enhancements in the proposed scheme.

Problem Formulation
In the proposed scenario, the total number of prosumers is I, indexed by i.There are N suppliers with surplus energy ϕ and M users with an energy shortage ψ so that ⊆ .The problem is to optimize the power in jth hour and share the energy among the users so that the shortage is minimized by maximum utilization of surplus energy.This requires finding the shortage/surplus energy of each user, which naturally leads us to following Equations.
where, τ is the total energy of the ith user in jth hour.β is the renewable energy (kW) of the ith user in jth hour.
is the grid energy (kW) of the ith user in jth hour.ξ is the consumption (kW) of the ith user in jth hour.ϕ , ψ are the surplus and shortage of energy respectively.
Note that there are a number of options available to the selling user.Users may prefer to sell energy only if they possess more renewable energy than required, e.g., the user may switch off the expensive grid power if sufficient solar power is available and sell only if there is surplus renewable energy.However, for simplicity, we assume that the users want to sell any form of surplus energy available to them.
The problem has been formulated in such a way that maximum possible surplus energy is allocated to those with a shortage.Furthermore, the total price associated with surplus energy is taken into account.This in turn ensures that the selling users with minimum prices are selected by the optimization algorithm.As we will see later, the relative importance of maximizing the allocation of surplus energy to the users with a shortage and minimizing the associated price can be controlled.The total price associated with nth selling user in the jth hour is: where is the per unit price.The objective function becomes:

Problem Formulation
In the proposed scenario, the total number of prosumers is I, indexed by i.There are N suppliers with surplus energy φ n and M users with an energy shortage ψ m so that (N + M) ⊆ I.The problem is to optimize the power in jth hour and share the energy among the users so that the shortage is minimized by maximum utilization of surplus energy.This requires finding the shortage/surplus energy of each user, which naturally leads us to following Equations.
where, τ ij is the total energy of the ith user in jth hour.β ij is the renewable energy (kW) of the ith user in jth hour.G ij is the grid energy (kW) of the ith user in jth hour.ξ nj is the consumption (kW) of the ith user in jth hour.φ nj , ψ mj are the surplus and shortage of energy respectively.
Note that there are a number of options available to the selling user.Users may prefer to sell energy only if they possess more renewable energy than required, e.g., the user may switch off the expensive grid power if sufficient solar power is available and sell only if there is surplus renewable energy.However, for simplicity, we assume that the users want to sell any form of surplus energy available to them.
The problem has been formulated in such a way that maximum possible surplus energy is allocated to those with a shortage.Furthermore, the total price associated with surplus energy is taken into account.This in turn ensures that the selling users with minimum prices are selected by the optimization algorithm.As we will see later, the relative importance of maximizing the allocation of surplus energy to the users with a shortage and minimizing the associated price can be controlled.The total price associated with nth selling user in the jth hour is: where C nj is the per unit price.The objective function becomes: subject to x nj = 1, i f energy o f user n is committed in time slot j 0, otherwise Note that in Equation ( 5) price of the energy being sold, ζ nj , is minimized while utilization of surplus energy, φ nj , is maximized.In other words, the objective here is to allocate the surplus energy to the users with a shortage as much as possible while at the same time choosing those surplus options which are at a lower price.This in turn minimizes the demand-supply mismatch while taking into account price of surplus energy.The weight 'w' in Equation ( 5) is used to control the bias between ζ nj and φ nj .If shortage is to be minimized at any cost, then the variable 'w' takes a value of zero.
Note also that the users with a shortage will be dealt one at a time based on any of the following criteria.
(1) Give priority to the user according to a single criterion.We have chosen capacity of renewable energy for this, as such users offer greater share in PESM.This approach motivates the other users to install or increase the renewable resources.However other criteria are also possible such as price of surplus energy, contribution of surplus energy in last 24 h etc. (2) Another approach is to use multiple criteria.We have used capacity of renewable energy, price of surplus energy and contribution of surplus energy in 24 h for this purpose.The user that contributed more as compared to others according to above-mentioned criteria gets higher priority.These criteria urge users to generate more energy, be active participants in energy sharing and keep the selling price at its lowest possible value.Note that these incentives are based on the assumption that more renewable energy is needed.When the production reaches to a certain limit, the incentives will have to be changed accordingly.
We define a variable ρ t to represent tth priority criterion.Based on the proposed priority criteria, the problem is reformulated as: where xr nj and xs nj are binary values and represent the inclusion or exclusion of the remaining and served users respectively.ψr mj and ψs mj are the shortage of remaining and served users respectively.
κ mj and ∆ mj denote capacity and overall contribution respectively.The overall contribution has been defined as: where α, β and γ are capacity, selling price and contribution of surplus energy respectively.A more comprehensive contribution factor, involving other possible parameters, may be used in future enhancements of this work.The weights P 1 , P 2 and P 3 represent the relative importance of above three criteria and take values from 0 to 1 such that: The effectiveness of the algorithm, with both single criterion and multiple criteria approaches, has been evaluated through extensive simulations.The test system and results have been presented in the next section.BIP has been used for optimization.BIP is the type of integer programming in which decision variables can take value of 0 or 1 only; in the proposed scheme, if there is a user's surplus energy available for sharing then the respective decision variable takes a value of 1, otherwise it is 0.
The algorithm deals with shortages on hourly bases.However the execution time is very small (less than 10 s on a 1.80 GHz processor machine) and it can be run as frequently as required based on the availability of the updated surplus/shortage scenario.The frequency of running the algorithm also depends on communication speed between the controller and prosumers.

Simulations and Results
A test system has been devised in order to simulate the proposed scheme.We consider a small number of prosumers in order to keep the simulations simple.However, the proposed scheme is scalable i.e., the ideas and methodology presented here are equally applicable to a large system.The details of the test system and simulation results are presented in the subsequent subsections.

Test System
The proposed optimization would run in a central controller communicating with all participating prosumers, as depicted in Figure 2. The communication architecture and technologies are beyond the scope of this paper and can be included in a future enhancement of this work.For now we concentrate on energy sharing optimization.A test system has been devised involving six prosumers; the energy surplus and shortage values of each user, used in the algorithm, are indicated in Figure 3.Note that these values, i.e., the given shortage and surplus scenario, hugely influence the resulting reduction in shortage.If the shortage is much greater than the surplus, the algorithm will have less impact on the energy shortage reduction.On the other hand if the shortage is less than surplus, the algorithm can potentially bring the shortage to zero.We have chosen a realistic scenario.The first few hours and last couple of hours in Figure 3 indicate a high usage time span while in rest of the hours there is a mix consumption pattern.The other important parameter that influences the outcome of algorithm is the price associated with each user's surplus energy.As given in Equation ( 5) the algorithm tries to maximize surplus energy utilization and minimize the associated price at the same time.Per unit selling price offered by different users, in Pakistani Rupee (PKR), is given in Figure 4.The problem is to allocate available surplus energy to users with a shortage in such a way that the surplus is utilized as much as possible while shortage is minimized.Note that this problem can be approached in several different ways.It can be modelled as deterministic or stochastic programming, based on the nature of available information.Similarly, we may employ linear programming or BIP depending on whether it is desired to allocate full amount of surplus energy offered by a certain user or allocate flexibally i.e., only a certain part based on a shortage situation.The proposed algorithm, elaborated in the previous section, uses deterministic BIP approach and employs MATLAB 'bintprog' function.
Note that linear programming would create extra billing-related problems such as calculating/measuring amount of surplus energy from a certain user allocated to different users with shortages.The BIP, on the other hand, removes this problem, as a participating selling prosumer will either commit its full available energy or no energy at all; this makes the billing problem simpler, and hence reduces the controller overhead.The billing in this case will be unpredictable, however, the algorithm tries to choose the surplus options in such a way that minimizes the associated price.Note that linear programming would create extra billing-related problems such as calculating/measuring amount of surplus energy from a certain user allocated to different users with shortages.The BIP, on the other hand, removes this problem, as a participating selling prosumer will either commit its full available energy or no energy at all; this makes the billing problem simpler, and hence reduces the controller overhead.The billing in this case will be unpredictable, however, the algorithm tries to choose the surplus options in such a way that minimizes the associated price.

Results
As mentioned in Section 3.1, users with a shortage are prioritized according to single and multiple criteria, which results in two different approaches for energy sharing optimization.The results according to the two approaches are presented in the subsequent subsections.Note that linear programming would create extra billing-related problems such as calculating/measuring amount of surplus energy from a certain user allocated to different users with shortages.The BIP, on the other hand, removes this problem, as a participating selling prosumer will either commit its full available energy or no energy at all; this makes the billing problem simpler, and hence reduces the controller overhead.The billing in this case will be unpredictable, however, the algorithm tries to choose the surplus options in such a way that minimizes the associated price.

Results
As mentioned in Section 3.1, users with a shortage are prioritized according to single and multiple criteria, which results in two different approaches for energy sharing optimization.The results according to the two approaches are presented in the subsequent subsections.

Results
As mentioned in Section 3.1, users with a shortage are prioritized according to single and multiple criteria, which results in two different approaches for energy sharing optimization.The results according to the two approaches are presented in the subsequent subsections.

Single Criterion
The single criterion used to implement the first approach is renewable energy capacity of prosumers.The greater the capacity, the higher the priority and vice versa.The user who has a shortage and the highest installed renewable capacity will be served first.The capacity of 6 users is shown in Figure 5.The single criterion used to implement the first approach is renewable energy capacity of prosumers.The greater the capacity, the higher the priority and vice versa.The user who has a shortage and the highest installed renewable capacity will be served first.The capacity of 6 users is shown in Figure 5.The objective is to reduce the shortage of energy by selling surplus energy to users with a shortage in an optimized manner.At the same time, using this criterion encourages prosumers to increase their renewable capacity.Note that an upper limit on the capacity may be imposed according to the market drivers.In that case, the criterion would incentivize the users to increase the renewable capacity up to the allowed limit.The current implementation assumes that renewable energy has to be produced as much as possible.This is realistic particularly for the developing countries.Shortage and surplus energy after implementation of the optimization algorithm is shown in Figure 6.As the figure indicates, much of the energy shortage has been addressed by the other users having surplus energy.Price of surplus energy offered to users having a shortage is shown in Figure 7. First criterion simulations show a 30.16%reduction in overall shortage of six users over 24 h.The total price of surplus energy available in this case is 668 PKR.The objective is to reduce the shortage of energy by selling surplus energy to users with a shortage in an optimized manner.At the same time, using this criterion encourages prosumers to increase their renewable capacity.Note that an upper limit on the capacity may be imposed according to the market drivers.In that case, the criterion would incentivize the users to increase the renewable capacity up to the allowed limit.The current implementation assumes that renewable energy has to be produced as much as possible.This is realistic particularly for the developing countries.Shortage and surplus energy after implementation of the optimization algorithm is shown in Figure 6.As the figure indicates, much of the energy shortage has been addressed by the other users having surplus energy.Price of surplus energy offered to users having a shortage is shown in Figure 7. First criterion simulations show a 30.16%reduction in overall shortage of six users over 24 h.The total price of surplus energy available in this case is 668 PKR.

Single Criterion
The single criterion used to implement the first approach is renewable energy capacity of prosumers.The greater the capacity, the higher the priority and vice versa.The user who has a shortage and the highest installed renewable capacity will be served first.The capacity of 6 users is shown in Figure 5.The objective is to reduce the shortage of energy by selling surplus energy to users with a shortage in an optimized manner.At the same time, using this criterion encourages prosumers to increase their renewable capacity.Note that an upper limit on the capacity may be imposed according to the market drivers.In that case, the criterion would incentivize the users to increase the renewable capacity up to the allowed limit.The current implementation assumes that renewable energy has to be produced as much as possible.This is realistic particularly for the developing countries.Shortage and surplus energy after implementation of the optimization algorithm is shown in Figure 6.As the figure indicates, much of the energy shortage has been addressed by the other users having surplus energy.Price of surplus energy offered to users having a shortage is shown in Figure 7. First criterion simulations show a 30.16%reduction in overall shortage of six users over 24 h.The total price of surplus energy available in this case is 668 PKR.Note that the shortages still appearing in Figure 6 can be addressed using a storing mechanism and/or from other communities.Similarly the surplus can be stored (for future use) and/or sold to some other community.We will have more to say on this in the conclusion section.

Multiple Criteria
If there is more than one user with a shortage of energy then, according to this approach, priority is given to the user who contributes more in 24 h in terms of multiple parameters.In the current implementation, the contribution is defined on the basis of renewable capacity, selling price and contribution of surplus energy, as given in Equation (11).The values of weights , and in our implementation are same i.e., 1/3 (13) The surplus energy price associated with all users is according to Figure 4 while the contribution in terms of surplus energy is given in Figure 8.Note that the shortages still appearing in Figure 6 can be addressed using a storing mechanism and/or from other communities.Similarly the surplus can be stored (for future use) and/or sold to some other community.We will have more to say on this in the conclusion section.

Multiple Criteria
If there is more than one user with a shortage of energy then, according to this approach, priority is given to the user who contributes more in 24 h in terms of multiple parameters.In the current implementation, the contribution is defined on the basis of renewable capacity, selling price and contribution of surplus energy, as given in Equation (11).The values of weights P 1 , P 2 and P 3 in our implementation are same i.e., P 1 = P 2 = P 3 = 1/3 (13) The surplus energy price associated with all users is according to Figure 4 while the contribution in terms of surplus energy is given in Figure 8.Note that the shortages still appearing in Figure 6 can be addressed using a storing mechanism and/or from other communities.Similarly the surplus can be stored (for future use) and/or sold to some other community.We will have more to say on this in the conclusion section.

Multiple Criteria
If there is more than one user with a shortage of energy then, according to this approach, priority is given to the user who contributes more in 24 h in terms of multiple parameters.In the current implementation, the contribution is defined on the basis of renewable capacity, selling price and contribution of surplus energy, as given in Equation (11).The values of weights , and in our implementation are same i.e., 1/3 (13) The surplus energy price associated with all users is according to Figure 4 while the contribution in terms of surplus energy is given in Figure 8.  Surplus and shortage of energy after optimization is shown in Figure 9 while price of allocated surplus energy is shown in Figure 10.A shortage reduction of 44.13% has been observed using this approach for the same scenario used in single criterion approach.The total price of allocated surplus energy is calculated by the algorithm as 534.4 PKR.These results are better than the single criterion approach in terms of reduction in shortage, however note that the results are heavily dependent on the initial surplus/shortage scenario.Surplus and shortage of energy after optimization is shown in Figure 9 while price of allocated surplus energy is shown in Figure 10.A shortage reduction of 44.13% has been observed using this approach for the same scenario used in single criterion approach.The total price of allocated surplus energy is calculated by the algorithm as 534.4 PKR.These results are better than the single criterion approach in terms of reduction in shortage, however note that the results are heavily dependent on the initial surplus/shortage scenario.Note that the value of variable 'w' in above mentioned simulations (see Equation ( 8)) is taken as zero, which means the results in Sections 4.2.1 and 4.2.2 give maximum possible utilization of surplus energy for the given scenario.In order to see the effect of 'w', we have simulated the multiple criteria approach with different 'w' values; the results are presented in Table 2. Surplus and shortage of energy after optimization is shown in Figure 9 while price of allocated surplus energy is shown in Figure 10.A shortage reduction of 44.13% has been observed using this approach for the same scenario used in single criterion approach.The total price of allocated surplus energy is calculated by the algorithm as 534.4 PKR.These results are better than the single criterion approach in terms of reduction in shortage, however note that the results are heavily dependent on the initial surplus/shortage scenario.Note that the value of variable 'w' in above mentioned simulations (see Equation ( 8)) is taken as zero, which means the results in Sections 4.2.1 and 4.2.2 give maximum possible utilization of surplus energy for the given scenario.In order to see the effect of 'w', we have simulated the multiple criteria approach with different 'w' values; the results are presented in Table 2.Note that the value of variable 'w' in above mentioned simulations (see Equation (8)) is taken as zero, which means the results in Sections 4.2.1 and 4.2.2 give maximum possible utilization of surplus energy for the given scenario.In order to see the effect of 'w', we have simulated the multiple criteria approach with different 'w' values; the results are presented in Table 2.
The increasing value of 'w' reduces the price but at the same time decreases the amount of surplus energy to be allocated to users with shortage.This has a negative impact on shortage reduction.A small value of 'w' (between 0 and 0.1) biases the optimization algorithm slightly in the favor of low price options while keeping the shortage reduction near to optimal.

Conclusions
Electricity supply at an optimized cost through effective DSM is one of the core issues related to the smart grid.Note that the cost optimization relates to both utilities and consumers/prosumers.From the prosumer´s perspective, this would mean minimum buying price and maximum selling price.This can lead to unfair pricing particularly in a time of severe energy shortage.There must be some mechanism of price control.The proposed scheme takes this objective into account and minimizes the price from buyers' point of view.In this paper, we have presented PESM scheme for cooperative DSM in smart grid.Prosumer-based social communities will help the utilities in solving the energy management issues and reducing the carbon prints.However the energy sharing optimization within a single community is the basic building block for inter-community optimal energy sharing.A test system with six users, having realistic profiles, has been presented in order to simulate cooperative DSM while a few realistic criteria have been employed for energy sharing priorities among prosumers.Although the number of users in this scenario is small, the proposed methodology is scalable; the obtained results indicate the effectiveness of the proposed algorithm for large communities as well.The scheme allows users with excessive energy to sell their surplus energy to users with an energy shortage in an optimized manner.The multiple criteria approach results in 44.13% reduction in shortage for a typical scenario.This is much higher than 30.16%reduction achieved by single criterion approach.In other words, the method and parameters used to prioritize users can affect the resulting shortage reduction quite significantly.Since the proposed scheme is automated, it is possible that price is very high in some instances.Along with any suitable price control mechanism imposed by a regulatory body, the scheme would be more useful in maintaining the overall prosumer satisfaction.The automated price control within the given regulations is one of the possible future enhancements in the scheme.As indicated earlier, it can be observed from the results that not all of the shortages can be met when there is not enough surplus energy available.It is also obvious that all surplus energy can not be used up when there is relatively less shortage.This problem can be addressed by storing surplus energy in preceding slots for use in the future according to requirements.Furthermore, the surplus energy available even after optimization may be allocated to other communities, as part of inter-community energy sharing optimization.These futuristic ideas along with experimentation with other optimization techniques are in the scope of our future work.

Figure 1 .
Figure 1.Three major roles of a prosumer.

Figure 1 .
Figure 1.Three major roles of a prosumer.

Figure 4 .
Figure 4. Price of selling surplus energy in Pakistani Rupees (PKR).

Figure 4 .
Figure 4. Price of selling surplus energy in Pakistani Rupees (PKR).
of surplus energy (PKR)

Figure 4 .
Figure 4. Price of selling surplus energy in Pakistani Rupees (PKR).

Figure 6 .
Figure 6.Shortage and surplus energy after the optimization.

Figure 6 .
Figure 6.Shortage and surplus energy after the optimization.

Figure 7 .
Figure 7. Price of surplus energy allocated by optimization algorithm.

Figure 7 .
Figure 7. Price of surplus energy allocated by optimization algorithm.

Figure 6 .
Figure 6.Shortage and surplus energy after the optimization.

Figure 7 .
Figure 7. Price of surplus energy allocated by optimization algorithm.

Figure 9 .
Figure 9. Optimized shortage and surplus energy according to multiple criteria approach.

Figure 10 .
Figure 10.Price of allocated surplus energy.

Figure 9 .
Figure 9. Optimized shortage and surplus energy according to multiple criteria approach.

Figure 10 .
Figure 10.Price of allocated surplus energy.

Figure 10 .
Figure 10.Price of allocated surplus energy.

Table 2 .
Effect of weight 'w' on optimization results.Optimized shortage and surplus energy according to multiple criteria approach.

Table 2 .
Effect of weight 'w' on optimization results.

Table 2 .
Effect of weight 'w' on optimization results.