# A Convex Optimization Algorithm for Electricity Pricing of Charging Stations
## 3 Convex Optimization Algorithm
### SOCR Method  
In [22], a method of equality transformation is proposed to promotion dimension of model like Equation (13). \[ \begin{array}{l}R_{ij,t}=V_{i,t}V_{j,t}\cos\theta_{ij,t},\forall t\in T, \forall ij\in L\\ S_{ij,t}=V_{i,t}V_{j,t}\sin\theta_{ij,t},\forall t\in T,\forall ij\in L\\ W_{i,t}=V_{i,t}^{2},\forall t\in T,\forall i\in I\\ R_{ij,t}^{2}+S_{ij,t}^{2}=W_{i,t}W_{j,t},\forall t\in T,\forall ij\in L\end{array}  \tag{13}\]  
where \(R_{ij,t},S_{ij,t},W_{i,t}\) are temporary variables in order to replace the original variables, which have no practical physical significance. After this transformation, decision variables have become \(\left\{P_{G,t},P_{c,t}^{i},W_{i,t},R_{ij,t},S_{ij,t}\right\}\) in the security checking problem of DSO. Additionally, Equation (2) becomes a linear form like Equation (14). In this process, variables are projected into a higher dimensional space. In order to ensure the accuracy of the original problem, a new set of equality constraints need to be added as Equation (13), which constitutes a set of rotating conical spaces. In order to transform the model into convex optimization form, Equation (15) is applied to relax the feasible region to some second order cones. \[ \begin{array}{l}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}(W_{i,t}+W_{j,t}-2R_{ij,t}),\forall t\in T\\ P_{L,t}^{i}+P_{c,t}^{i}=G_{ij}W_{i,t}-(G_{ij}R_{ij,t}+B_{ij}S_{ij,t}),\forall t \in T,\forall i\in I\\ Q_{L,t}^{i}=-B_{ij}W_{i,t}+(B_{ij}R_{ij,t}-G_{ij}S_{ij,t}),\forall t\in T, \forall i\in I\\ V^{2}\leq W_{i,t}\leq\sqrt{{}^{2}},\forall t\in T,\forall i\in I\\ (G_{ij}^{2}+B_{ij}^{2})(W_{i,t}+W_{j,t}-2R_{ij,t}+2S_{ij,t})\leq\overline{I}_{ ij^{\prime}}^{2},\forall t\in T,\forall ij\in L\\ \end{array}  \tag{14}\]  
\[R_{ij,t}^{2}+S_{ij,t}^{2}\leq W_{i,t}W_{j,t},\forall t\in T,\forall ij\in L. \tag{15}\]  
So far, the original problem has been relaxed into a mixed integer second order conic programming (MISOCP). The existing commercial solver can solve this convex optimization problem. However, the existing convex optimization algorithms are weak in solving this problem because the problem contains a large number of variables [21]. In order to improve the efficiency of solving this problem, a polyhedral approximation method is proposed to construct a mixed integer linear programming (MILP), which can be solved quickly by general algorithms like the branch and bound method [23]. At the same time, the literature [22] has confirmed that the polyhedral approximation method can accurately control model errors and has high efficiency in power flow problems. At first, Equation (15) is rewritten as Equation (16). And Equation (17) is applied to relax Equation (16) to a polyhedral space. \[\sqrt{R_{ij,t}^{2}+S_{ij,t}^{2}+(\frac{W_{i,t}-W_{j,t}}{2})^{2}}\leq\frac{W_{ i,t}+W_{j,t}}{2},\forall t\in T,\forall ij\in L, \tag{16}\]  
\[\sqrt{R_{ij,t}^{2}+S_{ij,t}^{2}+(\frac{W_{i,t}-W_{j,t}}{2})^{2}}\leq(1+ \varepsilon)(\frac{W_{i,t}+W_{j,t}}{2}),\forall t\in T,\forall ij\in L\text{m} \tag{17}\]  
where \(\varepsilon\) is a relaxation scalar and \(\varepsilon\in(0,0.5]\). Secondly, the rotating cones are equivalent to two standard cones like Equations (18) and (19). \[E_{ij,t}\geq\sqrt{R_{ij,t}^{2}+S_{ij,t}^{2}},\forall t\in T,\forall ij\in L, \tag{18}\]  
\[\frac{W_{i,t}+W_{j,t}}{2}\geq\sqrt{(\frac{W_{i,t}-W_{j,t}}{2})^{2}+E_{ij,t}^{ 2}},\forall t\in T,\forall ij\in L. \tag{19}\]  
Finally, the smooth edges of cones are replaced with polyhedrons by Equations (21)-(23). The dimensions of a polyhedron depend on the accuracy required in Equation (20). \[\varepsilon(v)=\frac{1}{\cos(\frac{\#}{2^{v+1}})}-1. \tag{20}\]  
The boundary of a polyhedron is calculated by recursion. The initial boundary can be calculated by Equation (21) and the recursive expression is shown in Equation (22). These expressions form a set of linear spaces when \(v\) is given. \[