# A Convex Optimization Algorithm for Electricity Pricing of Charging Stations
## 2 The Model of Electricity Pricing of Charging Stations
In the charging pricing problem of CSs, the objective function of CSs is shown in Equation (3) and the constraints are shown in Equation (4), including price boundary constraints and average price equality constraints in order to ensure the fairness of the market when the competition between CSs is neglected [19]. The variables in this problem are \(\left\{\pi_{c,t},P_{c,t}^{i},p_{c,t}^{n},P_{b,t}\right\}\) and the purpose of this problem is to maximize the revenue of the CSs [18]. \[\max\limits_{n_{c,t}}f_{CSs}=\sum\limits_{t\in T}\pi_{c,t}\sum\limits_{i\in I }P_{c,t}^{i}-\sum\limits_{t\in T}\pi_{b,t}P_{b,t}, \tag{3}\]  
Figure 1: The relationship among distribution network operators (DSO), charging stations (CSs), and electric vehicles (EVs). \[ \begin{array}{ll}\text{s.t}&P_{b,t}=\sum\limits_{i\in I}p_{c,t}^{i},\forall t \in T\\ &P_{c,t}^{i}=\sum\limits_{n\in N(i)}p_{c,t}^{n},\forall t\in T,\forall i\in I\\ &\pi\leq\pi_{c,t}\leq\overline{\pi}_{c},\forall t\in T\\ &\frac{1}{t}\sum\limits_{t\in T}\pi_{c,t}=\overline{\pi}_{c}\end{array}  \tag{4}\]  
where \(f_{CSs}\) is the income of CSs; \(\pi_{c,t}\) is the charging price at period \(t\); \(\pi_{b,t}\) is the price of electricity purchase \(P_{b,t}\) at period \(t\); \(N\) is the set of electric vehicle users; \(p_{c,t}^{n}\) is the charging power of EV\({}_{n}\) at period \(t\); \(\overline{\pi}_{c}\) and \(\pi_{t}\) are the boundary of charging price; \(\overline{\pi}_{c}\) is the average charging price. In charging mode optimization problem of EVs, the objective function of EVs is shown in Equation (5) and the constraints are shown in Equation (6), including power demand equation constraints, maximum charging power constraints, and available charging time constraints. The variables in this problem are \(\left\{p_{c,t}^{n}\right\}\) and the purpose of this problem is to minimize the charging cost of EVs [18]. \[\min\limits_{p_{c,t}^{n}}f_{\text{EV},n}=\sum\limits_{t\in T}p_{c,t}^{n}\pi_{ c,t},\forall n\in N, \tag{5}\]  
\[ \begin{array}{ll}\text{s.t}&\sum\limits_{t\in T}p_{c,t}^{n}=E_{\text{ev}}^{n },\forall n\in N\\ &0\leq p_{c,t}^{n}\leq\overline{p}_{c},\forall t\in T,\forall n\in N\\ &p_{c,t}^{n}=0,\forall t\
otin T_{\text{e}}(n),\forall n\in N\end{array}  \tag{6}\]  
where \(f_{\text{EV},n}\) is the charging cost of EV\({}_{n}\); \(E_{\text{ev}}^{n}\) is the power demand of EV\({}_{n}\); \(\overline{p}_{c}\) is the maximum charging power; \(T_{\text{e}}(n)\) is the set of rechargeable time of EV\({}_{n}\). From the above formulas, there are three objective functions in the electricity pricing problem and there are correlations among variables, what lead to the complexity of the model. Hence a series of equivalent transformations must be applied to the model. According to the [PERSON] leadership game model, the game between CSs and EVs can be regarded as a bilevel optimization problem [20], and the subproblems can be expressed as Equation (7). \[p_{c,t}^{n}=\text{argmin}\sum\limits_{t\in T}p_{c,t}^{n}\pi_{c,t}. \tag{7}\]  
In order to obtain the optimal solution of the problem, the Lagrange function is shown in Equation (8). \[L_{n}=\sum\limits_{t\in T}p_{c,t}^{n}\pi_{c,t}-\lambda^{n}(\sum\limits_{t\in T }p_{c,t}^{n}-E_{\text{ev}}^{n})-\sum\limits_{t\in T}\mu_{\text{lb},t}^{n}p_{ c,t}^{n}-\sum\limits_{t\in T}\mu_{\text{ub},t}^{n}(p_{c,t}^{n}-\overline{p}_{c})- \sum\limits_{t\in T}\mu_{\text{a},t}^{n}p_{c,t}^{n},\forall n\in N, \tag{8}\]  
where, \(L_{n}\) is the Lagrange function of Equations (5) and (6); \(\lambda^{n}\) is the dual variable of power demand equation constraints; \(\mu_{\text{lb},t}^{n}\) and \(\mu_{\text{ub},t}^{n}\) are dual variables of maximum charging power constraints; \(\mu_{\text{a},t}^{n}\) is the dual variable of available charging time constraints. According to the linear duality theory [21], the dual expression of Equation (5) is shown in Equation (9). At the same time, the optimum condition is Equation (10).