Abstract
Considering a demand response (DR) based social welfare maximization model, a complementarity problem based on the KarushKuhnTuker condition is described, which is a nondual method for determining realtime price for smart grids. The Lagrange multiplier in the dual method, which is used to determine the basic electricity price, is applied in the model. The proposed method computes the optimal electricity consumption, price and production. According to the electricity price, users can arrange their electricity equipment reasonably to reduce the consumption pressure at peak time. The model aims to encourage users to actively participate in the DR and realize peak cutting and valley filling. In addition, the model considers different utility functions representing three types of users. Finally, a Jacobian smoothing version of Newton method is used to solve the model. Statistical simulations of the model validate the rationality and feasibility of the proposed method.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
1 Introduction
As our awareness about energy and the environment grows, the demand for a reliable and sustainable power grid and the need for highquality and stable resources have led to the evolution of smart grids as novel means of electricity distribution [1, 2]. In particular, widespread blackouts in parts of the northeastern United States and eastern Canada in 2003 attracted more attention to the development of smart grids in many countries [1]. Smart grids are the systems with complex structure and extensive stakeholders. The idea behind smart grids is to improve the efficiency of power system, from generation to endusers, which enables user participation [3]. Power supplyside management and demandside management are the main problems in the research on smart grids. Power supplyside management refers to the management issues in traditional power systems. Demandside management is a new research area in smart grids and aims to improve terminal power efficiency, change client electromode, optimize resource allocation, and realize minimumcost power service. Demandside management is a research focus on smart grids [4].
The deployment of communication infrastructure and intelligent devices in smart grids is associated with the concept of demand response (DR), which is a costeffective method for reducing energy prices [5]. DR enables demandside activities to balance the power supply and demand. In smart grids, smart meters transmit the power price and consumption information of electricity equipment to users, to better control electricity consumption and cost; the relevant information is sent to the power provider for load control and price setting [6]. Thus, DR programs are key elements in determining demandside activities in future smart grids. These DR programs concentrate on shifting consumption from peak to offpeak periods to reduce the pressure on utilityhandled equipment such as distribution transformers and power lines and valuable resources for the effective operation of smart grid structures [7, 8]. DR in demandside management can be divided into two categories: incentive response mechanisms and price response mechanisms. Among them, the price response mechanisms refer to the load transfer or reduction behavior of the user in response to the realtime change of the electricity price. It saves electricity costs and is more feasible [9, 10]. In recent years, many scholars and researchers have studied the DR problem in smart grids and obtained considerable achievements. Parvania et al [11] presented a stochastic DR model based on twostage stochastic mixed integer programming in the wholesale electricity market. Chai et al [12] studied the DR problem in systems with multiple utility companies and multiple residential customers, while Deng et al [13] proposed a distributed realtime DR algorithm that determines each user’s demand and each utility company’s supply. These studies are concerned with DR programs and their role in the analysis of power system operations. Haider et al [14] proposed an adaptive consumptionlevel DR pricing scheme, which can be used to easily implement DR. Dai et al [15] analyzed a supply–demand equilibrium model with many power providers using game theory, and Juan et al [16] examined the role and influence of voluntary realtime pricing in Spain. Asadi et al [17] proposed a method for determining realtime pricing using a welfare maximization model based on DR. The main work of the realtime pricing method based on the social welfare maximization model is to compute the shadow price (i.e., the Lagrange multiplier of an optimization problem). The demonstration proves that reasonable pricing can encourage users to actively participate in DR and is effective in shifting consumption from peak to offpeak periods and reducing the pressure on utilityhandled equipment [18,19,20,21,22,23]. The government or power companies can set electricity or guidance prices based on the shadow price. In this paper, we study realtime pricing based on the social welfare maximization model.
The dual optimization method is an important method, which solves not only the decision variables of the optimization problem but also the Lagrange multiplier. Hence, the dual method is used to solve the realtime pricing problem based on the social welfare maximization model. Asadi et al [17] developed a particle swarm optimization algorithm to determine realtime pricing for smart grids, whereas Zhu et al [21] solved the realtime pricing problem using a simulated annealing algorithm. Song et al [22] applied the gradient projection method to the problem of realtime pricing, and Wang et al [23] used a distributed online algorithm to determine energy distribution in smart grids. The above techniques are based on the dual optimization method, whereby a shadow price which is Lagrange multiplier, is used to determine the basic price of electricity. The social welfare maximization model is divided into two subproblems in the dual optimization method. One subproblem is that users determine their intended electricity consumption based on a reference price provided by power companies. Another subproblem is related to the electricity price and quantity of electricity produced, in which the power companies find that the quantity of electricity produced depends on the price. The price provided by power companies, is the Lagrange multipliers in the dual optimization method. Although the dual optimization method solves the price problem (i.e. Lagrange multiplier in the realtime pricing problem), the following problems still need further study.

1)
The computation speed is slow. Realtime pricing is shortterm and the algorithm needs to respond quickly. The dual optimization method is a minimax problem, which is suited to solving smallscale problems. In the social welfare maximization model, each user’s electricity consumption is a variable, and the scale of the problem is large. Hence, the dual optimization method cannot guarantee the computation speed, and it is difficult to achieve a quick response [17].

2)
The accuracy is low. Although the Lagrange multiplier can be computed by the dual optimization method, they are obtained as a byproduct. The multiplier and the decision variable are not equal during the execution of the algorithm. The numerical accuracy of the decision variables is focused, but that of the multiplier is not high in the dual optimization method. However, the Lagrange multiplier is the electricity price we want to determine [21,22,23].
To solve these problems, we propose a complementarity method, which contains the Lagrange multiplier. First, based on the social welfare maximization model, a KarushKuhnTucker (KKT) condition is established. This system is a complementarity problem, which contains the multiplier and the decision variables. Then a Jacobian smoothing Newton method is used to solve the KKT condition and get the electricity price. The advantage of the proposed approach is that the computing speed and numerical accuracy of the associated algorithms is dramatically improved. Moreover, both the multiplier and decision variables play the same role in the algorithm. Further, convergence of Newton method has been proven, which further ensures the accuracy of the numerical results. In addition, we consider three types of users, i.e. residential users, commercial users, and industrial users. They are all important players in the electricity market, which have a great impact on the research. Residential electricity is used in household appliances for residential life, consumption is low, and prices have been low for a long time. Industrial and commercial electricity demands are large, and electrical energy requirements are higher than residential requirements. Since the price is an equilibrium price under multiuser conditions, if the electricity consumption gaps between different users are large, the equilibrium price for the user with lower power consumption is unfair. Therefore, it is more reasonable to consider the price and generation capacities separately for different types of users. In the proposed method, we consider multiprice and utility functions for different type of users, and perform simulation verification.
The remainder of this paper is organized as follows. In Section 2, we briefly describe the social welfare model. In Section 3, the realtime pricing problem is established with a KKT condition, and the Jacobian smoothing Newton method is presented. Finally, simulation results are presented and discussed in Section 4.
2 Social welfare model
Similar to [24], the intended time cycle for the operation of users is divided into \({\Gamma}\) time and \({\Gamma} =\{1, 2, ..., T\}\), is the set of all time slots. This division can be based on the behavior of all the users and their power demand pattern, peak load time slots, valley load time slots and normal load time slots. Denoting \({\mathcal{N}} = \left\{ {1,2, \cdots ,N} \right\}\) as the set of users requiring electricity, each user \(i \in {\mathcal{N}}\) requires a certain amount of electricity for his/her electrical appliances. Denoting \(x_{i}^{t}\) as the electricity consumption demand of residential user \(i\), \(y_{j}^{t}\) as the electricity consumption demand of commercial user \(j\), and \(z_{k}^{t}\) as the electricity consumption demand of industrial user \(k\) in time slot \(t\). The electricity consumption for each user and each time slot is bounded which is in \([m_{i}^{t} , M_{i}^{t}], i \in {\mathcal{N}}\). Here, the minimum electricity consumption level \(m_{i}^{t}\) represents the load from the appliances which are always required to be on during the day, and the maximum electricity consumption level \(M_{i}^{t}\) represents the total power consumption level of the appliances assuming they are all on. Denoting \(L_{t}^{x}\) as the generation capacity for residential user, \(L_{t}^{y}\) as the generation capacity for commercial user, \(L_{t}^{z}\) as the generation capacity for industrial user, and \(L_{t} = L_{t}^{x} + L_{t}^{y} + L_{t}^{z}\) as the total generation capacity in time slot \(t\). The electricity provider must provide the generation capacity to cover minimum and maximum electricity requirements of all the users, i.e., \(L_{t}^{\hbox{min} } = \sum\limits_{i = 1}^{N} {m_{i}^{t} }\) and \(L_{t}^{\hbox{max} } = \sum\limits_{i = 1}^{N} {M_{i}^{t} }\).
2.1 Utility function
Utility functions are often used in microeconomics as a measure of the requirements and desires of a customer based on their consumption or leisure activities. These functions represent the relationship between the consuming utility and the number of a commodity. They are usually increasing concave functions that satisfy:

1)
An increasing function: \(\frac{\partial U}{\partial x} \ge 0\);

2)
A decreasing marginal function: \(\frac{{\partial^{2} U}}{{\partial^{2} x}} \le 0\).
Where \(U( \cdot )\) is an utility function. When these two conditions are satisfied, the utility function increases with the consumption and is the maximum at the boundary. In previous studies, researchers adopted quadratic or logarithmic functions as the utility function [17,18,19,20,21,22,23]. Because the electricity requirements and desires are different for residential, industrial, and commercial users, we consider three types of utility functions.
For residential users:
For commercial users:
For industrial users:
where \(x\), \(y\), and \(z\) denote the electricity consumption of the three types of users; \(y_{\hbox{max} }\) and \(z_{\hbox{max} }\) are the maximum demand of commercial and industrial users, respectively; \(\alpha\), \(\beta\), and \(\gamma\) are predetermined constants characterizing the saturation point of the utility; \(\omega_{x}\), \(\omega_{y}\) and \(\omega_{z}\) are nonnegative parameters characterizing the user types; and \(U_{x} (x,\omega_{x} )\), \(U_{y} (y,\omega_{y} )\), and \(U_{z} (z,\omega_{z} )\) satisfy increasing and marginal conditions, as shown in Fig. 1.
A user that consumes \(\bar{x}\) kW of electricity during a designated number of hours at a rate of p ¥/kWh is charged \(p\,\bar{x}\) ¥/h. Hence, the welfare of a user can be simply represented as:
where \(p_{x} x\), \(p_{y} y\), and \(p_{z} z\) are the costs imposed by the electricity provider on the different types of users.
2.2 Energy cost model
The cost function \(C(L_{t} )\) is increasing and strictly convex. In smart grids, researchers often use quadratic functions as the cost function [12]. In this research, the cost function is represented as:
where \(a_{t}\) is a predetermined positive constant; \(b_{t}\) and \(c_{t}\) are predetermined nonnegative constants; and \(L_{t}\) is the generation capacity in time slot \(t\).
2.3 Social welfare model
From a social equality perspective, the social welfare model of electricity aims to maximize social welfare among the users and the electricity provider. It is desirable to maximize the total utilities of the subscribers and minimize the cost imposed on the electricity provider. Thus, the objective function is the total utility of the subscribers subtracted from the cost incurred by the electricity provider [17, 21, 22]. The mathematical model can be represented as:
where \( {U_{x} (x ,\omega_{x} )} \) , \( {U_{y} (y ,\omega_{y} )} \), and \( {U_{z} (z ,\omega_{z} )} \) are described by formula (1)~(3); \( x_{i}^{t}\) is the electricity consumption demand of residential user i; \( y_{j}^{t}\) is the electricity consumption demand of commercial user j; \( z_{k}^{t}\) is the electricity consumption demand of industrial user k; \( \omega_{i}^{t}\), \( \omega_{j}^{t}\) and \( \omega_{k}^{t}\) are nonnegative parameters characterizing the user types. As the total generation capacity \(L_{t}\) is the summation of all electricity production, we assume that \(L_{t}\) can be written as:
where \(L_{t}^{x}\), \(L_{t}^{y}\), and \(L_{t}^{z}\) are the generation capacities of the electricity provider for the three different types of users; \(\varepsilon_{i} \in \left( {0,1} \right)\;\left( {i = 1,2,3} \right)\)is a predetermined constants and \(\sum\limits_{i = 1}^{3} {\varepsilon_{i} } = 1\).
Bounded uncertainty has long been used to model dynamic control systems such as (8). Thus, the electricity optimization problem schedule based on the model of the users is represented as:
where \(t = 1,2, \cdots ,T\).
The objective function in (10) is the maximum sum of each social welfare model in time slot \(t\). It has the following equivalent formula:
Obviously, (10) can be modified into a simple optimization subproblem as follows:
where \(t = 1,2, \cdots ,T\).
For residential users, the hourly electricity load is equal to the sum of consumption of each household appliance. According to the using requirements, some household appliances such as daily lighting and refrigerators must always be on, other appliances such as geysers and washing machines are directly affected by the electricity price and require a specific amount of time to complete their work assignments. Like residential users, commercial and industrial users have reasonable electricity consumption requirements in different time slots according to order, production demand or working time. So the electricity requirements and desires of users based on electricity consumption may be different in each time slot, i.e. \(\omega_{x}\), \(\omega_{y}\), and \(\omega_{z}\) are different for each user and time slot. Hence, (12) needs to be independently solved at the beginning of each time slot.
3 Realtime pricing formulation
3.1 Model of KKT conditions
For the purposes of discussion, the objective function and constraints of (12) are expressed as follows:
and
where \(\overline{\varvec{x}} = \left( {x_{1}^{t} ,x_{2}^{t}, {...} ,x_{{N_{1} }}^{t} ,y_{1}^{t} ,y_{2}^{t} , {...} ,y_{{N_{2} }}^{t} ,z_{1}^{t} ,z_{2}^{t} , {...} ,z_{{N_{3} }}^{t} }, {{L}_{t}} \right)^{\text{T}}\). Then (12) is a maximum optimal problem, and can be transformed into the following equivalent minimum optimal problem:
Furthermore, we obtain the following theorems.
Theorem 1
The optimization problem (15) has a unique global optimal solution.
Proof
According to (1)–(3) and (7), the utility function is concave, and the cost function is convex. The objective function \( f(\bar{\varvec{x}})\) in (15) is the algebraic sum of quadratic functions and logarithm functions, so \( f(\bar{\varvec{x}})\) is strictly convex. Let
Set \(D\) is convex. Hence, (15) is a convex optimization problem and a solution must exist.
Suppose both \(\bar{\varvec{x}}_{1}^{ * }\) and \(\bar{\varvec{x}}_{2}^{ * }\) are global optimal solutions to (15), where \(\bar{\varvec{x}}_{1}^{ * } \ne \bar{\varvec{x}}_{2}^{ * }\). The global optimal solution must be in the feasible region, and therefore \(\bar{\varvec{x}}_{1}^{ * } ,\;\bar{\varvec{x}}_{2}^{ * } \in D\) exist. According to the definition of the strictly convex function, for any \(\mu \in (0,1)\) such that
let \(\tilde{\varvec{x}} = \mu \bar{\varvec{x}}_{1}^{ * } + (1  \mu )\bar{\varvec{x}}_{2}^{ * }\). Feasible region \(D\) is a convex set, and therefore these must be \(\tilde{\varvec{x}} \in D\) and \(\tilde{\varvec{x}} \ne \bar{\varvec{x}}_{1}^{ * }\). Hence, \(\tilde{\varvec{x}}\) is a feasible solution. Because \(\bar{\varvec{x}}_{1}^{ * }\) is a global optimal solution, it contradicts \( f(\tilde{\varvec{x}}) <  f(\bar{\varvec{x}}_{1}^{ * } )\). Therefore the assumption that \(\bar{\varvec{x}}_{1}^{ * }\) and \(\bar{\varvec{x}}_{2}^{ * }\) are global optimal solutions is not true. Hence the optimization problem (15) has a unique global optimal solution.
According to the extreme value theorem, if \(\bar{\varvec{x}}^{ * }\) is a local optimal solution to (15), \(\lambda \ge 0\) exists and the KKT conditions can be set up as:
where \(f(\bar{\varvec{x}}^{ * } )\) and \(\varvec{g}(\bar{\varvec{x}}^{ * } )\) are expressed as (13)–(14). In microeconomics, \(\lambda_{i}\)\((i = 1,2,3)\) means the shadow price of electricity, which reflects the value of electricity. We adopt the shadow price as the basic electricity price of smart grids. We can prove that \(\bar{\varvec{x}}^{ * }\) is the global optimal solution to (15). There is a definition about convex function as follows [25].
Definition 1
Suppose that set \(D \subset {\text{R}}^{n}\) is convex, and \(F(\varvec{x})\) is convex in \(D\). If \(F(\varvec{x})\) is differentiable, for any \(\varvec{x},\;\;\varvec{y} \in D\), there exists a following equivalent definition:
Theorem 2
If \(\bar{\varvec{x}}^{ * }\) is a solution of the KKT conditions (16), then \(\bar{\varvec{x}}^{ * }\) is the global optimal solution to (15).
Proof
Since \(\bar{\varvec{x}}^{ * }\) is a solution to (16), \(\bar{\varvec{x}}^{ * }\) satisfies the condition \(\varvec{g}(\bar{\varvec{x}}^{ * } ) \ge {\mathbf{0}}\). Hence, \(\bar{\varvec{x}}^{ * } \in D\), i.e. \(\bar{\varvec{x}}^{ * }\) is a feasible solution to (15).
The objective function \( f(\bar{\varvec{x}})\) in (15) is convex. According to Definition 1, for any feasible solution \(\varvec{y} \in D\) and \(\bar{\varvec{x}}^{ * } \in D\) which satisfies
If \(\bar{{x}}^{ * }\) is a KKT point, it can be proved that \(\overline{{x}}^{ * }\) is a local optimal solution to (15) and satisfies \(g (\overline{{x}}^{ * }) = 0\). Hence, there does not exist a descent direction \(\varvec{p} \in {\text{R}}^{N}\) such that \( \nabla f(\bar{\varvec{x}}^{ * } )^{\text{T}} \varvec{p} < 0\) and \(\varvec{p}^{\text{T}} \nabla g(\bar{\varvec{x}}^{ * } ) > 0\). As for any vector \(\varvec{p} \in {\text{D}}\), we have \( \nabla f(\bar{\varvec{x}}^{ * } )^{\text{T}} \varvec{p} \ge 0\). For \(\overline{{x}}^{ * } \), we have \({(\bar{{x}}^{ * })^{T}} ( \nabla f(\bar{{x}}^{ * } ) )= {(\bar{{x}}^{ * })^{T}} {\sum\limits_{i=1}^{3}{ \lambda_{i}}\nabla {g_{i}} (\bar{{x}}^{ * })} = 0 \). Hence, for any \(\varvec{y} \in D\), there exists \( f(\varvec{y}) \ge  f(\bar{\varvec{x}}^{ * } )\), i.e. \(\bar{\varvec{x}}^{ * }\) is the global optimal solution to (15).
Since (15) is obtained by the conversion of (12), \(\bar{\varvec{x}}^{ * }\) is also the global optimal solution to (12). Thus, we can get the optimal solution of (12) by solving the KKT conditions (16). In particular, researchers often use quadratic functions as utility functions in most simulation experiments. If only the utility function is quadratic, the optimal problem (12) is a quadratic programming problem which is a special form of convex optimization. Hence, the KKT condition can also be established for quadratic programming.
According to the extreme value theorem, each variable of the solution to (16) is optimal, that is, the electricity computation, price, and production are optimal, and the social welfare is the maximum. It is the goal to solve realtime pricing. Therefore, we can adopt the KKT condition (16) as the new realtime pricing model of smart grids based on DR.
3.2 Optimization problem formulation
In (16), \(\varvec{\lambda}^{\text{T}} \varvec{g}(\bar{\varvec{x}}) = 0,\;\lambda_{k} \ge 0,\;g_{k} (\bar{\varvec{x}}) \ge 0\) has a distinct form which requires a different method of solution.
Definition 2
Given a mapping \(\varvec{F}:{\text{R}}^{n} \to {\text{R}}^{n}\), the complementarity problem is to find a vector \(\varvec{x} \in {\text{R}}^{n}\) which satisfies
Recently, the complementarity problem has undergone significant development, resulting in tremendous progress in both theory and methodology [26,27,28]. According to complementarity theory, if (17) is established, each component has the following equivalent definitions:
where \(x_{i} \in \varvec{x}\); \(F_{i} (\varvec{x}) \in \varvec{F}(\varvec{x})\); and \(\left( \cdot \right)_{ + } = \hbox{max} ( \cdot ,0)\).
Obviously, (16) contains a complementarity problem and can be transformed into the following system of equations:
Define \(\varphi (\varvec{\lambda},\varvec{g}(\bar{\varvec{x}})) =\varvec{\lambda} \left( {\varvec{\lambda} \varvec{g}(\bar{\varvec{x}})} \right)_{ + }\). Obviously, (19) is nonsmooth. Both the nonsmooth and smoothing Newton methods are used to solve this system of nonsmooth equations. The nonsmooth Newton method solves this problem by using a Jacobian matrix, whereas the smoothing Newton method approximates the nonsmooth functions by constructing a smooth function with good convergence. Previous research and numerical results show that the smoothing Newton method offers better convergence and more stable numerical results than the nonsmooth method. Therefore, we propose a Jacobian smoothing Newton method to solve the system of nonsmooth equations (19). The Jacobian smoothing method has global and superlinear convergence.
3.3 Smoothing method
Considering a system of nonsmooth equations is:
where \(\varvec{\varPhi}\left( \cdot \right):{\text{R}}^{n} \to {\text{R}}^{n}\) is a nonsmooth function. \(\varvec{\varPhi}_{{\mu_{k} }} \left( \cdot \right):{\text{R}}^{n} \to {\text{R}}^{n}\) is a sequence of smooth functions satisfying the following condition:
The smoothing method is to construct a smooth function \(\varvec{\varPhi}_{{\mu_{k} }} \left( \varvec{x} \right)\) to fit the nonsmooth function \(\varvec{\varPhi}\left( \varvec{x} \right)\). Then the solution of the smooth equations is as follow:
is approximate to the solution of the original problem (20). The quadratic function, density and maximum entropy methods are typically used to construct the smooth function, which must satisfy the following definitions [25,26,27,28].
Definition 3
The function \(\varvec{\varPhi}\left( \varvec{x} \right):{\text{R}}^{n} \to {\text{R}}^{n}\) is nonsmooth. We say that \(\varvec{\varPhi}_{\mu } \left( \varvec{x} \right):{\text{R}}^{n} \to {\text{R}}^{n}\) is a smooth function of \(\varvec{\varPhi}\left( \varvec{x} \right)\) if, for any \(\varvec{x} \in {\text{R}}^{n}\) and \(\mu > 0\), there exists a constant \(\kappa > 0\) which satisfies
According to Definition 3, if function \(\varvec{\varPhi}_{\mu } \left( \varvec{x} \right)\) is a smooth function of \(\varvec{\varPhi}\left( \varvec{x} \right)\), there must exist parameter \(\mu > 0\) satisfying the curves of function \(\varvec{\varPhi}_{\mu } \left( \varvec{x} \right)\) and \(\varvec{\varPhi}\left( \varvec{x} \right)\) almost coincide. Thus, Definition 3 ensures that the solutions of (20) and (22) are similar.
Definition 4
Suppose that \(\varvec{\varPhi}\left( \varvec{x} \right):{\text{R}}^{n} \to {\text{R}}^{n}\) is locally Lipschitzian continuous. \(\varvec{\varPhi}_{\mu } \left( \varvec{x} \right):{\text{R}}^{n} \to {\text{R}}^{n}\) is a smooth function of \(\varvec{\varPhi}\left( \varvec{x} \right)\). If for any \(\varvec{x} \in {\text{R}}^{n}\), such that
We say that the functions \(\varvec{\varPhi}_{\mu } \left( \varvec{x} \right)\) and \(\varvec{\varPhi}\left( \varvec{x} \right)\) satisfy the Jacobian consistency property, where \(\partial_{c}\varvec{\varPhi}\left( \varvec{x} \right)\) is the Csubdifferential.
Definition 4 shows the approximation of the firstorder differential, i.e. the descent directions of function \(\varvec{\varPhi}_{\mu } \left( \varvec{x} \right)\) and \(\varvec{\varPhi}\left( \varvec{x} \right)\) are consistent. For realtime pricing, we will construct a new smooth function satisfying the Jacobian consistency property. First, the functions denoted by the density method are modified as follows:
where \(P\left( {\mu ,\varvec{x}  \varvec{F}(\varvec{x})} \right)\) is a function of (26).
where \(\mu \in (0,1)\) and \(\rho (s)\) are density functions. Obviously, \(\varvec{\varPhi}_{\mu } \left( \varvec{x} \right)\) is a piecewisesmooth function consisting of polynomial functions. Hence, it is easier to solve its subdifferential and the system of equations \(\varvec{\varPhi}_{\mu } (\varvec{x}) = 0\). Next, we prove that \(\varvec{\varPhi}_{\mu } \left( \varvec{x} \right)\) is a smooth function of \(\varvec{\varPhi}(\varvec{x})\) that satisfies the Jacobian consistency property.
Theorem 3
Suppose that \(\varvec{\varPhi}_{\mu } \left( \varvec{x} \right)\) and \(\varvec{\varPhi}(\varvec{x})\) are defined as (25)–(28). Then \(\varvec{\varPhi}_{\mu } \left( \varvec{x} \right)\) is a smooth function that can be used instead of \(\varvec{\varPhi}(\varvec{x})\).
Proof
Let \(\tilde{\varvec{x}} = \varvec{x}  \varvec{F}(\varvec{x})\). First, we prove that for any \(\varvec{x} \in {\text{R}}^{n}\) and \(\mu > 0\), there exists some \(\kappa > 0\) which satisfies
We consider two cases: \(n = 1\) and \(n > 1\).
Case 1: \(n = 1\). We have \(x \in {\text{R}}\) and \(F:{\text{R}} \to {\text{R}}\). According to (25)–(28), if \(\tilde{x}/\mu\) is in \(\left[ {{1 \mathord{\left/ {\vphantom {1 2}} \right. \kern0pt} 2},\;\infty } \right)\), there exists
If \(\bar{x}/\mu\) is in \(\left( {0,{{\;1} \mathord{\left/ {\vphantom {{\;1} 2}} \right. \kern0pt} 2}} \right)\), we have
Let \(\bar{y} = \tilde{x}/\mu\) and \(Y = 4\bar{y}^{3} + 12\bar{y}^{2}  15\bar{y} + 2\).
When \(\tilde{x}/\mu \in \left( {0,{{\;1} \mathord{\left/ {\vphantom {{\;1} 2}} \right. \kern0pt} 2}} \right)\), \(\bar{y} \in \left( {0,{{\;1} \mathord{\left/ {\vphantom {{\;1} 2}} \right. \kern0pt} 2}} \right)\). Obviously, \(Y\) is differentiable, and for any \(\bar{y} \in \left( {0,\;{1 \mathord{\left/ {\vphantom {1 2}} \right. \kern0pt} 2}} \right)\), there exists
According to the extreme value theorem, \(Y\) must decrease. Calculate the two endpoint function values as \(Y\left {_{{\bar{y} = 0}} } \right. = 2\) and \(Y\left {_{{\bar{y} = {1 \mathord{\left/ {\vphantom {1 2}} \right. \kern0pt} 2}}} } \right. =  2\). Thus, \(Y \in \left( {  2,2} \right)\) when \(\bar{y} \in \left( {0,\;{1 \mathord{\left/ {\vphantom {1 2}} \right. \kern0pt} 2}} \right)\). Furthermore, for \(\tilde{x}/\mu \in \left( {0,{{\;1} \mathord{\left/ {\vphantom {{\;1} 2}} \right. \kern0pt} 2}} \right)\), we have
At point \(\tilde{x}/\mu \in \left( {  {1 \mathord{\left/ {\vphantom {1 2}} \right. \kern0pt} 2},\;0} \right]\), the proof is similar to that of \(\tilde{x}/\mu \in \left( {0,\;{1 \mathord{\left/ {\vphantom {1 2}} \right. \kern0pt} 2}} \right)\). For \(\tilde{x}/\mu \in \left( {  {1 \mathord{\left/ {\vphantom {1 2}} \right. \kern0pt} 2},\;0} \right]\), we can write
If \(\tilde{x}/\mu\) is in \(\left( {  \infty ,\;  {1 \mathord{\left/ {\vphantom {1 2}} \right. \kern0pt} 2}} \right]\),
If we choose \(\kappa = {1 \mathord{\left/ {\vphantom {1 4}} \right. \kern0pt} 4}\), for any \(x \in {\text{R}}\) and \(\mu > 0\), there must exist \(\left {\varPhi_{\mu } \left( x \right)  \varPhi \left( x \right)} \right \le \kappa \mu\). Hence, \(\varPhi_{\mu } (x)\) is a smooth function of \(\varPhi (x)\).
Case 2: \(n > 1\). As in case 1, we choose \(\kappa = {1 \mathord{\left/ {\vphantom {1 4}} \right. \kern0pt} 4}\). Then, for any \(\varvec{x} \in {\text{R}}^{n}\) and \(\mu > 0\), we have
We choose \(\bar{\kappa } = \sqrt n \kappa\). Then, \(\left\ {\varvec{\varPhi}_{\mu } (\varvec{x}) \varvec{\varPhi}(\varvec{x})} \right\ \le \bar{\kappa }\mu\) for any \(\varvec{x} \in {\text{R}}^{n}\) and \(\mu > 0\). Hence, according to Definition 3, \(\varvec{\varPhi}_{\mu } (\varvec{x})\) is a smooth function of \(\varvec{\varPhi}(\varvec{x})\), as shown in Fig. 2.
Theorem 4
Suppose that \(\varvec{\varPhi}_{\mu } (\varvec{x})\) and \(\varvec{\varPhi}(\varvec{x})\) are expressed as in (25)–(28). Then, the function \(\varvec{\varPhi}_{\mu } (\varvec{x})\) and \(\varvec{\varPhi}(\varvec{x})\) satisfy the Jacobian consistency property.
Proof
As \(P(\mu ,x) = x\int_{  \infty }^{{{x \mathord{\left/ {\vphantom {x \mu }} \right. \kern0pt} \mu }}} {\rho (s){\text{d}}s}  \mu \int_{  \infty }^{{{x \mathord{\left/ {\vphantom {x \mu }} \right. \kern0pt} \mu }}} {s\rho (s){\text{d}}s}\) is differentiable, its derivative is
\(\rho \left( s \right)\) is a density function, so \(\rho \left( s \right)\) is differentiable and satisfies
Hence, \(P\left( {\mu ,x} \right)\) is continuously differentiable, and there exists \(P^{\prime}(\mu ,x) \in [0,1]\), and
Let \(\tilde{\varvec{x}} = \varvec{x}  \varvec{F}(\varvec{x})\), we can obtain the differential as such \(\varvec{\varPhi^{\prime}}_{\mu } \left( \varvec{x} \right) = (a_{ij} )_{n \times n}\) where
where \(i,j = 1,2, \cdots ,n\).
Denote \(\varvec{D}_{\mu } (\tilde{\varvec{x}}) = {\text{diag}}(\varvec{P^{\prime}}_{x} (\mu ,\tilde{\varvec{x}}))\), then
Because \(\partial_{c}\varvec{\varPhi}\left( \varvec{x} \right) = \partial\varvec{\varPhi}_{1} \left( \varvec{x} \right) \times \cdots \times \partial\varvec{\varPhi}_{n} \left( \varvec{x} \right) = (a_{ij} )_{n \times n}\), where
where \(i,j = 1,2, \cdots ,n\); \(v_{i} \in \left[ {0,\;1} \right]\). Therefore, \(\partial_{c}\varvec{\varPhi}\left( \varvec{x} \right)\) can be marked as:
where \(\varvec{D}(\tilde{\varvec{x}}) = {\text{diag}}(\varvec{v})\), and \(\varvec{v} \in {\text{R}}^{n}\) satisfies
Hence, we have
According to Theorem 4 , \(\varvec{\varPhi}_{\mu } (\varvec{x})\) and \(\varvec{\varPhi}(\varvec{x})\) satisfy the Jacobian consistency property.
Definitions 3 and 4 show that if \(\mu > 0\) is small enough, the curves of function \(\varvec{\varPhi}_{\mu } (\varvec{x})\) and \(\varvec{\varPhi}(\varvec{x})\) almost coincide, and the gradient of \(\varvec{\varPhi}_{\mu } (\varvec{x})\) approximates the subdifferential of \(\varvec{\varPhi}(\varvec{x})\). The characteristic of approaching the gradient ensures that the descent directions of the smooth and nonsmooth functions are consistent. Hence, we can select the function \(\varvec{\varphi }_{\mu } (\bar{\varvec{x}}) =\varvec{\lambda} \varvec{P}\left( {\mu ,\varvec{\lambda} \varvec{g}(\bar{\varvec{x}})} \right)\) and substitute nonsmooth function \(\varvec{\varphi }(\bar{\varvec{x}}) =\varvec{\lambda} \left( {\varvec{\lambda} \varvec{g}(\bar{\varvec{x}})} \right)_{ + }\) in (19).
3.4 Jacobian smoothing Newton method
The Jacobian smoothing Newton method uses the Jacobian smooth function to approximate and replace the nonsmooth function. Equation (19) is a partial complementarity problem, but it can be solved using the Jacobian smoothing Newton method because smooth functions satisfy Theorems 3 and 4 . Therefore, we define a system of nonsmooth equations as follows:
a system of smooth equations:
The nonsmooth (39) can be solved using the smooth version in (40). Let
where \(f(\bar{\varvec{x}})\) and \(\varvec{g}(\bar{\varvec{x}})\) are expressed as (13)–(14), and \(\varvec{P}\left( {\mu ,\varvec{\lambda} \varvec{g}(\bar{\varvec{x}})} \right)\) is expressed as (25)–(28). For the purposes of discussion, we express the variables as \(\varvec{Z} = (\mu ,\bar{\varvec{x}},\varvec{\lambda})\) and \(\varvec{X} = (\bar{\varvec{x}},\varvec{\lambda})\). The process of solving the realtime pricing based on (40) is as follows.

1)
For electricity provider

Step 1: If \(t \in {\mathcal{T}}\), choose the parameters based on historical data, and then compute the electricity price and production by (40) in the beginning of pricing time; else update the information of user demand.

Step 2: Send the electricity price and production information to the users.

Step 3: Update the information of users demand. If the demand is greater than a predetermined threshold, Update the electricity generation capacity by (45)–(47) and compute the price by formula (40).

Step 4: Repeat the step 2 until the pricing time end or the supply and demand are in balance.


2)
For each user

Step 1: Update the price and production information from provider.

Step 2: Determine the electricity usage based on the price and production given by provider.

Step 3: Send the electricity demand to the provider.

Step 4: Repeat the step 1 until the pricing time end or the supply and demand are in balance.

The update formula for electricity generation capacity is as follows:
where \(\zeta_{i} \in \left( {0,1} \right)\;\left( {i = 1,2,3} \right)\) is a step length factor. If only demands of some types exceed the threshold, the electricity generation capacities of these types are updated and the value of variables associated with other type’s users do not change.
The step of solving the equations as (40) is as follows.

Step 1: Choose the parameters.

Step 2: Determine the direction of iteration \(\Delta \varvec{z}^{k}\) and step length factor \(\rho\) by formulas as follows:
$$\varvec{H^{\prime}(Z}^{k} )\Delta \varvec{Z}^{k} \varvec{ =  H(Z}^{k} )$$(51)$$f(\varvec{Z}^{k} + \rho \Delta \varvec{Z}^{k} ) \le (1  2\sigma \rho )f(\varvec{Z}^{k} )$$(52)
Let \(\varvec{Z}^{k + 1} = \varvec{Z}^{k} + \rho \Delta \varvec{Z}^{k}\). If (51) or (52) has no solution, determine the direction of iteration and step length factor by formulas as follows:
Let \(\varvec{X}^{k + 1} = \varvec{X}^{k} + \rho \Delta \varvec{X}^{k}\) and \(\varvec{Z}^{k + 1} = (\mu^{k} ,\varvec{X}^{k} )\). Repeat the step 2 until the end condition is satisfied.
4 Numerical simulations
Numerical simulations are conducted to evaluate the performance of the proposed method. The simulation assumptions and parameters are as follows. We consider 20 residential customers, two commercial customers, and one industrial customer. The random variable \(\omega_{x}\) has the range \([0,2]\). Both \(\omega_{y}\) and \(\omega_{z}\) are also in \([0,2]\). Let \(\alpha = 0.5\), \(\beta = 10\), and \(\gamma = 25\). The cost parameters are set as \(a_{t} = 0.01\) and \(b_{t} = c_{t} = 0\).
To demonstrate the effectiveness of the proposed method, the simulation results are compared with those from a single realtime pricing model and a distributed algorithm based on the dual method.
4.1 Multiprice and singleprice algorithms based on complementarity problem
In the multiprice algorithm, users are divided into residential, commercial and industrial groups, each of which is assigned a different electricity price. In the singleprice algorithm, all users form a single group, and the electricity is supplied at one price.
The prices in the multiprice algorithm are lower than in the singleprice algorithm as shown in Fig. 3. In the multiprice case, the industrial price is the lowest and the residential price is the highest. The low price reduces the average consumption cost, which brings more practical benefits to users. For industrial users, in particular, the cost of production can be greatly reduced. Furthermore, the multiprice algorithm considers the condition and characteristic of different user types, so it is more reasonable than the singleprice algorithm.
For residential users, the total electricity production and consumption results are shown in Fig. 4. Most of the electricity consumption is concentrated around 25–30 kWh. The greatest residential consumption occurs at 20:00, with the lowest at 00:00. There are three peaks, at 06:00, 13:00, and 20:00. The consumption increases over the period 00:00–06:00, and the price also increases. The lowest price occurs at 00:00, and the highest price occurs at 06:00. This suggests that the lowest price prevents power consumption from decreasing, while the highest price prevents electricity consumption from increasing. At higher prices, users can shift their electricity consumption from peak to offpeak periods to reduce the pressure on utilityhandled equipment. This ensures that there are no “shocks” to the electricity consumption at particular times. The price and consumption patterns around the other peaks exhibit similar behavior. Obviously, this reflects the consumption is related to the price, and the model is reasonable.
The results in Fig. 5 indicate that the electricity price and consumption of commercial users are stable. Electricity consumption is largely concentrated around 26–30 kWh, with the electricity price concentrated around ¥ 0.5–0.6. In Fig. 5, when the electricity consumption decreases, the price becomes lower to encourage electricity consumption. Consumption is observed to increase over the next hour, such as at 02:00, 09:00, and 20:00.
In Fig. 6, the results indicate that the electricity price and consumption of industrial users are also stable. Electricity consumption is concentrated around 24–27 kWh, with prices generally at ¥ 0.45–0.48. Stable realtime pricing is useful in ensuring the stability of electricity production because drastic changes in production can be harmful to equipment and work arrangements, potentially leading to huge losses. Thus, maintaining stable production is important for industrial users and the electricity provider.
According to Figs. 4, 5 and 6, the total actual electricity consumption of the three groups of users is very similar. However, the number of users in each group is different, with twenty residential users, two commercial users, and one industrial user. This means that the individual consumption of industrial users is the highest and that of residential users is the lowest.
Figures 7 and 8 present a comparison of the multiprice and singleprice algorithms. Although the prices in the multiprice algorithm are lower than the singleprice, the electricity consumption and social welfare are clearly higher than those in the singleprice case. Thus, the multiprice method based on the complementarity problem plays a role in enhancing satisfaction with electricity consumption. The low average cost and high welfare are beneficial to encouraging users to take part in DR programs offered by smart grids.
In Fig. 9, the results indicate that the proposed multiprice method achieves good convergence and is effective. The price is close to the optimal price after 10 iterations. Thus, the proposed method is fast.
4.2 Multiprice algorithm based on the complementarity problem and distributed algorithm based on the dual method
In the dual optimal method [23, 24], the social welfare maximization model is translated into suboptimization problems as follows:
The iterative formula for the distributed algorithm is as follows:
where the three types of users do not interact each other, and their prices are computed separately.
The price given by the distributed algorithm is shown in Fig. 10, and the electricity consumption is presented in Fig. 11.
The price and consumption vary considerably across the different groups of users as shown in Figs. 10 and 11. The industrial price is mainly between ¥ 0.65–0.7, the commercial price is generally ¥ 0.5–0.6, and the residential price varies from ¥ 0.08–0.1. Clearly, the industrial and commercial prices are similar, and the residential price is the lowest. In response to these prices, industrial and commercial consumption is also similar at 30–35 kWh, but the residential consumption is between 45–60 kWh as shown in Fig. 11. The residential price is too low, resulting in a sharp increase in consumption. For the multiprice complementarity algorithm, the price for all three groups is between ¥ 0.4–0.6 as shown in Fig. 3, and consumption is mainly 24–30 kWh as shown in Fig. 12. This indicates that our proposed algorithm reduces the price gaps to give a balanced structure and promotes an increase in electricity consumption that prevents excessive user cost, thus balancing the consumption profile as well.
In the distributed algorithm, each user is an independent individual who does not interact with others, so the maximum social welfare is the sum of the optimal individual welfares. However, there are always certain influences between individuals in social activities. In the pricing model based on the complementarity method, every type of users interacts with each other in the process of realtime pricing, and the maximum social welfare is an integral, rather than the sum of optimal individual welfares. The numerical results show that the social welfare of the complementarity algorithm is higher than that of the distributed algorithm, as shown in Fig. 13. Obviously, the pricing model based on the complementarity algorithm is more reasonable.
5 Conclusion
The complementarity model is described to solve the realtime pricing problem for smart grids. The proposed model is based on KKT conditions of the social welfare maximization problem, which computes the optimal electricity consumption for users, price and production for the electricity provider at the beginning of each time slot according to the electricity equipment information entered by users, and production and cost information provided by power companies. We consider three types of users in our model, which avoids the problem of a single utility function. Numerical results show that the proposed algorithm balances electricity supply and demand, improves social welfare, and encourages users to actively participate in the DR program. Users can use more electricity appliances during periods of low prices and turn off anything that is not required at all time during periods of high price, which is beneficial to peak cutting and valley filling. In addition, the simulations reported in this paper are on a small scale, but the advantages of peak cutting and valley filling are very significant. Hence, when the model includes larger numbers of users, the advantages will be even greater.
The method provides a new basic theory for more studies on realtime pricing. In the future, we will further study this issue from two aspects. Firstly, we will try to improve the model. Since the proposed model is simple and contains a few limitations, we will be committed to study a model with more constraints such as rewards for power consumption, energy scheduling of home appliances and the effects of weather on power distribution systems. Secondly, we will study the decentralized pricing method based on the complementarity problem.
References
Yu YX, Luan WP (2009) Smart grid. Power Syst Clean Energy 127(9):251–253
Fang X, Misra S, Xue G et al (2012) Smart gridthe new and improved power grid: a survey. IEEE Commun Surv Tutor 14(4):944–980
Shafiekhah M, Kheradmand M, Javadi S et al (2016) Optimal behavior of responsive residential demand considering hybrid phase change materials. Appl Energy 163:81–92
Gellings CW (2017) Evolving practice of demandside management. J Modern Power Syst Clean Energy 5(1):1–9
Khodaei A, Shahidehpour M, Bahramirad S (2011) SCUC with hourly demand response considering intertemporal load characteristics. IEEE Trans Smart Grid 2(3):564–571
Samadi P, MohsenianRad H, Schober R et al (2012) Advanced demand side management for the future smart grid using mechanism design. IEEE Trans Smart Grid 3(3):1170–1180
Shahab B, Hadi A, Miadreza SK et al (2018) A decentralized electricity market scheme enabling demand response deployment. IEEE Trans Power Syst 33(4):4219–4227
Shao S, Pipattanasomporn M, Rahman S (2011) Demand response as a load shaping tool in an intelligent grid with electric vehicles. IEEE Trans Smart Grid 2(4):624–631
Soares J, Ghazvini MAF, Vale Z et al (2016) A multiobjective model for the dayahead energy resource scheduling of a smart grid with high penetration of sensitive loads. Appl Energy 162:1074–1088
Deng R, Yang Z, Chow MY et al (2015) A survey on demand response in smart grids: mathematical models and approaches. IEEE Trans Ind Inform 11(3):570–582
Parvania M, FotuhiFiruzabad M (2010) Demand response scheduling by stochastic SCUC. IEEE Trans Smart Grid 1(1):89–98
Chai B, Chen J, Yang Z et al (2014) Demand response management with multiple utility companies: a twolevel game approach. IEEE Trans Smart Grid 5(2):722–731
Deng R, Yang ZY, Hou F et al (2015) Distributed realtime demand response in multiseller–multibuyer smart distribution grid. IEEE Trans Power Syst 30(5):2364–2374
Haider HT, See OH, Elmenreich W (2016) Residential demand response scheme based on adaptive consumption level pricing. Energy 113:301–308
Dai YM, Gao Y, Gao HY et al (2017) Realtime pricing scheme based on Stackelberg game in smart grid with multiple power retailers. Neurocomputing 280:149–156
Juan MRF, Manuel BP, Jesus MRS et al (2017) The voluntary price for the small consumer: realtime pricing in Spain. Energy Policy 102:41–51
Asadi G, Gitizadeh M, Roosta A (2013) Welfare maximization under realtime pricing in smart grid using PSO algorithm. In: Proceedings of 21st Iranian conference on electrical engineering (ICEE), Mashhad, Iran, 14–16 May 2013, pp 1–7
Khan AR, Mahmood A, Safdar A et al (2016) Load forecasting, dynamic pricing and DSM in smart grid: a review. Renew Sustain Energy Rev 54:1311–1322
MohsenianRad A, LeonGarcia A (2010) Optimal residential load control with price prediction in realtime electricity pricing environments. IEEE Trans Smart Grid 1(2):120–133
Bitar E, Xu Y (2017) Deadline differentiated pricing of deferrable electric loads. IEEE Trans Smart Grid 8(1):13–25
Zhu HB, Gao Y, Hou Y et al (2018) Multitime slots realtime pricing strategy with power fluctuation caused by operating continuity of smart home appliances. Eng Appl Artif Intell 71(C):166–174
Song X, Qu J (2015) An improved realtime pricing algorithm based on utility maximization for smart grid. In: Proceeding of the 11^{th} world congress on intelligent control and automation, Shenyang, China, 29 June–4 July 2014, pp 2509–2513
Wang Y, Mao S, Nelms RM (2014) Distributed online algorithm for optimal realtime energy distribution in the smart grid. IEEE Internet Things J 1(1):70–80
Samadi P, MohsenianRad AH, Schober R et al (2010) Optimal realtime pricing algorithm based on utility maximization for smart grid. In: Proceedings of the first IEEE international conference on smart grid, Gaithersburg, USA, 4–6 October 2010, pp 415–420
Bai J, Li J, Xu F et al (2018) Generalized symmetric ADMM for separable convex optimization. Comput Optim Appl 70(1):129–170
Pang JS (1995) Complementarity problem. Kiuwer Academic Publishers, Boston
Chen X, Qi L, Sun D (1998) Global and superlinear convergence of the smoothing newton method and its application to general box constrained variational inequalities. Math Comput 67(222):519–541
Han JY, Xiu NH, Qi HZ (2006) Nonlinear complementarity theory and algorithm. Shanghai Science and Technology Publishers, Shanghai
Acknowledgements
The authors would like to express their appreciation to the editors and reviewers for helping to improve the quality of the manuscript during the peer review process. The work was supported in part by the National Natural Science Foundation of China (No. 11171221) and the Shared University research (SUR: 2015021).
Author information
Authors and Affiliations
Corresponding author
Additional information
CrossCheck date: 13 December 2018
Rights and permissions
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
About this article
Cite this article
WANG, H., GAO, Y. Realtime pricing method for smart grids based on complementarity problem. J. Mod. Power Syst. Clean Energy 7, 1280–1293 (2019). https://doi.org/10.1007/s4056501905087
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s4056501905087