1 Introduction

The worldwide energy sectors face critical challenges with regards to security of power supply, environmental impacts and energy costs [1]. As a result, energy investments are trending towards innovations addressing energy efficiency and environmental friendliness. EVs present significant benefits over traditional vehicles with regards to reliance on oil, reducing harmful gas emissions and lowering fluctuation of renewable energy sources. World market for EVs are developing rapidly, and accordingly, EVs have become a hot research topic in the field of electric engineering [2, 3].

Network losses rate is an important economic index of power system operation and a comprehensive measure of the power enterprise technology and management level. Distribution network has the features of low voltage, large scale and many equipments. Losses of distribution network account for more than 40% of total power system losses and it has relatively large energy loss reduction space. Uncoordinated charging of a large numbers of EVs can significantly increase the network losses, lower voltage, and overload distribution transformers or lines. While coordinated charging of EVs can significantly reduce power losses and provides safe and economic operation of the distribution system.

Researches on coordinated charging of EVs generally consist of distributed and centralized coordinated charging technology. The distributed coordinated charging technology mainly include fuzzy mathematics theory [4, 5], sensitivity analysis [6], etc. The centralized coordinated charging technology generally involves simulated sensitivity analysis [7, 8], evolutionary algorithm [9, 10], optimization techniques [1119], etc. In [7, 8], a real time smart load management strategy is proposed for coordinated charging of EVs based on sensitivity analysis technique. But the control variables are the charging locations rather than charging power of EVs and the results are therefore not optimal. In [9, 10], a generic algorithm is employed for coordinated charging of EVs. Nevertheless, due to the inherent inefficiency of calculations, the generic algorithm is not well suited to meet requirements on calculation speed for coordinated charging of a large population of EVs.

As coordinated charging of EVs is a large scale optimization problem, many techniques are proposed to improve the calculation speed. In [11], by correcting nodal voltages iteratively, a linear constrained convex quadratic programming of coordinated charging of EVs is built at each iteration. In [12], a sequential non convex quadratic programming for coordinated charging of EVs is proposed. However, both of the above methods belong to heuristic techniques and the simulation results are based on small systems. When applied to large systems, they could not converge or converge very slowly. In [13, 14], aiming at maximizing total charging energy of all EVs, with the inequality constraints of node voltage and thermal loadings of distribution transformer and cables linearized, a linear programming of coordinated charging of EVs is proposed. In [15], aiming at maximizing the revenue of power corporations with the model of distribution network linearized, a mixed integer linear programming of coordinated charging of EVs is proposed. As the relationship between losses of distribution system and charging power of EVs is non-linear, a linear programming is not applicable to coordinated charging of EVs aiming at minimizing distribution system losses.

In [16], with time-of-use power price and battery degradation costs taken into account, a quadratic programming is proposed to optimize charging and discharging power of EVs. In [17], a coordination strategy for optimal charging of EVs with congestion of distribution system taken into account is proposed. In [18], with three-phase photovoltaic inverters and EV chargers adapted to transfer power from highly loaded to low loaded phases, quadratic programming is proposed to minimize the power losses of the distribution system. In [19], load factor, load variance, and network losses are proven to be equivalent under certain conditions. As a consequence, minimizing network losses can be transformed to minimizing load factor or load variance. Unfortunately, the voltage constraints are not taken into account in the above four models. When there are a large amounts of EVs connected to low voltage distribution network, the voltage constraints can be really a factor that limit the charging power of EVs. Neglecting the voltage constraints can greatly improve the calculation speed, but may result in the charging power of EVs unfeasible.

Against to the discrepancy of inefficiency of calculations or not taking into account of voltage constraints, nonlinear primal dual interior point dynamic optimization algorithm is introduced to solve the problem. Since primal dual interior point algorithm has been proven to have polynomial time complexity, it is very suitable for large scale optimization problems. This paper is structured as follows: as household single phase charging of EV could contribute to imbalance of the distribution system, the phase component and polar coordinates power flow equations of unbalanced distribution systems are derived in Section 2. In Section 3, the model for coordinated charging of EVs is established with charging demand, voltage and current constraints considered. In Section 4, the primal dual interior point algorithm is elaborated. In Section 5, with an actual 423-bus case as the test system, simulation results indicate that the proposed method is very promising as it has good convergence performance, fast calculation speed, can minimize power losses, lower load variance and improve voltage profile compared to the uncoordinated scenarios. Section 6 concludes the whole paper.

2 Model of unbalanced distribution system

Figure 1 is the single line schematic diagram of a simple distribution system, in which \(V_{g}\) is the ground and reference voltage and \(V_{i}^{n}\) is the voltage of neutral wire for node \(i\). The relationship of voltages and currents between nodes \(i + 1\) and \(i\) is

$$\left[ {\begin{array}{*{20}l} {\dot{V}_{i + 1}^{a} } \hfill \\ {\dot{V}_{i + 1}^{b} } \hfill \\ {\dot{V}_{i + 1}^{c} } \hfill \\ {\dot{V}_{i + 1}^{n} } \hfill \\ \end{array} } \right] = \left[ {\begin{array}{*{20}l} {\dot{V}_{i}^{a} } \hfill \\ {\dot{V}_{i}^{b} } \hfill \\ {\dot{V}_{i}^{c} } \hfill \\ {\dot{V}_{i}^{n} } \hfill \\ \end{array} } \right] + \left[ {\begin{array}{*{20}l} {Z_{i}^{aa} } \hfill & {Z_{i}^{ab} } \hfill & {Z_{i}^{ac} } \hfill & {Z_{i}^{an} } \hfill \\ {Z_{i}^{ba} } \hfill & {Z_{i}^{bb} } \hfill & {Z_{i}^{bc} } \hfill & {Z_{i}^{bn} } \hfill \\ {Z_{i}^{ca} } \hfill & {Z_{i}^{cb} } \hfill & {Z_{i}^{cc} } \hfill & {Z_{i}^{cn} } \hfill \\ {Z_{i}^{na} } \hfill & {Z_{i}^{nb} } \hfill & {Z_{i}^{nc} } \hfill & {Z_{i}^{nn} } \hfill \\ \end{array} } \right]\left[ {\begin{array}{*{20}l} {\dot{I}_{i + 1,i}^{a} } \hfill \\ {\dot{I}_{i + 1,i}^{b} } \hfill \\ {\dot{I}_{i + 1,i}^{c} } \hfill \\ {\dot{I}_{i + 1,i}^{n} } \hfill \\ \end{array} } \right]$$
(1)

in which, \(\left[ {\dot{I}_{i + 1,i}^{a} \;\dot{I}_{i + 1,i}^{b} \;\dot{I}_{i + 1,i}^{c} \;\dot{I}_{i + 1,i}^{n} } \right]^{T}\) are the currents of three-phase and neutral wire flowing from node \(i + 1\) to \(i\), and the element of impedance matrix is the self or mutual impedance of three-phase and neutral wire between nodes \(i + 1\) and \(i\). With voltages and currents of the three-phase separated from those of the neutral wire, (1) can be rewritten as

$$\left[ \begin{array}{l} \dot{\varvec{V}}_{i + 1}^{abc}\\ \dot{V}_{i + 1}^{n} \\ \end{array} \right] = \left[ \begin{array}{l} \dot{\varvec{V}}_{i}^{abc}\\ \dot{V}_{i}^{n}\end{array} \right] + \left[ \begin{array}{ll} \varvec{Z}_{i}^{abc} &\quad \varvec{Z}_{i}^{n}\\ \left( {\varvec{Z}_{i}^{n} } \right)^{T} &\quad z_{i}^{nn} \end{array} \right]\left[ \begin{array}{l} \dot{\varvec{I}}_{i + 1,i}^{abc} \hfill \\ \dot{I}_{i + 1,i}^{n} \end{array} \right]$$
(2)
Fig. 1
figure 1

Schematic diagram of a simple distribution system

In typical case, the neutral wire is connected to the ground wire. Therefore, it has \(V_{i}^{n} = V_{g} \;\forall i\). By substituting \(V_{i}^{n} = V_{i + 1}^{n}\) into (2), the current of neutral wire flowing from node \(i + 1\) to \(i\) can be calculated as

$$\dot{I}_{i + 1,i}^{n} = - \left( {z_{i}^{nn} } \right)^{ - 1} \left( {\varvec{Z}_{i}^{n} } \right)^{T} \dot{\varvec{I}}_{i + 1,i}^{abc}$$
(3)

Substituting (3) into (2), the relationship of the three-phase voltages and currents between nodes \(i + 1\) and \(i\) is

$$\dot{\varvec{V}}_{i + 1}^{abc} = \dot{\varvec{V}}_{i}^{abc} + \varvec{Z}_{eqi}^{abc} \dot{\varvec{I}}_{i + 1,i}^{abc}$$
(4)

in which, the equivalent three-phase impedance matrix between node \(i + 1\) and \(i\) is

$$\varvec{Z}_{eqi}^{abc} = \varvec{Z}_{i}^{abc} - \left( {z_{i}^{nn} } \right)^{ - 1} \varvec{Z}_{i}^{n} \left( {\varvec{Z}_{i}^{n} } \right)^{T}$$
(5)

Therefore, the three-phase five wire system is completely transformed into the three-phase three wire system. As an outcome, the calculation complexity is greatly reduced.

By defining the equivalent admittance matrix between node \(i + 1\) and \(i\) as \(\varvec{Y}_{eqi}^{abc} = \left( {\varvec{Z}_{eqi}^{abc} } \right)^{ - 1}\), and applying the Kirchhoff’s current law, the three-phase currents injecting into the grid from load \(i\) is

$$\dot{\varvec{I}}_{i}^{abc} = \left( {\varvec{Y}_{eqi}^{abc} + \varvec{Y}_{eqi - 1}^{abc} } \right)\dot{\varvec{V}}_{i}^{abc} - \varvec{Y}_{eqi - 1}^{abc} \dot{\varvec{V}}_{i - 1}^{abc} - \varvec{Y}_{eqi}^{abc} \dot{\varvec{V}}_{i + 1}^{abc}$$
(6)

Applying (6) to all the nodes, the matrix expression is

$$\left[ \begin{array}{l} \dot{\varvec{I}}_{1}^{abc} \\ \dot{\varvec{I}}_{2}^{abc} \\ \; \vdots \\ \dot{\varvec{I}}_{N}^{abc} \\ \dot{\varvec{I}}_{N + 1}^{abc} \\ \end{array} \right] = \varvec{Y}^{abc} \left[ \begin{array}{l} \dot{\varvec{V}}_{1}^{abc} \\ \dot{\varvec{V}}_{2}^{abc} \\ \; \vdots \\ \dot{\varvec{V}}_{N}^{abc} \\ \dot{\varvec{V}}_{N + 1}^{abc} \end{array} \right]$$
(7)

Let \(\varvec{Y}_{ij}^{abc}\) be the matrix consisting of the \(3(i - 1) + 1\) \(\sim 3(i - 1) + 3^{th}\) row, \(3(j - 1) + 1\sim 3(j - 1) + 3^{th}\) column elements of \(\varvec{Y}^{abc}\). The three-phase apparent power injecting into the grid from load \(i\) is \(\varvec{S}_{i}^{abc} = \dot{\varvec{V}}_{i}^{abc} \odot \left( {\dot{\varvec{I}}_{i}^{abc} } \right)^{ * }\), in which, symbol \(\odot\) indicates component multiplication. Substituting the \(i^{th}\) current in (7) into the above equation, the three-phase apparent power can be expressed with the voltage vector as

$$\varvec{S}_{i}^{abc} = \dot{\varvec{V}}_{i}^{abc} \odot \left( {\varvec{Y}_{i}^{abc} \dot{\varvec{V}}^{abc} } \right)^{ * }$$
(8)

in which, \(\varvec{Y}_{i}^{abc}\) is the matrix consisting of the \(3(i - 1) + 1\sim 3(i - 1) + 3^{th}\) row elements of \(\varvec{Y}^{abc}\) . Separating the real part from the imaginary one of the admittance matrix between node \(i\) and \(j\), i.e. \(\varvec{Y}_{ij}^{abc} = \varvec{G}_{ij}^{abc} + j\varvec{B}_{ij}^{abc}\), and taking voltage with the polar form, i.e. \(\dot{\varvec{V}}_{i}^{abc} = \varvec{V}_{i}^{abc} \odot e^{{j\varvec{\theta}_{i}^{abc} }}\), the three-phase apparent power can be expressed as

$$\varvec{S}_{i}^{abc} = \varvec{V}_{i}^{abc} \odot e^{{j\varvec{\theta}_{i}^{abc} }} \odot \left( {\sum\limits_{k = 1}^{N + 1} {\left( {\varvec{G}_{ik}^{abc} + j\varvec{B}_{ik}^{abc} } \right)\left( {\varvec{V}_{k}^{abc} \odot e^{{j\varvec{\theta}_{k}^{abc} }} } \right)} } \right)^{ * }$$
(9)

Separating the real part from the imaginary one of the apparent power, i.e. \(\varvec{S}_{i}^{abc} = \varvec{P}_{i}^{abc} + j\varvec{Q}_{i}^{abc}\), the three-phase active and reactive power injecting into grid from load \(i\) are

$$\left\{ \begin{array}{l} P_{i}^{\alpha } = V_{i}^{\alpha } \sum\limits_{k = 1}^{N + 1} {\sum\limits_{\beta = a}^{c} {V_{k}^{\beta } } } \left[ {G_{ik}^{\alpha \beta } \cos (\theta_{i}^{\alpha } - \theta_{k}^{\beta } ) + B_{ik}^{\alpha \beta } \sin (\theta_{i}^{\alpha } - \theta_{k}^{\beta } )} \right] \hfill \\ Q_{i}^{\alpha } = V_{i}^{\alpha } \sum\limits_{k = 1}^{N + 1} {\sum\limits_{\beta = a}^{c} {V_{k}^{\beta } } } \left[ {G_{ik}^{\alpha \beta } \sin (\theta_{i}^{\alpha } - \theta_{k}^{\beta } ) - B_{ik}^{\alpha \beta } \cos (\theta_{i}^{\alpha } - \theta_{k}^{\beta } )} \right] \hfill \\ \forall i = 1,2, \cdots ,N,\;\forall \alpha = a,b,c \hfill \\ \end{array} \right.$$
(10)

in which, \(G_{ik}^{\alpha \beta }\), \(B_{ik}^{\alpha \beta }\) are the \(\alpha^{th}\) row, \(\beta^{th}\) column element of the \(3 \times 3\) matrix \(\varvec{G}_{ik}^{abc}\), \(\varvec{B}_{ik}^{abc}\) respectively. When \(\alpha\), \(\beta\) is equal to \(a\), \(b\), \(c\), the corresponding row and column element of \(\varvec{G}_{ik}^{abc}\), \(\varvec{B}_{ik}^{abc}\) is 1, 2, 3 respectively.

3 Model of coordinated charging of EVs

The objective function for coordinated charging of EVs is

$$\left\{ \begin{array}{l} \hbox{min} \sum\limits_{{t = t_{1} }}^{{t_{\hbox{max} } }} {P_{Loss,\,t} \Delta t} \hfill \\ P_{Loss,t} = \sum\limits_{i = 1}^{N + 1} {\sum\limits_{k = 1}^{N + 1} {\sum\limits_{\alpha = a}^{c} {\sum\limits_{\beta = a}^{c} {V_{i,t}^{\alpha } V_{k,t}^{\beta } G_{ik}^{\alpha \beta } \cos (\theta_{i,t}^{\alpha } - \theta_{k,t}^{\beta } )} } } } \hfill \\ \forall G_{ik}^{\alpha \beta } \ne 0 \hfill \\ \end{array} \right.$$
(11)

in which, \(P_{Loss,t}\) is the power losses at time \(t\); \(\Delta t\) is the time step; \(t_{1}\), \(t_{\hbox{max} }\) is the start and end time for coordinated charging of EVs respectively; \(V_{i,t}^{\alpha }\), \(V_{k,t}^{\beta }\) is the RMS voltage of node \(i\), \(k\) for phase \(\alpha\), \(\beta\) at time \(t\) respectively; \(\theta_{i,t}^{\alpha }\), \(\theta_{k,t}^{\beta }\) is the voltage angle of node \(i\), \(k\) for phase \(\alpha\), \(\beta\) at time \(t\) respectively. By taking the form of (11), it is very easy to realize on a program.

Constraint on charging power of each EV is

$$0 \le P_{m,t} \le P_{m,\hbox{max} }$$
(12)

in which, \(P_{m,t}\), \(P_{m,\hbox{max} }\) is the charging power and its maximum of the \(m^{th}\) EV at time \(t\) respectively.

Constraint on charging demand of each EV is

$$\rho \sum\limits_{{t = t_{ms} }}^{{t_{me} }} {P_{m,t} } = E_{m}^{cap} - E_{m}^{ini}$$
(13)

in which, \(\rho\) is the charging efficiency, \(E_{m}^{ini}\), \(E_{m}^{cap}\) is the initial energy and the battery capacity of the \(m^{th}\) EV respectively. \(t_{ms}\), \(t_{me}\) is the charging start and end time of the \(m^{th}\) EV respectively.

Voltage constraint on each node of the distribution network is

$$V_{\hbox{min} } \le V_{{_{i,t} }}^{\alpha } \le V_{\hbox{max} }$$
(14)

in which, \(V_{\hbox{min} }\), \(V_{\hbox{max} }\) is the lower and upper limit of the statutory voltage respectively.

Current constraint on each transformer is

$$I_{T,t}^{\alpha } \le I_{T,\hbox{max} }$$

in which, \(I_{T,t}^{\alpha }\), \(I_{T,\hbox{max} }\) is the RMS current of the \(T^{th}\) transformer at time \(t\) and its maximum.

Current constraint on each line is

$$I_{l,t}^{\alpha } \le I_{l,\hbox{max} }$$

in which, \(I_{l,t}^{\alpha }\), \(I_{l,\hbox{max} }\) is the RMS current of the \(l^{th}\) line at time \(t\) and its maximum.

The constraints on power flow are

$$\left\{ \begin{array}{l} - P_{Li,t}^{\alpha } - P_{Vi,t}^{\alpha } - P_{i,t}^{\alpha } = 0 \hfill \\ - Q_{Li,t}^{\alpha } - Q_{i,t}^{\alpha } = 0 \hfill \\ i = 1,\;2,\cdots ,N \hfill \\ \alpha = a,\;b,\;c \hfill \\ t = t_{1} ,t_{2} , \ldots ,t_{\hbox{max} } \hfill \\ \end{array} \right.$$
(15)

in which, \(P_{Vi,t}^{\alpha }\), \(P_{Li,t}^{\alpha }\), \(Q_{Li,t}^{\alpha }\) is the charging power, active and reactive power of load at node \(i\), phase \(\alpha\), time \(t\) respectively. \(P_{i,t}^{\alpha }\), \(Q_{i,t}^{\alpha }\) is the active and reactive power injecting into the grid from node \(i\) at phase \(\alpha\), time \(t\) respectively.

4 Nonlinear primal dual interior point algorithm [20]

In general, nonlinear programming problem can be written as the following form

$$\left\{ \begin{array}{l} \hbox{min}\, \varvec{f}\left( \varvec{x} \right) \hfill \\ s.t.\;\varvec{g}(\varvec{x}) = {\mathbf{0}} \hfill \\ \underline{\varvec{h}} \le \varvec{h}(\varvec{x}) \le \overline{\varvec{h}} \hfill \\ \end{array} \right.$$
(16)

in which,

$$\left\{ \begin{array}{l} \varvec{x} = \left[ {x_{1} \;x_{2} \; \cdots x_{n} } \right]^{T} \hfill \\ \varvec{g}\left( \varvec{x} \right) = \left[ {g_{1} (\varvec{x})\;g_{2} (\varvec{x})\; \cdots g_{m} (\varvec{x})} \right]^{T} \hfill \\ \varvec{h}\left( \varvec{x} \right) = \left[ {h_{1} (\varvec{x})\;h_{2} (\varvec{x})\; \cdots h_{r} (\varvec{x})} \right]^{T} \hfill \\ \end{array} \right.$$

By introducing slack variables \(\varvec{l}\) and \(\varvec{u}\), (16) can be transformed to

$$\left\{ \begin{array}{l} \hbox{min}\, \varvec{f}(\varvec{x}) \hfill \\ s.t.\;\varvec{g}(\varvec{x}) = {\mathbf{0}} \hfill \\ \varvec{h}(\varvec{x}) - \varvec{l} - \underline{\varvec{h}} = {\mathbf{0}} \hfill \\ \varvec{h}(\varvec{x}) + \varvec{u} - \overline{\varvec{h}} = {\mathbf{0}} \hfill \\ \left( {\varvec{l},\;\varvec{u}} \right) \ge {\mathbf{0}} \hfill \\ \end{array} \right.$$
(17)

By introducing Lagrange multipliers \(\varvec{y} \in R^{m}\), \(\left( {\varvec{z},\,\,\tilde{\varvec{z}},\;\varvec{w},\;\tilde{\varvec{w}}} \right) \in R^{r}\), Lagrange function associated with (17) can be constructed as

$$L\left( {\varvec{x},\;\varvec{l},\;\varvec{u},\;\varvec{y},\;\varvec{z},\;\varvec{w},\;\tilde{\varvec{z}},\;\tilde{\varvec{w}}} \right) = \varvec{f}(\varvec{x}) - \varvec{y}^{T} \varvec{g}(\varvec{x}) - \varvec{z}^{T} (\varvec{h}(\varvec{x}) - \varvec{l} - \underline{\varvec{h}} ) - \varvec{w}^{T} (\varvec{h}(\varvec{x}) + \varvec{u} - \overline{\varvec{h}} ) - \tilde{\varvec{z}}\varvec{l} - \tilde{\varvec{w}}\varvec{u}$$
(18)

The KKT equations for (18) is

$$\left\{ \begin{array}{l} \varvec{L}_{\varvec{x}} = \nabla_{\varvec{x}} \varvec{f}(\varvec{x}) - \nabla_{\varvec{x}} \varvec{g}(\varvec{x})^{T} \varvec{y} - \nabla_{\varvec{x}} \varvec{h}(\varvec{x})^{T} \left( {\varvec{z} + \varvec{w}} \right) = {\mathbf{0}} \hfill \\ \varvec{L}_{\varvec{l}} = \varvec{z} - \tilde{\varvec{z}} = {\mathbf{0}} \hfill \\ \varvec{L}_{\varvec{u}} = - \varvec{w} - \tilde{\varvec{w}} = {\mathbf{0}} \hfill \\ \varvec{L}_{\varvec{y}} = - \varvec{g}(\varvec{x}) = {\mathbf{0}} \hfill \\ \varvec{L}_{\varvec{z}} = \varvec{h}(\varvec{x}) - \varvec{l} - \underline{\varvec{h}} = {\mathbf{0}} \hfill \\ \varvec{L}_{\varvec{w}} = \varvec{h}(\varvec{x}) + \varvec{u} - \overline{\varvec{h}} = {\mathbf{0}} \hfill \\ {\varvec{L}}{\tilde{\varvec{Z}}}{\varvec{e}} = {\mathbf{0}} \hfill \\ {\varvec{U}}{\tilde{\varvec{W}}}{\varvec{e}} = {\mathbf{0}} \hfill \\ \left( {{\varvec{l}},\;{\varvec{u}},\;{\tilde{\varvec{z}}},\;{\tilde{\varvec{w}}}} \right) \ge {\mathbf{0}}\;{\varvec{y}} \ne {\mathbf{0}} \hfill \\ \end{array} \right.$$
(19)

in which, \(\varvec{e} = [1\;\;1 \cdots 1]^{T} \in R^{r}\), \(\left( {\varvec{L},\,\varvec{U},\,\,\tilde{\varvec{Z}},\;\,\tilde{\varvec{W}}} \right) \in R^{r \times r}\) are the diagonal matrixes, defined as

$$\left\{ \begin{array}{l} \varvec{L} = {\text{diag}}\left( {l_{1} \cdots l_{r} } \right) \hfill \\ \varvec{U} = {\text{diag}}\left( {u_{1} \cdots u_{r} } \right) \hfill \\ \tilde{\varvec{Z}} = {\text{diag}}\left( {\tilde{z}_{1} \cdots \tilde{z}_{r} } \right) \hfill \\ \tilde{\varvec{W}} = {\text{diag}}\left( {\tilde{w}_{1} \cdots \tilde{w}_{r} } \right) \hfill \\ \end{array} \right.$$

By eliminating \(\tilde{\varvec{z}}\) and \(\tilde{\varvec{w}}\), (19) is reduced to

$$\left\{ \begin{array}{l} \varvec{L}_{\varvec{x}} = \nabla_{\varvec{x}} \varvec{f}(\varvec{x}) - \nabla_{\varvec{x}} \varvec{g}(\varvec{x})^{T} \varvec{y} - \nabla_{\varvec{x}} \varvec{h}(\varvec{x})^{T} \left( {\varvec{z} + \varvec{w}} \right) = {\mathbf{0}} \hfill \\ \varvec{L}_{\varvec{y}} = - \varvec{g}(\varvec{x}) = {\mathbf{0}} \hfill \\ \varvec{L}_{\varvec{z}} = \varvec{h}(\varvec{x}) - \varvec{l} - \underline{\varvec{h}} = {\mathbf{0}} \hfill \\ \varvec{L}_{\varvec{w}} = \varvec{h}(\varvec{x}) + \varvec{u} - \overline{\varvec{h}} = {\mathbf{0}} \hfill \\ \varvec{LZe} = {\mathbf{0}} \hfill \\ \varvec{UWe} = {\mathbf{0}} \hfill \\ \left( {\varvec{l},\;\varvec{u},\,\varvec{z}} \right) \ge {\mathbf{0}};\varvec{w} \le {\mathbf{0}};\;\varvec{y} \ne {\mathbf{0}} \hfill \\ \end{array} \right.$$
(20)

Is it possible to solve (20) by Newton-Raphson’s method directly? The answer is no. The reason for th is lies in the special nonlinearity in the fifth and sixth equations of (20). For example, by Newton-Raphson’s method, the fifth and sixth equations of (20) is linearized as \(\varvec{Z}\Delta \varvec{l} + \varvec{L}\Delta \varvec{z} = - \varvec{LZe}\) or \(z_{i} \Delta l_{i} + l_{i} \Delta z_{i} = - l_{i} z_{i}\), \(\;i = 1,\;2,\; \cdots ,r\). If at the \(k^{th}\) iteration, \(l_{i}^{k} = 0\) happens, then \(\Delta l_{i}^{k} = 0\), and \(l_{i}^{k + 1} = l_{i}^{k} + \Delta l_{i}^{k} = 0\). That is, once \(l_{i}\) falls on the boundary of the feasible region, it is stuck at that point on the boundary. The same situation may occur for \(z_{i}\). Such an undesirable characteristics preclude the convergence of the algorithm. For the sake of overcoming this difficulty, a perturbation factor \(\mu\) \(\left( {\mu > 0} \right)\) is introduced to relax the fifth and sixth equations of (20) as

$$\left\{ \begin{array}{l} \varvec{L}_{l}^{\mu } = \varvec{LZe} - \mu \varvec{e} = {\mathbf{0}} \hfill \\ \varvec{L}_{u}^{\mu } = \varvec{UWe} + \mu \varvec{e} = {\mathbf{0}} \hfill \\ \end{array} \right.$$
(21)

Therefore, (20) should be replaced with

$$\left\{ \begin{array}{l} \varvec{L}_{\varvec{x}} = \nabla_{\varvec{x}} \varvec{f}(\varvec{x}) - \nabla_{\varvec{x}} \varvec{g}(\varvec{x})^{T} \varvec{y} - \nabla_{\varvec{x}} \varvec{h}(\varvec{x})^{T} \left( {\varvec{z} + \varvec{w}} \right) = {\mathbf{0}} \hfill \\ \varvec{L}_{\varvec{y}} = - \varvec{g}(\varvec{x}) = {\mathbf{0}} \hfill \\ \varvec{L}_{\varvec{z}} = \varvec{h}(\varvec{x}) - \varvec{l} - \underline{\varvec{h}} = {\mathbf{0}} \hfill \\ \varvec{L}_{\varvec{w}} = \varvec{h}(\varvec{x}) + \varvec{u} - \overline{\varvec{h}} = {\mathbf{0}} \hfill \\ \varvec{L}_{l}^{\mu } = \varvec{LZe} - \mu \varvec{e} = {\mathbf{0}} \hfill \\ \varvec{L}_{u}^{\mu } = \varvec{UZe} + \mu \varvec{e} = {\mathbf{0}} \hfill \\ \left( {\varvec{l},\;\varvec{u},\varvec{z}} \right) \ge {\mathbf{0}};\varvec{w} \le {\mathbf{0}};\;\varvec{y} \ne {\mathbf{0}} \hfill \\ \end{array} \right.$$
(22)

From (21), \(\mu\) can be expressed as

$$\mu { = }\frac{{\varvec{l}^{T} \varvec{z} - \varvec{u}^{T} \varvec{w}}}{2r}$$
(23)

Define the complementary gap as

$$C_{gap} = \varvec{l}^{T} \varvec{z} - \varvec{u}^{T} \varvec{w}$$
(24)

In practical application, the central factor \(\sigma\) is introduced to speed up the convergence rate by modifying (23) to be

$$\mu = \sigma \frac{{C_{gap} }}{2r}\quad \sigma \in \left( {0,\;1} \right)$$
(25)

By applying the Newton-Raphson’s method to the perturbed KKT equations, the correction equations of (22) are

$$\left\{ \begin{array}{l} \left[ {\nabla_{{\varvec{xx}}}^{2} \varvec{f}(\varvec{x}) - \sum\limits_{i = 1}^{m} {y_{i} \nabla_{{\varvec{xx}}}^{ 2} g_{i} (\varvec{x})} - \sum\limits_{i = 1}^{r} {(z_{i} + w_{i} )} \nabla_{{\varvec{xx}}}^{ 2} h_{i} (\varvec{x})} \right]\Delta \varvec{x} \hfill \\ - \nabla_{\varvec{x}} \varvec{g}(\varvec{x})^{T} \Delta \varvec{y} - \nabla_{\varvec{x}} \varvec{h}(\varvec{x})^{T} \left( {\Delta \varvec{z} + \Delta \varvec{w}} \right) = - \varvec{L}_{{\varvec{x}\text{0}}} \hfill \\ - \nabla_{\varvec{x}} \varvec{g}(\varvec{x})^{T} \Delta \varvec{x} = - \varvec{L}_{{\varvec{y}{\mathbf{0}}}} \hfill \\ \nabla_{\varvec{x}} \varvec{h}(\varvec{x})\Delta \varvec{x} - \Delta \varvec{l} = - \varvec{L}_{{\varvec{z}{\mathbf{0}}}} \hfill \\ \nabla_{\varvec{x}} \varvec{h}(\varvec{x})\Delta \varvec{x} + \Delta \varvec{u} = - \varvec{L}_{{\varvec{w}{\mathbf{0}}}} \hfill \\ \varvec{Z}\Delta \varvec{l} + \varvec{L}\Delta \varvec{z} = - \varvec{L}_{{\varvec{l}{\mathbf{0}}}}^{\mu } \hfill \\ \varvec{W}\Delta \varvec{u} + \varvec{U}\Delta \varvec{w} = - \varvec{L}_{{\varvec{u}{\mathbf{0}}}}^{\mu } \hfill \\ \end{array} \right.$$
(26)

in which, \(\left( {\varvec{L}_{{\varvec{x}{\mathbf{0}}}} ,\;\varvec{L}_{{\varvec{y}{\mathbf{0}}}} ,\;\varvec{L}_{{\varvec{z}{\mathbf{0}}}} ,\;\varvec{L}_{{\varvec{w}{\mathbf{0}}}} ,\;\varvec{L}_{{\varvec{l}{\mathbf{0}}}}^{\mu } ,\;\varvec{L}_{{\varvec{u}{\mathbf{0}}}}^{\mu } } \right)\) denote the residuals of the perturbed KKT equations, \(\nabla_{{\varvec{xx}}}^{2} h_{i} (\varvec{x})\), \(\nabla_{{\varvec{xx}}}^{2} g_{i} (\varvec{x})\) are the Hessian matrix of \(h_{i} (\varvec{x})\) and \(g_{i} (\varvec{x})\) respectively.

From the last four equations of (26), the relationships between \(\Delta \varvec{l}\), \(\Delta \varvec{u}\), \(\Delta \varvec{z}\), \(\Delta \varvec{w}\) and \(\Delta \varvec{x}\), \(\Delta \varvec{y}\) can be expressed as

$$\left\{ \begin{array}{l} \Delta \varvec{l} = \nabla_{\varvec{x}} \varvec{h}(\varvec{x})\Delta \varvec{x} + \varvec{L}_{{\varvec{z}{\mathbf{0}}}} \hfill \\ \Delta \varvec{u} = - \left[ {\nabla_{\varvec{x}} \varvec{h}(\varvec{x})\Delta \varvec{x} + \varvec{L}_{{\varvec{w}{\mathbf{0}}}} } \right] \hfill \\ \Delta \varvec{z} = - \varvec{L}^{ - 1} \varvec{Z}\nabla_{\varvec{x}} \varvec{h}(\varvec{x})\Delta \varvec{x} - \varvec{L}^{ - 1} \left( {\varvec{ZL}_{{\varvec{z}{\mathbf{0}}}} + \varvec{L}_{{\varvec{l}{\mathbf{0}}}}^{\mu } } \right) \hfill \\ \Delta \varvec{w} = \varvec{U}^{ - 1} \varvec{W}\nabla_{\varvec{x}} \varvec{h}(\varvec{x})\Delta \varvec{x} + \varvec{U}^{ - 1} \left( {\varvec{WL}_{{\varvec{w}{\mathbf{0}}}} - \varvec{L}_{{\varvec{u}{\mathbf{0}}}}^{\mu } } \right) \hfill \\ \end{array} \right.$$
(27)

Substituting the last two equations of (27) into the first two equations of (26), the reduced correction equations (28), (29) are obtained, in which inequality constraints \(\varvec{h}(\varvec{x})\) are eliminated so that the size of the correction equation is determined only by that of the equality constraints \(\varvec{g}(\varvec{x})\).

$$\left[ {\begin{array}{cc} {\varvec{H}\left( \cdot \right)} & { - \nabla_{\varvec{x}} \varvec{g}(\varvec{x})^{T} }\\ { - \nabla_{\varvec{x}} \varvec{g}(\varvec{x})^{T} }& {\mathbf{0}}\end{array} } \right]\left[ \begin{aligned} \Delta \varvec{x} \hfill \\ \Delta \varvec{y} \hfill \\ \end{aligned} \right] = \left[ \begin{array}{l}\varvec{\psi}\left( { \cdot ,\,\mu } \right) \hfill \\ - \varvec{L}_{{\varvec{y}{\mathbf{0}}}} \hfill \\ \end{array} \right]$$
(28)
$$\left\{ \begin{array}{l} \varvec{H}\left( \cdot \right) = \left[ {\nabla_{{\varvec{xx}}}^{2} \varvec{f}(\varvec{x}) - \sum\limits_{i = 1}^{m} {y_{i} \nabla_{{\varvec{xx}}}^{2} g_{i} (\varvec{x})} - \sum\limits_{i = 1}^{r} {(z_{i} + w_{i} )} \nabla_{{\varvec{xx}}}^{2} h_{i} (\varvec{x})} \right] \hfill \\ + \nabla_{\varvec{x}} \varvec{h}(\varvec{x})^{T} \left( {\varvec{L}^{ - 1} \varvec{Z} - \varvec{U}^{ - 1} \varvec{W}} \right)\nabla_{\varvec{x}} \varvec{h}(\varvec{x}) \hfill \\\varvec{\psi}\left( { \cdot ,\,\mu } \right) = - \varvec{L}_{{\varvec{x}{\mathbf{0}}}} + \nabla_{\varvec{x}} \varvec{h}(\varvec{x})^{T} \left[ {\varvec{U}^{ - 1} \left( {\varvec{WL}_{{\varvec{w}{\mathbf{0}}}} - \varvec{L}_{{\varvec{u}{\mathbf{0}}}}^{\mu } } \right) - \varvec{L}^{ - 1} \left( {\varvec{ZL}_{{\varvec{z}{\mathbf{0}}}} + \varvec{L}_{{\varvec{l}{\mathbf{0}}}}^{\mu } } \right)} \right] \hfill \\ \end{array} \right.$$
(29)

The proposed primal dual interior point algorithm can be summarized as follows:

  • Step 0: Initialization; Set \(k = 0\), \(K = 50\), center factor \(\sigma \in \left( {0,\;1} \right)\), tolerance \(\xi_{1} = 10^{ - 6}\), \(\xi_{2} = 10^{ - 4}\), in which, \(k\) is the iteration count and its maximum respectively. Choose \(x_{0}\) to be a solution of the equality constraints, \(\left( {\user2{l}_{\text{0}} ,\;\user2{u}_{\text{0}} } \right) > {\mathbf{0}}\), \(\varvec{z}_{\text{0}} > {\mathbf{0}}\), \(\varvec{w}_{\text{0}} < {\mathbf{0}}\), \(\varvec{y}_{\text{0}} \ne {\mathbf{0}}\).

WHILE \(\left( {k \le K} \right)\) DO

  • Step 1: Compute the complementary gap as (24).

    If \(\left( {C_{gap} \le \xi_{1} \& \left\| {g\left( x \right)} \right\|_{\infty } \le \xi_{2} } \right)\), then output the optimal solution and stop.

  • Step 2: Compute the perturbed factor as (25).

  • Step 3: Solve the correction equations (28), (27) for \(\left( {\Delta \varvec{x},\;\Delta \varvec{y}} \right)\) and \(\left( {\Delta \varvec{l},\;\Delta \varvec{u},\;\Delta \varvec{z},\;\Delta \varvec{w}} \right)\).

  • Step 4: Perform the ratio test to determine the maximum step size in the primal and dual space by

    $$\left\{ \begin{array}{l} step_{P} = 0.9995\hbox{min} \left\{ {\mathop {\hbox{min} }\limits_{i} \left( {\frac{{ - l_{i} }}{{\Delta l_{i} }},\;\Delta l_{i} < 0} \right);\;\mathop {\hbox{min} }\limits_{i} \left( {\frac{{ - u_{i} }}{{\Delta u_{i} }},\;\Delta u_{i} < 0} \right);\;1} \right\} \hfill \\ step_{D} = 0.9995\hbox{min} \left\{ {\mathop {\hbox{min} }\limits_{i} \left( {\frac{{ - z_{i} }}{{\Delta z_{i} }},\;\Delta z_{i} < 0} \right);\;\mathop {\hbox{min} }\limits_{i} \left( {\frac{{ - w_{i} }}{{\Delta w_{i} }},\;\Delta w_{i} > 0} \right);\;1} \right\} \hfill \\ \end{array} \right.$$
    (30)
  • Step 5: Update the primal and dual variables by

    $$\left\{ \begin{array}{lll} x^{{\left( {k + 1} \right)}} = x^{\left( k \right)} + step_{P} \Delta x^{(k)} &\quad y^{{\left( {k + 1} \right)}} = y^{\left( k \right)} + step_{D} \Delta y^{\left( k \right)} \hfill \\ l^{{\left( {k + 1} \right)}} = l^{\left( k \right)} + step_{P} \Delta l^{\left( k \right)}& \quad u^{{\left( {k + 1} \right)}} = u^{\left( k \right)} + step_{P} \Delta u^{\left( k \right)} \hfill \\ z^{{\left( {k + 1} \right)}} = z^{\left( k \right)} + step_{D} \Delta z^{\left( k \right)} &\quad w^{{\left( {k + 1} \right)}} = w^{\left( k \right)} + step_{D} \Delta w^{\left( k \right)} \hfill \\ k = k + 1&\; \end{array} \right.$$
    (31)

    END DO

  • Step 6: Print “Computation does not converge” and stop.

5 Simulation case

5.1 Simulation conditions

Shown as Fig. 2, an actual distribution network containing 423 single phase nodes (141 three-phase nodes) is introduced to test the capability of the proposed method for coordinated charging of EVs. Length, impedance and rated current of lines are shown in Table 1. The transformer’s rated capacity is 400 kVA with both positive and zero sequence impedance are \(0.06 + {{j}}0.0125\) p.u. Shown as the arrows in Fig. 2, there are total 165 households in the distribution network. The lumped load connected to phase A indicates 31 single phase household loads of another area, while the rest 134 household loads indicate three-phase symmetrical ones. It is assumed that the maximum active power of each household load is 4 kW, and power factor is 0.95. As the load curve of each household is not available, typical summer load curves between 18:00-8:00 shown as Fig. 3 is assigned to each household. Different load curves may result in different optimal charging power curves for each EV. But, the capability of the algorithm is independent of load curves.

Fig. 2
figure 2

The diagram of an actual distribution system

Table 1 The parameters of the distribution network
Fig. 3
figure 3

Load curves of household

Other simulation conditions are set as follows:

  1. 1)

    All EV owners are willing to participate in coordinated charging and charging power of each EV is fully controllable. Charging time period is between 18:00-8:00. Charging demand is fully charged.

  2. 2)

    Maximal charging power of each EV is 4 kW. The capacity of battery of each EV is 20 kWh. Charging efficiency is 0.98.

  3. 3)

    Shown as the small black circles in Fig. 2, there are 67 EVs distributed in the distribution network. Taking one EV per household for example, the permeability of EV is 50%. Charging locations of each EV is the same as the household load. Each EV adopts single phase charging mode. EVs located at area 1, 2 and 3 are connected to phase A, B and C respectively.

  4. 4)

    The optimization time interval is 1 hour. That is, the household load and charging power of each EV are kept constant in each hour.

  5. 5)

    The legal lower voltage limit of each phase is assumed to be 0.9 p.u..

Node 141 is taken as the slack node, and its voltage is kept constant as 1.05 p.u.. The rest of the nodes are taken as PQ nodes. The three-phase base power of the system is chosen to be 160 kVA.

5.2 Simulation results

All of the programs are written by MATLAB. The central factor \(\sigma\) is set to be 0.1. To validate the proposed coordinated charging algorithm, scenarios without EV and that of uncoordinated charging are introduced as the control groups. Under the uncoordinated charging scenario, once an EV is connected to distribution network, it starts charging with maximal power until fully charged. Since most EVs are connected to distribution network between 18:00-21:00, the charging start time of EVs are selected with Monte Carlo method between 18:00-21:00. The initial SOC of each EV is selected with Monte Carlo method as well. The average losses of distribution system are obtained by implementing the simulation for 500 times. Under the coordinated charging scenario, generally the programs converge after 10 to 40 iterations shown as Fig. 4 and Fig. 5.

Fig. 4
figure 4

Change curve of dual gap

Fig. 5
figure 5

Maximum flow deviation curve

Curves of Average losses under different scenarios are shown as Fig. 6. It is evident that uncoordinated charging will result in sharp increase of losses during the peak time. While the average losses of coordinated charging are flat over the whole charging time period. Under the uncoordinated charging scenario, the average of total energy losses is 458.1 kWh, while under the coordinated charging scenario, that is 192.6 kWh. The average of total energy losses under the coordinated charging scenario is much less than that under the uncoordinated charging scenario, which is reduced by 57.97%.

Fig. 6
figure 6

Network loss curves under different scenarios

The three-phase typical voltage profiles of node 6, which is located at the terminal of distribution network under different scenarios, are shown as Fig. 7. Clearly, under the scenario without EVs, as the lumped load is connected to phase A, the voltage of phase A for node 6 is slightly lower than that of phase B and C. Under the uncoordinated charging scenario, a large number of EVs start charging at the peak time, cause a sharp drop in voltage, far beyond the statutory lower limit, especially for phase C which is located at the terminal of the distribution network. Under the coordinated charging scenario, because EVs mainly charge at the off peak time, node voltages are greatly improved over the uncoordinated charging scenario. Compared to the scenario without EV, the three-phase voltage decreases a little, but not beyond the statutory voltage limit. As node 6 is located at the terminal of the distribution network, voltage of phase C for node 6 is close to the lower limit all the time under the coordinated charging scenario. Thus, the voltage is really a binding constraint when there are a large amount of EVs connected to the distribution network.

Fig. 7
figure 7

The three-phase voltage curves of node 6 under different scenarios

Charging power of some EVs are shown as Fig. 8. It can be seen that, charging power of EVs located at different nodes vary from each other greatly. When the household load is low at late night and early morning, the charging power of each EV is high while in the early evening when the household load is high, the charging power of each EV is low or even zero. That is, charging power curve of each EV is closely associated with household load curves. Coincidently, charging power curves are also closely associated with charging locations. In the same charging area, closer to the power supply point is the charging location, higher is the maximal charging power. For example, in area 1, the maximal charging power of EV located at node 15 is higher than that at node 91. Similarly, in area 2 and 3, the maximal charging power of EV located at node 108 and 30 is higher than that at node 126 and 140 respectively. This is because in the same area, all the EVs are connected to the same phase, the closer the charging location is to the power supply point, the more relaxed voltage constraint becomes, and as a result, the higher is the maximal charging power. However, where EVs’ charging locations are not in the same area, and therefore not connected to the same phase, this no longer holds true. For example, maximal charging power of EV located at node 15 is lower than that located at node 30, but node 15 is closer to the power supply point than node 30.

Fig. 8
figure 8

Optimal charging power of electric vehicles at typical nodes

Curves for total charging power of EVs, total load of household and total power of the distribution system are shown as Fig. 9. Evidently, the changing trend of the curve for total charging power is opposite to that of total household load. At the peak of the total household load, the total charging power is minimal while at the bottom of the total household load, the total charging power is maximal. As an outcome, the total power of distribution system which is the sum of total household load, charging power of EVs and losses, is relatively uniform over the whole charging time period. The proposed coordinated charging method can shave peaks and fill valleys, thus lowering the variance of total power of distribution system.

Fig. 9
figure 9

Relationship between electric vehicle charging load and conventional load

Currents of transformers and main cables are shown as Fig. 10, Fig. 11 respectively. It can be seen that under uncoordinated charging scenario, transformers and main cables are overloaded at the peak time. While under coordinated charging scenario, currents are far from the limit. It is evident that neither the currents of transformer nor those of main cable are the binding constraints on this network. Clearly, the network equipment is more than well suited to accommodate the additional load required by the high penetration of EVs, assuming the proposed coordinated charging scheme is introduced.

Fig. 10
figure 10

Currents of transformer

Fig. 11
figure 11

Currents of main cable

From the simulation results, it can be seen that the proposed method has a rapid convergence rate in the optimization of large-scale coordinated charging of EVs, and can greatly reduce power losses, improve voltage and lower the variance of load compared to uncoordinated charging scenario.

5.3 Relationship between populations of EVs and losses of distribution system

Average energy losses under uncoordinated and coordinated charging scenarios with different penetration levels of EVs are shown as Table 2. Clearly, as the numbers of EVs connected to distribution network increase linearly approximately, the average losses of energy under uncoordinated charging scenario aggrandize super linearly. This is because when the number of EVs charging at the peak time increase, the voltage drops deteriorate. Since the loads are constant, currents rise drastically. Power losses increase super linearly, since power losses is proportional to quadratic current. Nevertheless, under coordinated charging scenario, the ascent rate of energy losses are relatively uniform compared to that under uncoordinated charging scenario. This is because the proposed algorithm makes most of the EVs charging at valley time, which results in voltage profile higher and flatter than that under uncoordinated charging scenario. With the popularity of EVs, the amounts of EVs that can be dispatched are more and more. As a consequence, the economic benefits generated by the optimization algorithm will be more and more significant compared to uncoordinated charging scenario.

Table 2 Energy losses of uncoordinated and coordinated charging with different penetrations levels

6 Conclusions

In this paper, the component and polar coordinates power flow equations of unbalanced distribution system are derived. The coordinated charging model of EVs is established aiming at minimizing losses with the constraints of voltage and currents of transformers and lines taken into account. Primal dual interior point algorithm is introduced to solve this nonlinear dynamic programming problem. As the primal dual interior point algorithm has been proven in terms of polynomial time complexity, the efficiency of the algorithm is theoretically validated, and is therefore very suitable for large scale optimization problems. The simulation results of an actual 423-bus distribution system indicate that:

  1. 1)

    The proposed method for coordinated charging of EVs can significantly reduce losses. In the case of 50% EVs’ penetration, compared to the uncoordinated charging scenario, the proposed method can reduce power losses by 57.97% on average.

  2. 2)

    Charging at peak times can be avoided by the proposed coordinated charging method, and therefore, upgrade of distribution transformer and line can be deferred. Charging power at valleys is increased and total load variance is lowered and utilization of assets is improved.

  3. 3)

    Compared to uncoordinated charging, the proposed coordinated charging method can avoid sharp voltage drop, overloading of transformer and line, and improve the voltage profile. As a result, safety and economics of the power supply are guaranteed.

  4. 4)

    Charging power of EVs are not only closely associated with load curves, but are closely associated with charging location. When there are a large numbers of EVs connected to distribution network, charging at the start of the distribution network is safer, more economical and efficient than at the end of the distribution network. Therefore parking lots should be built nearer to rather than farther from the power supply point in order to obtain maximal energy and increase the distribution network’s holster capability for EVs.