Abstract
The realtime 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 realtime 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.
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 priceresponse based DR programs, especially, can effectively promote user enthusiasm to participate in the market, and it is one of the most costeffective elements as regards energy cost reduction for residential and small industrial buildings [2, 3]. The DR programs primarily shift users’ consumption from peak to offpeak periods to reduce loads on utilityhandling 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, timeofuse, and realtime pricing. The latter has advantages over the multistep and timeofuse pricing methods, which is the most effective for demand side management and can avoid new peaks caused by user electricity consumption during lowprice periods [7–10]. When the realtime 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 peakload shifting. Bahrami et al. [10] have proposed a realtime 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 realtime pricing in smart grid. The studies on realtime 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 arithmeticgeometric mean inequality to solve utilitymaximisation 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 realtime pricing model (i.e., the social welfare model). With consideration of electricity vehicle charging, Bitar [14] has proposed a novel forward market for a deadlinedifferentiated electricpower servicebased 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 realtime pricing model based on utility maximisation. Asadi et al. [16] have proposed use of the particle swarm optimisation algorithm to solve the realtime pricing problem based on the social welfare model. Zhu et al. [17] have solved the realtime 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 realtime pricing problem; however, the multiplier is obtained as a byproduct, 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 smallscale 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 realtime pricing cannot be guaranteed if the dual optimisation method is applied. In this study, we propose an algorithm for the realtime 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 realtime 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 realtime 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 realtime 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 realtime 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 Section 2, we briefly describe the social welfare maximisation model, i.e., the realtime 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, twoway realtime 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 realtime 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 oneday operation cycle is divided into onehour time slots. So, the realtime pricing and demand response have a onehour resolution. Denote as the set of time slots, where an individual time slot . We use to represent the set of users requiring electricity, where a given user requires a certain amount of energy for his/her electricity appliances. We take as the electricity consumption demand of user at time slot . The electricity consumption for each time slot and user is bounded; i.e., . Here, the minimum electricity consumption level 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 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 as , where 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 asHere, 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 by selecting the appropriate (see Figure 1).
A subscriber who consumes kW of electricity during a designated number of hours at a rate of dollars per kW is charged dollars. Hence, the welfare of each user can simply be represented aswhere is the user’s welfare function and is the cost imposed by the energy provider on the user. For each announced price value , each user attempts to adjust his/her 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 at the optimal .
2.3. Energy Cost Model
The cost function of electricity provision is assumed to be increasing and strictly convex. Piecewise linear functions and quadratic functions are common cost functions [11–18]. Here, we express the cost function as a quadratic functionwhere is the energygenerating capacity, is a predetermined positive constant, and and 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, realtime 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 , where is an independent and identically Gaussian random variable with zero mean and variance . The variance 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, indicates the effect of the load uncertainty on the social welfare function. Mathematically, the optimisation problem is expressed aswhere , 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 variable aswhere is the minimum electricity demand unaffected by price and represents the electricity consumption of equipment or household appliances that can be controlled and selected to operate according to price. In addition, is the load uncertainty at time slot . In the model given in (4), the load uncertainty affects the generating capacity and total social welfare function, but not the individual consumption. Thus, we consider only. We assume . Then, the utility function can be written asFurther, the utility function can be written asThe 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 aswhich can be rewritten asThe overall optimisation problem under the load uncertainty model isAs 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
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 followsAs (11) is a maximum optimisation problem, there exists the following equivalent minimum optimisation problemThe objection function is quadratic and convex according to (1), (3), and (12). The feasible regionis 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 is a local optimal solution to (14), there exists some . In addition, the KKT conditions can be established aswhere and are expressed as (12) and (13), respectively. The point is called the KKT point of (14). Furthermore, if is a KKT point, 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 followsFor the purposes of discussion, we write the KKT condition of (16) as
3.1.2. Optimisation Problem Formulation
Clearly, the first term in (21), , corresponds to a system of smooth equations that can be solved easily (see formula (17)). The second term, , 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 formThe 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 definitionwhere . Therefore, we can express the subproblem given in (20) asIn (24), the formula is nonsmooth at point ; therefore, 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 higherstability 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 is nonsmooth. We say that is a smooth function of if, for any and , there exists a constant such that
Definition 2 (see [20]). Suppose that is locally Lipschitzian continuous. Here, is a smooth function of . If, for any ,where is the Csubdifferential, we say that the functions and satisfy the Jacobian consistency property.
Definition 2 shows the approximation of the firstorder differential; i.e., the descent directions of functions and are consistent. Denote a differentiable function . The smooth function denoted by the density method is as follows [20, 24]:We can prove that and satisfy the Jacobian consistency property.
Theorem 3. Suppose that and are defined as in (27)–(30). Then, the following conclusions can be drawn:(1) is a smooth function of ;(2) and satisfy the Jacobian consistency property.
Proof. (1) Let . We consider two cases: and .
Case 1 (). We have and . According to (27)–(30), if , there existsIf , we haveIf we choose , then, for any and , there must exist . Hence, is a smooth function of when .
Case 2 (). In accordance with Case 1, we choose . Then, for any and , we haveWe choose . Then, for any and , there exists . Hence, according to Definition 1, is a smooth function of .
(2) According to (27) and (30), we can obtain the differential , whereWith the definition , we write asThe component of is written aswhere . Thus, can be marked aswhere and such thatHence, we have
Theorem 3 shows that and are approximately equal when is sufficiently small, and their descent directions are consistent (see Figure 2). The following system of equations is establishedThen, 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].
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 is a function with an independent variable and . Hence, the first term in (21) can be decomposed into separable subproblems of the form aswhere . Thus, the subproblem 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 consumption 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 ) and the generating capacity level , 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 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.
The distributed algorithms of each user and the energy provider are described in Algorithms 1 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 and their DR program solves the local problem given in (42) to obtain the optimal consumption , which corresponds to the new value of . The users send their new 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 2 shows that the energy provider updates and in (41); this maximises the energy provider’s welfare and updates their information on the total consumption level of the system in each (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., cannot exceed the user’s maximum electricity demand level. Thus, the constraint for individual consumption is written aswhere . This relation becomes the following constraintAs the total cost is the summation of all electricity production costs, we assume that can be written asThe overall optimisation problem under the load uncertainty model for each fixed isClearly, (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)and , whereThe KKT conditions can be defined asAccording to complementarity theory (as presented in (23)), we can write (49) aswhere is defined as in (17) and the components of are as follows:
3.2.2. Distributed Algorithm
We explained in the previous Section 3.1.3 that can be solved for users by individually computing separable subproblems . According to the definitions given in (1), (45), (47), and (48), each component is a function with an independent variable and . The energy provider can simply solve their own local optimisation problem determined by (51) to obtain and . Hence, the KKT conditions of (49) can be transformed into separable subproblems, whereThese subproblems incorporate the electricity consumption for user and the price and generating capacity for the energy provider. This is a centralised optimisation model with , 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 are described in Figure 5.
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 , 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 and . For the Gaussian load uncertainty and unknown distribution, the simulation parameters were , , and .
Figure 6 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.
Figure 7 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 lowprice 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:006: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 lowprice periods and deactivate devices that do not require constant operation during highprice 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.
(a)
(b)
Figure 8 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 9 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.
(a)
(b)
Figure 10 shows the difference between the electricity demand and generating capacity for zero load uncertainty; i.e., the constraint 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 11 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.
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 Section 4.1. We considered 100 residential customers. For the convenience of verification, we choose cost function as formula (3). Parameter 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.
(a)
(b)
(c)
(d)
(a)
(b)
(c)
(a)
(b)
Four individual prices given by the proposed decentralised method for the 100 users were selected randomly, as shown in Figure 12. The simulation results show that the individual prices differed and fluctuate around those of the proposed centralised algorithm.
Figure 13 shows that the electricity consumption of an individual is lower than that of the centralised method in the highprice 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.
Figure 14 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 lowprice 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 lowprice periods and deactivate those that do not require constant operation during highprice periods. This is beneficial for load peak shifting.
Figure 15 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 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 lowprice periods, even though the price decreases and the electricity consumption rises.
5. Conclusion
In the smart grid, the realtime 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 realtime 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 realtime 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 realtime 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.
Nomenclature
Variables and Parameters for Energy User:  Predetermined constant characterising the saturation point of the utility 
:  Nonnegative parameters characterising the user 
:  Electricity consumption vector 
:  Electricity consumption variable of user in time slot 
:  Lower bound for electricity consumption of user in time slot 
:  Upper bound for electricity consumption of user in time slot 
:  Utility function of user 
:  Welfare function of user 
:  Energy production level in time slot 
:  Lower bound for energy production level in time slot 
:  Upper bound for energy production level in time slot 
:  Cost function of energy 
:  Cost parameters 
:  Electricity price 
:  Lagrangian multiplier, i.e., shadow price 
:  Arbitrary vector in period 
:  Objective function 
:  Constraint function 
:  Nonsmooth function 
:  Partial derivative of 
:  Density function 
:  Smoothing parameter in 
:  Function denoted by the density function 
:  Smooth function of 
:  Set of time slots 
:  Set of energy users . 
Data Availability
The data used to support the findings of this study are included within the article.
Conflicts of Interest
The authors declare that there are no conflicts of interest regarding the publication of this paper.
Acknowledgments
This work was supported by the National Natural Science Foundation of China (no. 11171221).