# A Convex Optimization Algorithm for Electricity Pricing of Charging Stations
## 2 The Model of Electricity Pricing of Charging Stations  
The benefits of DSO and EVs should be taken into account when CSs set electricity prices. The relationship among DSO, CSs, and EVs is shown in Figure 1. Usually, optimizing the power plan of CSs can not only improve its own revenue, but also reduce the peak-valley difference of the distribution network. DSO and CSs can achieve a win-win situation, which constitutes a cooperative relationship [11]. In order to adjust the load curve, DSO guides CSs through marginal price to formulate an appropriate power plan. Charging fee is a cost for EVs but a revenue for CSs. Therefore, there is a conflict of benefits between EVs and CSs, which can be considered as a non-cooperative game relationship [16; 17]. A more accurate description should be the Stackelberg game between EVs and CSs because there is a sequence of decisions between the two sides [18]. After charging station operators set charging service price, electric vehicle users decide charging mode according to the price. The goal of EVs is to reduce charging cost and thus EVs will charge when the charging price is low. When CSs formulate the power plan, guiding EVs to charge orderly by setting an appropriate charging price is necessary, and the revenue of CSs should also be maximized. The electricity pricing problem of charging stations is a classical problem in power systems [2; 3; 4; 5; 6; 7; 8; 9; 10; 11], which can be decomposed into the security checking problem of DSO, charging pricing problem of CSs, and charging mode optimization problem of EVs. In the security checking problem of DSO, the objective function of DSO is shown in Equation (1) and the constraints are shown in Equation (2), including power demand equation constraints, bus power balance constraints, bus voltage safety constraints, and line power transmission capacity constraints. The variables in this problem are \(\left\{P_{G,t},P_{c,t}^{i},V_{i,t},\theta_{ij,t}\right\}\) and the purpose of this problem is to ensure the security of the power system [11]. \[\min\limits_{P_{c,t}^{i}}f_{DSO}=\|P_{G,t}-\overline{P}_{G}\|_{2}, \tag{1}\]  
\[ \begin{array}{ll}\text{s.t}&P_{G,t}=\sum\limits_{i\in I}\left(P_{L,t}^{i}+P_ {c,t}^{i}\right)+\sum\limits_{i\in L}G_{ij}(V_{i,t}^{2}+V_{j,t}^{2}-2V_{i,t}V_ {j,t}\cos\theta_{ij,t}),\forall t\in T\\ &\overline{P}_{G}=\frac{1}{\gamma}\sum\limits_{i\in I}P_{G,t}\\ &P_{L,t}^{i}+P_{c,t}^{i}=G_{ij}V_{i,t}^{2}-V_{i,t}V_{j,t}(G_{ij}\cos\theta_{ ij,t}+B_{ij}\sin\theta_{ij,t}),\forall t\in T,\forall i\in I\\ &Q_{L,t}^{i}=-B_{ij}V_{i,t}^{2}+V_{i,t}V_{j,t}(B_{ij}\cos\theta_{ij,t}-G_{ij} \sin\theta_{ij,t}),\forall t\in T,\forall i\in I\\ &V\leq V_{i,t}\leq\overline{V},\forall t\in T,\forall i\in I\\ &(G_{ij}^{2}+B_{ij}^{2})(V_{i,t}^{2}+V_{j,t}^{2}-2V_{i,t}V_{j,t}\cos\theta_{ ij,t}+2V_{i,t}V_{j,t}\sin\theta_{ij,t})\leq\overline{I}_{ij}^{2},\forall t\in T,\forall ij\in L\end{array}  \tag{2}\]  
where \(f_{DSO}\) is the deviation of load in distribution network; \(P_{G,t}\) is the total active power of DSO in period \(t\); \(\overline{P}_{G}\) is the average active power of DSO; \(P_{L,t}^{i}\) is the basic active power at bus \(i\) in period \(t\); \(Q_{L,t}^{i}\) is the basic reactive power at bus \(i\) in period \(t\); \(P_{c,t}^{i}\) is the charging power at bus \(i\) in period \(t\); \(G_{ij}\) is the conductance of line \(ij\); Line \(ij\) stands for transmission line from bus \(i\) to bus \(j\); \(V_{i,t}\) is the voltage at bus \(i\) in period \(t\); \(\theta_{ij,t}\) is the power angle difference of line \(ij\) in period \(t\); \(T\) is the set of dispatching time; \(B_{ij}\) is the susceptance of line \(ij\); \(I\) is the bus set of distribution network; \(L\) is the set of transmission lines of distribution network; \(\overline{V}\) and \(V\) are the boundary of voltage.