On the Optimal Selection and Integration of Batteries in DC Grids through a Mixed-Integer Quadratic Convex Formulation

Grids a Mixed-Integer Quadratic Abstract: This paper deals with the problem of the optimal selection and location of batteries in DC distribution grids by proposing a new mixed-integer convex model. The exact mixed-integer nonlinear model is transformed into a mixed-integer quadratic convex model (MIQC) by approximating the product among voltages in the power balance equations as a hyperplane. The most important characteristic of our proposal is that the MIQC formulations ensure the global optimum reaching via branch & bound methods and quadratic programming since each combination of the binary variables generates a node with a convex optimization subproblem. The formulation of the objective function is associated with the minimization of the energy losses for a daily operation scenario considering high renewable energy penetration. Numerical simulations show the effectiveness of the proposed MIQC model to reach the global optimum of the optimization model when compared with the exact optimization model in a 21-node test feeder. All the validations are carried out in the GAMS optimization software.


Introduction
Electrical distribution networks have experienced important paradigm shifts associated with the large-scale insertion of renewable generation based on photovoltaic and wind sources in conjunction with energy storage technologies mainly focused on chemical storage [1][2][3][4]. All of these devices are interfaced with the distribution network through the implementation of power electronic converters with alternating current (AC) and direct current (DC) conversion stages as a function of the device interconnected and the technology of operation of the distribution grid, i.e., AC or DC network [5,6]. From the beginning to the electrical networks to our days, the predominant technology for building electrical networks in transmission levels has been the AC technology due to the most of the demands connected to the networks were simple, i.e., electrical rotate machines (induction motors), temperature conditioners, and illumination, among others; however, the nature of the loads have drastically changed with the appearance of computers, electric vehicles, household appliances, and small dispersed generating and storage systems, most of them operated with DC technologies [7][8][9][10]. Recent studies have demonstrated the advantages of having distribution networks in medium voltage levels operated with DC technologies due to important reductions in energy losses associated with the distribution activity since the reactive power is compensated directly in the point of connection of the load [11,12].
Recognizing the recent relevance that is having distribution networks operated with DC technologies, this research explores the impact of the integration of battery energy storage systems (BESSs) in these grids, considering the high penetration of renewable generation under an economic dispatch environment [13,14]. In the current literature, the problem of the optimal integration of BESSs has been explored in multiple pieces of research for AC and DC grids; here, we present some of these researches.
Authors of [15] have presented a mixed-integer nonlinear programming (MINLP) model to represent the problem of the optimal location of BESSs in AC distribution grids. To solve this model a decomposition method was proposed where the MINLP model is divided into two optimization sub-problems named planning and operation. In the planning stage is defined the optimal location of the BESSs, while the operation stage is entrusted with their optimal operation. For solving the planning stage the classical simulated annealing algorithm is implemented based on sensitivity indexes associated with the impedance matrix of the network. Numerical validations were carried out in two test feeders composed of 135 and 230 nodes; however, the authors did not provide comparisons with other optimization methodologies to confirm the effectiveness of the proposed approach. In Reference [16], the authors have implemented the problem of the optimal location-reallocation of batteries in DC microgrids by solving the exact MINLP model in the GAMS software. Numerical results were presented in a 21-bus system considering that the initial location of the batteries was heuristically defined by the utility company. The authors do not provide any comparative methodology to demonstrate the efficiency of the proposed optimization methodology since the research is presented in a tutorial style. Soroudi, in Reference [13] has presented different optimization models for the optimal operation of BESSs in electrical AC networks. Three models were presented, which correspond to (i) the economic dispatch model, (ii) the DC equivalent of the AC grid, (iii) and the complete AC model of the grid. All these optimization models were solved in the GAMS optimization package; nevertheless, no comparison with metaheuristic or approximated optimization models were provided, since the intention of the author is to provide optimization tools to introduce engineers in the power system optimization topics from the tutorial point of view. Authors of [17] have presented a master-slave optimization methodology to operate batteries in DC networks considering multiple loads curves and high renewable generation availability. In the master stage was proposed a particle swarm optimizer to define the optimal operation of the batteries during the day, while the slave stage was entrusted with solving the multi-period power flow problem. The objective persecuted by the authors corresponded to the minimization of the energy purchasing cost at the substation node. The proposed methodology was tested in a test feeder composed of 21 nodes, and the efficiency of the methodology was compared with different metaheuristic approaches such as black-hole optimizer and the genetic algorithm. In Reference [18] the authors have proposed the implementation of the genetic algorithm to select and operate BESSs in AC distribution networks. The genetic algorithms were entrusted with determining the size and the operation scheme of the batteries using an integer codification with three possible states to operate these batteries. Numerical results demonstrate that the total grid energy losses is reduced when batteries are installed by using the Baran & Wu test feeder composed of 69 nodes [19]; however, the authors did not provide comparisons with exact or metaheuristics optimizers to confirm the effectiveness of the proposed optimization approach.
Other authors have proposed multiple operative models to coordinate the daily operation of the batteries; some of these approaches are: mixed-integer linear programming [20][21][22]; second order cone optimization [23][24][25], semidefinite programming [26]; genetic algorithms [27][28][29], particle swarm optimization [30,31]; nonlinear programming [32][33][34][35][36], and reinforcement learning for energy system optimization [37,38]. The main characteristic of those researches is that the batteries are modeled through a linear relation between the state-of-charge and the amount of power injected/absorbed into the grid [11]; this linear representation allows solving efficiently the problem of the optimal dispatch of these batteries in AC and/or DC grids where these are previously located to the network.
To contribute to the research area associated with the optimal integration and operation of BESSs in electrical networks, here, we propose an efficient mixed-integer quadratic convex (MIQC) model to select and size batteries in DC networks. This corresponds to an improvement of the mixed-integer nonlinear programming (MINLP) model proposed in [16], with the main advantage that the optimal location and coordination of the batteries correspond to the global optimal solution of the problem since the MIQC model ensures the finding through the application of the Branch & Bound and interior-point methods [39]. To verify the efficiency of the proposed MIQC model is evaluated in a DC network composed of 21 nodes and its results are compared with the exact MINLP model implemented in the GAMS software.
To demonstrate the novelty of the proposed convex reformulation to select and locate batteries in DC grids, in Table 1 are summarized the main literature reports, by highlighting the type of mathematical models, solution techniques, and objective functions considered. Table 1. Main approaches reported in the specialized literature.

Math. Model
Objective Function Solution Method Ref.

MINLP
Minimization of the grid generation costs General algebraic modeling system [34] MINLP

Minimization of energy losses costs and investment costs
Sensitivity index combined with simulated annealing [15] MINLP Minimization of energy losses costs General algebraic modeling system [16] MINLP Minimization of energy losses costs Genetic algorithms and multiperiod power flow [18] NLP Simultaneous minimization of energy losses costs and greenhouse gas emissions General algebraic modeling system [40] NLP Minimization of grid generation costs General algebraic modeling system [13] NLP Minimization of energy losses costs Particle swarm optimization and multiperiod power flow [17] LP Minimization of grid operation costs and greenhouse gas emissions Stochastic linear programming [20] MILP Minimization of the operating costs reduction by promoting self-consumption General algebraic modeling system [22] MILP Minimization of operative costs in microgrids Simulation scenarios in the CPLEX solver [21] MICP Minimization of the grid expansion planning costs CPLEX solver in the AMPL software [23] SDP Minimization of the grid generation costs Convex solvers in the CVX environment for MATLAB [26] SOCP Minimization of the grid generation costs Convex solvers in the CVX environment for MATLAB [25] Note that the literature reports in Table 1 show that the most common objective functions are associated with the minimization of the grid operating costs and energy losses costs, which supports the selection of the objective function considered in this research to select and integrate BESSs in DC grids. In addition, the proposed MIQC reformulation for the exact MINLP model has not been previously proposed for AC and DC grids, which was identified in this research as a gap in the scientific literature that this investigation tries to fill.
Ahead, this document has the following organization: Section 2 presents the exact MINLP formulation of the problem of the optimal selection and operation of BESSs in DC grids considering as the objective function minimization of the energy losses costs during the period of operation; Section 3 presents the proposed MIQC reformulation by using a Taylor linearization of the product among voltages in the power balance equation; Section 4 presents the main characteristics of the 21-bus system used to validate the proposed optimization methodology. Section 5 presents the main numerical results when comparing the exact MINLP and the proposed MIQC models, including their analysis and discussion. Finally, Section 6 lists the main conclusions obtained from this research.

General Formulation
The study of the optimal siting and selection of BESS in DC microgrids considering high penetration of renewable sources corresponds to a mixed-integer nonlinear programming formulation that can be represented as a multi-period economic dispatch [15,41]. The nonlinear part of the optimization model is defined by the product among voltages in the power balance constraint [42]; while binary nature is associated with the variables that define the location or not of a BESS in an arbitrary node of the network [16].

Objective Function
Here, we present the exact MINLP for optimal locating-reallocating BESS in DC networks considering as the objective function the minimization of the costs of the daily energy losses.
where f 1 is the value of the objective function related with the total costs of the daily energy losses, CoE t is the average cost of the energy in the spot market; v i,t and v j,t are the voltage variables at nodes i and j during the period of time t, respectively. G ij corresponds to the conductance parameter that relates nodes i and j; ∆t represents the length of the time period where the demand and generation are assumed constant; this parameter can be 1 h, 30 min, or 15 min, depending on the data resolution. It should be noted that H and B are the sets that contain all the periods of time and all the buses of the network, respectively.

Remark 1.
The main characteristic of the objective function f 1 is that it corresponds to an algebraic sum of quadratic terms with the main advantage that its combination is convex, since the conductance matrix, i.e., G, is a positive definite [43]; which implies that this objective function can be rewritten as follows where v t is the vector that contains all the nodal voltages at each period of time.
It is worth mentioning that the minimization of the objective function (2) involves the improvement of the voltage profiles in all the nodes of the networks since the total grid energy losses are a nonlinear function of the voltage profiles. In addition, due to the presence of the conductance matrix in this objective function, the usage of the renewable energies are in general maximized, since these helps with local power injection that reduces the current magnitudes provided by the slack source. For this reason, as confirmed by Table 1, in this research the minimization of the total costs of the energy losses is selected as the performance index for our proposed MIQC model.

Set of Constraints
The problem of the optimal selection and operation BESSs in DC grids includes multiple constraints: power balance, state-of-charge (SoC) in batteries, devices' capabilities, voltage regulation bounds, and the maximum number of BESSs that can be installed along the grid [17], among others. In this paper, the complete list of constraints considered is presented below.
where is the maximum number of BESS available for being introduced in the DC grid, and E is the set that includes all the BESS technologies available.

Model Interpretation
The exact MINLP formulation (1) to (12) can be understood as follows: Equation (1) and its matricial form defined in (2) correspond to the objective function of the optimization problem that defines the daily cost of the energy losses of the network associated with the energy dissipation in all the distribution lines of the distribution system. Equality constraint (3) defines the power balance at each node of the network which results from the application of the nodal voltage method to the grid with constant power consumption; Equation (4) defines the linear relation between the state-of-charge of the battery and its power delivered/consumed [13]; Equations (5) and (6) define the operative characteristics for operating BEESs, which are the desired initial and final SoCs typically defined by the distribution company. Equations (7)-(9) define the upper and lower power limits for the slack and disperse generation sources as well as for BESSs, respectively. In Equation (10), the voltage regulation constraints are set. Inequality constraint (11) presents the upper and lower bounds for the SoCs in BESSs; Equation (12) defines the maximum number of BESSs available for installation in the DC distribution grid.

Remark 2.
The main complication of the MINLP model (1)- (12) corresponds to the power equilibrium constraints (see Equation (3)) since this is non-convex owing the products among continuous variables, i.e., voltages in all the nodes [42].
This set of equality constraints (power balance equations) will be treated with a Taylor-based linearization to become the MINLP model into a MIQC model as the main contribution of this work as will be presented in the next section.

Mixed-Integer Quadratic Reformulation
To deal with the MINLP model that represents the problem of the optimal selection and location of batteries in DC distribution grids, we present the proposed MIQC reformulation based on the linearization of the product among two continuous variables present in the power balance constraint (3). This linearization is based on the convex representation of the load flow problem for DC distribution grids proposed in [44]. The linearization of the product of two continuous variables is detailed as follows.
Let us suppose that a function to represent the product between two continuous positive variables defined as: In addition, consider that the initial value assignable to these variables are ω 10 and ω 20 , which implies that after applied the Taylor' series expansion to (13), the following representation for this product between two continuous variables is obtained, where f H.O.T (·) models the high-order-terms in the Taylor's series expansion. To obtain a linear approximation of the product between two variables, the high-order-terms in f H.OT (·) can be neglected due to their small contribution around the operating point (ω 10 , ω 20 ).
When the linear approximation defined in (14) is applied to electrical networks to transform the power balance set of constraints in (3), the following linear equivalent set of constraints is obtained [44]. (15) where v i0,t and v j0,t represent the linearization points for the voltage profiles at each period of time; where if the per-unit representation is used, then these values are equal to 1.00 pu [44].
To demonstrate the effectiveness of the linearization of the product between voltages around the operative point (v 10 , v 20 ) = (1, 1) a graphic comparison between the nonlinearised and the linearised representation is considered for two small load systems. Considering a grid with two demand nodes with lower and upper voltage regulation bounds of 0.90 pu and 1.10 pu, the error between the nonlinear function in (13) and the linear representation (14) is presented in Figure 1.
Note that the percentage error depicted in Figure 1 shows that the linearization of the product between voltages has an estimation error of about 1% in the extreme voltage points, which confirms that the linear representation in (14) is suitable to represent the product of the voltage variables as was redefined in Equation (15).

Remark 3.
Once the power balance equations are linearized as defined in (15), the complete structure of the proposed MIQC is composed by the objective function (1) or (2) and the restrictions (4)- (12) and (15).  To summarize the solution methodology for the proposed MIQC model and the exact MINLP formulation in Figure 2 is presented the flow diagram of both mathematical models in the GAMS software [13].

Analysis of a DC Network
To validate the MIQC model for the optimal selection and location of BESSs in DC networks using the GAMS software we use the 21-node test feeder reported in [16]. The complete information of this test feeder is presented below.
The 21-bus system corresponds to a radial DC network with 21 nodes and 20 branches with a radial configuration. A controlled voltage source is sited at node 1, which defines the voltage profile of the network in 1 kV. The connection among nodes in this test feeder is presented in Figure 3.     Two distributed generators (DGs) are considered in the the 21-bus system, one wind power generator and one photovoltaic system. The wind power generator is located at node 12 with a maximum power rate of 221.52 kW. The photovoltaic source is located at node 21 with a maximum power rate of 281.58 kW. It is worth mentioning that the rated power of the DGs will multiply the normalized generation curves presented in Table 5.

Implementation and Results
The implementation of the proposed MIQC model and the exact MINLP model was made on a desktop computer running on INTEL(R) Core(TM) i7-7700, 3.60 GHz, 8 GB RAM with 64-bit Windows 10 Pro (Intel, Santa Clara, CA, USA). The optimization package corresponds to the GAMS software version 25.1.3 using the BONMIN solver.
To evaluate the performance of the BESSs in the DC network in all the simulations is considered that the initial and the final state-of-charge are assigned as 50%, and along the day this variable can vary from 10% to 90% [36]. In addition, three simulation cases are studied as follows: • Case 1: The initial location of the BESSs is tested in the exact MINLP model and the MIQC model to determine the error introduced by the Taylor approximation in the daily cost of the energy losses. Note that this simulation case solves the power flow problem with multiple periods since the binary variables related with BESSs are fixed, i.e., the MINLP model becomes into a nonlinear programming model and the MIQC model becomes a quadratic convex model. The main idea of the proposed simulation scenarios is to verify the effect of the proposed approximated MIQC model to select, locate and operate batteries in DC networks when compared with the exact MINLP model. For this reason, both models are implemented in the same optimization environment (i.e., GAMS interface). Regarding processing times, both optimization models take less than 5 min to be solved, which implies that for the 21-node test system the proposed optimization model allows evaluating multiple operative conditions (generation and demand combinations) to define the best operative scheme of the batteries, once these batteries have been installed, by ensuring that each solution will be optimal.

Comparative Results in the Case 1
In this simulation case, the initial BESS location is presented in Table 4 and Figure 3 are fixed into the exact MINLP and the MIQC model.
Once the exact MINLP model is solved in the GAMS package with the DICOPT solver, it is found a total daily cost of the energy losses of COP $52957.92; while the solution of the MIQC model with the same solver provides an optimal solution with a cost of COP $50, 890.12. The difference between both solutions is about 3.90%, which corresponds to the approximation error between the exact and approximated power balance equations (see Equations (3) and (15)). In Figure 4 are reported the profiles of the state-of-charge of the batteries obtained with the exact and the convex approximation models.
The behavior of the state of the charge in the exact and convex model follows the same tendency with negligible errors, which confirms the effectiveness of the quadratic convex approximated model to operate batteries in DC networks. The main advantage of the quadratic approximation is that the existence of the global optimal solution is ensured via convexity theory, which is indeed more attractive for the grid operation since the solution with the same inputs will always be the same, which is not possible to ensure with nonlinear programming models or solution techniques based on metaheuristics. It is worth motioning that if the solution provided by the proposed quadratic model is evaluated in the exact nonlinear model, then, the error in the estimation of the daily energy losses costs is less than 0.5%, which demonstrate the effectiveness of our proposal to determine the operative plan of BESSs under an economic dispatch environment for DC networks.
With respect to the behavior of the state of charge for all the BESSs depicted in Figure 4, we can observe that: (i) all the batteries begin and finish the day with the operative consign assigned, i.e., 50 % of the state of charge; (ii) the maximum value of the state of charge is about 77.20% for the battery located at node 7, and the minimum value occurs for the same battery with a value of 48.90%; these values imply that the batteries maintain during all the day values between their minimum and maximum bounds, i.e., from 10% to 90%; and (iii) the behavior of the state of charge at each battery is different since this depends on its location and the possibility of absorbing energy from the renewable energy source to return this energy to the grid when the load increases. Note for example that the BESS located at node system provides energy to the grid after period 21, while the remainder BESSs returns energy to the grid only after period 33, these behaviors confirm the complex relation among demand, power generation, and batteries to reach the minimization of the daily energy losses costs in the DC grid.

Comparative Results between Case 2 and Case 3
To determine the effectiveness and robustness of the proposed MIQC model to select and locate BESSs in DC networks, here, we compared the solution provided with the exact MINLP formulation and our proposed convex approximation. The solution of the exact MINLP and the MIQC models are obtained with the GAMS optimization package using the BONMIN solver. The objective function value for both models as well as the battery locations are reported in Table 6. Results in Table 6 show that: (i) the BESSs' location found by the exact MINLP model are the nodes 13, 20 and 21, with an objective function of COP $47,209.95, i.e., a reduction with respect to the base case of 10.85%. The solution of the exact MINLP model reallocates all the batteries with respect to the benchmark case, which implies that the solution of the optimization model to select and locate the BESSs in the DC network is better than the heuristic approach reported in [36]; (ii) the proposed MIQC model finds a better optimal solution with an objective value of COP $41,627.34, which has an estimation error with respect to the evaluation of the BESSs' location in the exact model about 3.49%, which implies that the location of the batteries in nodes 5, 16, and 21 provides a daily energy losses cost of COP $43,134.59 (note that this objective function value corresponds to the evaluation of the batteries' location provided by our proposed MIQC model into the exact MINLP approach to eliminate the estimation error introduced with the model linearization). This objective function shows that with respect to the benchmark case the effective reduction of the daily energy losses cost is about 18.55% when the MIQC model is used to select and locate the BESSs in the DC grid; and (iii) the effective improvement of the proposed MIQC model with respect to the exact MINLP formulation is about 8.63%. Figure 5 presents the final location of the BESSs system obtained for the exact MINLP and the proposed MIQC model, where we can observe that only node 21 appears in both solutions, this is due to the presence of a distributed generator in this node that allows storing energy in the periods of high generation and low demand. To illustrate the behavior of the BESSs in both models, we also present the state-of-charge profile in this node for both solutions compared with the generation curve in this node.   Figure 6 shows that: (i) both optimization models present a similar state-of-charge behavior at node 21; however, the proposed MIQC model provides additional energy to the grid which helps with the total energy losses cost minimization (see periods of time between 3 to 33) and (ii) both batteries provide energy in the initial period of time (from 1 to 18) since this energy will recover in the period of times where the PV source increases its power injection (see periods of time between 15 to 33) to help with additional power injections in the periods of time that the PV source decreases (periods 33 to 48) and the demand increase, i.e., periods of time from 33 and beyond.

Conclusions
This paper studied the problem of the optimal selection and location of the BESSs in DC grids by transforming the exact MINLP formulation into a MIQC equivalent. This transformation was applied to the power balance constraint using Taylor's series expansion applied to the product among voltages at each node. The proposed obtained MIQC model has as the main advantage that it ensures the global optimal reaching via Branch & Bound and interior-point methods. Numerical results demonstrated that the error introduced by the Taylors' approximation is less than 4.0 % for in the economic dispatch analysis when batteries are considered fixed.
When the exact MINLP and the proposed MIQC models are solved in the GAMS software with the BONMIM solver the numerical results demonstrated that the MINLP model obtains a reduction of 10.85% in the daily energy losses cost when compared to the benchmark case by reallocating the BESSs in nodes {13(A), 20(B), 21(B)}; however, the proposed MIQC model allowed a reduction of 18.55% in the daily grid operation costs by reassigning batteries at nodes {5(A), 16(B), 21(B)}. The net difference between both models was about 7.70% in favor of the proposed MIQC model when compared with the exact MINLP formulation, which confirmed the robustness and effectiveness of the proposed convex formulation to select and locate BESSs in DC networks.
It will be possible to develop the following future researches: (i) to include in the proposed MIQC model the possibility of doing the location of renewable energy sources and batteries for DC networks simultaneously; (ii) reformulate the exact MINLP model as a mixed-integer conic model to size and locate batteries in DC grids by minimizing the total cost estimation error; and (ii) improve the battery models with temperature and degradation factors using reinforcement learning techniques for being integrated into AC and DC networks considering different objective functions such as voltage maximization or renewables usage maximization. energéticos distribuidos en redes de distribución de energía eléctrica." and in part by the Dirección de Investigaciones de la Universidad Tecnológica de Bolívar under grant PS2020002 associated with the project: "Ubicación óptima de bancos de capacitores de paso fijo en redes eléctricas de distribución para reducción de costos y pérdidas de energía: Aplicación de métodos exactos y metaheurísticos."

Conflicts of Interest:
The authors declare no conflict of interest.