Optimal Multi-Period Dispatch of Distributed Energy Resources in Unbalanced Distribution Feeders

This paper presents an efficient algorithm for the multi-period optimal dispatch of deterministic inverter-interfaced energy storage in an unbalanced distribution feeder with significant solar PV penetration. The three-phase, non-convex loss-minimization problem is formulated as a convex second-order cone program (SOCP) for the dispatch of batteries in a receding-horizon fashion in order to counter against the variable, renewable generation. The solution of the SOCP is used to initialize a nonlinear program (NLP) in order to ensure a physically realizable solution. The phenomenon of simultaneous charging and discharging of batteries is rigorously analyzed and conditions are derived that guarantee it is avoided. Simulation scenarios are implemented with GridLab-D for the IEEE-13 and IEEE-123 node test feeders and illustrate not only AC feasibility of the solution, but also near-optimal performance and solve-times within a minute.

The optimal power flow (OPF) is a useful tool to coordinate the grid resources subject to the nonlinear power flow equations and network constraints [5]. For constant power loads, the AC power flow equations relate the voltages in the network with the power injections. It has been shown in [6] that the solution space of the three-phase OPF is non-convex and the solution space of the OPF problem and its convex hull are different. However, many works in literature such as [7] have shown the importance of considering the imbalances in a distribution network for accurate analysis. The full ACOPF model represents an NP-hard, non-convex problem. Recently, there have been efforts to use convex optimization techniques to solve the OPF problem [8], [9]. Previous works in literature have shown that for certain (e.g. radial) network toplogies, the convex relaxations, such as second order cone programs (SOCP) and semi-definite programs (SDP) can be exact [10], [11]. Traditionally, DistFlow algorithms based on branch flow power models, which is an exact nonlinear formulation of the distribution network power flow equations, are used to solve the OPF problem in distribution networks [12]. However, these methods only consider balanced single phase equivalent models. Distribution networks are inherently unbalanced which makes it important to study the full three-phase models of these networks [13].
Linear approximate models can also be powerful when they are sufficiently accurate. One particular approximation is an extension of the DistFlow model [12] to unbalanced power flows, LinDist3Flow, which is a linear formulation of the branch flow applied to 3-phase distribution networks. This model is obtained by linearization and assumptions of fixed per-phase imbalances [14], [15]. Linear models, even though simple and computationally efficient, do not provide guarantees on optimality and feasibility, which are important for scheduling/dispatch problems, such as battery dispatch.
In [16], [17] the authors use SDP rank constraint relaxation to the three phase model of a distribution network, whereas in [18], [19], the authors have used multi-period SDP relaxation techniques to solve this problem for transmission networks, however, SDP solvers are still not numerically robust [20]. In [21], the authors have utilized a single phase OPF AC-QP algorithm that is initialized with an SOCP relaxation. However, this multi-period OPF formulation neglects the non-unity charge and discharge efficiency of the battery, which can create solutions to the OPF problem that are physically unrealizable due to simultaneous charging and discharging of batteries.
In [22], we developed a three-phase convex SOCP relaxation of the multi-period OPF problem. We also provided sufficient This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see http://creativecommons.org/licenses/by/4.0/ conditions to avoid simultaneous charging and discharging of batteries in distribution networks with non-unity charging and discharging efficiencies. In this paper, we extend the work in [22] by developing a multi-period SOCP-NLP algorithm that provides a near optimal but guaranteed feasible solution. We also extend and generalize the analysis on simultaneous charging and discharging to different objective functions and provide comprehensive simulation results on 100+ node feeder system to illustrate computational effectiveness of the proposed optimization algorithms. The optimized solutions obtained from the relaxed SOCP model, are used to initialize a nonlinear program (NLP) of the actual AC power flow to obtain a physically realizable solution. Furthermore, the real-power solutions that form the energy trajectory and are obtained from the SOCP are fixed in the NLP, leading to a decoupling of the different time-steps. As a result, the NLP solves each time-step separately (and possibly in parallel), leading to a scalable framework. Validation is performed with GridLab-D [23].
Thus, main contributions of this paper are as follows: 1) A novel approach to obtain a near-optimal feasible solution by temporal de-coupling of the NLP initialized with the solution from a multi-period three-phase SOCP convex relaxation is presented. By fixing the real-power solutions, the time-steps of the NLP are decoupled leading to a scalable framework 2) Rigorous analysis is performed on the convex formulation and general conditions are derived that guarantee that the phenomenon of simultaneous charging and discharging of batteries is avoided for different types of network objectives. Section II develops the three-phase OPF problem and the convex formulation for the dispatch of batteries to minimize the network line losses. The role of the objective function on the conditions for which simultaneous charging and discharging of batteries is avoided are analyzed in Section III. Section IV guarantees a physically realizable battery multi-period dispatch by coupling the relaxed SOCP with the exact NLP formulation. Simulation-based analysis and validation results are discussed in Section V for the IEEE-123 node system and GridLab-D. Conclusions and future research directions are presented in Section VI.

II. CONVEX FORMULATION OF MULTI-PERIOD 3-PHASE OPF
The aim of this section is to develop a convex formulation of the multi-period optimal power flow in three-phase distribution networks that can be used for the dispatch of DERs in the network. Fig. 1 illustrates the types of DERs available to the optimizer at each node and the corresponding notation. A common objective in distribution networks is to minimize the real power losses, while keeping the system within its operational grid constraints [24]. This program optimizes the batteries (i.e., the real and reactive powers) in the network, whose architecture is shown in Fig. 1, over the minute-to-minute time-scale. Such fast solution times for large networks requires formulation that can be solved in polynomial time. Thus, we focus on the following convex formulation. Let vector V n,t ∈ C |φ| be the voltage at node n and time t, with W n,t = V n,t V * n,t , i l,t ∈ C |φ| be the current in branch l at time t, with I l,t = i l,t i * l,t , S l,t = V n,t i * l,t be the apparent power in branch l at time t and Z l = R l + jX l ∈ C |φ|×|φ| be the impedance of branch l. Let S net n,t ∈ C |φ| be the apparent power injection, S L n,t ∈ C |φ| be the apparent load, S S n,t ∈ C |φ| be the apparent power from solar PV, P c n,t ∈ R |φ| and P d n,t ∈ R |φ| be the charge and discharge power of battery, q b n,t ∈ R |φ| be the reactive power from battery and B n,t ∈ R |φ| be the state of charge (SoC) of the battery, all defined at node n and time t, assuming the nodes have Wye-connected single phase batteries. The symbols •, (.) * and diag(.) represent the Hadamard product of matrices, the complex conjugate operator, and the diagonal operator, respectively.

B. Mathematical Formulation
n,t , S S n,t } be the set of independent optimization variables ∀ t ∈ T , n ∈ N , then the problem of optimally dispatching the batteries to minimize objective function f (x) can be formulated as: where the above equations hold ∀t ∈ T . In the optimization problem (1a)-(1o), (1a) represents the objective function, which for our case is to minimize line losses, i.e., f (x) = L l=1 ). The constraint that relates the voltages and currents in the network to the variables W n,t , I l,t and S l,t are in (1b) while (1c) is the power flow equation relating the voltage drop in the network with the branch power flows. Constraint (1d) represents the power balance equation at each node which makes sure that the power coming into a node equals power going out, (1e) and (1f) are the real and reactive nodal power balance equations, (1g) is the line power flow constraint with S max,l ∈ R |φ| being the apparent power limit of line l, (1h) is the voltage limit constraint at each node with V min,n ∈ R |φ| and V max,n ∈ R |φ| the lower and upper voltage limit respectively at node n, and (1i) represents the apparent power limit of the solar inverter at node n. Constraints (1j)-(1o) describe the battery power, state of charge (SoC) and charge/discharge complementarity constraints with H max,n ∈ R |φ| as the apparent power limit of the battery inverter at node n and B min,n ∈ R |φ| and B max,n ∈ R |φ| as the lower and upper state of charge limit of the battery respectively at node n and Δt is the prediction horizon step. The variable types used in the formulation are presented in Table I.
The optimization model from (1a)-(1o) is nonlinear due to the equality constraints in (1b) and (1o), which can also be equivalently expressed as an integer constraint using binary variables as shown in [22]. These constraints make the problem NP-hard. The nonlinear equality constraint in (1b) can equivalently be expressed by the following two constraints [17]: The inequality constraint in equation (2) is an positive semidefinte (PSD) convex constraint, whereas the rank constraint is non-convex. Removing the rank constraint in (2) leads to a convex SDP formulation, however, it is desirable to find a second order cone relaxation that can be solved with numerically robust solvers such as GUROBI [25]. SOCP relaxation can be applied to the PSD constraint in equation (2) as in [26], [27] to obtain the following relaxed SOC constraints:, If the complementarity constraint given in equation (1o) is also relaxed, the optimization model becomes convex and can be solved with GUROBI (as a QCQP) or MOSEK (as an SOCP). However, the reader will notice that removing (1o) means that a feasible solution may charge and discharge a battery simultaneously, which is not physically realizable. Therefore, we need to analyze conditions under which the complementarity condition is satisfied at optimality. Improving upon the work in [22], Section III provides conditions for avoiding simultaneous charging and discharging in batteries which are not dependent on the size of inverters.

III. RELAXING BATTERY COMPLEMENTARITY CONSTRAINT
This section focuses on the phenomenon of simultaneous charging and discharging (SCD) of batteries in (1). As detailed in [22] and [28,Appendix] and illustrated in Fig. 2, SCD begets a family of battery dispatch solutions (P d n,t , P c n,t ) whose nodal net-injections, P d n,t − P c n,t , are identical but whose effect on the battery's predicted state of charge introduces a undesirable prediction error proportional to t∈T P d n,t P c n,t . To avoid SCD, one can enforce complementarity condition (1o) between charging and discharging decision variables of each battery. However, (1o) renders the SOCP problem non-convex. One approach to eliminate the challenging constraint is to introduce a binary (charge/discharge) variable to formulate an equivalent mixed-integer SOCP (MISOCP) problem. However, despite recent advances in MIP solvers, the MISOCP is computationally challenging as the number of batteries or the time-horizon increases. Instead, this paper omits (1o) entirely and then analyzes under which conditions the optimal solution satisfies the complementarity constraint. This ensures that a (near) globally optimal solution can be achieved in a computationally efficient manner.
In [28] the authors present a receding-horizon OPF scheme for congestion management with batteries and quantify the effects of simultaneous charging and discharging. They then devise an algorithm that uses primal and dual variables from a relaxed solution to parameterize a complementarity-enforced instance of the problem. That approach ensures the dispatch is physically realizable and does not modify the original objective function. However, the computational effort has now doubled by having to solve the problem twice) and it may still not be optimal. In [29], Karush-Kuhn-Tucker (KKT) conditions applied to a balanced bulk transmission network for the economic dispatch problem are analyzed and it is shown that under reasonable economic assumptions, simultaneous charging and discharging can be avoided. The authors in [30] introduced a method of modifying the objective function in order to avoid simultaneous charging and discharging, but do not provide the conditions under which it holds. In [22], we provided a preliminary analysis in a loss-minimizing distribution system setting with energy storage by imposing sufficient conditions on the Lagrange multipliers from the energy balance and inverter constraints. However, the conditions proposed in [22] are impractical for systems with bidirectional loads (e.g., batteries) and a high penetration of solar PV. In this paper, more general conditions are proposed that provably guarantee no SCD and hold for different practical optimization objectives and use-cases. Specific operating conditions are finally identified where SCD is provably optimal (which is undesired) and explicit methods are then presented that enforce complementarity.
The approach herein first augments the objective function to reduce the effects of SCD's fictitious energy losses, i.e., fictitious in the sense that the predicted state of charge will be different from the actual state of charge since the battery cannot operate with SCD (e.g., see Fig. 2), and is as follows: where f (x) is given in (1a). Loss-minimization on the IEEE-13 node network with network parameters provided in [31], Fig. 3 illustrates the effects of SCD with a single battery. Without the complementarity constraint imposed, the optimizer may waste energy through charge/discharge inefficiencies to achieve a lower state of charge of the battery as shown in Fig. 4(a) The addition of the battery power term in the objective function avoids SCD as shown in Fig. 3 with a negligible effect Fig. 3. Comparison of simultaneous charge and discharge in battery at node 680, phase B for IEEE-13 node system between the cases with battery power term in objective, the 1st and 2nd run of the two-step algorithm presented in [28] and the mixed integer formulation. The reason for simultaneous occurrence of charge and discharge is that the objective function only has terms for the losses in the distribution lines and does not take into account the fictitious energy loss in the battery due to charging and discharging Thus, all solutions with the same value for P d − P c , are equivalent in the optimization solution, which begets simultaneous charging and discharging. on the original objective function as illustrated with Fig. 4(b), where a comparison is presented with the exact mixed integer formulation. The solutions have the same optimized line losses as shown in Fig. 4(b) and the addition of battery power term incentivizes the solution to points that satisfy the complementarity constraint.
To formalize this result, Theorem III.1 below provides specific conditions under which the convex formulation with a differentiable objective function, f (x) can avoid SCD with (6). Specifically, the result holds for the following practical objectives in distribution networks:   (6), the SCD relaxation is exact if the following conditions hold at each node n and phase φ: (6) is strictly positive (> 0), C3) Γ(t) : = T τ =t (β 1,n,φ (τ ) − β 2,n,φ (τ )) ≥ −α, β 1,n,φ (τ ), β 2,n,φ (τ ) ∈ R + be Lagrange multipliers for the upper and lower bounds of inequality (1l), respectively. The proof of Theorem III.1 is provided in Appendix A. Theorem III.1 showed that with the modified objective function given by (6), SCD can be avoided under certain conditions in order to obtain a physically realizable solution from the optimizer.
The addition of the battery power term in the objective does, however, modify the objective function resulting in a sub-optimal solutions compared to the original objective. When the battery is charging, i.e., P d = 0, the modified objective is the same as the original objective resulting in the same optimal value. When the battery is discharging, i.e., P d > 0, the modified objective is different from the original line loss minimization objective, however, as α can be chosen to be small the effect on the optimal value is negligible. Fig. 3 shows the comparison between the solution (P d , P c ) obtained from the convex formulation and the mixed-integer formulation and shows that the solutions match. This is also shown in Fig. 4(b) which compares the optimal value (line loss) between the two formulations and shows that the objective values match.
Remark: Theorem III.1 holds for the given objectives when conditions C1, C2 and C3 are satisfied. However, condition C3 can be restrictive, especially under a high penetration of renewable generation. Furthermore, certain objective functions like tracking battery state of charge require stricter conditions as shown in Corollary VIII.0.1 in Appendix B. For such cases, the following methods are proposed to obtain a physically realizable solution that avoids simultaneous charging and discharging of batteries.
r Large α: In the case where Γ(t) < 0, α can be chosen large enough to ensure that condition C1 is satisfied. The value of Γ(t) may be estimated based upon the solar and load conditions. However, the drawback of this approach is that a large value of α would clearly shift the optimal solution.
r Two-step battery dispatch: as presented in [28], the first run permits SCD and the the second enforces complimentarity based on the net-effect of the first solution to obtain a physically realizable solution. This method can provide a near optimal feasible solution as shown in Fig. 3 but doubles the run-time. Future work will further explore how this two-step technique can provide optimality certificates and will improve its implementation to avoid the doubling of the solve time. r Simplified battery model: In this method, the battery model in (1k) is replaced by an approximated battery model that uses a single standing-loss efficiency η eq instead as shown below: n,t ∈ R |φ| is the net battery power injection. The value of η eq can be estimated based upon expected battery schedule and the values of η d and η c . Future work will explore a mapping between the two battery models as a way to estimate η eq to minimize modeling error over the horizon with respect to the actual battery model in (1k). Based on the results of this section, a convex formulation of the multi-period three-phase OPF can be obtained that satisfies the complementarity condition between charging and discharging of batteries under certain conditions. When the conditions are not satisfied, this work proposes techniques to obtain a near optimal solution that enforces complementarity. However, the second order cone relaxation of the nonlinear power flow equations may engender solutions that are not physically realizable. To guarantee realizability, the next section presents a nonlinear programming (NLP) formulation of the OPF problem that is initialized with the relaxed SOCP solution. Note that the NLP initialization goes beyond just a warm-start and includes a novel mechanism to account for the multi-period formulation inherent to an energy storage trajectory.

IV. MULTI-PERIOD COUPLING OF SOCP WITH NLP
The original OPF formulation given by (1a)-(1o) is nonconvex because of the nonlinear power flow constraint in (1b) and the SCD complementarity constraint in (1o). The two constraints are relaxed to obtain an SOCP formulation of the OPF problem. The non-convex constraint (1o) is relaxed as explained in Section III, which provides conditions under which the SOCP solution is tight (with respect to the complementarity condition). However, the relaxation of the nonlinear power flow model in (1b) with the second-order cone constraints (3)-(5) can result in non-physical solutions to the OPF problem as has recently been shown in [6].
Thus, if we seek a physically realizable solution for a general objective function, we need a nonlinear programming (NLP) formulation. Thus, we seek to leverage the multi-period solution available from the SOCP. However, NLPs are not scalable and the solve time increases dramatically with the increase in problem size (and coupling) [32] To overcome this challenge, we propose a time-decoupled approach by fixing the battery's active power set-points in the NLP based on the solution obtained from the SOCP. This allows the NLP to focus on reactive power setpoints and voltage limits, which aligns with recent analysis [33]. In [33], it is shown how reactive power and voltage limits lead to disconnections in the power flow solution space resulting in a non-zero duality gap for the relaxed OPF. Based on these observations, an SOCP-NLP coupled algorithm is developed as shown in Fig. 5, where the solution obtained from the SOCP is passed to the NLP solver. Prior work in literature, such as [26], have  proposed the idea of using the solution of a convex relaxation as an initial starting point for solving the full, nonlinear ACOPF. However, herein we extend the notion of a "warm start" to the multi-period domain. Specifically, we decouple the multi-period NLP by fixing the active power set-points of the batteries to the solution of the convex relaxation (SOCP). Keeping the active power solutions constant leads to fixing the state of charge of the batteries and, as a result, results in a decoupling of the time-steps of the prediction horizon in the NLP. Thus, each time-step can be solved independently and in parallel (as independent NLPs), which leads to a scalable implementation compared to solving the multi-period NLP. This is further explained through Fig. 6 where for each time-step of the prediction, the reactive power range available to the NLP is constrained by the SOCP's solution. That is, Fig. 6 illustrates the decomposition approach presented herein by showing the effect of the SOCP's optimized active power trajectory on the feasible set of the reactive power of the NLP problem.
Remark: The decoupling of the time-steps reduces the feasible set of the optimization problem and, hence, increases the optimal value. Thus, the decoupled problem represents an upper bound on the time-coupled nonlinear problem, which in turn is lower bounded by the SOCP as shown below: where NLP opt represents the optimal value of the time-coupled nonlinear program and DN LP opt the optimal value of the timedecoupled nonlinear program (DNLP).
The DNLP problem at each time-step t of the prediction horizon can then be expressed as: where P c * ∈ R |φ| and P d * ∈ R |φ| are the charge and discharge power of the battery obtained from the SOCP at node n and time t, such that P * = P d * − P c * . The NLP given by equations (8a)-(8d) is solved separately at each step of the prediction horizon to obtain a feasible plus (near) optimal solution with guaranteed feasibility and a bound on the optimality, as the relaxed SOCP provides a lower bound on the optimal value of the original nonlinear problem [32]. Utilizing this SOCP-NLP coupled optimization framework, a scalable solution of threephase OPF problem can be obtained rapidly, plus the framework provides bounds and guarantees on feasibility and optimality of the solution, where the upper-bound on the global optimality gap is computed from In the next section, simulation tests are conducted on unbalanced IEEE test feeders to verify the feasibility of the proposed formulation and investigate the global optimality gap. The validation is conducted by using forward-backward sweep in GridLab-D.

A. Case Study Description
Simulation-based analysis of the multiperiod SOCP-NLP algorithm presented above is conducted on the unbalanced 123-node IEEE test feeder with a base voltage of 2.4 kV and base apparent power of 1 MVA. The algorithm is implemented in receding-horizon fashion. That is, the SOCP results in an open-loop, optimal battery and inverter control schedule, which is used by the NLP to calculate a physically realizable schedule that is implemented by GridLab-D (i.e., the "plant") to determine the resulting AC power flows. The forecasts of demand and renewable generation are then updated and the SOCP-NLP implementation repeats. A sample forecast of aggregate solar, demand and net-demand over a prediction horizon is shown in Fig. 7.
Distributed storage and solar PV units are added at random to 16 nodes in the network which can supply active and reactive power through four quadrant operation. Each storage unit has an energy capacity of 40 kWh and an apparent power rating of 50 kVA, whereas each solar PV unit has a rating of 100 kVA. The solar and load profile over the 30-step prediction horizon, with each step being 1 minute duration, are constructed from the minutely forecast data available [34]. Let mean load, μ l , be the base load of the IEEE-123 node system and μ s be the mean solar and equal to 100 kW Discrete control devices such as switches, capacitor banks and transformers are fixed at their nominal value for this study. A three phase OPF is run in a receding horizon fashion with a prediction horizon of 30 time-steps, for the dispatch of controllable assets of the network to minimize the network losses. The set-points provided by the solution of the SOCP are used to initialize an NLP to provide a feasible solution. The SOCP is modeled in JuMP [35], with Julia and solved using GUROBI [25]. The multi-period SOCP has 108,000 variables, 48,000 linear constraints and 81,000 SOC constraints. The NLP is also modeled in JuMP, but solved with IPOPT [36] using HSL_MA86 solver [37]. The single-period NLP has 3,600 variables, 1,600 linear constraints, 700 SOC constraints and 2,000 non-linear constraints.

B. Data Management
To enable the presented framework, it is assumed that the minutely PV production forecast data and the demand profile data over the 30 minute horizon, as shown in Fig. 7, is available to the central dispatcher. In this paper, we assume a perfect forecast, whereas future work will investigate the role of uncertainty and robustness to forecast error. Such minutely solar PV forecasts are available today at minutely forecasts with a 60-minute prediction horizon [34]. It is also assumed that the dispatcher knows about the power rating and capacity of the available PV units and the updated state of charge of the distributed storage units. This dispatcher could be a distribution system operator (DSO; e.g., NY REV's DSIP [3]), so it is reasonable to assume that such system information is available. Furthermore, it is assumed that the DSO knows the network topology, so it can formulate and solve the optimization problem based on network parameters and dispatch available flexible resources accordingly.

C. Test Case Results
The results obtained under four different solar and load cases as shown in Table II, where high load and high solar corresponds to the base values and low load and low solar corresponds to a mean value of 50% of base. These cases are utilized to show the feasibility, optimality, gap and solve time of the formulated algorithms.    Table III show that the optimality gap of the obtained solution is always less than 3%, as the SOCP solution provides the lower bound to the global optimum. The RMSE and worst case values are calculated based on the optimal values of the SOCP and the NLP run in a receding horizon fashion through simulations over a horizon of one hour. To further investigate the optimality gap, Fig. 8(a) shows the optimality gap as the solar penetration level in the system is varied for the base load case. From the figure it can be seen that the optimality gap is always below 3% for the different solar penetration levels.
The feasiblity of the NLP solution is tested against GridLab-D and the validation is given in Fig. 8(b) for case HH, which shows that the voltages obtained from the NLP match closely with those obtained through a power flow performed in GridLab-D using backward-forward sweep. NLPs are not scalable and the solve time increases dramatically with the increase in problem size (and coupling) as can be seen from Fig. 10(a) for case HH, which shows the increase in solve time as the length of the prediction horizon increases. The computation time of the decoupled algorithm is illustrated in Table IV showing that the mean total solve time at each time step for SOCP+NLP is always under 45 seconds, providing sufficient time for communication  delays in order to guarantee a solve time of under one minute for the dispatch of distributed storage to counter the fast-time variation in renewable generation. The SOCP time is the time it takes to solve the multi-period optimization with a time-horizon of 30 steps, whereas the NLP time is the time it takes to solve each time-instant in a decoupled and parallel form. Fig. 9(a)-9(d) shows the worst case difference in DER reactive power generation over the prediction horizon between the SOCP and the NLP, whereas Fig. 10(b) shows the variation in SOCP solve time as the size of the receding horizon is increased for case HH. In the figure, the edges of the box represent the 25th and 75th percentile of data, whereas the + sign represents the most extreme value in the dataset. It can be seen from Fig. 10(b) that the SOCP algorithm scales well with the increase in horizon size.

VI. CONCLUSIONS AND FUTURE WORK
This paper presented a method for the optimal dispatch of batteries in an unbalanced three-phase distribution network. A second order cone relaxation is used to convert the non-convex power flow equation into a convex formulation that can be solved in polynomial time. As the solution obtained from the relaxed problem may not be feasible, an NLP is solved at each time-step by fixing the real power set-points and decoupling the time-steps to obtain a physically realizable solution. Furthermore, the phenomenon of simultaneous charging and discharging of batteries is analyzed and sufficient conditions are provided for different objective functions that provably avoid this phenomenon to obtain a feasible solution. Simulation tests are conducted on IEEE-13 and IEEE-123 node distribution test feeders showing the feasibility of the obtained solution. The optimality gap is found to be within 2.1%. The approach is computationally tractable and solves in less than 45 seconds, which ensures that enough time is available for realistic communication delays. This permits an implementation of the optimization scheme on the minute timescale.
Future work will focus on reducing the optimality gap by using stronger relaxations of the power flow equations. We will also try and provide guarantees for a feasible solution to the decoupled NLP given an initialized SOCP solution. Extending the work to different grid objectives and including mechanical voltage control devices such as transformers and capacitor banks is another scope for improvement. Providing bounds on the gap between voltages obtained from the SOCP solver and a power flow solution is also an avenue for future work. Further analysis on the phenomenon of simultaneous charging and discharging is required as described in Section III APPENDIX A PROOF OF THEOREM III.1 Proof: Since the SOCP optimization problem is convex and Slater's condition holds trivially, the KKT optimality conditions are both necessary and sufficient. Thus, for the KKT conditions, let r L be the Lagrangian. r λ p ∈ R be the Lagrange multiplier for (1e). r λ s ∈ R + be the Lagrange multiplier for inequality (1j). r λ d , λ d ∈ R + be Lagrange multipliers associated with the lower bound and upper bound of inequality (1m), respectively.
r λ c , λ c ∈ R + be Lagrange multipliers for the lower and upper bounds of inequality (1n), respectively. Note that P c and P d are the charging and discharging rates for the battery at node n, phase φ at time t and represent primal variables and η c , η d ∈ [0, 1] are the charging and discharging efficiencies.
(10) With respect to P d , KKT conditions give ∂L ∂P d ≡ 0: