# Calculation Method for Electricity Price and Rebate Level in Demand Response Programs
## 2 Formulation of Power Supply-Demand-Balancing Operation under SWM  
SWM is formulated as a problem to maximize the weighted sum of utility functions in a society without regarding to how the profit is distributed in each member of the society [22; 23; 24]. Since the members of the society are classified into power suppliers (or power producers, etc.) and consumers, the social welfare function is written as:  
\[SW=\sum\
olimits_{t=1}^{T}\!SW_{t}=\sum\
olimits_{t=1}^{T}\left(\sum\
olimits_{ i=1}^{NS}\!U_{1,t}(s_{i,t})+\alpha\sum\
olimits_{j=1}^{NC}\!U_{2,t}\!\left(d_{j,t} \right)\right), \tag{1}\]  
where \(t\) is the time slot (\(t=1,\cdots,T\)); \(i\) is the number assigned to the power suppliers (\(i=1,\cdots,NS\)); \(s_{i,t}\) is the electric power fed from power supplier \(i\) and an element of vector \(s_{i}\); \(U_{1,t}(\cdot)\) is the utility function of the power suppliers; \(j\) is the number assigned to the consumers (\(j=1,\cdots,NC\)); \(d_{j,t}\) is the power consumption in the consumer \(j\) and an element of vector \(d_{i}\); \(U_{2,t}(\cdot)\) is the utility function of the consumers; \(\alpha\) is the weighting coefficient. In the design of DRs, we can regard the power suppliers and the consumers as aggregated ones. Besides, the coefficient \(\alpha\) in Equation (1) equals to 1, if we align the units of the utility functions, e.g., into the price. The suppliers' utility is expressed with the sum of the income by selling electricity and the operational costs in the power supply, while the consumers' utility is described with the sum of the satisfaction obtained in exchange for consuming electricity and the electricity costs [6; 25]. Their utility functions are represented as:  
\[U_{1,t}(s_{t}) =p_{t}s_{t}-E_{t}(s_{t}),\text{ for }\forall t, \tag{2}\] \[U_{2,t}(d_{t}) =F_{t}(d_{t})-p_{t}d_{t},\text{ for }\forall t, \tag{3}\]where \(p_{t}\) is the standard price of electric power; \(E_{t}(\cdot)\) is the operational cost of the power suppliers; \(F_{t}(\cdot)\) is the satisfaction of the power consumers. Since \(p_{t}s_{t}\), \(p_{t}d_{t}\), and \(E_{t}(s_{t})\) are expressed with the price, all units in Equation (1) were unified when we evaluated \(F_{t}(d_{t})\) in Equation (3) by the price. In this case, the SWM problem can be formulated as:  
\[\underset{s,\ d}{\max}SW, \tag{4}\] \[SW_{t}=F_{t}(d_{t})-E_{t}(s_{t})+p_{t}(s_{t}-d_{t}),\ \text{for}\ \forall t,\] (5) \[\text{s.t.}\ s_{t}=d_{t},\ \text{for}\ \forall t,\] (6) \[G^{\min}\leq s_{t}\leq G^{\max},\ \text{for}\ \forall t, \tag{7}\]  
where \(G^{\max}\) and \(G^{\min}\) are the maximum and the minimum values of the power supply, respectively. Equation (6) shows the balance of the power supply and demand, and the constraint Equation (7) restricts the controllability of the power supply, depending on specifications of the target power grid, e.g., the maximum and the minimum outputs of power generation units. Hence, the optimal solution of the formulated SWM problem represents the power supply-demand operation that maximizes the social welfare. If Equation (5) is a convex function, we can apply Lagrange relaxation [6; 26; 27], and Lagrange multipliers correspond to shadow prices. Lagrangian function and Karush-Kuhn-Tucker conditions are represented as:  
\[\mathcal{L}_{t}(s_{t},d_{t},\ \lambda_{t},\ \mu_{1,t},\mu_{2,t})=SW_{t}+ \lambda_{t}(s_{t}-d_{t})+\mu_{1,t}\Big{(}s_{t}-G^{\min}\Big{)}+\mu_{2,t}(G^{ \max}-s_{t}), \tag{8}\] \[\left\{ \begin{array}{l}-\frac{\partial U_{1,t}(s_{t})}{ \partial s_{t}}+\lambda_{t}+\varepsilon_{t}-\mu_{t}=0\\ \frac{\partial U_{2,t}(d_{t})}{\partial d_{t}}-\lambda_{t}=0\end{array} \right., \tag{9}\]  
where \(\lambda_{t}\), \(\mu_{1,t}\), and \(\mu_{2,t}\) are the Lagrange multipliers. The authors assumed simple utility functions in the numerical simulations of this paper, and thus, we can solve the target problem based on the Newton-Raphson method. Otherwise, any of other techniques, e.g., intelligent optimization algorithms, will be useful for solving SWM problems.