# Distributed Real-Time Pricing Method Incorporating Load Uncertainty Based on Nonsmooth Equations for Smart Grid

Authors: Hongjie Wang; Yan Gao
Journal: Mathematical Problems in Engineering
 (2019)

---

## Abstract

The real-time pricing mechanism of smart grid based on demand response is an effective means to adjust the balance between energy supply and demand, whose implementation will impact the user's electricity consumption behaviour, the operation, and management in the future power systems. In this paper, we propose a complementarity algorithm to solve the real-time pricing of smart grid. The Karush–Kuhn–Tucker condition is considered in the social welfare maximisation model incorporating load uncertainty to transforming the model into a system of nonsmooth equations with Lagrangian multipliers, i.e., the shadow prices. The shadow price is used to determine the basic price of electricity. The system of nonsmooth equations is a complementarity problem, which enables us to study the existence and uniqueness of the equilibrium price and to design an online distributed algorithm to achieve the equilibrium between energy supply and demand. The proposed method is implemented in a simulation system composed of an energy provider and 100 users. Simulations results show that the proposed algorithm can motivate the users’ enthusiasm to participate in the demand side management and shift the peak loading. Furthermore, the proposed algorithm can improve the supply shortage. When compared with an online distributed algorithm based on the dual optimisation method, the proposed algorithm has a significantly lower running time and more accurate Lagrangian multipliers.


---

## Body

## 1. Introduction

Given the increased expectations of customers, in both quality and quantity [1], the limited energy resources, and the lengthy and expensive process of exploiting new resources, the reliability of the grid has been put in danger and there is a need to develop new methods to increase the grid efficiency. Smart grid is an intelligent and efficiency power system that allows information exchange between users and power providers. Smart grid has demand response (DR) functionality, and provides a foundation to enable demand side activities in smart grid. The price-response based DR programs, especially, can effectively promote user enthusiasm to participate in the market, and it is one of the most cost-effective elements as regards energy cost reduction for residential and small industrial buildings [2, 3]. The DR programs primarily shift users’ consumption from peak to off-peak periods to reduce loads on utility-handling equipment, i.e., distribution transformers and lines, and may constitute a value resource for effective operation of the smart grid structure [4, 5]. Thus, the researches on pricing mechanism of smart grid based on demand response will impact the user's electricity consumption behaviour and the operation and management in the future power systems [6].Currently, the main pricing methods based on DR programs contain fixed, multistep, time-of-use, and real-time pricing. The latter has advantages over the multistep and time-of-use pricing methods, which is the most effective for demand side management and can avoid new peaks caused by user electricity consumption during low-price periods [7–10]. When the real-time pricing method is implemented, users can shift their usage and save on electricity loads to reduce electricity costs while satisfying building inhabitant comfort level and satisfaction requirements. Notably, the participative behaviours of users are useful to achieve peak-load shifting. Bahrami et al. [10] have proposed a real-time scheduling problem of energy hubs in a dynamic pricing market. The simulations have validated that the dynamic pricing can increase the energy hubs’ average payoff. In 2010, Samadi et al. [11] have proposed a utility framework that is aimed at the total utility being maximised for all users and the production cost being minimised for the energy provider. The framework is converted into an optimisation problem containing a Lagrangian multiplier for users and provider in the dual domain. Samadi et al. used the Lagrangian multiplier to determine the basic price of electricity and designed a distributed algorithm for real-time pricing in smart grid. The studies on real-time pricing of smart grid mainly are in two aspects: improving the model and designing algorithm for the social welfare maximisation model, since 2010 [12–18]. Kojiḉ [12] has used Jensen’s inequality and the weighted arithmetic-geometric mean inequality to solve utility-maximisation problems. Zhu et al. [13] have proposed a distributed optimisation algorithm based on the alternating direction method of the multiplier algorithm with Gaussian back substitution, so as to obtain solutions of the real-time pricing model (i.e., the social welfare model). With consideration of electricity vehicle charging, Bitar [14] has proposed a novel forward market for a deadline-differentiated electric-power service-based utility function, in which consumers consent to defer service of prespecified loads in exchange for reduced energy prices. Song et al. [15] have proposed an improved algorithm based on the gradient projection method to solve the problem of poor convergence associated with optimal real-time pricing model based on utility maximisation. Asadi et al. [16] have proposed use of the particle swarm optimisation algorithm to solve the real-time pricing problem based on the social welfare model. Zhu et al. [17] have solved the real-time pricing problem using the simulated annealing algorithm. Furthermore, Tarasak [18] has extended the social welfare maximisation model to include the effect of the load uncertainty; this approach derives the optimal prices under different types of load uncertainty and demonstrates the influence of the load uncertainty on the power consumption and generating capacity. Bahrami et al. [19] have considered an electricity market with generation uncertainty and proposed a day ahead decentralised algorithm to solve the optimal energy trading.The above techniques are based on dual optimisation. The dual optimisation method solves the price problem corresponding to the Lagrangian multipliers in the real-time pricing problem; however, the multiplier is obtained as a by-product, which affects the multiplier accuracy. In fact, the multiplier, i.e., price, is our concern, and price bias errors can cause various losses. Furthermore, the dual optimisation method is a minimax problem suitable for application to small-scale problems only. In the smart grid, the number of users is huge, and more power providers can be included in the future. Hence, the scale of the problem is large and satisfactory computation speed of real-time pricing cannot be guaranteed if the dual optimisation method is applied. In this study, we propose an algorithm for the real-time pricing of smart grid that can provide enhanced computation speed and accuracy over the dual optimisation method. We consider the Karush–Kuhn–Tucker (KKT) condition in the social welfare maximisation model and use a system of nonsmooth equations to solve the real-time pricing of smart grid. The contributions of this paper can be summarised as follows.(1) Based on social welfare maximisation model, this paper establishes the real-time pricing model of smart grid by KKT condition. A system of nonsmooth equations with the Lagrangian multipliers is creatively established. The Lagrangian multipliers, i.e., the shadow prices, are used to determine the basic price of electricity. Compared to the dual method, the Lagrangian multiplier is a decision variable and plays the same role as electricity consumption and generating capacity level in the nonsmooth equations. Hence, the numerical results of Lagrangian multiplier are more accurate in the nonsmooth equations.(2) The system of nonsmooth equations is converted into two optimal problems for users and provider. Then an online distributed algorithm is designed to solve the real-time pricing of smart grid. In the proposed algorithm, users can shift their usage and save electricity loads to reduce electricity costs while satisfying their requirements according to the prices provided by energy provider in each time slot, and the energy provider can adjust prices and electricity production levels according to users' demand and expectations. This approach is beneficial for shifting the load peak and avoiding a new load peak.(3) The smooth Newton method is used to solve the nonsmooth equations, i.e., solving the real-time pricing in the proposed distributed algorithm. The Newton method is good convergence that ensures the computational speed of the algorithm. In the simulation experiments considering a power system with an energy provider and 100 users, the simulation results have proved that the algorithm is more accurate and the convergence is better than that of the dual method.The remainder of this paper is organised as follows. In Section2, we briefly describe the social welfare maximisation model, i.e., the real-time pricing model. In Section 3, a model with a KKT condition is established, instead of the social welfare model, and transformed into two subproblems. The smooth Newton method is selected to solve the equations. Finally, simulation results are presented and discussed in Section 4.


## 2. Preliminary Knowledge

### 2.1. Electricity System Model

A smart grid constitutes a delivery system composed of an energy provider and multiple users. The energy provider constantly contracts with and serves the users. In addition, each user installs a smart meter to control their energy consumption; hence, two-way real-time communication between the energy provider and user is allowed. The communication network delivers information required for smart grid operation, such as energy demand, electricity price, and customer identification data. The smart meter aggregates the power consumption demands of all appliances and reports the result to the energy provider. In return, the smart meter receives a real-time price from the energy provider and then user adjusts the appliance electricity consumption accordingly.The notation employed in this study is the same as that used in [11]. A one-day operation cycle is divided into one-hour time slots. So, the real-time pricing and demand response have a one-hour resolution. Denote T=1,⋯,T as the set of time slots, where an individual time slot t∈T. We use N=1,⋯,N to represent the set of users requiring electricity, where a given user i∈N requires a certain amount of energy for his/her electricity appliances. We take xit as the electricity consumption demand of user i at time slot t. The electricity consumption for each time slot and user is bounded; i.e., xit∈mit,Mit. Here, the minimum electricity consumption level mit represents the load from the appliances that are required to be in constant operation throughout the day and night, while the maximum electricity consumption level Mit represents the total power consumption level of the appliances, assuming they are all in operation simultaneously.


### 2.2. Utility Function

Each user is an independent individual in the electricity system and has a unique satisfaction level. From the perspective of microeconomics, the utility function is a measure of a user’s demands and desires based on their consumption or leisure activities. We define the utility function of an individual asUx, where x is the user’s electricity consumption. In previous studies, some researchers adopted a quadratic function as the utility function [9, 10]. In this work, we also use a quadratic function as the utility function, which is expressed as(1)Ux=ωx-α2x2,if0≤x<ωαω22α,ifx≥ωα.Here, α is a predetermined parameter characterising the utility saturation point and ω is a nonnegative parameter characterising the user types assumed to be private. ω typically varies for different time slots and users. We can choose different Ux by selecting the appropriate ω (see Figure 1).Figure 1
Sample utility function for power usersα=0.5.A subscriber who consumesx kW of electricity during a designated number of hours at a rate of P dollars per kW is charged Px dollars. Hence, the welfare of each user can simply be represented as(2)Wx=Ux-Px,where Wx is the user’s welfare function and Px is the cost imposed by the energy provider on the user. For each announced price value P, each user attempts to adjust his/her x to maximise his/her own welfare. This can be achieved by setting the derivative of (2) to zero; hence, the marginal benefit to the user becomes equal to the P at the optimal x.


### 2.3. Energy Cost Model

The cost function of electricity provision is assumed to be increasing and strictly convex. Piece-wise linear functions and quadratic functions are common cost functions [11–18]. Here, we express the cost function as a quadratic function(3)CLt=atLt2+btLt+ct,where Lt is the energy-generating capacity, at is a predetermined positive constant, and bt and ct are predetermined nonnegative constants. The generating capacity of the provider should satisfy the minimum electricity demands of all users and should not exceed their maximum demands.


### 2.4. Social Welfare Model under Load Uncertainty

Similar to [11], in this study, real-time pricing is formulated as maximisation of the social welfare among the consumers and energy provider. The objective function is the summation of all users’ utility functions in all time slots minus the total cost incurred by the energy provider. The constraint is that the summed power consumption cannot exceed the generating capacity at each time slot [18, 19]. The electricity consumption is x-it=xit+δit, where δit is an independent and identically Gaussian random variable with zero mean and variance σδ2. The variance δit represents the load uncertainty and can reflect several variations in a practical environment. This term provides a margin for the energy provider to store additional electricity to prevent a possible outage. Further, σδ2 indicates the effect of the load uncertainty on the social welfare function. Mathematically, the optimisation problem is expressed as(4)max∑t=1T∑i=1NUxit-CLt-α2σδ2s.t.∑i=1Nxit≤Lt+η-NσδQ-1ε,t=1,⋯,T,where Qx=∫x∞1/2πe-t2/2dt, η∈0,1 is a specified threshold indicating an amount of exceeding sum power consumption, and ε is a small positive value which can be interpreted as an outage probability.In practice, some electricity equipment or household appliances must run constantly. This scenario corresponds to the lowest electricity demand and is independent of price. Other devices require a certain operating period or can be activated and deactivated at any time. These devices are affected by price; i.e., the electricity consumption decreases with increasing price and vice versa. An increase in the second type of electricity consumption induces added satisfaction; therefore, the utility value of the consumption is increased. We define the consumption variablexit as(5)xit=x-it+δit+mit,where mit is the minimum electricity demand unaffected by price and x-it represents the electricity consumption of equipment or household appliances that can be controlled and selected to operate according to price. In addition, x-it is the load uncertainty at time slot t. In the model given in (4), the load uncertainty δit affects the generating capacity and total social welfare function, but not the individual consumption. Thus, we consider x-it only. We assume mit≤x-it+mit<ωit/α. Then, the utility function can be written as(6)Ux-it+mit=ωitx-it+mit-α2x-it+mit2=ωitx-it-α2x-it2+ωitmit-α2mit2-αx-itmit=Ux-it+Umit-αx-itmit.Further, the utility function can be written as(7)U-x-it,mit=Ux-it+Umit-αx-itmit,if0≤x-it+mit<ωitαωit22α,ifx-it+mit≥ωitα.The η-NσδQ-1ε component in the constraint of (4) guarantees that the sum of the electricity consumption does not exceed the generating capacity. The constraint for electricity consumption and the generating capacity is written as(8)∑i=1Nx-it+mit≤L-t,which can be rewritten as(9)s.t.∑i=1Nx-it≤L-t-∑i=1NmitL-t=Lt+η-NσδQ-1ε,t=1,⋯,T.The overall optimisation problem under the load uncertainty model is(10)max∑t=1T∑i=1NU-x-it,mit-CL-t-η+NσδQ-1ε-α2σδ2s.t.∑i=1Nx-it+mit≤L-t,t=1,⋯,T.As each time slot is independent, (10) can be solved by independently computing the social maximisation welfare for each time slot. In other words, we have the following optimisation problem for each t∈T(11)max∑i=1NU-x-it,mit-CL-t-η+NσδQ-1ε-α2σδ2s.t.∑i=1Nx-it+mit≤L-t.


## 2.1. Electricity System Model

A smart grid constitutes a delivery system composed of an energy provider and multiple users. The energy provider constantly contracts with and serves the users. In addition, each user installs a smart meter to control their energy consumption; hence, two-way real-time communication between the energy provider and user is allowed. The communication network delivers information required for smart grid operation, such as energy demand, electricity price, and customer identification data. The smart meter aggregates the power consumption demands of all appliances and reports the result to the energy provider. In return, the smart meter receives a real-time price from the energy provider and then user adjusts the appliance electricity consumption accordingly.The notation employed in this study is the same as that used in [11]. A one-day operation cycle is divided into one-hour time slots. So, the real-time pricing and demand response have a one-hour resolution. Denote T=1,⋯,T as the set of time slots, where an individual time slot t∈T. We use N=1,⋯,N to represent the set of users requiring electricity, where a given user i∈N requires a certain amount of energy for his/her electricity appliances. We take xit as the electricity consumption demand of user i at time slot t. The electricity consumption for each time slot and user is bounded; i.e., xit∈mit,Mit. Here, the minimum electricity consumption level mit represents the load from the appliances that are required to be in constant operation throughout the day and night, while the maximum electricity consumption level Mit represents the total power consumption level of the appliances, assuming they are all in operation simultaneously.


## 2.2. Utility Function

Each user is an independent individual in the electricity system and has a unique satisfaction level. From the perspective of microeconomics, the utility function is a measure of a user’s demands and desires based on their consumption or leisure activities. We define the utility function of an individual asUx, where x is the user’s electricity consumption. In previous studies, some researchers adopted a quadratic function as the utility function [9, 10]. In this work, we also use a quadratic function as the utility function, which is expressed as(1)Ux=ωx-α2x2,if0≤x<ωαω22α,ifx≥ωα.Here, α is a predetermined parameter characterising the utility saturation point and ω is a nonnegative parameter characterising the user types assumed to be private. ω typically varies for different time slots and users. We can choose different Ux by selecting the appropriate ω (see Figure 1).Figure 1
Sample utility function for power usersα=0.5.A subscriber who consumesx kW of electricity during a designated number of hours at a rate of P dollars per kW is charged Px dollars. Hence, the welfare of each user can simply be represented as(2)Wx=Ux-Px,where Wx is the user’s welfare function and Px is the cost imposed by the energy provider on the user. For each announced price value P, each user attempts to adjust his/her x to maximise his/her own welfare. This can be achieved by setting the derivative of (2) to zero; hence, the marginal benefit to the user becomes equal to the P at the optimal x.


## 2.3. Energy Cost Model

The cost function of electricity provision is assumed to be increasing and strictly convex. Piece-wise linear functions and quadratic functions are common cost functions [11–18]. Here, we express the cost function as a quadratic function(3)CLt=atLt2+btLt+ct,where Lt is the energy-generating capacity, at is a predetermined positive constant, and bt and ct are predetermined nonnegative constants. The generating capacity of the provider should satisfy the minimum electricity demands of all users and should not exceed their maximum demands.


## 2.4. Social Welfare Model under Load Uncertainty

Similar to [11], in this study, real-time pricing is formulated as maximisation of the social welfare among the consumers and energy provider. The objective function is the summation of all users’ utility functions in all time slots minus the total cost incurred by the energy provider. The constraint is that the summed power consumption cannot exceed the generating capacity at each time slot [18, 19]. The electricity consumption is x-it=xit+δit, where δit is an independent and identically Gaussian random variable with zero mean and variance σδ2. The variance δit represents the load uncertainty and can reflect several variations in a practical environment. This term provides a margin for the energy provider to store additional electricity to prevent a possible outage. Further, σδ2 indicates the effect of the load uncertainty on the social welfare function. Mathematically, the optimisation problem is expressed as(4)max∑t=1T∑i=1NUxit-CLt-α2σδ2s.t.∑i=1Nxit≤Lt+η-NσδQ-1ε,t=1,⋯,T,where Qx=∫x∞1/2πe-t2/2dt, η∈0,1 is a specified threshold indicating an amount of exceeding sum power consumption, and ε is a small positive value which can be interpreted as an outage probability.In practice, some electricity equipment or household appliances must run constantly. This scenario corresponds to the lowest electricity demand and is independent of price. Other devices require a certain operating period or can be activated and deactivated at any time. These devices are affected by price; i.e., the electricity consumption decreases with increasing price and vice versa. An increase in the second type of electricity consumption induces added satisfaction; therefore, the utility value of the consumption is increased. We define the consumption variablexit as(5)xit=x-it+δit+mit,where mit is the minimum electricity demand unaffected by price and x-it represents the electricity consumption of equipment or household appliances that can be controlled and selected to operate according to price. In addition, x-it is the load uncertainty at time slot t. In the model given in (4), the load uncertainty δit affects the generating capacity and total social welfare function, but not the individual consumption. Thus, we consider x-it only. We assume mit≤x-it+mit<ωit/α. Then, the utility function can be written as(6)Ux-it+mit=ωitx-it+mit-α2x-it+mit2=ωitx-it-α2x-it2+ωitmit-α2mit2-αx-itmit=Ux-it+Umit-αx-itmit.Further, the utility function can be written as(7)U-x-it,mit=Ux-it+Umit-αx-itmit,if0≤x-it+mit<ωitαωit22α,ifx-it+mit≥ωitα.The η-NσδQ-1ε component in the constraint of (4) guarantees that the sum of the electricity consumption does not exceed the generating capacity. The constraint for electricity consumption and the generating capacity is written as(8)∑i=1Nx-it+mit≤L-t,which can be rewritten as(9)s.t.∑i=1Nx-it≤L-t-∑i=1NmitL-t=Lt+η-NσδQ-1ε,t=1,⋯,T.The overall optimisation problem under the load uncertainty model is(10)max∑t=1T∑i=1NU-x-it,mit-CL-t-η+NσδQ-1ε-α2σδ2s.t.∑i=1Nx-it+mit≤L-t,t=1,⋯,T.As each time slot is independent, (10) can be solved by independently computing the social maximisation welfare for each time slot. In other words, we have the following optimisation problem for each t∈T(11)max∑i=1NU-x-it,mit-CL-t-η+NσδQ-1ε-α2σδ2s.t.∑i=1Nx-it+mit≤L-t.


## 3. Distributed Algorithm

### 3.1. Centralised Optimisation Problem with Load Uncertainty

#### 3.1.1. Model Based on KKT Conditions

For the purposes of discussion, we express the objective function and constraints of (11) as follows(12)fx=∑i=1NU-x-it,mit-CL-t-η+NσδQ-1ε-α2σδ2,(13)gx=L-t-∑i=1Nmit-∑i=1Nxit.As (11) is a maximum optimisation problem, there exists the following equivalent minimum optimisation problem(14)min-fxs.t.gx≥0.The objection function -fx is quadratic and convex according to (1), (3), and (12). The feasible region(15)D=x∣gx≥0,x=x1t,⋯,xNt,LtT,is convex. Hence, (14) is a convex optimisation problem and its solution exists [20]. As both the utility function and cost function are defined as a quadratic function, we express the model as a quadratic programming problem. This is also true for other convex optimisation problems. According to the extreme value theorem, if x∗ is a local optimal solution to (14), there exists some λ≥0. In addition, the KKT conditions can be established as(16)∇fx∗+λ∇gx∗=0λgx∗=0λ≥0,gx∗≥0,where f(x∗) and g(x∗) are expressed as (12) and (13), respectively. The point x-=x∗,λ is called the KKT point of (14). Furthermore, if x-=x∗,λ is a KKT point, x∗ is the global optimal solution of (14).In particular,λ in (16) is the Lagrangian multiplier representing the energy price. We consider the model given in (16) instead of social welfare maximisation model for the smart grid. The derivatives in (16) can be written as follows(17)Dx=∂fx∂x-1+λ∂gx∂x-1⋯⋯⋯⋯⋯∂fx∂x-N+λ∂gx∂x-N=∂Ux-1∂x-1-αm1-λ⋯⋯⋯⋯⋯∂Ux-N∂x-N-αmN-λ,(18)R-x=∂fx∂L-t+λ∂gx∂L-t=-2atL-t-η+NσδQ-1ε+bt+λ,(19)∇fx+λ∇gx=DxR-x,(20)Rx=R-x=0λgx=0λ≥0,gx≥0.For the purposes of discussion, we write the KKT condition of (16) as(21)∇fx+λ∇gx=0λgx=0λ≥0,gx≥0⇔Dx=0Rx.


#### 3.1.2. Optimisation Problem Formulation

Clearly, the first term in (21), Dx=0, corresponds to a system of smooth equations that can be solved easily (see formula (17)). The second term, Rx, corresponds to a pair of equations and an inequality (see formula (20)); this system is complex. Thus, we focus on solving the subproblem in the form of (20), which has the following distinct form(22)a≥0,b≥0,ab=0.The problem given in (22) is called the complementarity problem [20, 21], which is very difficult to solve directly. According to complementarity theory, there exists the following equivalent definition(23)a≥0,b≥0,ab=0⇔min⁡a,b=0⇔a-a-b+=0,where ·+=max·,0. Therefore, we can express the subproblem given in (20) as(24)Rx=∂fx∂L-t+λ∂gx∂L-tλ-λ-gx+=0.In (24), the formula φx=λ-λ-gx+ is nonsmooth at point λ=gx; therefore, Rx=0 is a system of nonsmooth equations. The methods primarily used to solve nonsmooth equations are the nonsmooth and smooth Newton methods. Previous studies and their numerical results have shown that the smooth Newton method offers superior convergence and higher-stability numerical results than the nonsmooth Newton method [22–24]. Therefore, we propose use of a smooth Newton method to solve the system of nonsmooth equations given in (24). The advantages of using a smooth Newton method to solve (24) are that both the multiplier and the decision variables play the same role in the algorithm and that the convergence of the smooth Newton method has been proven, which further ensures the accuracy of the numerical results. Note that the smooth Newton method solves nonsmooth equations by constructing a smooth function to fit the nonsmooth part.The following two important definitions must now be introduced.Definition 1 (see [20]).
The functionΦx:Rn→Rn is nonsmooth. We say that Φμx:Rn→Rn is a smooth function of Φx if, for any x∈Rn and μ>0, there exists a constant κ>0 such that(25)Φμx-Φx≤κμ.Definition 2 (see [20]).
Suppose thatΦx:Rn→Rn is locally Lipschitzian continuous. Here, Φμx:Rn→Rn is a smooth function of Φx. If, for any x∈Rn,(26)limμ→0distΦμ′x,∂cΦx=0,where ∂cΦx is the C-subdifferential, we say that the functions Φμx and Φx satisfy the Jacobian consistency property.
Definition2 shows the approximation of the first-order differential; i.e., the descent directions of functions Φμx and Φx are consistent. Denote a differentiable function Fx:Rn→Rn. The smooth function denoted by the density method is as follows [20, 24]:(27)ρs=e-s1+e-s2,(28)Pμ,x=∫-∞∞x-μs+ρsds=x+μln⁡1+e-x/μ,(29)Φx=x-x-Fx+,(30)Φμx=x-Pμ,x-Fx.We can prove that Φx and Φμx satisfy the Jacobian consistency property.Theorem 3.
Suppose thatΦμx and Φx are defined as in (27)–(30). Then, the following conclusions can be drawn:(1)
Φμx is a smooth function of Φx;(2)
Φμx and Φx satisfy the Jacobian consistency property.Proof.
(1) Letx-=x-Fx. We consider two cases: n=1 and n>1.
Case  1 (n=1). We have x∈R and F:R→R. According to (27)–(30), if x-≥0, there exists(31)Φμx-Φx=Pμ,x--x-+=x-+μln⁡1+e-x-/μ-x-≤μln⁡2.If x-<0, we have(32)Φμx-Φx=Pμ,x--x-+=x-+μln⁡1+e-x-/μ≤μln⁡1+ex-/μ≤μln⁡2.If we choose κ=ln⁡2, then, for any x∈R and μ>0, there must exist Φμx-Φx≤κμ. Hence, Φμ(x) is a smooth function of Φ(x) when n=1.
Case  2 (n>1). In accordance with Case 1, we choose κ=ln⁡2. Then, for any x∈Rn and μ>0, we have(33)Φμx-Φx=∑i=1nΦμxi-Φxi2≤nκμ.We choose κ-=nκ. Then, for any x∈Rn and μ>0, there exists Φμ(x)-Φx≤κ-μ. Hence, according to Definition 1, Φμx is a smooth function of Φx.
(2) According to (27) and (30), we can obtain the differential Φμ′x=aijn×n, where(34)aij=1-P′μ,x-i1-Fix′xj,i=jP′μ,x-iFix′xj,i≠j.(35)P′μ,x=1-e-x/μ1+e-x/μ∈0,1.With the definition Dμx-=diagPx′μ,x-, we write Φμ′x as(36)Φμ′x=F′x-IDμx-+I.The component of ∂cΦx=aijn×n is written as(37)aij=1-1-Fix′xj,ifi=jandx-i>01,ifi=jandx-i<01-vi1-Fix′xj,ifi=jandx-i=0Fix′xj,ifi≠j,where vi∈0,1i,j=1,2,⋯,n. Thus, ∂cΦx can be marked as(38)∂cΦx=F′x-IDx-+I,where D(x-)=diagv and v∈Rn such that(39)vi=1,ifx-i>00,ifx-i<0∈0,1,ifx-i=0.Hence, we have(40)limμ→0distΦμ′x,∂cΦx=0.Theorem3 shows that Φμ(x) and Φ(x) are approximately equal when μ is sufficiently small, and their descent directions are consistent (see Figure 2). The following system of equations is established(41)Rμx=∂fx∂L-t+λ∂gx∂L-tλ-Pμ,λ-gx=0.Then, we can solve the system of equations given in (41) using the smooth Newton method, instead of targeting the primal problem (24). The flow of the smooth Newton method is shown in Figure 3 [20–24].Figure 2
Smooth functiony=P(μ,x) and nonsmooth function y=max⁡(0,x).Figure 3
Flow of smooth Newton method.


#### 3.1.3. Distributed Algorithm

According to (1) and (3), each utility function is independent and unaffected by other users, while the cost function is a polynomial of degree one. Each component of Dx is a function with an independent variable xi and λ. Hence, the first term Dx=0 in (21) can be decomposed into N separable subproblems of the form as(42)Dix=Dixi=∂Ux-i∂x-i-αmi-λ=0,where i=1,2,⋯,N. Thus, the subproblem Dx=0 can be solved by the users’ DR programs. Another subproblem of the form given in (41) can be solved by the energy provider.In this case, we can obtain the energy consumptionxit∗ for each user by (42). In addition, the energy provider can simply solve their own local optimisation problem, which is determined by (41), to obtain the Lagrangian multiplier (i.e., the energy price λt∗) and the generating capacity level Lt∗, respectively.The key concept that motivates us to propose an algorithm to solve the social welfare model based on utility maximisation can be understood if we compare the local problem of (21), which must be solved by each individual user’s DR program, with (2), which introduces each user’s welfare. In fact, if the energy provider charged the users at a rate P=λt∗ and each individual user attempted to maximise their own welfare function, the total energy consumption would be guaranteed not to exceed the provided capacity. The interaction between the energy provider and users is depicted in Figure 4.Figure 4
Interactions between the energy provider and users in the system.The distributed algorithms of each user and the energy provider are described in Algorithms1 and 2, respectively. In Algorithm 1, each user begins with their initial condition, which is assumed to be random. Then, each user receives the new value of λk and their DR program solves the local problem given in (42) to obtain the optimal consumption xit∗λk, which corresponds to the new value of λk. The users send their new xit∗λk values to the energy provider. We note that, in each time slot, users apply their new loads only after the algorithm has converged (see Algorithm 1).Algorithm 1:Update load of consumption by each user.
Step1 Initialization Step2 for each t∈T Receive λk from energy provider; Update the consumption value xit∗λk by solving (42); Send xit∗λk to energy provider. Step3 Repeat Step 2 until the pricing time ends or the electricity supply and demand are in balance.Algorithm 2:Update price and capacity by energy provider.
Step1 Initialization Step2 Repeat If time t∈T Receive xit∗λk from all the users; Compute the price and capacity value by solving (41); Send the price to the all users. Else Receive load from all the users; Update the total load. End (Until end of intended period)Algorithm2 shows that the energy provider updates λkxit∗ and Lkxit∗ in (41); this maximises the energy provider’s welfare and updates their information on the total consumption level of the system in each t∈T (see Algorithm 2).The pricing algorithm considered in this study differs from the dual optimisation algorithm [11] in two respects: (i) we consider the social welfare model as a KKT condition, i.e., being composed of two systems of equations; (ii) both multiplier and decision variables play the same role in the algorithm. In contrast, the multiplier is treated as an accessory in the dual optimisation method.


### 3.2. Decentralised Optimisation Problem with Load Uncertainty

#### 3.2.1. Model Based on KKT Conditions

For each user, the electricity consumption is constrained; i.e.,xit cannot exceed the user’s maximum electricity demand level. Thus, the constraint for individual consumption is written as(43)x-it+mit≤Lit,i=1,2,⋯,N,where Lit∈mit,Mit. This relation becomes the following constraint(44)s.t.x-it+mit≤Lit,i=1,2,⋯,NLt=∑i=1NLit-η+NσδQ-1ε.As the total cost CLt is the summation of all electricity production costs, we assume that CLt can be written as(45)CLt=∑i=1NCLit+NσδQ-1ε-η∗1N.The overall optimisation problem under the load uncertainty model for each fixed t∈T is(46)max∑i=1NU-xit,mit-∑i=1NCLit+NσδQ-1ε-η∗1N-α2σδ2s.t.xit+mit≤Lit,i=1,2,⋯,N.Clearly, (46) is also a quadratic programming problem and its solution must exist. For the purposes of discussion, we establish the following objective function and constraints of (46)(47)fx=∑i=1NU-xit,mit-∑i=1NCLit+NσδQ-1ε-η∗1N-α2σδ2,and gx=g1x,g2x,⋯,gNxT, where(48)gix=Lit-mit-xit.The KKT conditions can be defined as(49)∇fx+∑i=1Nλi∇gix=0λgxT=0λi≥0,gix≥0,i=1,2,⋯,N.According to complementarity theory (as presented in (23)), we can write (49) as(50)
∇
f
x
+
∑
i
=
1
N
λ
i
∇
g
i
x
=
0
λ
g
x
T
=
0
λ
i
≥
0
,
g
i
x
≥
0
,
i
=
1,2
,
⋯
,
N
⇔
D
x
=
0
R
u
x
=
0
,where Dx is defined as in (17) and the components of Rμx are as follows:(51)Rμix=∂fx∂Lit+λi∂gx∂Litλi-λi-gix+.


#### 3.2.2. Distributed Algorithm

We explained in the previous Section3.1.3 that Dx can be solved for users by individually computing N separable subproblems Dixi=0. According to the definitions given in (1), (45), (47), and (48), each component Rμix is a function with an independent variable Lit and λi. The energy provider can simply solve their own local optimisation problem determined by (51) to obtain λi∗ and Lit∗i=1,2,⋯,N. Hence, the KKT conditions of (49) can be transformed into N separable subproblems, where(52)DixRμix=0.These subproblems incorporate the electricity consumption xit for user i and the price λi and generating capacity Lit for the energy provider. This is a centralised optimisation model with N=1, as in Section 3.1. Thus, the decentralised distributed algorithm is similar to the centralised model. The interactions between the energy provider and each user i are described in Figure 5.Figure 5
Interactions between energy provider and each user in system.


## 3.1. Centralised Optimisation Problem with Load Uncertainty

### 3.1.1. Model Based on KKT Conditions

For the purposes of discussion, we express the objective function and constraints of (11) as follows(12)fx=∑i=1NU-x-it,mit-CL-t-η+NσδQ-1ε-α2σδ2,(13)gx=L-t-∑i=1Nmit-∑i=1Nxit.As (11) is a maximum optimisation problem, there exists the following equivalent minimum optimisation problem(14)min-fxs.t.gx≥0.The objection function -fx is quadratic and convex according to (1), (3), and (12). The feasible region(15)D=x∣gx≥0,x=x1t,⋯,xNt,LtT,is convex. Hence, (14) is a convex optimisation problem and its solution exists [20]. As both the utility function and cost function are defined as a quadratic function, we express the model as a quadratic programming problem. This is also true for other convex optimisation problems. According to the extreme value theorem, if x∗ is a local optimal solution to (14), there exists some λ≥0. In addition, the KKT conditions can be established as(16)∇fx∗+λ∇gx∗=0λgx∗=0λ≥0,gx∗≥0,where f(x∗) and g(x∗) are expressed as (12) and (13), respectively. The point x-=x∗,λ is called the KKT point of (14). Furthermore, if x-=x∗,λ is a KKT point, x∗ is the global optimal solution of (14).In particular,λ in (16) is the Lagrangian multiplier representing the energy price. We consider the model given in (16) instead of social welfare maximisation model for the smart grid. The derivatives in (16) can be written as follows(17)Dx=∂fx∂x-1+λ∂gx∂x-1⋯⋯⋯⋯⋯∂fx∂x-N+λ∂gx∂x-N=∂Ux-1∂x-1-αm1-λ⋯⋯⋯⋯⋯∂Ux-N∂x-N-αmN-λ,(18)R-x=∂fx∂L-t+λ∂gx∂L-t=-2atL-t-η+NσδQ-1ε+bt+λ,(19)∇fx+λ∇gx=DxR-x,(20)Rx=R-x=0λgx=0λ≥0,gx≥0.For the purposes of discussion, we write the KKT condition of (16) as(21)∇fx+λ∇gx=0λgx=0λ≥0,gx≥0⇔Dx=0Rx.


### 3.1.2. Optimisation Problem Formulation

Clearly, the first term in (21), Dx=0, corresponds to a system of smooth equations that can be solved easily (see formula (17)). The second term, Rx, corresponds to a pair of equations and an inequality (see formula (20)); this system is complex. Thus, we focus on solving the subproblem in the form of (20), which has the following distinct form(22)a≥0,b≥0,ab=0.The problem given in (22) is called the complementarity problem [20, 21], which is very difficult to solve directly. According to complementarity theory, there exists the following equivalent definition(23)a≥0,b≥0,ab=0⇔min⁡a,b=0⇔a-a-b+=0,where ·+=max·,0. Therefore, we can express the subproblem given in (20) as(24)Rx=∂fx∂L-t+λ∂gx∂L-tλ-λ-gx+=0.In (24), the formula φx=λ-λ-gx+ is nonsmooth at point λ=gx; therefore, Rx=0 is a system of nonsmooth equations. The methods primarily used to solve nonsmooth equations are the nonsmooth and smooth Newton methods. Previous studies and their numerical results have shown that the smooth Newton method offers superior convergence and higher-stability numerical results than the nonsmooth Newton method [22–24]. Therefore, we propose use of a smooth Newton method to solve the system of nonsmooth equations given in (24). The advantages of using a smooth Newton method to solve (24) are that both the multiplier and the decision variables play the same role in the algorithm and that the convergence of the smooth Newton method has been proven, which further ensures the accuracy of the numerical results. Note that the smooth Newton method solves nonsmooth equations by constructing a smooth function to fit the nonsmooth part.The following two important definitions must now be introduced.Definition 1 (see [20]).
The functionΦx:Rn→Rn is nonsmooth. We say that Φμx:Rn→Rn is a smooth function of Φx if, for any x∈Rn and μ>0, there exists a constant κ>0 such that(25)Φμx-Φx≤κμ.Definition 2 (see [20]).
Suppose thatΦx:Rn→Rn is locally Lipschitzian continuous. Here, Φμx:Rn→Rn is a smooth function of Φx. If, for any x∈Rn,(26)limμ→0distΦμ′x,∂cΦx=0,where ∂cΦx is the C-subdifferential, we say that the functions Φμx and Φx satisfy the Jacobian consistency property.
Definition2 shows the approximation of the first-order differential; i.e., the descent directions of functions Φμx and Φx are consistent. Denote a differentiable function Fx:Rn→Rn. The smooth function denoted by the density method is as follows [20, 24]:(27)ρs=e-s1+e-s2,(28)Pμ,x=∫-∞∞x-μs+ρsds=x+μln⁡1+e-x/μ,(29)Φx=x-x-Fx+,(30)Φμx=x-Pμ,x-Fx.We can prove that Φx and Φμx satisfy the Jacobian consistency property.Theorem 3.
Suppose thatΦμx and Φx are defined as in (27)–(30). Then, the following conclusions can be drawn:(1)
Φμx is a smooth function of Φx;(2)
Φμx and Φx satisfy the Jacobian consistency property.Proof.
(1) Letx-=x-Fx. We consider two cases: n=1 and n>1.
Case  1 (n=1). We have x∈R and F:R→R. According to (27)–(30), if x-≥0, there exists(31)Φμx-Φx=Pμ,x--x-+=x-+μln⁡1+e-x-/μ-x-≤μln⁡2.If x-<0, we have(32)Φμx-Φx=Pμ,x--x-+=x-+μln⁡1+e-x-/μ≤μln⁡1+ex-/μ≤μln⁡2.If we choose κ=ln⁡2, then, for any x∈R and μ>0, there must exist Φμx-Φx≤κμ. Hence, Φμ(x) is a smooth function of Φ(x) when n=1.
Case  2 (n>1). In accordance with Case 1, we choose κ=ln⁡2. Then, for any x∈Rn and μ>0, we have(33)Φμx-Φx=∑i=1nΦμxi-Φxi2≤nκμ.We choose κ-=nκ. Then, for any x∈Rn and μ>0, there exists Φμ(x)-Φx≤κ-μ. Hence, according to Definition 1, Φμx is a smooth function of Φx.
(2) According to (27) and (30), we can obtain the differential Φμ′x=aijn×n, where(34)aij=1-P′μ,x-i1-Fix′xj,i=jP′μ,x-iFix′xj,i≠j.(35)P′μ,x=1-e-x/μ1+e-x/μ∈0,1.With the definition Dμx-=diagPx′μ,x-, we write Φμ′x as(36)Φμ′x=F′x-IDμx-+I.The component of ∂cΦx=aijn×n is written as(37)aij=1-1-Fix′xj,ifi=jandx-i>01,ifi=jandx-i<01-vi1-Fix′xj,ifi=jandx-i=0Fix′xj,ifi≠j,where vi∈0,1i,j=1,2,⋯,n. Thus, ∂cΦx can be marked as(38)∂cΦx=F′x-IDx-+I,where D(x-)=diagv and v∈Rn such that(39)vi=1,ifx-i>00,ifx-i<0∈0,1,ifx-i=0.Hence, we have(40)limμ→0distΦμ′x,∂cΦx=0.Theorem3 shows that Φμ(x) and Φ(x) are approximately equal when μ is sufficiently small, and their descent directions are consistent (see Figure 2). The following system of equations is established(41)Rμx=∂fx∂L-t+λ∂gx∂L-tλ-Pμ,λ-gx=0.Then, we can solve the system of equations given in (41) using the smooth Newton method, instead of targeting the primal problem (24). The flow of the smooth Newton method is shown in Figure 3 [20–24].Figure 2
Smooth functiony=P(μ,x) and nonsmooth function y=max⁡(0,x).Figure 3
Flow of smooth Newton method.


### 3.1.3. Distributed Algorithm

According to (1) and (3), each utility function is independent and unaffected by other users, while the cost function is a polynomial of degree one. Each component of Dx is a function with an independent variable xi and λ. Hence, the first term Dx=0 in (21) can be decomposed into N separable subproblems of the form as(42)Dix=Dixi=∂Ux-i∂x-i-αmi-λ=0,where i=1,2,⋯,N. Thus, the subproblem Dx=0 can be solved by the users’ DR programs. Another subproblem of the form given in (41) can be solved by the energy provider.In this case, we can obtain the energy consumptionxit∗ for each user by (42). In addition, the energy provider can simply solve their own local optimisation problem, which is determined by (41), to obtain the Lagrangian multiplier (i.e., the energy price λt∗) and the generating capacity level Lt∗, respectively.The key concept that motivates us to propose an algorithm to solve the social welfare model based on utility maximisation can be understood if we compare the local problem of (21), which must be solved by each individual user’s DR program, with (2), which introduces each user’s welfare. In fact, if the energy provider charged the users at a rate P=λt∗ and each individual user attempted to maximise their own welfare function, the total energy consumption would be guaranteed not to exceed the provided capacity. The interaction between the energy provider and users is depicted in Figure 4.Figure 4
Interactions between the energy provider and users in the system.The distributed algorithms of each user and the energy provider are described in Algorithms1 and 2, respectively. In Algorithm 1, each user begins with their initial condition, which is assumed to be random. Then, each user receives the new value of λk and their DR program solves the local problem given in (42) to obtain the optimal consumption xit∗λk, which corresponds to the new value of λk. The users send their new xit∗λk values to the energy provider. We note that, in each time slot, users apply their new loads only after the algorithm has converged (see Algorithm 1).Algorithm 1:Update load of consumption by each user.
Step1 Initialization Step2 for each t∈T Receive λk from energy provider; Update the consumption value xit∗λk by solving (42); Send xit∗λk to energy provider. Step3 Repeat Step 2 until the pricing time ends or the electricity supply and demand are in balance.Algorithm 2:Update price and capacity by energy provider.
Step1 Initialization Step2 Repeat If time t∈T Receive xit∗λk from all the users; Compute the price and capacity value by solving (41); Send the price to the all users. Else Receive load from all the users; Update the total load. End (Until end of intended period)Algorithm2 shows that the energy provider updates λkxit∗ and Lkxit∗ in (41); this maximises the energy provider’s welfare and updates their information on the total consumption level of the system in each t∈T (see Algorithm 2).The pricing algorithm considered in this study differs from the dual optimisation algorithm [11] in two respects: (i) we consider the social welfare model as a KKT condition, i.e., being composed of two systems of equations; (ii) both multiplier and decision variables play the same role in the algorithm. In contrast, the multiplier is treated as an accessory in the dual optimisation method.


## 3.1.1. Model Based on KKT Conditions

For the purposes of discussion, we express the objective function and constraints of (11) as follows(12)fx=∑i=1NU-x-it,mit-CL-t-η+NσδQ-1ε-α2σδ2,(13)gx=L-t-∑i=1Nmit-∑i=1Nxit.As (11) is a maximum optimisation problem, there exists the following equivalent minimum optimisation problem(14)min-fxs.t.gx≥0.The objection function -fx is quadratic and convex according to (1), (3), and (12). The feasible region(15)D=x∣gx≥0,x=x1t,⋯,xNt,LtT,is convex. Hence, (14) is a convex optimisation problem and its solution exists [20]. As both the utility function and cost function are defined as a quadratic function, we express the model as a quadratic programming problem. This is also true for other convex optimisation problems. According to the extreme value theorem, if x∗ is a local optimal solution to (14), there exists some λ≥0. In addition, the KKT conditions can be established as(16)∇fx∗+λ∇gx∗=0λgx∗=0λ≥0,gx∗≥0,where f(x∗) and g(x∗) are expressed as (12) and (13), respectively. The point x-=x∗,λ is called the KKT point of (14). Furthermore, if x-=x∗,λ is a KKT point, x∗ is the global optimal solution of (14).In particular,λ in (16) is the Lagrangian multiplier representing the energy price. We consider the model given in (16) instead of social welfare maximisation model for the smart grid. The derivatives in (16) can be written as follows(17)Dx=∂fx∂x-1+λ∂gx∂x-1⋯⋯⋯⋯⋯∂fx∂x-N+λ∂gx∂x-N=∂Ux-1∂x-1-αm1-λ⋯⋯⋯⋯⋯∂Ux-N∂x-N-αmN-λ,(18)R-x=∂fx∂L-t+λ∂gx∂L-t=-2atL-t-η+NσδQ-1ε+bt+λ,(19)∇fx+λ∇gx=DxR-x,(20)Rx=R-x=0λgx=0λ≥0,gx≥0.For the purposes of discussion, we write the KKT condition of (16) as(21)∇fx+λ∇gx=0λgx=0λ≥0,gx≥0⇔Dx=0Rx.


## 3.1.2. Optimisation Problem Formulation

Clearly, the first term in (21), Dx=0, corresponds to a system of smooth equations that can be solved easily (see formula (17)). The second term, Rx, corresponds to a pair of equations and an inequality (see formula (20)); this system is complex. Thus, we focus on solving the subproblem in the form of (20), which has the following distinct form(22)a≥0,b≥0,ab=0.The problem given in (22) is called the complementarity problem [20, 21], which is very difficult to solve directly. According to complementarity theory, there exists the following equivalent definition(23)a≥0,b≥0,ab=0⇔min⁡a,b=0⇔a-a-b+=0,where ·+=max·,0. Therefore, we can express the subproblem given in (20) as(24)Rx=∂fx∂L-t+λ∂gx∂L-tλ-λ-gx+=0.In (24), the formula φx=λ-λ-gx+ is nonsmooth at point λ=gx; therefore, Rx=0 is a system of nonsmooth equations. The methods primarily used to solve nonsmooth equations are the nonsmooth and smooth Newton methods. Previous studies and their numerical results have shown that the smooth Newton method offers superior convergence and higher-stability numerical results than the nonsmooth Newton method [22–24]. Therefore, we propose use of a smooth Newton method to solve the system of nonsmooth equations given in (24). The advantages of using a smooth Newton method to solve (24) are that both the multiplier and the decision variables play the same role in the algorithm and that the convergence of the smooth Newton method has been proven, which further ensures the accuracy of the numerical results. Note that the smooth Newton method solves nonsmooth equations by constructing a smooth function to fit the nonsmooth part.The following two important definitions must now be introduced.Definition 1 (see [20]).
The functionΦx:Rn→Rn is nonsmooth. We say that Φμx:Rn→Rn is a smooth function of Φx if, for any x∈Rn and μ>0, there exists a constant κ>0 such that(25)Φμx-Φx≤κμ.Definition 2 (see [20]).
Suppose thatΦx:Rn→Rn is locally Lipschitzian continuous. Here, Φμx:Rn→Rn is a smooth function of Φx. If, for any x∈Rn,(26)limμ→0distΦμ′x,∂cΦx=0,where ∂cΦx is the C-subdifferential, we say that the functions Φμx and Φx satisfy the Jacobian consistency property.
Definition2 shows the approximation of the first-order differential; i.e., the descent directions of functions Φμx and Φx are consistent. Denote a differentiable function Fx:Rn→Rn. The smooth function denoted by the density method is as follows [20, 24]:(27)ρs=e-s1+e-s2,(28)Pμ,x=∫-∞∞x-μs+ρsds=x+μln⁡1+e-x/μ,(29)Φx=x-x-Fx+,(30)Φμx=x-Pμ,x-Fx.We can prove that Φx and Φμx satisfy the Jacobian consistency property.Theorem 3.
Suppose thatΦμx and Φx are defined as in (27)–(30). Then, the following conclusions can be drawn:(1)
Φμx is a smooth function of Φx;(2)
Φμx and Φx satisfy the Jacobian consistency property.Proof.
(1) Letx-=x-Fx. We consider two cases: n=1 and n>1.
Case  1 (n=1). We have x∈R and F:R→R. According to (27)–(30), if x-≥0, there exists(31)Φμx-Φx=Pμ,x--x-+=x-+μln⁡1+e-x-/μ-x-≤μln⁡2.If x-<0, we have(32)Φμx-Φx=Pμ,x--x-+=x-+μln⁡1+e-x-/μ≤μln⁡1+ex-/μ≤μln⁡2.If we choose κ=ln⁡2, then, for any x∈R and μ>0, there must exist Φμx-Φx≤κμ. Hence, Φμ(x) is a smooth function of Φ(x) when n=1.
Case  2 (n>1). In accordance with Case 1, we choose κ=ln⁡2. Then, for any x∈Rn and μ>0, we have(33)Φμx-Φx=∑i=1nΦμxi-Φxi2≤nκμ.We choose κ-=nκ. Then, for any x∈Rn and μ>0, there exists Φμ(x)-Φx≤κ-μ. Hence, according to Definition 1, Φμx is a smooth function of Φx.
(2) According to (27) and (30), we can obtain the differential Φμ′x=aijn×n, where(34)aij=1-P′μ,x-i1-Fix′xj,i=jP′μ,x-iFix′xj,i≠j.(35)P′μ,x=1-e-x/μ1+e-x/μ∈0,1.With the definition Dμx-=diagPx′μ,x-, we write Φμ′x as(36)Φμ′x=F′x-IDμx-+I.The component of ∂cΦx=aijn×n is written as(37)aij=1-1-Fix′xj,ifi=jandx-i>01,ifi=jandx-i<01-vi1-Fix′xj,ifi=jandx-i=0Fix′xj,ifi≠j,where vi∈0,1i,j=1,2,⋯,n. Thus, ∂cΦx can be marked as(38)∂cΦx=F′x-IDx-+I,where D(x-)=diagv and v∈Rn such that(39)vi=1,ifx-i>00,ifx-i<0∈0,1,ifx-i=0.Hence, we have(40)limμ→0distΦμ′x,∂cΦx=0.Theorem3 shows that Φμ(x) and Φ(x) are approximately equal when μ is sufficiently small, and their descent directions are consistent (see Figure 2). The following system of equations is established(41)Rμx=∂fx∂L-t+λ∂gx∂L-tλ-Pμ,λ-gx=0.Then, we can solve the system of equations given in (41) using the smooth Newton method, instead of targeting the primal problem (24). The flow of the smooth Newton method is shown in Figure 3 [20–24].Figure 2
Smooth functiony=P(μ,x) and nonsmooth function y=max⁡(0,x).Figure 3
Flow of smooth Newton method.


## 3.1.3. Distributed Algorithm

According to (1) and (3), each utility function is independent and unaffected by other users, while the cost function is a polynomial of degree one. Each component of Dx is a function with an independent variable xi and λ. Hence, the first term Dx=0 in (21) can be decomposed into N separable subproblems of the form as(42)Dix=Dixi=∂Ux-i∂x-i-αmi-λ=0,where i=1,2,⋯,N. Thus, the subproblem Dx=0 can be solved by the users’ DR programs. Another subproblem of the form given in (41) can be solved by the energy provider.In this case, we can obtain the energy consumptionxit∗ for each user by (42). In addition, the energy provider can simply solve their own local optimisation problem, which is determined by (41), to obtain the Lagrangian multiplier (i.e., the energy price λt∗) and the generating capacity level Lt∗, respectively.The key concept that motivates us to propose an algorithm to solve the social welfare model based on utility maximisation can be understood if we compare the local problem of (21), which must be solved by each individual user’s DR program, with (2), which introduces each user’s welfare. In fact, if the energy provider charged the users at a rate P=λt∗ and each individual user attempted to maximise their own welfare function, the total energy consumption would be guaranteed not to exceed the provided capacity. The interaction between the energy provider and users is depicted in Figure 4.Figure 4
Interactions between the energy provider and users in the system.The distributed algorithms of each user and the energy provider are described in Algorithms1 and 2, respectively. In Algorithm 1, each user begins with their initial condition, which is assumed to be random. Then, each user receives the new value of λk and their DR program solves the local problem given in (42) to obtain the optimal consumption xit∗λk, which corresponds to the new value of λk. The users send their new xit∗λk values to the energy provider. We note that, in each time slot, users apply their new loads only after the algorithm has converged (see Algorithm 1).Algorithm 1:Update load of consumption by each user.
Step1 Initialization Step2 for each t∈T Receive λk from energy provider; Update the consumption value xit∗λk by solving (42); Send xit∗λk to energy provider. Step3 Repeat Step 2 until the pricing time ends or the electricity supply and demand are in balance.Algorithm 2:Update price and capacity by energy provider.
Step1 Initialization Step2 Repeat If time t∈T Receive xit∗λk from all the users; Compute the price and capacity value by solving (41); Send the price to the all users. Else Receive load from all the users; Update the total load. End (Until end of intended period)Algorithm2 shows that the energy provider updates λkxit∗ and Lkxit∗ in (41); this maximises the energy provider’s welfare and updates their information on the total consumption level of the system in each t∈T (see Algorithm 2).The pricing algorithm considered in this study differs from the dual optimisation algorithm [11] in two respects: (i) we consider the social welfare model as a KKT condition, i.e., being composed of two systems of equations; (ii) both multiplier and decision variables play the same role in the algorithm. In contrast, the multiplier is treated as an accessory in the dual optimisation method.


## 3.2. Decentralised Optimisation Problem with Load Uncertainty

### 3.2.1. Model Based on KKT Conditions

For each user, the electricity consumption is constrained; i.e.,xit cannot exceed the user’s maximum electricity demand level. Thus, the constraint for individual consumption is written as(43)x-it+mit≤Lit,i=1,2,⋯,N,where Lit∈mit,Mit. This relation becomes the following constraint(44)s.t.x-it+mit≤Lit,i=1,2,⋯,NLt=∑i=1NLit-η+NσδQ-1ε.As the total cost CLt is the summation of all electricity production costs, we assume that CLt can be written as(45)CLt=∑i=1NCLit+NσδQ-1ε-η∗1N.The overall optimisation problem under the load uncertainty model for each fixed t∈T is(46)max∑i=1NU-xit,mit-∑i=1NCLit+NσδQ-1ε-η∗1N-α2σδ2s.t.xit+mit≤Lit,i=1,2,⋯,N.Clearly, (46) is also a quadratic programming problem and its solution must exist. For the purposes of discussion, we establish the following objective function and constraints of (46)(47)fx=∑i=1NU-xit,mit-∑i=1NCLit+NσδQ-1ε-η∗1N-α2σδ2,and gx=g1x,g2x,⋯,gNxT, where(48)gix=Lit-mit-xit.The KKT conditions can be defined as(49)∇fx+∑i=1Nλi∇gix=0λgxT=0λi≥0,gix≥0,i=1,2,⋯,N.According to complementarity theory (as presented in (23)), we can write (49) as(50)
∇
f
x
+
∑
i
=
1
N
λ
i
∇
g
i
x
=
0
λ
g
x
T
=
0
λ
i
≥
0
,
g
i
x
≥
0
,
i
=
1,2
,
⋯
,
N
⇔
D
x
=
0
R
u
x
=
0
,where Dx is defined as in (17) and the components of Rμx are as follows:(51)Rμix=∂fx∂Lit+λi∂gx∂Litλi-λi-gix+.


### 3.2.2. Distributed Algorithm

We explained in the previous Section3.1.3 that Dx can be solved for users by individually computing N separable subproblems Dixi=0. According to the definitions given in (1), (45), (47), and (48), each component Rμix is a function with an independent variable Lit and λi. The energy provider can simply solve their own local optimisation problem determined by (51) to obtain λi∗ and Lit∗i=1,2,⋯,N. Hence, the KKT conditions of (49) can be transformed into N separable subproblems, where(52)DixRμix=0.These subproblems incorporate the electricity consumption xit for user i and the price λi and generating capacity Lit for the energy provider. This is a centralised optimisation model with N=1, as in Section 3.1. Thus, the decentralised distributed algorithm is similar to the centralised model. The interactions between the energy provider and each user i are described in Figure 5.Figure 5
Interactions between energy provider and each user in system.


## 3.2.1. Model Based on KKT Conditions

For each user, the electricity consumption is constrained; i.e.,xit cannot exceed the user’s maximum electricity demand level. Thus, the constraint for individual consumption is written as(43)x-it+mit≤Lit,i=1,2,⋯,N,where Lit∈mit,Mit. This relation becomes the following constraint(44)s.t.x-it+mit≤Lit,i=1,2,⋯,NLt=∑i=1NLit-η+NσδQ-1ε.As the total cost CLt is the summation of all electricity production costs, we assume that CLt can be written as(45)CLt=∑i=1NCLit+NσδQ-1ε-η∗1N.The overall optimisation problem under the load uncertainty model for each fixed t∈T is(46)max∑i=1NU-xit,mit-∑i=1NCLit+NσδQ-1ε-η∗1N-α2σδ2s.t.xit+mit≤Lit,i=1,2,⋯,N.Clearly, (46) is also a quadratic programming problem and its solution must exist. For the purposes of discussion, we establish the following objective function and constraints of (46)(47)fx=∑i=1NU-xit,mit-∑i=1NCLit+NσδQ-1ε-η∗1N-α2σδ2,and gx=g1x,g2x,⋯,gNxT, where(48)gix=Lit-mit-xit.The KKT conditions can be defined as(49)∇fx+∑i=1Nλi∇gix=0λgxT=0λi≥0,gix≥0,i=1,2,⋯,N.According to complementarity theory (as presented in (23)), we can write (49) as(50)
∇
f
x
+
∑
i
=
1
N
λ
i
∇
g
i
x
=
0
λ
g
x
T
=
0
λ
i
≥
0
,
g
i
x
≥
0
,
i
=
1,2
,
⋯
,
N
⇔
D
x
=
0
R
u
x
=
0
,where Dx is defined as in (17) and the components of Rμx are as follows:(51)Rμix=∂fx∂Lit+λi∂gx∂Litλi-λi-gix+.


## 3.2.2. Distributed Algorithm

We explained in the previous Section3.1.3 that Dx can be solved for users by individually computing N separable subproblems Dixi=0. According to the definitions given in (1), (45), (47), and (48), each component Rμix is a function with an independent variable Lit and λi. The energy provider can simply solve their own local optimisation problem determined by (51) to obtain λi∗ and Lit∗i=1,2,⋯,N. Hence, the KKT conditions of (49) can be transformed into N separable subproblems, where(52)DixRμix=0.These subproblems incorporate the electricity consumption xit for user i and the price λi and generating capacity Lit for the energy provider. This is a centralised optimisation model with N=1, as in Section 3.1. Thus, the decentralised distributed algorithm is similar to the centralised model. The interactions between the energy provider and each user i are described in Figure 5.Figure 5
Interactions between energy provider and each user in system.


## 4. Numerical Simulations

Similar to [8–10], we perform the numerical simulations according to the users’ electricity usage. Each method was tested more than 50 times, where the related parameters were selected randomly. Furthermore, we compare the results with the dual optimisation method.


### 4.1. Performance Evaluation of Proposed Centralised Method

Numerical simulations were conducted to evaluate the performance of the proposed method. The simulation assumptions and parameters were as follows. We considered 100 residential customers. Variableω had the range [1,4], and the value differed for each user (that is, we distinguished between customers). Parameter α was 0.5. The minimum and maximum power demands varied throughout the day and night but remained fixed during a 1 h period. The cost parameters were at=0.005 and bt=ct=0. For the Gaussian load uncertainty and unknown distribution, the simulation parameters were η=0.1, ε=0.001, and σδ=0.01.Figure6 shows the energy consumption and generating capacity level given by the proposed method. The generating capacity and consumption are consistent, and there is no supply shortage. In addition, the generating capacity meets the minimum demand of all users and is limited at the maximum demand (see Table 1). Furthermore, the generating capacity is the highest at 6:00, but drops rapidly at 7:00; this illustrates that the generating capacity is constrained and does not rise or fall constantly.Table 1
Numerical results of example given by the proposed algorithm and dual algorithm.
N Centralised algorithm Decentralised algorithm Dual algorithm Maximum Electricity Demand Minimum Electricity Demand Production level Total energy consumption Optimal price Production level Total energy consumption Production level Total energy consumption Optimal price 1 186.865 183.593 1.868 169.606 172.666 186.862 183.508 1.869 514.743 102.949 2 184.583 181.174 1.856 166.011 169.76 185.152 181.73 1.852 504.603 100.921 3 183.343 180.070 1.833 165.618 169.481 183.391 179.945 1.834 503.677 100.735 4 171.073 167.657 1.712 152.235 156.083 171.143 167.723 1.711 465.047 93.009 5 186.357 182.971 1.867 169.611 173.445 186.523 183.173 1.865 517.132 103.426 6 189.874 186.482 1.904 171.915 175.167 190.19 186.758 1.902 523.195 104.639 7 181.414 178.134 1.813 165.016 168.886 181.407 178.029 1.814 501.598 100.32 8 177.081 173.663 1.774 161.123 164.166 177.214 173.856 1.772 489.198 97.8395 9 185.998 182.715 1.859 168.84 171.033 185.970 182.639 1.86 511.502 102.3 10 180.857 177.463 1.817 159.250 162.55 181.295 177.884 1.813 484.693 96.939 11 183.654 180.374 1.835 167.459 170.258 183.652 180.243 1.837 507.574 101.514 12 170.349 166.927 1.708 153.26 157.093 170.551 167.179 1.706 467.909 93.582 13 185.472 182.072 1.859 166.83 170.814 185.713 182.268 1.857 509.598 101.92 14 185.376 182.065 1.88 167.356 170.675 186.817 183.399 1.868 508.893 101.779 15 184.286 180.857 1.846 166.119 169.07 184.442 181.034 1.844 504.761 100.952 16 178.385 174.977 1.789 163.06 165.489 178.676 175.242 1.787 494.013 98.803 17 183.002 179.714 1.854 167.945 171.681 184.32 181.019 1.843 512.33 102.466 18 180.181 176.905 1.801 159.17 163.886 180.19 176.802 1.802 487.726 97.545 19 185.513 182.232 1.854 169.176 171.368 185.518 182.124 1.855 511.705 102.341 20 177.209 173.793 1.776 158.894 161.957 177.411 174.018 1.774 481.921 96.384 21 181.006 177.634 1.816 162.32 165.759 181.274 177.941 1.813 493.888 98.778 22 178.014 174.675 1.791 157.761 162.547 178.577 175.194 1.786 481.696 96.339 23 177.591 174.252 1.792 158.971 163.055 178.425 175.089 1.784 483.981 96.796 24 183.35 180.072 1.833 164.607 167.315 183.390 179.958 1.834 499.932 99.987Figure 6
Total electricity consumption and generating capacity given by proposed algorithm.Figure7 shows a comparison of the electricity price given by the proposed method and dual optimisation method. Both the prices given by two algorithms are similar in each time slot. The price given by the proposed method is high at 1:00, 6:00, 14:00, and 19:00 (see Figure 7(a)). This pattern conforms to electricity use habits. When the price of the proposed method rises excessively, the consumption drops rapidly in the next time slot, as at 1:00, 6:00, and 14:00 (see Figures 6 and 7(a)). This illustrates that, when the electricity demand is increasing during low-price periods, the price is also rising to prevent sustained growth of the demand. For example, the price and demand at 1:00 are too high. The demand then decreases at 2:00–4:00 before increasing within the period of 4:00-6:00, because the price becomes low. This result illustrates that price changes can affect user demand for electricity. Users can operate greater numbers of electricity appliances during low-price periods and deactivate devices that do not require constant operation during high-price periods. This is beneficial for peak cutting and valley filling. In addition, the price given by the proposed method is higher than that of the dual optimisation method for most time slots (see Figure 7(b) and Table 1). Hence, the price given by the proposed method is more accurate.Figure 7
Electricity price when (1) proposed algorithm and (2) dual optimisation algorithm are used. (a) Electricity price of proposed algorithm. (b) Ratio of electricity price.
(a) (b)Figure8 shows a comparison between the proposed method and dual optimisation method. The electricity consumption and generating capacity of the proposed method are slightly lower than those of the dual optimisation method for most time slots. The maximum reduction rate exceeded 0.7%. Although both the generating capacity and consumption are dropped, the generating capacity level is still higher than the consumption. In addition, the price given by the proposed method is similar to that given by the dual optimisation method. This result illustrates that the proposed algorithm is more accurate and is useful for preventing a possible outage.Figure 8
Comparisons of generating capacity levelL and total electricity consumption X between (1) proposed algorithm and (2) dual optimisation algorithm.Figure9 shows that the social welfare value of the proposed method grows slightly. The reason for this growth is that the electricity consumption of the proposed method is a little lower than that of the dual method.Figure 9
Social welfare function when (1) proposed algorithm and (2) dual optimisation algorithm are used. (a) Social welfare value. (b) Ratio of social welfare.
(a) (b)Figure10 shows the difference between the electricity demand and generating capacity for zero load uncertainty; i.e., the constraint η-NσδQ-1ε is zero. The blue and brown bars correspond to the results for the proposed and dual optimisation algorithm, respectively. For the results shown in this figure, the supply shortage exists in both of the two algorithms if the effect of the load uncertainty is neglected. The algorithm with load uncertainty can effectively avoid shortage (see Figure 6 and Table 1). Hence, it is necessary to consider the model with load uncertainty. Overall, Figures 7–10 show that the proposed method has higher accuracy than the dual optimisation method.Figure 10
Comparison of difference between total electricity consumption and generating capacity for zero load uncertainty, for the proposed algorithm and the dual algorithm.Figure11 shows a comparison of the iteration numbers of the proposed method and dual optimisation method. We performed 50 simulation experiments. In Figure 11, the average iteration number of the proposed method is smaller for each time slot. Therefore, the proposed method has faster computation speed than the dual optimisation method.Figure 11
Comparison of iteration numbers of proposed algorithm and dual optimisation algorithm.


### 4.2. Numerical Simulations for Evaluation of Proposed Decentralised Method

The simulation assumptions and parameters used to evaluate the distributed algorithm were identical to those for the simulations described in Section4.1. We considered 100 residential customers. For the convenience of verification, we choose cost function as formula (3). Parameter at specially was 0.5 to ensure that total costs do not vary greatly. In practicular, the cost function can be determined according to the actual situation. The simulation results for the proposed decentralised algorithm are shown in Figures 12–16.Figure 12
Individual optimal prices given by proposed decentralised algorithm.Figure 13
Individual electricity consumption when proposed (1) decentralised and (2) centralised algorithms are used.
(a) (b) (c) (d)Figure 14
Total electricity consumption and generating capacity given by proposed decentralised algorithm.Figure 15
Comparison of social welfare functions when proposed (1) decentralised and (2) centralised algorithms are used. (a) Cost of total generating capacity. (b) Electricity consumption. (c) Social welfare value.
(a) (b) (c)Figure 16
Comparison of social welfare functions when proposed decentralised and centralised algorithms are used, for the modified cost. (a) Electricity generating capacity. (b) Ratio of social welfare.
(a) (b)Four individual prices given by the proposed decentralised method for the 100 users were selected randomly, as shown in Figure12. The simulation results show that the individual prices differed and fluctuate around those of the proposed centralised algorithm.Figure13 shows that the electricity consumption of an individual is lower than that of the centralised method in the high-price period. The volatility of electricity consumption becomes smaller. This illustrates that the proposed decentralised method encourages users to actively participate in the DR program for the smart grid, i.e., operating electrical appliances reasonably according to electricity price to reduce the consumption cost. It is useful to avoid the load peak caused by the user concentrates on using electricity.Figure14 shows the electricity consumption and generating capacity given by the decentralised method. The generating capacity and consumption are consistent, and there is no supply shortage. In addition, both the total generating capacity level and total consumption are down compared with the centralised method (identical to Figure 6). Finally, the total consumption is affected by price (see Figures 12 and 13). The electricity consumption increases in the low-price period, but the price rises with the consumption. When the price becomes too high, the consumption decreases in the next time slot. Users can operate greater numbers of electrical appliances during low-price periods and deactivate those that do not require constant operation during high-price periods. This is beneficial for load peak shifting.Figure15 shows a comparison of the social welfare functions given by the proposed centralised and decentralised algorithms. Clearly, both the social welfare value and consumption given by decentralised algorithm are lower for the former. The social welfare value is lower, because the cost functions are calculated by the different methods. In the decentralised algorithm, the generating capacity is divided to N subsets and the cost of total generating capacity level is the sum of subsets’ cost; but the cost is computed by the total generating capacity as an individual in the centralised algorithm. The cost function of the centralised algorithm is revised according to the calculation of the decentralised algorithm. The results show that the modified cost has increased and is higher than that of the decentralised algorithm in each time slot. Furthermore, the modified social welfare systems of the centralised algorithm are down, and they are lower than those given by the decentralised method (see Figure 16). In summary, the decentralised algorithm can improve the social welfare value and avoid new load peaks caused by user electricity consumption in low-price periods, even though the price decreases and the electricity consumption rises.


## 4.1. Performance Evaluation of Proposed Centralised Method

Numerical simulations were conducted to evaluate the performance of the proposed method. The simulation assumptions and parameters were as follows. We considered 100 residential customers. Variableω had the range [1,4], and the value differed for each user (that is, we distinguished between customers). Parameter α was 0.5. The minimum and maximum power demands varied throughout the day and night but remained fixed during a 1 h period. The cost parameters were at=0.005 and bt=ct=0. For the Gaussian load uncertainty and unknown distribution, the simulation parameters were η=0.1, ε=0.001, and σδ=0.01.Figure6 shows the energy consumption and generating capacity level given by the proposed method. The generating capacity and consumption are consistent, and there is no supply shortage. In addition, the generating capacity meets the minimum demand of all users and is limited at the maximum demand (see Table 1). Furthermore, the generating capacity is the highest at 6:00, but drops rapidly at 7:00; this illustrates that the generating capacity is constrained and does not rise or fall constantly.Table 1
Numerical results of example given by the proposed algorithm and dual algorithm.
N Centralised algorithm Decentralised algorithm Dual algorithm Maximum Electricity Demand Minimum Electricity Demand Production level Total energy consumption Optimal price Production level Total energy consumption Production level Total energy consumption Optimal price 1 186.865 183.593 1.868 169.606 172.666 186.862 183.508 1.869 514.743 102.949 2 184.583 181.174 1.856 166.011 169.76 185.152 181.73 1.852 504.603 100.921 3 183.343 180.070 1.833 165.618 169.481 183.391 179.945 1.834 503.677 100.735 4 171.073 167.657 1.712 152.235 156.083 171.143 167.723 1.711 465.047 93.009 5 186.357 182.971 1.867 169.611 173.445 186.523 183.173 1.865 517.132 103.426 6 189.874 186.482 1.904 171.915 175.167 190.19 186.758 1.902 523.195 104.639 7 181.414 178.134 1.813 165.016 168.886 181.407 178.029 1.814 501.598 100.32 8 177.081 173.663 1.774 161.123 164.166 177.214 173.856 1.772 489.198 97.8395 9 185.998 182.715 1.859 168.84 171.033 185.970 182.639 1.86 511.502 102.3 10 180.857 177.463 1.817 159.250 162.55 181.295 177.884 1.813 484.693 96.939 11 183.654 180.374 1.835 167.459 170.258 183.652 180.243 1.837 507.574 101.514 12 170.349 166.927 1.708 153.26 157.093 170.551 167.179 1.706 467.909 93.582 13 185.472 182.072 1.859 166.83 170.814 185.713 182.268 1.857 509.598 101.92 14 185.376 182.065 1.88 167.356 170.675 186.817 183.399 1.868 508.893 101.779 15 184.286 180.857 1.846 166.119 169.07 184.442 181.034 1.844 504.761 100.952 16 178.385 174.977 1.789 163.06 165.489 178.676 175.242 1.787 494.013 98.803 17 183.002 179.714 1.854 167.945 171.681 184.32 181.019 1.843 512.33 102.466 18 180.181 176.905 1.801 159.17 163.886 180.19 176.802 1.802 487.726 97.545 19 185.513 182.232 1.854 169.176 171.368 185.518 182.124 1.855 511.705 102.341 20 177.209 173.793 1.776 158.894 161.957 177.411 174.018 1.774 481.921 96.384 21 181.006 177.634 1.816 162.32 165.759 181.274 177.941 1.813 493.888 98.778 22 178.014 174.675 1.791 157.761 162.547 178.577 175.194 1.786 481.696 96.339 23 177.591 174.252 1.792 158.971 163.055 178.425 175.089 1.784 483.981 96.796 24 183.35 180.072 1.833 164.607 167.315 183.390 179.958 1.834 499.932 99.987Figure 6
Total electricity consumption and generating capacity given by proposed algorithm.Figure7 shows a comparison of the electricity price given by the proposed method and dual optimisation method. Both the prices given by two algorithms are similar in each time slot. The price given by the proposed method is high at 1:00, 6:00, 14:00, and 19:00 (see Figure 7(a)). This pattern conforms to electricity use habits. When the price of the proposed method rises excessively, the consumption drops rapidly in the next time slot, as at 1:00, 6:00, and 14:00 (see Figures 6 and 7(a)). This illustrates that, when the electricity demand is increasing during low-price periods, the price is also rising to prevent sustained growth of the demand. For example, the price and demand at 1:00 are too high. The demand then decreases at 2:00–4:00 before increasing within the period of 4:00-6:00, because the price becomes low. This result illustrates that price changes can affect user demand for electricity. Users can operate greater numbers of electricity appliances during low-price periods and deactivate devices that do not require constant operation during high-price periods. This is beneficial for peak cutting and valley filling. In addition, the price given by the proposed method is higher than that of the dual optimisation method for most time slots (see Figure 7(b) and Table 1). Hence, the price given by the proposed method is more accurate.Figure 7
Electricity price when (1) proposed algorithm and (2) dual optimisation algorithm are used. (a) Electricity price of proposed algorithm. (b) Ratio of electricity price.
(a) (b)Figure8 shows a comparison between the proposed method and dual optimisation method. The electricity consumption and generating capacity of the proposed method are slightly lower than those of the dual optimisation method for most time slots. The maximum reduction rate exceeded 0.7%. Although both the generating capacity and consumption are dropped, the generating capacity level is still higher than the consumption. In addition, the price given by the proposed method is similar to that given by the dual optimisation method. This result illustrates that the proposed algorithm is more accurate and is useful for preventing a possible outage.Figure 8
Comparisons of generating capacity levelL and total electricity consumption X between (1) proposed algorithm and (2) dual optimisation algorithm.Figure9 shows that the social welfare value of the proposed method grows slightly. The reason for this growth is that the electricity consumption of the proposed method is a little lower than that of the dual method.Figure 9
Social welfare function when (1) proposed algorithm and (2) dual optimisation algorithm are used. (a) Social welfare value. (b) Ratio of social welfare.
(a) (b)Figure10 shows the difference between the electricity demand and generating capacity for zero load uncertainty; i.e., the constraint η-NσδQ-1ε is zero. The blue and brown bars correspond to the results for the proposed and dual optimisation algorithm, respectively. For the results shown in this figure, the supply shortage exists in both of the two algorithms if the effect of the load uncertainty is neglected. The algorithm with load uncertainty can effectively avoid shortage (see Figure 6 and Table 1). Hence, it is necessary to consider the model with load uncertainty. Overall, Figures 7–10 show that the proposed method has higher accuracy than the dual optimisation method.Figure 10
Comparison of difference between total electricity consumption and generating capacity for zero load uncertainty, for the proposed algorithm and the dual algorithm.Figure11 shows a comparison of the iteration numbers of the proposed method and dual optimisation method. We performed 50 simulation experiments. In Figure 11, the average iteration number of the proposed method is smaller for each time slot. Therefore, the proposed method has faster computation speed than the dual optimisation method.Figure 11
Comparison of iteration numbers of proposed algorithm and dual optimisation algorithm.


## 4.2. Numerical Simulations for Evaluation of Proposed Decentralised Method

The simulation assumptions and parameters used to evaluate the distributed algorithm were identical to those for the simulations described in Section4.1. We considered 100 residential customers. For the convenience of verification, we choose cost function as formula (3). Parameter at specially was 0.5 to ensure that total costs do not vary greatly. In practicular, the cost function can be determined according to the actual situation. The simulation results for the proposed decentralised algorithm are shown in Figures 12–16.Figure 12
Individual optimal prices given by proposed decentralised algorithm.Figure 13
Individual electricity consumption when proposed (1) decentralised and (2) centralised algorithms are used.
(a) (b) (c) (d)Figure 14
Total electricity consumption and generating capacity given by proposed decentralised algorithm.Figure 15
Comparison of social welfare functions when proposed (1) decentralised and (2) centralised algorithms are used. (a) Cost of total generating capacity. (b) Electricity consumption. (c) Social welfare value.
(a) (b) (c)Figure 16
Comparison of social welfare functions when proposed decentralised and centralised algorithms are used, for the modified cost. (a) Electricity generating capacity. (b) Ratio of social welfare.
(a) (b)Four individual prices given by the proposed decentralised method for the 100 users were selected randomly, as shown in Figure12. The simulation results show that the individual prices differed and fluctuate around those of the proposed centralised algorithm.Figure13 shows that the electricity consumption of an individual is lower than that of the centralised method in the high-price period. The volatility of electricity consumption becomes smaller. This illustrates that the proposed decentralised method encourages users to actively participate in the DR program for the smart grid, i.e., operating electrical appliances reasonably according to electricity price to reduce the consumption cost. It is useful to avoid the load peak caused by the user concentrates on using electricity.Figure14 shows the electricity consumption and generating capacity given by the decentralised method. The generating capacity and consumption are consistent, and there is no supply shortage. In addition, both the total generating capacity level and total consumption are down compared with the centralised method (identical to Figure 6). Finally, the total consumption is affected by price (see Figures 12 and 13). The electricity consumption increases in the low-price period, but the price rises with the consumption. When the price becomes too high, the consumption decreases in the next time slot. Users can operate greater numbers of electrical appliances during low-price periods and deactivate those that do not require constant operation during high-price periods. This is beneficial for load peak shifting.Figure15 shows a comparison of the social welfare functions given by the proposed centralised and decentralised algorithms. Clearly, both the social welfare value and consumption given by decentralised algorithm are lower for the former. The social welfare value is lower, because the cost functions are calculated by the different methods. In the decentralised algorithm, the generating capacity is divided to N subsets and the cost of total generating capacity level is the sum of subsets’ cost; but the cost is computed by the total generating capacity as an individual in the centralised algorithm. The cost function of the centralised algorithm is revised according to the calculation of the decentralised algorithm. The results show that the modified cost has increased and is higher than that of the decentralised algorithm in each time slot. Furthermore, the modified social welfare systems of the centralised algorithm are down, and they are lower than those given by the decentralised method (see Figure 16). In summary, the decentralised algorithm can improve the social welfare value and avoid new load peaks caused by user electricity consumption in low-price periods, even though the price decreases and the electricity consumption rises.


## 5. Conclusion

In the smart grid, the real-time pricing mechanism based on the Lagrangian multipliers, i.e., shadow prices, is an effective method to improve the utility of electricity under the optimal power allocation. The Lagrangian multiplier in the dual algorithms is an auxiliary variable that causes the accuracy of the multiplier to be limited. Given the limitations of multiplier, we proposed the system of nonsmooth equations to solve the real-time pricing of smart grid. The key idea is to use the KKT condition to establish the model with the Lagrangian multipliers. According to complementarity theory, the KKT condition is a complementarity problem which can be converted into an equivalent system of nonsmooth equations. We designed an online distributed algorithm to solve the real-time pricing of smart grid. In the proposed algorithms, the Lagrangian multiplier is a decision variable and the smooth Newton method of solving the nonsmooth equations is deterministic. Hence, the multiplier of the proposed algorithm is more accurate than that of the dual algorithm.Numerical experiments show that the multiplier is more accurate, resource allocation is better, and the number of iteration is less than that of dual algorithm. The implementation of the proposed algorithm, both the centralised and decentralised algorithm, is easy, especially for real-time pricing with multiuser and multiprice. In particular, the pricing of the decentralised algorithm is more flexible to encourage users to actively participate in the DR program of smart grid while also increasing their electricity consumption.In simulation, we consider the power system with an electricity provider and 100 users. In fact, the energy system can be divided into several energy groups according to the electricity consumption behaviour, area, types of users, etc. The every group can be treated as an individual and the basis electricity price of each individual can be determined by the proposed algorithm in the energy system. In the same way, the every user can be marked as an individual and the each group is a small energy system in the proposed algorithm. Hence, the proposed algorithm can be implemented in smart grid. In the future, we will improve model and consider more factors, such as rewards for energy consumption, energy scheduling of home appliances, and the effects of weather on power distribution systems, so that we can solve problems that are more practical. On another way, we will design a new algorithm to improve the accuracy of the numerical results and computation speed.



---

*Source: 1498134-2019-02-12.xml*