Demand-side management for smart grid via diffusion adaptation

: This study presents a novel fully distributed and cooperative demand side management framework based on adaptive diffusion strategy. In this approach, each customer autonomously and without any need for the global information, minimises his incommodity function. The proposed framework has ability to track drifts resulting from the changes in the customer preferences and conditions or any rapidly changing price parameter coming from the wholesale market. In this scenario, the customers aim at maximising their individual utility functions; while the utility company aims at minimising the smart grid total payment (i.e. maximisation of the social welfare). The authors show that there is no need for the utility company to participate in the scheduling program for maximising social welfare. This measurement is maximised adaptively when the customers minimise their incommodity. Moreover, the authors provide a detailed analysis of the robustness of the proposed strategy in the presence of imperfect communication/computation conditions. Numerical results show that the proposed framework performs well, is scale free, and can achieve lower peak-to-average ratio of the total energy demand compared with that achieved by the game theoretical methods.


Introduction
Demand side management (DSM) refers to the process of encouraging and motivating the customers to schedule their energy consumption profiles in order to smooth out the total energy demand fluctuations and reduce the customers payment. Indeed, the DSM includes all operations that aim at making a change in the customer's energy consumption profile, in shape and/or time, to make a correspondence between the demand side and the supply side, while trying to reduce the fossil fuel usage and efficiently exploit the green energy resources [1]. One possible way to assess the DSM (or demand response (DR)) programs is to classify them into three main categories based on the types of data processing or scalability, adopted persuasion, and objective function. The first category is divided into two methods itself, namely centralised and decentralised methods according to the data exchange mechanism [2]. In the centralised mode, each customer interacts with only the control centre (utility company) individually and independent of the other customers. However, the extent of interactions in the decentralised methods (such as our method) is very high and encompasses the communication between the control centre and the customers as well as the communication between every two customers [3].
The second category includes incentive-based and price-based programs motivated by the utility company [4]. In the incentivebased programs a fixed or time-varying price is adopted, whereas the utility company pays the customers for reducing the energy consumption, or penalises them if they do not participate in the program. Direct load controlling, interruptible/curtailable load curtailing, demand bidding-buyback (DBB), and emergency demand reduction require incentive-based programs [1,4]. In the price-based programs the customers receive different electricity prices at different time intervals. In fact, the utility company (e.g. the retailer) manipulates the price trend to smooth out the total energy demand fluctuations and reduces the peak-to-average ratio (PAR) as much as possible knowing that the customers naturally use less electricity when the price is high. Including price-based programs can be referred to as time-of-use pricing [5], critical peak pricing [6], real-time pricing (RTP) [7], or inclining block rate (IBR) [8].
In the last category, the DSM programs can further be grouped based on the application (i.e. assignment DSM [9] and energy management DSM [10]) and the optimisation approach (i.e. singleobjective, multi-objective, and weighted-sum multi-objective problems [11]). The single-objective DSM problems frequently aim at minimising the PAR, customer payment, or maximising the social utility [12]. The multi-objective programs are used to optimise multiple objects (e.g. cost-minimisation and utility maximisation) separately and simultaneously [11]. However, one useful solution to take into account those objects simultaneously is by defining a new function as the difference between a weighted sum of commensurable functions and a weighted sum of other nonconformist functions [13,14].
Our proposed mechanism is a decentralised RTP-based weighted-sum multi-objective method. In this way, Samadi et al. [7] considered the DSM problem with a distributed RTP model based on the message exchange between the customers' smart meters and the energy provider. In this scheme, the customers send information about their energy demand and receive a control message which contains RTP information. Moreover, the proposed paper models the customers' preferences and their energy consumption patterns by carefully selecting the utility functions. This is based on the concepts from microeconomics and proposes a distributed algorithm which automatically manages the interactions between the customers without any need for utility company management. Further, they proposed a decentralised weighted-sum multi-objective smart pricing DSM using the Vickrey-Clarke-Groves mechanism to optimise the social welfare function in [14]. The welfare function is constructed of the aggregate utility functions of all the customers (which analytically models each customer's preferences and energy consumption patterns) excluding the total electricity cost. In these works it is required that each customer provides some information about his energy demand to others.

Related work
To the best of our knowledge, for the first time, an autonomous game-based DSM has been presented by Mohsenian-Rad et al. [5]. They showed that in a general scheme where one energy provider (utility company) serves multiple customers, the global optimal performance in terms of minimising the energy costs is achieved at the Nash equilibrium (NE) of the formulated DSM program. Moreover, their approach has the ability to reduce the PAR, as well as minimising each customer's individual payment. In their other work [8], they proposed an automatic DSM framework which attempts to achieve the desired trade-off between minimising the electricity payment and minimising the waiting time for the operation of each appliance in household at the presence of an RTP-based tariff combined with IBRs. However, the proposed methods are not fully distributed and each customer needs to broadcast its energy consumption pattern to all the other customers.
Other RTP-based strategies which benefit from the weightedsum multi-objective functions are the convex optimisation-based methods [15,16] and non-cooperative game methods [12,17]. As an example of convex optimisation-based methods, an RTP-based strategy which benefits from a fast distributed dual gradient algorithm, is provided in [15]. Compared with traditionally distributed dual sub-gradient algorithms, this improved method not only accelerates the convergence rate but also overcomes the possible oscillation that is caused by the uncertainty in choosing the step-size for the iteration process in a sub-gradient projection method. The work in [18] uses a game-theoretic approach in which the energy provider tries to minimise the square Euclidean distance between the instantaneous and the average load demands of the power system. A novel day-ahead game theoretic model predictive control approach for DSM that can adapt to real-time data was developed in [19]. The authors of [20] studied real-time information-based DSM in both centralised and decentralised structures aiming at minimising the PAR and the power generation cost. For the decentralised solution, they proposed the game theoretical approaches so that most of the computation is performed locally. Besides, they proved that all the DSM participants benefit from the DSM system equally because both the centralised schemes and the game theoretical approaches minimise the global PAR.
In [21], a realistic DSM model that accounts for uncertainty in the energy consumption pattern variations and calculates a robust price for all users in the smart grid was introduced and the existence of solutions was analysed. They showed that the proposed mechanism reduces the monetary expenses for all the users in a real-time market, while at the same time it provides a reliable production cost estimate to the energy supplier. Yaghmaee et al. [22] proposed a two-tier cloud-based DSM to control the residential load of customers equipped with local power generation and storage facilities as auxiliary sources of energy in their study. Given a household appliance inventory, the authors of [23] built a dictionary of reference models for a single residence as a means of detecting and structured the general behavioural activity from realtime advanced metering infrastructure aggregate consumption observations. Using the proposed hidden Markov model, the DSM manager detects the consumer behaviour from the real-time aggregate consumption and a pre-built dictionary of reference models. These models capture the variations in consumer habits as a function of daily living activity sequence and the DSM program was developed accordingly. A tradeoff analysis between comfort, consumption threshold, and appliance activation delay was carried out in this paper.
A practical DSM scenario where selfish customers compete to minimise their individual energy cost through scheduling their future energy consumption profiles was investigated in [24]. An RTP-based load billing scheme was adopted in this work to effectively convince the consumers to shift their peak-time consumption and to fairly charge the consumers for their energy consumption. The authors of [25] proposed a hierarchical dayahead DSM model integrated with renewable energy sources. The proposed model consists of three layers namely: the utility in the upper layer, the DR aggregator in the middle layer and customers in the lower layer. To achieve these objectives, a multi-objective problem was formulated and an artificial immune algorithm was employed to solve it.

Motivation and contributions
None of the mentioned works are fully distributed, they are based on perfect communication mechanism. Therefore, there is no guarantee that the costumers communicate to each other or the system is robust to link failure. So, we are motivated to develop an autonomous fully distributed robust strategy which can overcome the weaknesses of the game-theoretical and other methods in terms of computational efficiency, robustness, degree of freedom, and the need for global information. Besides, our diffusion-based method has ability to continuously adapt and learn from the drifts eventuating from the changes in the customer preferences and conditions or the price parameter coming from the wholesale market. Moreover, in this paper, we propose a novel mechanism to manage the customers' energy consumption schedule in order to achieve maximum social welfare, autonomously and without any intervening of the energy provider.
In [26], it is shown that the NE of the game-based algorithms is not unique. However, the NE forms a convex set and each consumer's payoff is the same over each set. Moreover, it is proved that the A-DSM program is convergent to the equilibrium set if the consumers take turns in processing the algorithm (i.e. they should not run their algorithms at the same time). However, when a large number of consumers participate in the A-DSM program, it takes a long time to converge. Therefore, there is an essential need to provide an algorithm such that the consumers can make decisions simultaneously, not one after the other. In the game-theoretical methods it is essential that the consumers take turns in processing the optimisation algorithm so that the mechanism converges. Therefore, some supervision is needed to coordinate the behaviour of consumers one by one and make sure that they do not run their algorithms in parallel. This can impose a significant time-delay in large systems and prevents implementation of real-time DSM solutions. However, our proposed algorithm does not need a coordinator and can be implemented in a parallel manner (the consumers can run their algorithms regardless of the others' states) which significantly reduces the computational/communication delay.
Compared to the work in [27], this paper proposes a more general DSM solution applicable to a wide range of scenarios (not just ability to sell electricity back to the grid). In addition to including only few appliances like in [27], in this paper the appliances are modelled in more details, which is needed for a legitimate DSM-solution in real-world applications. A simple yet effective technique is proposed to tackle the challenges and difficulties in solving the DSM problem with five different classes of electrical appliances. Moreover, in this paper we provide a detailed analysis of the performance of proposed diffusion strategy over the conditions such as noisy data/links and communication failures, corrupted/asynchronous information, intruder attacks.
Notation: In this work, matrices and vectors are denoted as bold italic face capital letters and bold italic face lower-case letters, respectively. Further, the scalars are denoted in normal letters unless otherwise stated. Let ⊗ denote the Kronecker product, I x denote the column vector with all entries equal to one and length x, I x denote the identity matrix with size x × x, E[ ⋅ ] denote the expectation operator, ℤ xy denote the matrix whose entries are all zero except for the (xy)th entry, which is equal to one, and F i denote the filtration to represent all information available up to iteration i. We also use Tr( ⋅ ) for the trace of a matrix and diag( ⋅ ) to denote a (block) diagonal matrix formed from its arguments. We use col{ ⋅ } x ∈ X to denote a column vector formed by stacking x ∈ X on top of each other. The main notations are listed in Table 1.
The rest of this paper is organised as follows. In Section 2 the system architecture is proposed. In Section 3 we formulate the social welfare maximisation problem. Our adaptive autonomous strategy is established in Section 4. Section 5 presents the numerical results, and the paper is concluded in Section 6.

Proposed system architecture
Here, a smart power system with an energy consumption and storage scheme is considered in which the residential customers can autonomously schedule their energy consumption profiles to optimise the objective functions while meeting the required energy of each appliance during a scheduling horizon (e.g. one day). To clarify the proposed scheme, we investigate an architecture consisting of one energy provider (i.e. the utility company) and a set of K = {1, 2, …, K} residential customers as in Fig. 1. As is common in the DSM literature, we assume that each customer is equipped with a smart meter with the ability of energy consumption scheduling of its appliances. All the customers' smart meters are connected to the same energy provider and their neighbours through a suitable two-way communication protocol, i.e. local area network. Further, the utility company is, in turn, connected to the wholesale market to provide its customers demand. It is assumed that the energy consumption scheduler (ECS) embedded in the smart meters is connected to the household appliances through home area network (e.g. simple ZigBee network) and is able to monitor, schedule, and collect all the data of electrical appliances plugged into the grid. However, the wholesale marketing, the utility company problems, and the unbalance issues (between supplied power and demanded power) have not been addressed in this study since they are beyond the scope of this paper.
In this work, it is assumed that the customers are price-takers, i.e. the customer operations do not affect the wholesale electricity price trend. Anyway, due to the load synchronisation issues, when the customers are price-takers, extending the DSM beyond a certain level does not necessarily improve the system performance and may result in sub-peaks in the consumption trend [28]. So, the system characteristics must be determined carefully. In the undertaken scenario here, the only objective of the energy provider is to maximise the social welfare and not to make profit.

Power system model
Following previous notations, the set of customers and their total number are denoted as K and K ≜ K , respectively. The set of equal length time slots h in the scheduling horizon is ℋ = {1, 2, …, H}. For example, to demonstrate a day ahead scheduling horizon we must set h = 1 hour and H ≜ ℋ = 24. Further, A k and A k ≜ A k denote the set of all appliances and the total number of appliances belonging to the customer k, respectively. Let l k h denote the total energy demand of customer k ∈ K at the time slot h ∈ ℋ. So, the total daily energy demand vector of the customer k from the energy provider is l k ≜ l k 1 , l k 2 , …, l k H . The energy provider calculates the total required energy of all the customers at time slot h as

Objective function model
To construct the social welfare function and restrict the customers from consuming more electricity at peak hours, the cost function (representing the customers payment) and the utility function (representing the satisfaction level) are introduced. The cost function is an increasing function of energy consumption (i.e. increasing l k h ). So, for each h ∈ ℋ, we must have (C(x 1 ) < C(x 2 ) ∀ x 1 < x 2 ). Also, the cost function is assumed to be strictly convex, i.e. for each h ∈ ℋ, , where x 1 , x 2 , and θ are real scalars such that, x 1 , x 2 ≥ 0 and 0 < θ < 1. The following common quadratic cost function which is also used for modelling the cost of thermal generators satisfies all the above assumptions [5]  where the price parameters ν h > 0 and b h , c h ≥ 0 may vary with each h ∈ ℋ.
In general, a utility function describes the criterion of usefulness that a customer acquires from the available resources. Using the utility function, we can describe the quality of energy used by the customers. Indeed, the choice of utility function adopted by each customer determines his characteristics and preferences. Therefore, the utility function is an essential assignment for better specification of the social welfare function. For each appliance, we represent the corresponding utility function as U k, a x k, a h , w k, a h , where w k, a h is a parameter, which may differ among different appliances, representing the preference (priority) of electricity consumption for appliance a ∈ A k of customer k at time slot h (e.g. higher w k, a h means this appliance is willing to consume more power at slot h), and x k, a h is defined in the following sub-section. According to utility theory [29], a legitimate utility function must be concave, so, it must be non-decreasing (i.e. the marginal benefit is non-negative) ∂U(x, w)/∂x ≥ 0, and the marginal benefit of each customer must be a non-increasing function ∂ 2 U(x, w)/∂x 2 ≤ 0. Moreover, we assume that for a fixed consumption level x, a larger w gives a larger U(x, w) (i.e. ∂U(x, w)/∂w > 0) and when the consumption level is zero for all w > 0 we have U(0, w) = 0 [14].
In this work, we assume that all the customers have ability to efficiently prioritise their appliances' tasks, such that, in the peak demand time they operate the most necessary appliances and postpone or modify the operation time of some less necessary ones. So, we adopt the quadratic utility functions corresponding to the linearly decreasing marginal benefit as follows [14,30] where α is a predetermined parameter.

Demand model
In our scenario, each customer can demand energy from either the energy provider or by taking it from its own storage device, if there is any. The energy consumption (demand) matrix for all the appliances of the customer k is where x k, a h is the energy scheduled by the ECS of the customer k for an appliance a ∈ A k at time slot h. The task of ECS embedded in each consumer's smart meter is to determine the optimal schedule for X k . Each column of the matrix X k denotes the energy scheduled for one appliance throughout the scheduling horizon. Now, we redefine l k h conforming to the rows of X k as Each customer is likely to have a storage device (e.g. battery) and five classes of appliances with non-shiftable, high-shiftable, midshiftable, low-shiftable, and curtailable characteristics denoted as , respectively. The dynamic change of the energy level E k, b h and charge/discharge power rate x k, b h of the battery are limited at each time-slot as follows where E k, b cap is the battery capacity and x k, b rat is the maximum charge/ discharge rate. The energy level of storage device b of customer k updated at slot h according to , 0 (idle mode), 1 (charge mode)}, the dynamic evolution energy level of the battery is updated.
The non-shiftable appliances are inelastic, meaning that they consume a fixed amount of energy at each time slot and there is no elasticity to modify their energy requirement. Examples of such appliances include lighting, refrigerator, TV, PC, and electric kettle. The shiftable appliances must consume specific total energy within a preferred time interval. For a ∈ A k hs variables x k, a h are continuous, while for a ∈ A k ms ∪ A k ls they are integers. These appliances are semi-elastic in the sense that, there is flexibility to shift their operation time, while there is no flexibility to adjust the total energy demands. Moreover, once a low-shiftable a ∈ A k ls appliance's operation is started, it needs to continue uninterrupted until the task is completed. Tumble dryer and dishwasher a ∈ A k ls , pool pump a ∈ A k ms , and plug-in hybrid electric vehicle (PHEV) a ∈ A k hs , are among these appliances. The last category includes curtailable appliances, which have the flexibility to adjust their total energy demand. For these appliances consuming more energy (in a limited interval) is equivalent to increasing the quality-of-usage (satisfaction) level. However, the evaluation of satisfaction level is time-dependent, such that a customer may require a higher satisfaction to consume some energy during a certain time than in another time. Electric fan, air conditioner, ventilator, and iron are some examples of curtailable appliances.
Each class of appliances has an allowed range of power consumption as follows: where γ k, a min and γ k, a max denote the minimum and maximum power levels that appliance a can consume, respectively. The second line belongs to the mid-shiftable and low-shiftable appliances expressing that these appliances work with their nominal power x k, a rat regulated by an auxiliary variable Γ k, a h = {0 (off mode), 1 (on mode)}. For curtailable appliances (the third line), there is a minimum γ k, a min ≤ u k, a min and a maximum γ k, a max ≥ ū k, a max acceptable power consumption level as the third line of (7). The last line implies that the appliances cannot/does not need to consume power out of range ℋ k, a . Based on the preferences and habits, each customer k ∈ K determines a certain time interval starting from α k, a ∈ ℋ and ending at β k, a ∈ ℋ, for each appliance a ∈ A k ≜ A k no ∪ A k hs ∪ A k ms ∪ A k ls ∪ A k cu , and requires this appliance to finish its work within this time interval ℋ k, a ≜ {α k, a , …, β k, a }. So, the following conditions must hold: where the first line of (8) refers to the non/high-shiftable appliances with a predetermined desired aggregated energy E k, a , which must be consumed until β k, a . However, according to the second line of (8), for curtailable appliances E k, a in bounded by minimum E k, a min and maximum E k, a max tolerable energy requirement of the appliance a ∈ A k cu , specified according to the customer preference. According to the third line, the mid-shiftable appliances need fixed amount of energy E k, a until β k, a , while the operation of them can be interrupted and resume again. The last line expresses that once the low-shiftable appliances switch on, their operations cannot be interrupted until the end of their tasks. That means, Γ k, a h works as a trigger for the low-flexible appliance and once is equal to one, the appliance continue working for a continuous period with length Δ k, a = E k, a /x k, a rat . These constraints may differ among the customers [Although in this work we assumed that u k, a min and u k, a max are fixed throughout the scheduling horizon, these bounds can defer at each slot for each individual customer.] and can be set according to each individual customer's preference [31]. Further, there is usually a constraint on the total permissible energy consumption for each customer k at each time slot h where l k max is the maximum amount of energy that customer k can demand from the energy provider at each time slot. In fact, this constraint prevents the creation of the sub-peaks for energy demand at low-price time slots or exceeding demand from the capacity of power-line. Finally, we define a feasible set for the DSM problem at each customer site to satisfy all the mentioned conditions as follows: An energy consumption profile determined by the ECS of customer k's smart meter is valid only if we have X k ∈ X k .

Methodology
In this section, the interactions between the customers and the energy provider are formulated as a social welfare optimisation problem. Later, we analyse and prove the existence and uniqueness of the optimal energy schedule X k of each customer k for the formulated problem.

Price-taker customer maximisation
For maximising the social welfare, all the customers aim to efficiently use the available capacity of delivering energy by the energy provider such that the sum of their individual satisfactions is maximised, while the total cost imposed on the energy provider is minimised simultaneously [14] max (11) where C h ( ⋅ ) denotes the cost (e.g. in terms of cents per kWh) imposed on the energy provider at time slot h, defined in (2), and U k, a ( ⋅ ) is as in (3) for some constant w k, a h . The energy provider aims to establish the necessary incentive for the customers to individually determine appropriate energy consumption schedules X k in response to the price vector P = P 1 , P 2 , …, P H , where P h is the price determined by the energy provider for the time slot h. So, if customer k consumes l k h kW electricity in time slot h he is charged P h l k h cents. Given the energy provider strategy (price vector P), each customer k ∈ K by considering the price elements as fixed values, adjusts its energy consumption schedule for maximising its individual welfare function as follows: Since the customer operations do not influence the price vector (they are price-taker), we have to analyse and demonstrate the competitive equilibrium among the customers and the energy provider. Considering the strict concavity assumption applied to the individual welfare functions (12) and convexity assumption of the feasible set (10), it can be shown that this competitive equilibrium always exists and is unique.

Competitive equilibrium
One straightforward method for modelling the interactions between customers to achieve a global pareto optimal DSM solution is by using the welfare theory inspired by microeconomics [32].
Definition 1: Pareto optimality is a state of allocation of resources from which it is impossible to reallocate so as to make any individual or preference criterion better off without making at least one individual or preference criterion worse off.
Theorem 1: (welfare economics) Any pareto optimal allocation (social welfare maximisation) can be supported as a competitive equilibrium, given an appropriate initial allocation of resources (see [32] for more details and proof).
According to this theorem, an optimal solution for each customer in the DSM depends on the price vector coming from the energy provider. We show this dependence as X k (P).
Definition 2: The price P and the customers demand i.e. a solution X k to (12) with price vector P that is optimal to each customer k is also optimal to the energy provider (i.e. it maximises the welfare (11)) [33]. Now, in view of Theorem 1, the following corollary can be established. It implies that setting the prices to the marginal power costs is optimal.
Corollary 1: There exists a competitive equilibrium between P * and X k * , ∀k ∈ K. Moreover, where P * h and l k * h are the optimal price and total demand of customer k at slot h, respectively. Proof: , where x k, a * h is the optimal energy scheduling for the appliance a of the customer k at slot h. The energy provider's problem may be given as where X = X 1 ∩ X 2 , …, X K and X is the global energy consumption block-matrix consisting of the energy demand for all the appliances throughout the scheduling horizon. Clearly, an optimal solution X * exists (because (13) is strictly concave). Moreover, there exist Lagrange multipliers P * h , ∀h ∈ ℋ such that (taking derivative with respect to x k, a h ) Since the right-hand side is independent of k, the utility company can set the prices as P * h ≜ P k * h ≥ 0, ∀k ∈ K. For more information, interested readers are referred to [33]. □ According to Definition 2, Corollary 1 denotes the competitive equilibrium between P * and X k * , ∀k ∈ K. Moreover, it denotes that there is no need for the utility company to assign different price signals for different customers (as P * h ≜ P k * h ). Moreover, determining an optimal price signal P * h for each slot h can achieve the social welfare maximisation according to Theorem 1. Therefore, from Theorem 1 we can conclude that there is a pareto optimal solution in the interactions between the utility company's price P * determination and the customers' consumption X k modification, as there is a competitive equilibrium between them. So, if each customer in the network individually seeks to achieve an optimal solution for (12) while the utility company is trying to determine an optimal price signal, this results in maximising the aggregate welfare (i.e. (11)), as we showed that it leads to a competitive equilibrium solution [Competitive equilibrium is achieved when profit-maximising producers and utility-maximising consumers settle on a price that suits all parties.]. However, there are several limitations for implementation of Theorem 1 in the real world [32]. In the next section, we show that to achieve the global optimal solution (in which the global objective function is the sum of individual objective functions), there is no need for intervention of the utility company and the global information sharing, while the interactions between customers can be done locally with only having the selfish constraints information. Further, this framework is not limited to those cumbersome constraints of the welfare theory and can be implemented in any situation.
Remark 1: As previously mentioned, solving marketing problems is beyond the scope of this paper. However, considering another price adoption policy such as shadow pricing (incurred by the constraints violation and ancillary service issues such as frequency regulation) do not change the main results of the proposed framework [34,35], and can be added as additional penalties to each individual customer cost according to procedure presented in the following section.

Fully distributed solution
In the previous section we proved that if the solution X k becomes optimal for the customer k, it is also optimal for (11). Moreover, we showed that the optimal base price signal P * is independent of the customers and is equal for all of them. Given that the price parameter and the provided energy are efficiently regulated to encourage the customers to refrain from consuming more energy at peak load demands, then, reducing the total cost imposed on the energy provider implies reducing the individual cost imposed on each customer. Note that, this assumption is reasonable only when the energy provider does not aim to make profit. So, we can approximate the social welfare function (11) with the following incommodity function: where C h ( . ) defined by (2) is the cost imposed on all the customers r ∈ N k at neighbourhood of customer k due to buying l r h from the wholesale market at slot h and the neighbourhood N k is defined in Fig. 2. Indeed, if all the customers (using diffusion strategy) attempt to reduce their individual costs through minimising the incommodity function by local cooperation with their neighbours (rather than sharing information with all other consumers), they can minimise the cost imposed on the energy provider. In the following text, we will show that this approximation achieves good performances compared to the global optimal solution, while the communication/computation burden is considerably reduced and the networks are much more resilient and robust. Therefore, each customer considers the following individual incommodity minimisation problem where λ, F k, f (X k ), f k , G k, g (X k ), and g k are defined as in Table 1. In solving (16), the integer variables regarding the mid/low-shiftable appliances in the second line of (7) raises a complex mixed-integer optimisation problem which is NP-hard to solve. To be able to provide a simple yet effective solution to problem (16), one can approximate the integer variables into continuous variables [36]. This technique can reduce the computation time at the customers' side which is essential in our real-time DSM application. As the interpretation of the corresponding integer variables in the DSM program is the power consumption rate of different electric appliances and the appliances can tolerate the consumption rate deviations lower than a Watt, this method provides good approximations of those integer variables. Let us decompose each consumption profile X k ≜ x k in , x k cn into vectors x k in and x k cn of all integer and continuous variables, respectively. Then, each integer entry 0 ≤ x k, a h, in ≤ r k, a u of x k in is replaced with its expansion x k, a h, in := 2 0 x k, a h, 0 , 2 1 x k, a h, 1 , …, 2 υ x k, a h, υ , where υ = min (r − 1) 2 r − 1 ≥ r k, a u and r k, a u is the upper bound of the integer variable x k, a h, in [36]. We can set x k, a h, in = x k, a rat , ∀h ∈ ℋ k, a and take x k, a h, 0 ∈ {0, 1} as the decision variable at each slot h. By introducing the following constraint we approximate all the integer variables as continuous variables: Now the problem is a constrained convex-continuous minimisation problem. We convert this problem into an unconstrained version using augmentation-based penalty method as follows [37]: with aggregate penalty function: where P k combines the inequality constraints (provided in (6)- (9)) and affine constraints (defined in (7), (8) and (17)). It is a smooth approximation to penalise the system for any unexpected out of range variation. Moreover, the scalar parameter η > 0 is the penalty parameter and is used for controlling the relative importance of the constraints and δ EP ( ⋅ ), δ IP ( ⋅ ) are penalty functions for the affine and inequality constraints defined as follows: Two common examples for these functions are δ EP (x) = x 2 , and δ IP (x) = max (0, x 3 / (x 2 + ρ 2 )) with some parameter ρ > 0. Note that, (18) is only an approximation to (16), but for the proposed method, since the penalty inside the feasible region is zero, it improves in quality as η is increased in value [38]. As η → ∞, the function η . P k (X) approximates the ideal P k (X) [37]. Since (18) and P k (X) are convex, their combination, i.e. (19), is also convex and its minimiser coincides with the minimiser of the original problem for η → ∞ [38]. As performed here, maximising the social welfare is equivalent to minimising the sum of individual incommodity functions (16), each available at the customers side, subject to convex constraints that are also distributed across these customers. The key challenges in this problem are that the energy provider acts as an aggregator only and each customer is only aware of its incommodity function and its constraints. However, from (13) we can see that if we want to solve the social welfare problem in a distributed manner, every consumer needs to know total consumption C h ∑ k ∈ K ∑ a ∈ A k x k, a h of all other consumers. Phrase C h ∑ k ∈ K l k h in (11) shows that the behaviour (decision on {X ℓ }) of consumer ℓ would affect the cost imposed on the other consumers, either. So, there is a need for all consumers to share data with each other according to some method (e.g. game theoretic methods). This requirement hinders providing a fully distributed solution and rises several challenges including privacy security problems and imposing high communication/ computation burden on the network. To cope with these issues, we approximated the social welfare problem by limiting the information exchange locally between the neighbours (i.e. C h ∑ r ∈ N k l r h ) in (15). Now, using the diffusion strategy to solve (16), we provide a fully decentralised autonomous solution in which the consumer need only to cooperate optionally with some neighbouring consumers (i.e. phrase C h ∑ r ∈ N k l r h in (15)). In Section 4.2 we will show that this approximation has good accuracy and resilient in achieving the global optimal solution. So, instead of considering the effect of [X ℓ ] ℓ ∈ K of all the other consumers on the consumer k, we consider X N k denote the components of the global consumption profile X that affect consumer k.
In this manner, an adaptive algorithm with the diffusion structure is exploited which allows the consumers to seek the minimiser of (11) by solving (15) cooperatively and in the fully distributed manner. This framework is based on penalty-based methods, in which all the customers autonomously run Algorithm 1 with some constant step-size [37]. Using a constant step-size endows this algorithm the ability of learning and tracking the drifts in the minimiser location resulted from rapidly updating the price information or probable change in the customer conditions and preferences [39]. According to Algorithm 1, each customer follows three steps. In the first step (i.e. adaptation step), in each iteration, customer k updates his current solution to a new solution using the local stochastic gradient available at this iteration. In the second step, namely constraint penalty step, the direction which is not feasible in accordance with the local constraint set, is penalised. Finally, in the last step, so called aggregation step, the customer combines his estimated solution with that of the customers in his neighbouring set N k . In this step, the non-negative combination coefficients d rk are selected such that d rk = 0 when nodes r and k are not neighbours and ∑ r = 1 K d rk = 1, ∀k ∈ K. One can choose the most popular combination coefficients, namely Metropolis weights [39] which are given as where N r is the degree of node (customer) r, and denotes the number of customers which can interact with it (i.e. those in its neighbourhood). For appropriately constructing this strategy it is important for the network to be a connected network. Fig. 3 shows a sample selection of different candidate topologies for such network. The left-top panel corresponds to the non-cooperative case and the other panels illustrate some connected topologies. The right-down panel corresponds to the fully connected case usually used in the game-theoretical approaches. Clearly, this topology is not scale free, needs more information exchanges between all the customers, and consumes more communication resources. Our proposed diffusion framework (with an optional connected topology) is depicted in Fig. 2. In this figure, customer k is only required to interact locally and to have access to local estimates from the neighbouring customers N k (highlighted in Fig. 2), and there is no need for this customer to interact with other customers, or to know any of the constraints besides its own. Thus, all the interactions done in this framework are in-network and since the neighbours are usually selected based on their physical vicinity, relatively low-power is needed for the information exchange and the customers privacy is not jeopardised. Moreover, the proposed algorithm does not require any projection method (which is always cumbersome and restrictive) to satisfy the feasible set (10), is able to cope with different network topologies, is robust to the communication noise and link disruptions, and does not require any global information or relying on the central manager. In implementing Algorithm 1 it is necessary that some network supervisor devise a connected network (connected graph) within which the diffusion of information is guaranteed. However, there is no need for consumers to know the network (graph) topology. Therefore, they do not know to/from which consumer they are sending/receiving data. In the end, the consumers only need to recover its consumption profile X k from X N k according to some clue provided by the supervisor, without knowing the rest of the profile belongs to who (Fig. 4). let us denote the cluster of consumers that contains the decision variable X k in their costs (they are affected by consumer k) by C k ≜ ℓ k ∈ N ℓ . In fact cluster C k denotes the set of the consumers interested in behaviour of consumers k and try to reach a consensus on it. Due to the use of left stochastic matrices, and in order for the algorithm to converge to the minimiser of the sum of costs, the step-sizes used for each X ℓ ℓ ∈ C k in X N k need to be divided by the entry of the Perron eigenvector [Let matrix A l be left stochastic and primitive, i.e. A l T I = I. The Perron vector is denoted by r l where A l r l = r l and I T r l = 1.] r l (k) corresponding to cluster C l for consumer k. Otherwise, the algorithm will converge to a neighbourhood of a different limit point [40]. So, the step-size μ k in Algorithm 1 is set accordingly For many combination rules, the entries r l (k) are known (e.g. r l (k) = ( N l ) −1 for Metropolis combination rule). For general left stochastic matrices, the results for estimating Perron entries already exist [41]. Proposition 1: Algorithm 1 approaches to the optimal solution X k o of (11), i.e. it holds that As the cost function (2) is strictly convex, and each cost function J k (X k ) and penalty function P k (X k ) is convex and differentiable with a Lipschitz continuous gradient [37], the proof of convergence to the optimal solution is directly concluded from Theorem 1 of [40].□

Robustness analysis
A detailed analysis of the stability and performance of the proposed diffusion-based DSM is provided here. We will show that under certain reasonable conditions, the proposed strategy under unpredicted failures and imperfectness will continue to be able to deliver performance that is comparable to the ideal case that no failure occurs. To do so, we consider an asynchronous smart grid that is subject to general sources of uncertainties and failures, such as changing topologies, random link failures, imperfect data communication and corrupted information, random data arrival times, and smart meters turning on and off randomly. It is shown in [42] that when constant step-sizes are used to enable adaptation, the effect of gradient noise can make the state of consensus networks grow unstable, while diffusion networks are stable under such conditions and are insensitive to the network topology changes.
Let v k, i X N k , i − 1 denote the gradient noise model, denoted, as an additive random perturbation to the true gradient vector as follows: The noise is assumed to be independent of any other random sources including topology, links, combination coefficients, and step-sizes conditioned on the filter F i − 1 . Accordingly, the imperfect (asynchronous) version of Algorithm 1 is defined as Algorithm 2 (Fig. 5), where the μ k (i), d rk (i) are now time-varying and random step-sizes and combination coefficients, and N k, i denotes the random neighbourhood of agent at iteration (state) i. The random step-size parameters μ k (i) and combination coefficients d rk (i) are non-negative random variables, which are required to satisfy the following constraints: Proof: See Lemma 2 of [43]. □ The asynchronous model in Algorithm 2 is general enough to cover many practical cases of interest. This model does not impose any specific probabilistic distribution on the step-sizes, network topologies, or combination coefficients. As an example, we can consider the sample space of each step-size μ k (i) to be the binary choice {0, μ k }. In this way, a random on-off model can be used to show the behaviour of the smart meter of consumer k due to random node failures and malfunction. Similarly, by letting d rk (i), r ∈ N k /{k} ≜ {{0, d rk }} the random communication link failure can be properly modelled. In general, the randomness of the combination coefficient matrix can be interpreted as three reasons, namely, link failures, the randomness in the network topology itself, and the consumers who assign random combination coefficients deliberately (as long as the constraint (27) is satisfied) or due to some malfunction. Let us collect the combination coefficients {d rk } k ∈ K at state i into the matrix D i ∈ ℝ K × K . Now, the stochastic process {D i , i ≥ 0} consists of a sequence of leftstochastic random matrices, whose entries satisfy the conditions in (27) at every state i with constant mean global matrix D ∈ ℝ K × K and Kronecker-covariance matrix C D ∈ ℝ K 2 × K 2 . Further, let with the following block matrices [43]. □ Consider a dynamic topology for the imperfect model at which each agent is allowed to randomly choose a subset of its neighbours to perform the combination step in Algorithm 2. In this model, the agent k chooses neighbour r with probability 0 < π rk < 1. This behaviour can be interpreted as a result of random link failure, smart meter malfunction, or the desire of the consumer to cheat or not to reveal his information. So, at each state i, the communication link from agent r to agent k drops with probability π rk . We model this situation for any r ∈ N k, i /{k} by Bernoulli random combination coefficients as follows: with probability π rk 0, with probability 1 − π rk (30) with fixed combination coefficient 0 < d rk < 1. According to Proposition 2, the values of d rk (i) in (30) should ensure that Subsequently, using Proposition 4, the combinations weights of the imperfect scenario becomes To model the asynchrony and imperfectness in processing the optimisation/adaptation part of Algorithm 2, we consider the following Beta distribution for the step-sizes: where ξ, ζ > 0 are the shape parameters and Γ( ⋅ ) denotes the Gamma function. The step-size μ k (i)} is assumed to take random values in the range [0, μ k ], where μ k denotes the largest possible value for the kth step-size μ k (i). We further assume that the scaled parameter μ k (i)/ μ k follows a Beta distribution . Therefore, using Beta distribution (33) and Proposition 4, the relevant quantities regarding the stepsizes is given by: In the following text, it is shown that the mean-square stability of Algorithm 2 is insensitive to the network topology and the combination coefficients, and under some condition on the stepsizes this algorithm is stable and converges to an acceptable range around the optimal solution. According to Theorem 1 in [43], the mean-square stability of such asynchronous networks can be achieved by investigating the stability of the following recursive inequality: where X k, i = X k o − X k, i denotes the error vector at agent k at iterate i with the desired optimal solution X k o , and β, θ, and σ υ 2 ≥ 0 are certain parameters defined by with some α ≥ 0 and γ k 2 ≜ 1 − 2μ k λ k, min + μ k 2 + c μ, k, k λ k, max 2 where λ k, min , λ k, max correspond to the lower and upper bounds on the eigenvalues of the Hessian λ ∇ X k 2 J′ k, η X k of the cost function J k, η ′ (X k ). The inequality (35) provides an upper bound for the worst individual mean-square-deviation (MSD) in the system at every state i. Therefore, as long as the factor β is inside the unit circle, i.e. β < 1, the sequences E∥ X k, i ∥ 2 ; i ≥ 0 for all k will remain bounded, guaranteeing the mean-square stability.
The mean-square stability of Algorithm 2 reduces to studying the convergence of the recursive inequality ϵ 2 (i) ≤ β ⋅ ϵ 2 (i − 1) + θσ υ 2 . As long as we have, for the first and second-order moments of the step-size distribution, random step-sizes {M i , i ≥ 0} will lead to stable networks (i.e. guarantees β < 1) regardless of their PDFs.
Proof: See Appendix IV in [43]. □ Without loss of generality, let ζ k = ϕ k ⋅ ξ k with a constant factor ϕ k > 0. It follows from (34) that the mean value μ k can be expressed in terms of ϕ k and the upper limit μ k , to have which is a monotonically decreasing function of the shape parameter ξ k ≥ 1. As the value of ξ k becomes larger, the probability mass of μ k (i) will gradually concentrate around its mean μ k . By substituting (38) into (37) we have where the bound on μ k is a monotonically increasing function of the shape parameter ξ k ≥ 1. As ξ k becomes larger, the bound in (40) becomes larger. The net effect allows for a wider range for realisations of the random step-sizes.
We showed that the mean-square stability of Algorithm 2 is independent of the combination weights and topology. However, is it shown in [44] that link noise and imperfect information exchange over the regression data (price signal P) modifies the dynamics of the network evolution, and leads to biased estimates in steady-state, deteriorating the performance of the proposed solution. The analysis also reveals how the network mean-square performance is affected by modifying weight matrices [44]. So, there is an urgent need to devise a proper robust mechanism for scaling/modifying combination weights adaptively in order to reduce the mean-square error measurement of the system in the presence of disturbances and asynchrony in Algorithm 2. Consider a model d k (i) = P N k , i X N k , i + v k (i) for the consumer k's payment evaluation inspired by the linear regression model in [45]. Similar to (22) P N k = col{P} ℓ ∈ N k for the price signal evaluation, and v k (i) denotes the measurement/evaluation or model noise with zero mean and variance σ υ, k 2 . It is shown in [46] that the error recursion of the proposed Algorithm 2 is where X i = X o − X i with the global optimal solution X o . D and ℳ denotes the block matrix of all the system combination weights and step-sizes, respectively. ℛ i ′ denotes the block diagonal matrix constructed of all the covariance matrix of evaluated price data P N k and z i denotes the block vectors constructed using all the cross-covariance matrix between evaluated price data and the model noise v k (i). v i X and v i Φ are the block vectors of the model noise stem from the combination and adaptation phases, respectively. Accordingly, the MSD and the excess mean square error (EMSE) measurements are computed as follows: where ℬ j ≜ D ⊤ (I NM − ℳℛ i ′ )I K . Parameters S and ℛ υ are defined as follows: where ℛ υ X , R υ Φ are the corresponding covariance matrices for v i X and v i Φ , and T = diag{T 1 , …, T K } with where ℛ υ p collects all covariance matrices ℛ υ, rk p corresponding to the evaluated price data noise [v k (i)] k ∈ K throughout the diffusion network. It is shown in [44,46] that minimising the upper bound of the network MSD and EMSE for Algorithm 2 over left-stochastic combination matrices D leads to the following relative variance rule: This relative variance combination rule relies on the knowledge about the combination noise covariances matrix R υ, rk Ψ , covariance matrix R p, k of the regression data (price signal) P k, i at consumer k in state i, and noise variance σ υ, k 2 , which in general are not available. Assuming that (40) holds, inspired by the work in [47], γ rk 2 can be estimated through the following recursion: where ν k is a positive coefficient smaller than one. Finally, it is worth emphasising that strong-connectivity [The network is said to be strongly-connected if it is connected with at least one self-loop, meaning that d kk > 0 for some consumer k.] of the network topology (satisfying conditions (27) and (31)) is of paramount importance if achieving to an acceptable sub-optimal solution is desired. Otherwise, it is shown that learning behaviour of the consumers is affected and some consumers can end up with having a dominating effect on the performance of others. Although sometimes a weak-connectivity of the network topology can be helpful in reducing the effect of outlier data on learning performance. However, in this situation where the topology is not strongly connected and one or more sub-networks are at the receiving end of other sub-networks, a leader-follower relationship develops with the limiting behaviour of the receiving sub-networks being completely dictated by the other sub-networks regardless of their own local information (or opinions) [48]. However, as all the cost functions are strongly convex, Theorem 1 of [48] implies that even in such conditions the weakly connected network is meansquare stable for sufficiently small step-sizes, namely, for every k it holds that where μ max = μ k /τ k with 0 < τ k ≤ 1. For detailed analysis about the performance (how fast the iterates converge and how close they get to the optimal solution) of the considered diffusion optimisation strategy under various sources of asynchrony, disturbance and imperfect communications see [49].

Simulation scenarios and system parameters
For numerical simulation, we have considered a smart power grid system which its subscribers varies between 10 and 500 for comparison between different scenarios. Further we assumed that each customer randomly and with uniform distribution is considered to have 20 non-shiftable appliances, 20 shiftable appliances, and 10 curtailable appliances. The appliance parameters are shown in Table 2 [5,50]. Further, we assume that all the customers can have [As the batteries are expensive, the utility company can provide some subsidies to encourage the customers for buying it, similar to the subsidies currently paid by the government for buying PHEV. This is because the batteries have significant role in the ancillary services such as frequency regulation.] ideal batteries [The battery (energy storage device or PHEV's battery) degradation cost and constraints such as battery charge/discharge efficiency, depth of discharge, self-discharge, and charge/discharge cycling limits are not considered in this paper [12,18,51]. These constraints do not violate generality of the proposed solution and the main achievements.], and are able to determine the value of energy for all their appliances through proper choice for parameter w k, a h , i.e. a higher w k, a h implies a higher utility value. For simplicity and better comparison of the customers' behaviours, all the customers characteristics and preferences are selected to be identical. The cost and utility functions are adopted from (2) and (3), respectively, while for simplicity we let b h = c h = 0. In the considered scenario, we assume that the price parameter coming from the wholesale market is ν = (0.15, 0.12, 0.1, 0.1, 0.2, 0.3, 0.45, 0.45, 0.5, 0.6, 0.6, 0.6, 0.5, 0.4, 0.45, 0.5, 0.6, 0.8, 0.9, 1.0, 1.1, 0.9, 0.7, 0.5) cents/kWh 2 . The performance of the proposed framework is evaluated in MATLAB R2014a environment using laptop PC Intel(R) Core(TM) i7-4510U CPU 2.00 GHz 8G memory.

Performance comparison
In this part, the simulation results for our approach are proposed and the performance comparison with the autonomous (game based) framework presented in [5] is also demonstrated. First, to demonstrate the stability and convergence of the algorithm, the convergence condition in terms of total system cost and PAR for N = 100 customer are shown in Fig. 6. In Fig. 6a, the convergence trends of total network cost have been plotted. Clearly, by using a decaying step-size the total system cost is converged in about 50 iterations for each customer (at total 5000 iterations). From the results in Fig. 6b, we claim that without considering the PAR reduction target, our algorithm is still stable. In the figure it is also shown that the total system PAR is converged after about 50 iterations per each customer which shows good convergence speed. However, the speed of convergence and accuracy of the algorithm strictly depend on the step-size μ. Meaning that if μ decreases, the convergence speed also decreases but the accuracy of estimating the optimal solution increases and vice versa. As shown in both sub-figures, by using a constant step-size the value of total system PAR and the payment did not converged and still decreased slowly. From this result we can assert that the dynamic of the proposed algorithm is not stopped and our framework has ability to continuously adapt and learn from drifts eventuating from the changes in the system state.
The simulation results for the energy demand curve of N = 100 customers for our framework and game-based method [5] are  Fig. 7. In this simulation for each customer we let l k max = 30 kW and ideal battery with capacity 24 kWh for both methods as well as η = 700, μ = 0.001, and ρ = 50 for our framework. We remark that for the diffusion-based optimisation η, μ, and ρ are selected experimentally according to the problem at hand and there is not a closed-form solution for their determination. As discussed in Section 4, the approximation of the original objective function (16) is improved in quality as η increases, however, choosing η strictly depends on the μ and further increase in η without sufficiently decreasing μ results in instability in the proposed Adapt-then-Combine (ATC) Algorithm 1. However, by running different simulation scenarios, we find that selecting η = 1/2μ is a good choice for these kinds of problems. As indicated in Fig. 7, in the game-based method the consumers shift their appliances in the slots with low price parameter ν h for minimising their cost as much as possible. The total cost imposed on the system is 288,910$ without DSM, 42,514$ with game-based method, and 115,680$ with our method. Although in this scenario the consumer payments are reduced significantly from the supply perspective, this behaviour creates another sub-peak which makes several adverse effects on the power system reliability and supply-demand balancing. The total system PAR is 2.8831 without DSM, 3.0380 with game-based method (5.3729% PAR increase), and 2.0168 with our method (30.0475% PAR reduction). This shows that in our method there is not any sub-peak in the total energy consumption curve and it has better performance in these situations. Although by choosing smaller values of l k max we can cope with these adverse effects (subpeaks), determining an appropriate l k max for each customer is timedependent, very difficult, and may cause significant discontent for the customers. So, unlike our framework, the game-based method is very sensitive to constraint (9).
Since the demand side management programs are implemented by the utility company (energy provider), from the energy provider perspective, these programs must be attractive. Although in the game-based method the customer's payment is reduced significantly, the peak load created at slots with low price can cause many issues in the power system due to the power congestion (e.g. the loss of reliability and stability, frequency sag and voltage drop, distribution transformer and cable overload). These issues can impose severe cost on the power system (and subsequently to the customers) and customer dissatisfaction due to the reducing power quality and blackouts. So, always there is a trade-off between minimising the PAR and the customer's payment and we cannot say which of the two parameters is more important. It is also crucial to consider a scenario in which both the demand side (the customers) and supply side (energy provider) benefit from it. This goal is achieved when both the total payment and PAR are reduced compared with a scenario where there is no DSM program.
For another comparison and showing the scale free feature of the presented scheme, in Fig. 8, the effect of increasing the number of customers on the total computation time in the network is studied. From this figure it can be claimed that our algorithm is scale free and is very useful in large scale implementations. Since in our method the customers cooperate only with their neighbours and the information is processed locally, the elapsed time for the information exchanging and calculating the optimal solution is much less than that for the game-based methods in which each customer should exchange information with all the customers throughout the network. The calculation time in a diffusion-based framework depends on the step-size μ. For example, as shown in Fig. 8 by changing μ from 0.002 to 0.001, we see that the total elapsed time is doubled. This is because for μ = 0.002 the algorithm converges approximately after 2500 iterations while for μ = 0.001 the algorithm needs 5000 iterations for convergence (see Fig. 6). Further, there is another trade-off between increasing robustness of the presented method with selecting larger N k for each customer and the calculation time. Since by increasing N k the scale of cooperation and the information exchange increase, which results in increasing the computational complexity.
To compare our method with the game-based algorithm in terms of storage devise performance, we have presented another scenario in which none of the customers has any storage device. The simulation parameters are selected similar to those in Fig. 7. The simulation result for this scenario shows that in the game-based method the total system PAR becomes 2.46 (14.7% PAR reduction) and the total system cost becomes 53,723$ which is large compared with that in Fig. 7. Therefore, we can say that for the game-based methods another solution for reducing the sub-peaks is achieved by applying restrictions on the use of storage devices among the customers.
For the presented diffusion-based method the total system PAR becomes 2.05 (28.7% PAR reduction) and the total system cost becomes 117,810$ which shows less increase in the cost compared with the game-based method. Further, the total PAR in our method does not change significantly for any of the two scenarios (with/ without storage device) compared with that in the game based. According to these results, it seems that the diffusion-based method does not use the storage device potential as effectively as the gamebased method does.
For further investigation, the effects of storage device performance for both methods are compared in Fig. 9. As depicted in this figure, in both methods all the consumers charge their batteries at slots with low price parameter ν h and discharge them (denoted with negative power consumption) at high price slots resulting in lower payment. However, total potential storage device usage in our framework, even with changing μ and the number of iterations I, is poor compared with that of the game-based method. For more clarity, the aggregate battery profile for the game-based method is shown using scale 0.1. The reason for this returns to the problem-solving techniques which in our method is based on convex optimisation and is completely different from the gametheoretical techniques which seek to achieve a fair equilibrium. However, we are working on improving this deficiency in our future work using adaptive multi-task diffusion strategy. Now, for the new simulation scenario, it is assumed that the total percentage of the shiftable and curtailable appliances varies from 0% (meaning that all the appliances are non-shiftable) to 100% (e.g. all appliances are randomly selected between shiftable and curtailable appliances). Clearly, employing the DSM programs is expected to have more significant impact on the energy consumption pattern when the total number of shiftable and curtailable appliances increases. To clearly illustrate this, we have plotted the total system cost and PAR versus total percentage of shiftable and curtailable appliances in Fig. 10 for N = 500 customers. It is seen that in Fig. 10a the cost is monotonically decreasing. This is due to the fact that by increasing the number of shiftable and curtailable appliances the ECS of each customer has more flexibility in scheduling of appliance energy consumption. In Fig. 10b the PAR fluctuates since the objective function does not minimise the PAR, but these fluctuations are negligible compared with those of game-based method. Indeed, these fluctuations are due to further shifting the appliances towards the slots with low price which can be solved by better selecting the price parameter ν h for each slot h ∈ ℋ (i.e. selecting higher price for slot with higher demand).
Another drawback of the game-based methods is that if we want to take into account the customers utility in the main objective function, the customers must share their priorities with each other. This would violate the privacy and security of the customers. In return, in our framework, the customers need to share only the estimated optimal power consumption locally and with their neighbours. The simulation results for the total utility level, energy consumption, and the cost imposed on the customers with changing the weight factor λ are shown in Fig. 11. In this figure for λ = 0 all the customers consider only the right-hand side of (16), i.e. they only wish to maximise their total utility level without taking into account the cost function (left-hand side of (16)). In this case the curtailable appliances consume as much electricity as possible, as for these kinds of appliances consuming more energy results in more utility level. So, we expect that the total cost and load demand in this scenario is larger than that of the game-based method which only seeks to reduce the consumer payments. By comparing the results in Figs. 11a-c, we can see that as λ increases, the total utility level, load demand, and cost reduce. For λ = 1 our framework becomes similar to the game-based method and does not consider the utility function. So, we can make a trade-off between more reducing the payment and more increasing the utility level by properly selecting the weight factor λ. Therefore, we can expect the total power consumption in our framework to be greater or equal to that of the game-based method depending on choosing λ. Since the utility level strictly depends on choosing the priority factor w (see (3)), and this factor may defer among different appliances/customers, for λ = 0 we assumed that the utility level is 100% and for λ = 1 we assumed that the utility level is 0%.

Conclusions
In this paper, we have developed an autonomous and fully distributed DSM framework, which benefits from useful properties of the adaptive networks for enhancing the residential customers' savings, preserving their utilities, and reducing the total PAR. In the proposed method the customers do not need to know the global information or rely on the energy provider operations. The presented framework can track the drifts resulted from changes in the price parameter or customer preferences and conditions. Moreover, in this frameworks, the details of the customers are not revealed and their privacy is secured. The problem has been modelled as a constrained cooperative minimisation problem where the aggregate objective function (social welfare) is equal to the  weighted sum of individual convex incommodity functions distributed across the customers. Owing to the useful properties and advantages of penalty methods compared to projection methods, we have converted the constrained minimisation problem into an unconstrained version using an augmentation-based penalty method and solved it in an iterative manner using steepest descent algorithm. Finally, using simulation results, we have shown that our method outperforms the game-based methods in reducing the PAR, considering the customers satisfaction and the calculation time.