Simultaneous Minimization of Energy Losses and Greenhouse Gas Emissions in AC Distribution Networks Using BESS

The problem of the optimal operation of battery energy storage systems (BESSs) in AC grids is addressed in this paper from the point of view of multi-objective optimization. A nonlinear programming (NLP) model is presented to minimize the total emissions of contaminant gasses to the atmosphere and costs of daily energy losses simultaneously, considering the AC grid complete model. The BESSs are modeled with their linear relation between the state-of-charge and the active power injection/absorption. The Pareto front for the multi-objective optimization NLP model is reached through the general algebraic modeling system, i.e., GAMS, implementing the pondered optimization approach using weighting factors for each objective function. Numerical results in the IEEE 33-bus and IEEE 69-node test feeders demonstrate the multi-objective nature of this optimization problem and the multiple possibilities that allow the grid operators to carry out an efficient operation of their distribution networks when BESS and renewable energy resources are introduced.


Introduction
The problem of the optimal operation of battery energy storage systems (BESSs) in electrical distribution has attracted much interest in the last two decades due to the advances in energy storage and power electronic converter technologies [1][2][3]. The main advantages of including these batteries are as follows: (i) possible greenhouse emissions minimization in power systems fed by fossil generation [4,5]; (ii) improvement of the voltage profiles and the reduction of the grid power losses [6]; (iii) possible reduction of power oscillations caused by uncertainties in the renewable energy resources [7][8][9]; (iv) dynamic active and reactive power compensation using power electronic converters in electric vehicles [10]; and (v) real-time demand management [11]. The main question that must be solved when batteries are included in AC grids is as follows: How must these batteries operate to improve the electrical grid performance? Note that the solution of this question involves the proposition and solution of an optimal multi-period power flow model [12], which is known in the literature as the economic dispatch model when the objective function is concerned with operative cost minimization [2].
Nowadays, BESSs are real options for improving the electrical performance of distribution networks in medium-and low-voltage levels [1,13], since these devices can facilitate peak energy consumption fulfillment, enhance the profits from the integration of renewables and distributed energy sources, help power quality management, and generally reduce distribution network expansion costs [14]. The authors of [15] presented an experimental case with regards of the designing a BESS for urban industrial application in order to improve local power quality. They considered two cases of study, i.e., reactive power compensation and rapid variations of the electricity variations caused by a metro train load and a production of a solar power plant, and they mentioned that these studies were technically successful. In addition, an evaluation of the BESS assessment in a real distribution system in Riyadh, Saudi Arabia, was studied by Almehizia et al. [16]. Numerical results quantify the economic return that BESSs can offer for the electrical distribution grids, thus showing that improving the decision-making of the electric utility can deal with increasing load demand and power quality issues.
To analyze BESS in electrical networks with AC or DC operational technologies, one of the most accepted and currently used models corresponds to the linear representation between the state-of-charge and the power injection/absorption [17,18]. However, even if the battery model can be represented using linear equations, nonlinearities appear due to the nonlinear non-convex behaviors in AC power grids, which are caused by the power balance equations [1,19]. To address the nonlinear economic dispatch problem involving BESS and renewable generation in AC grids, various optimization models with different grades of approximation can be used. The first model corresponds to the adaption of the classical economic dispatch model for thermal power systems that uses a unique nodal representation of the system [18]; the second model is the DC approximation of the power flow equations that works with the angular difference between two adjacent nodes by assuming that the voltage is equal to 1.0 pu [20]; and the third model corresponds to the complete AC power flow model that involves active and reactive power balance as well as voltage magnitudes and angles [21]. Note that the two first models are linear programming models, i.e., these are convex models, while the third model is nonlinear and non-convex due to the products among trigonometric functions and voltages in the power balance equations [22].
In the literature, these models are employed to operate BESS and renewable sources in power systems from the point of view of the economic dispatch approach. Some of these works are presented as follows. The authors of [18] presented a unique nodal model for optimal dispatching batteries in AC microgrids. The resulting linear programming model is solved using the CPLEX solver, and the numerical results show the effect of the load and renewable generation behavior in the battery demeanor regarding state-of-charge and power injection/absorption. Berglund et al. [23] presented a linear-integer programming model to minimize the total cost of the facility, including the peak power demand and the energy costs, with the aim of extending battery lifespan. The proposed model uses a unique nodal representation and its solution is reached by using the GAMS optimization package. The authors of [2,20,24,25] presented linear programming and integer-linear programming models for installing and operating BESS in power systems using the DC equivalent of the AC power flow problem. The main aims of these works are the minimization of the investment costs in power systems regarding new transmission lines and the reduction of the greenhouse gas emissions produced by conventional thermal power sources. Most of these models have been solved using the GAMS software. The authors of [17,26,27] evaluated the complete AC multi-period optimal power flow model for the operation of BESS, considering a daily demand curve and renewable generation penetration including apparent power capabilities of the electronic convertors that are interconnected to the BESS. The authors of [21] proposed a nonlinear programming model with continuous an integer variables to install and operate batteries in distribution grids to reduce the total costs of the power losses during daily operation. The batteries are modeled with a binary behavior where the power injection is fixed regarding their maximums and minimums. The solution of this model is reached by implementing a Chu-Beasley genetic algorithm. The authors of [1] proposed an optimization approach to locate and operate BESS and distributed generators in medium-and low-voltage distribution networks, using a hybrid optimization approach that combines the simulating annealing method in the planning stage and a conic decomposition in the operation stage. Three test feeders composed of 11, 135, and 230 nodes are used to validate the proposed optimization methodology, considering the minimization of the investment, operation, and maintenance costs during the planning period. Numerical results demonstrate the effectiveness and robustness of the optimization approach regarding the planning period; however, the authors did not consider terms related to the environmental impact associated with greenhouse gas emissions. In addition, due to the usage of heuristics in the planning stage, the possibility of finding the global optimal is not ensured.
After the revision of the state-of-the-art associated with the optimal integration of BESSs systems in AC distribution grids, the main contributions of this study can be summarized as follows: The multi-objective formulation of the problem regarding the optimal operation of BESS in AC radial distribution networks using the branch optimal power flow representation, considering the simultaneous minimization of the CO 2 gas emissions and the costs of the daily energy losses, is presented. The Pareto front is constructed using the multi-objective optimization approach via pondering factors by exploiting the potentialities of the GAMS software for nonlinear optimization. The different effects that voltage control in the substation and the active and reactive power injection in the BESSs have in the formation of the Pareto front were evaluated.
It is worth mentioning that the scope of this research is focused on the evaluation of different operative scenarios for multi-objective operation of BESSs in radial distribution networks, considering the linear representation of the state-of-charge in batteries and the amount of active power injected (or absorbed) to (or from) the grid, combined with the branch optimal power flow formulation, which has clearly not been proposed in the existing literature. However, it is important to note that even the optimal integration/operation of BESSs in electrical distribution grids can produce important technical and economical profits to the distribution system operators. Such an important fact regarding batteries (i.e., temperature-dependence and time-degradation) must be considered when batteries are installed in distribution grids, since the total expected benefit during its lifespan can be reduced significantly in comparison with ideal operative scenarios. This is an important area of research that the authors of [28] explored for direct current networks, and it can be extrapolated to AC grids in future works using our optimization model that serves as a starting point for future research.
The remainder of this document is organized as follows. Section 2 presents the complete multi-objective formulation of the problem of the optimal operation of BESSs in AC radial distribution networks by using the branch power flow formulation. Section 3 presents the solution methodology to solve the proposed multi-objective optimization problem by using the GAMS software that employs the pondering objective functions strategy. Section 4 shows the main characteristics of the 33-bus test feeder regarding its topology, demand behavior, renewable energy penetration, and BESSs' locations, among others. Section 5 presents the computational implementation of the proposed multi-objective optimization model to operate BESSs in radial AC grids as well as the main results with their corresponding analysis and discussion. Section 6 presents the main concluding remarks derived from this research as well as possible future directions.

Multi-Objective Optimization Problem
The problem of the optimal operation of battery energy storage systems in AC grids is a nonlinear programming (NLP) problem. Here, we adopt the formulation of the power flow problem for strictly radial distribution networks that was proposed by Farivar and Low [19], by extending it to the multi-period domain and including the linear model of the batteries [29]. The complete formulation of the NLP problem is presented below.

Objective Functions
To operate a BESS in AC distribution systems, we consider two objective functions: the minimization of the CO 2 greenhouse gas emissions and the daily cost of the energy losses in branches. These objective functions are defined as follows: where z 1 is the value of the objective function associated with the total emissions of CO 2 to the atmosphere by diesel generators, z 2 is the cost of the total energy losses in all the branches of the energy, CO emissions 2 is the rate of CO 2 emissions, p 0i,t is the active power generation that leaves the substation, i.e., root node, to node i, C energy ave is the average cost of the energy, R ij is the resistance associated with the distribution line that connects nodes i and j, and I ij,t represents the magnitude of the current that flows through the line ij at the period of time t. Observe that N and T are the sets that contain all the nodes of the grid and the periods of time of the study horizon.

Set of Constraints
The set of constraints associated with the operation of the BESS in electrical AC grids is composed of two main subsets, which are associated with the conventional power flow equations and the battery operation characteristics. Equations (3)-(6) present the conventional power flow equations formulated via branch model as presented in [30]: where p ij,t and q ij,t are the active and reactive power flows leaving node i to travel towards node j in a period of time t. p jk,t and q jk,t have the same definition applied to nodes j and k, respectively. Further, P j,t and Q j,t are the active and reactive power consumption measures at node j in a period of time t modeled as constant power loads. p dg j,t and q dg j,t are the active and reactive power generations in the distributed sources in the node j at the period of time t. Moreover, p b j,t and q b j,t correspond to the active and reactive power injections/absorptions in the battery b connected at node j in the period of time t and V i,t and V j,t are the voltage magnitudes in nodes i and j at the period of time t, respectively.

Remark 1.
Observe that the set of constraints in (3)-(6) is nonlinear and non-convex due to the presence of square variables associated with voltages, currents, and powers. However, the main complication of this model corresponds to Expression (6), since it defines the hyperbolic relation between voltages and powers [19].
The subset of constraints associated with batteries, element capacities, and voltage regulation bounds is described as follows: where soc b j,t is the state-of-charge of the BESS connected at node j in the period of time t, and ϕ b j is the battery charging/discharging coefficient. Besides, soc b,min j and soc b,min j are the lower and upper limits of the state-of-charge variable (these are lower than one and greater than zero to increment battery lifespan; for Ion-Lithium batteries, these are recommended to be 10% to 90% [6]). Note that p b,min

Interpretation of the Mathematical Model
The multi-objective optimization model defined in (1)-(13) has the following interpretation: Equations (1) and (2) represent the objective functions associated with the minimization of the CO 2 greenhouse gas emissions, and the cost of the daily energy losses. Equations (3) and (4) correspond to the power balance equation at each node of the network, except in the voltage-controlled source. Equations (5) and (6) define the voltage drop at each branch and the hyperbolic relation between voltages and powers, respectively. Equation (7) determines the linear relationship between the state-of-charge and the power injection/absorption at each BESS [18]. Inequality constraints (8)-(10) define the apparent power circle of the battery, the maximum and minimum bounds associated with the active power injection/absorption, and state-of charge, respectively. Inequality expressions (11) and (12) define the distributed generation limits regarding apparent and active power generations. Finally, Expression (13) is known as the voltage regulation constraint, which defines the admissible voltage variations in all the nodes of the network.

Remark 2.
The solution of the mathematical model, (1)-(13), requires powerful optimization tools since this is a nonlinear, non-convex optimization problem with multiple variables defined in the continuous domain. Here, to solve this NLP problem, we adopt the implementation presented in [31], where the GAMS optimization package has been employed to solve a single-objective optimization problem regarding BESS selection and location. This implies that, in this paper, we extend the application of this software for multi-objective optimization problems as described in [2] for power system applications.

Solution Methodology
To resolve the nonlinear programming model defined in (1)-(13), the GAMS software was selected in this research. This software can solve different single-objective optimization problems starting from linear programming, nonlinear programming, and, in general, mixed-integer nonlinear programming problems [2]. However, we adapted this software via loops to solve the proposed NLP problem for multi-objective operation of batteries using the well-known pondering factors approach [32,33]. Table 1 summarizes some studies that worked with the GAMS software to solve different optimization problems to demonstrate its potential applications. Table 1. Engineering optimization problems solved in the software GAMS.

Optimization Problem References
Optimal location and sizing distributed generation in AC grids [34][35][36][37][38] Distribution system planning [39][40][41] Optimal location of capacitor banks in distribution networks [42][43][44] Optimal location and operation of battery energy storage systems in distribution networks [2,17,26,31] Efficient design of osmotic generation plants [45][46][47] Economic dispatch of thermal plants in power systems [2,48] Solution of the general engineering problems using GAMS [49][50][51] In Table 1, we can observe that, in the literature, there are multiple optimization problems solved with the GAMS software. This demonstrates that this is an excellent tool to address complex programming models such as the case of the multi-objective operation of BESSs in AC grids study in this research.
In general, the implementation of an optimization model in the software GAMS has the following main steps [50]: • Define the sets associated with the groups of variables of the problem, i.e., set of periods of time T , set of nodes N , and set of branches L. , and so on).
• Define the variables and their natures, i.e., continuous, binary, or discrete. • Redact the equation names associated with each of the expressions in the optimization model, as well as the mathematical formulation of these equations using symbolic structure. • Select the direction of the optimization, i.e., minimization, and the nature of the problem for being solved, i.e., NLP.

Remark 3.
The implementation of an optimization model in the software GAMS requires some familiarization with its syntax and general structure, since it works using plain text to formulate the complete mathematical model. For more details about the GAMS usage, see the works by Soroudi [2] and Castillo et al. [50].
A schematic implementation of an optimization model using the GAMS software is depicted using a general flow chart in Figure 1.

Information of the Test Feeders
This section presents the parametric information of the test feeders considered for validating the multi-objective operation of BESSs in rural distribution grids fed by diesel sources. The first test feeder corresponds to the IEEE 33-node test feeder and the second is the IEEE 69-node test feeder. All information regarding both distribution grids is presented below.

IEEE 33-Node Test Feeder
The IEEE 33-bus test feeder, which is a radial distribution network composed of 33 buses and 32 distribution lines, is operated at 12.66 kV at the substation bus (i.e., bus 1). The electrical connection between buses in the 33-bus test feeder is presented in Figure 2 and the parametric information of this test feeder is presented in Table 2. It is important to highlight that the information presented in this table corresponds to the load peak consumption in all the nodes of the system, which is surmised of 3715 kW and 2300 kvar. In addition, it is considered here that this medium-voltage distribution network is located in a rural area, where the main substation corresponds to a diesel generator, as reported in [27].  In this electrical network, the existence of four distributed generators is also considered: two of them arise from solar photovoltaic technology and two of them work with wind generation technology. The location of these distributed generators is as follows: (i) the PV 1 source is installed at node 13 with a capacity of generation defined as 450 kW and the PV 2 source is located at node 25 with a capability of 1500 kW; and (ii) the WT 1 source is connected at the same node as the PV 1 source with a nominal capacity of 825 kW and the PV 2 is sited at node 30 with a rate of generation defined as 1200 kW. The information associated with the distributed sources and demand is listed in Table 3. It is worth mentioning that the information regarding renewable generation presented in Table 3 was obtained by using an artificial neural network (ANN) to predict the daily generation considering a year of historic information that contains data about solar radia-tion, wind speed, humidity, pressure, and time. The complete information related to the implementation of the ANN can be found in [38], and some aspects regarding the ANN implementation are provided in Appendix A.
Regarding the location and sizing of the BESSs, we consider the information reported in [27] that includes three batteries allocated in this test feeder: (i) a BESS with an energy capacity of 1000 kWh that can be charged/discharged in 4 h (Battery Type A); (ii) a BESS with an energy capacity of 1500 kWh that can be charged/discharged in 4 h (Battery Type B); and (iii) a BESS with an energy capacity of 2000 kWh that can be charged/discharged in 5 h (Battery Type C). Observe that the power injection/absorption of the battery can be calculated by dividing the energy rate by the total charging/discharging time, i.e., for the Battery Type A, this power injection/absorption is 250 kW. In addition, to define the location of these batteries, we consider the solution reported in [31] that defines that Battery Types A-C are located at nodes 14, 31, and 6, respectively.
To evaluate the objective functions associated with the minimization of the greenhouse emissions and the daily energy loss costs, we consider that the diesel generator located at node 1 emits about 612.35 kg/MWh and that the average energy costs are assumed to be US$ 0.1390, as taken from [26], by converting Colombian pesos (COP$ 479.3389) to American dollars.

IEEE 69-Node Test Feeder
The IEEE 69-bus test feeder is a radial distribution network composed of 69 buses and 69 distribution lines, which is operated at 12.66 kV at the substation bus (i.e., bus 1). The electrical connection between buses in the 69-bus test feeder is presented in Figure 3 and the parametric information of this test feeder is presented in Table 4. It is important to highlight that the information presented in this table corresponds to the load peak consumption in all nodes of the system, which surmises 3890.70 kW and 2693.6 kvar. In addition, here, it is considered that this medium-voltage distribution network is located in a rural area, where the main substation corresponds to a diesel generator and as reported in [27]. In this electrical network, the existence of four distributed generators is also considered, two of which work with solar photovoltaic technology and two of which work with wind generation technology. The location of these distributed generators is as follows: (i) the PV 1 source is installed at node 12 with a capacity of generation defined as 1050 kW and the PV 2 source is located at node 22 with a capability of 850 kW; and (ii) the WT 1 is sited at node 61 with a rate of generation defined as 760 kW and the WT 2 source is connected to the same node as the PV 1 source with a nominal capacity of 1000 kW. Note that the information of the distributed sources and demand is listed in Table 3.
As this test feeder is considered an additional BESS regarding the batteries considered for the IEEE-33 node test feeder (i.e., Battery Type D), as reported in [27], this is a BESS with an energy capacity of 3000 kWh that can be charged/discharged in 6 h. The location of the BESS Types A-D is at nodes 40, 64, 16, and 9, respectively.

Numerical Simulations
This section shows the computational implementation of the proposed multi-objective optimization approach to operate BESSs in AC distribution systems considering the minimization of the greenhouse gas emissions versus costs of daily energy losses. We implemented this approach on a personal computer AMD Ryzen 7 3700U, 2.3 GHz, 16 GB RAM with 64-bits Windows 10 Home Single Language using the GAMS optimization environment.
The construction of the Pareto fronts presented in this section was made by using the weighting factors methodology that combines both objective functions as follows: z m comb = ϑz 1 + (1 − ϑ)z 2 , where ϑ = m/20 is the pondering factor. Note that m defines the number of combined objective function evaluations. In the proposed study, the parameter m begins from 0 in steps of 1-20. It is worth mentioning that the value of ϑ determines the number of solutions contained in the Pareto front.
For numerical purposes, different simulation cases in this section are presented and applied to the IEEE 33-bust test feeder and the IEEE 69-bus test feeder. For the first distribution grid, we considered the following cases: (i) effect of the substation voltage control; (ii) effect of the reactive power compensation with battery converters; and (iii) effect of the renewable energy variation in the Pareto front conformation. However, for the IEEE 69-node test feeder, to avoid repeating the analysis made in the IEEE 33-node test feeder, we only evaluated the operation of the batteries with unity and variable power factors, given the generators operate in their nominal condition.

IEEE-Bus Test Feeder
In this subsection, all the simulation scenarios considered for the IEEE-33 bus test feeder are presented, which include the effect of the substation voltage control, the variable power factor capabilities in batteries, and the possible variation of the renewable energy resources.

Effect of the Substation Voltage Control
To demonstrate the effect that has the assignation of the substation voltage in a predefined value, e.g., V 1 = 1.00∠0, we simulated two cases. The first case considers that the substation is controlling the voltage magnitude at 1.00 pu and the second case leaves this voltage magnitudes free, i.e., it can take values from v min to v max . Figure 4 presents the Pareto fronts for both simulation cases. 6 6.5 7 7.5 8 8. The results in Figure 4 show the following. In the first case, the minimum and maximum values regarding the costs of energy losses are US$ 132.0450 and US$ 157.1888, which correspond to total CO 2 emissions of about 13.8714 and 6.5502 tons/day, respectively. The difference between the extreme solutions are US$ 25.1438 and 7.3212 tons/day, respectively. In the second case, the minimum and maximum values regarding the costs of energy losses are US$ 108.1019 and US$ 129.4134, which correspond to total CO 2 emissions of about 13.8294 and 6.4853 tons/day, respectively. The difference between the extreme solutions are US$ 20.6115 and 7.3441 tons/day, respectively. Finally, the main effect of maintaining the voltage magnitude of the substation in a fixed value (i.e., Case 1), in contrast to the solution reported by Case 2, is associated with an increment in the daily cost of the energy losses about US$ 26.4417. However, when CO 2 emissions are analyzed, we observe that the average difference is less than 0.0500 tons/day. These results imply that fixing the voltage substation has a direct effect on the energy losses, and that this effect is negative, as shown in Figure 4.
The complete list of the objective function pairs is reported in Table 5, based on the information in Figure 4 from left to right. Note that results in Table 5 demonstrate the multi-objective nature of the problem of the optimal operation of BESSs in AC grids, since the improvement of one of the objectives implies the deterioration of the other. In addition, observe that Solutions 6-12 can be considered attractive solutions to be selected by the distribution system operator, since these are in the intermediate area of the Pareto, which implies that both objectives perform well regarding their extremes. For example, Solution 9 in Case 1 produces a reduction of about 43.05% regarding CO 2 emissions and 7.11% in relation to the maximum energy daily costs; in Case 2, these reductions are 43.08% and 7.49%, respectively.

Effect of the Reactive Power Compensation with Battery Converters
In the previous subsection, we evaluate the effect of the voltage control in the substation bus considering unity power factor in the operation of the batteries and distributed generators. In this simulation case, we consider that the substation has free voltage magnitude and the batteries can support reactive power with their converters by assuming that the DGs will continue working with unity power factor [26]. In Figure 5, the Pareto front for the operational BESS, considering the variable power factor, is presented.
From the results in Figure 5, we can observe the following to be true. First, the extreme solutions of the Pareto front correspond to minimum CO 2 emissions of 6.3136 tons/day with a maximum daily energy costs of about US$ 59.1780, while the maximum value of the CO 2 emissions is 13.9245 tons/day with minimum daily operative costs of US$ 37.5963. Second, the difference between the extremes corresponds to a reduction of 54.66% regarding CO 2 emissions, while the costs of daily energy losses is about 34.47%. Third, when comparing the Pareto front in Figure 5 with Case 2 in the Pareto front presented in Figure 4, it is possible to observe that the injection of the reactive power in batteries allows the reduction of the daily operation costs by about US$ 70 per day, which represents a daily profit of 54.27% to the grid operator. 6 6.5 7 7.5 8 8. To illustrate the behavior of the state-of-charge in batteries, we plot this variable for all the batteries in both extremes (see Figure 6) of the Pareto front in Figure 5. The behaviors of the BESSs in Figure 6 show that, depending on the objective function prioritized, the BESSs will work with different charging/discharging profiles along the day. Depending on the minimization interest, they decide to store or provide energy in different periods of time (see comparison of batteries in nodes 6 and 14), especially in the period of time between 14 and 28. In addition, note that, in the case of minimizing the daily energy costs, the BESSs start to provide energy continuously from the period of time 16 to the period of time 46, while, in the case of the CO 2 minimization, these behaviors do not occur. This is attributable to the availability of the renewable resources and the demand behavior, which has two main peaks that require additional power injections from the BESS to minimize the amount of power injection in the conventional source that is directly connected with the amount of CO 2 emissions, as seen in Equation (1).

Effect of the Renewable Energy Variation in the Pareto Front Conformation
To present the effect of the renewable energy variation due to the stochastic nature of the primary energy resources, i.e., wind speed and solar radiation, we now present a simulation case where the amount of active power injection from the renewable energy resources varies from 50% to 100% for each varying level of renewable energy availability. As such, the Pareto front presented in Figure 7 is obtained, considering unity power factor in the renewable generation, active, and reactive power injections in the BESS, and the free behavior in the slack voltage magnitude. The following can be noted from the behavior of the Pareto fronts in Figure 6. First, depending on the availability of the renewable energy resources during a day of operation, the Pareto front can be very restricted. For instance, in the case of a renewable energy availability of 50%, the daily operative costs are between US$ 55 and US$ 58, while CO 2 emissions are between 20 and 21 tons/day. Second, when the amount of active power injection with renewable energy resources increases, the behavior of the Pareto front regarding the CO 2 emissions presents higher differences in their extremes. For example, for an availability of 50%, the difference between the extreme solutions is about 1.3506 tons/day, and, for a 90% renewable generation availability, this value is about 2.9869 tons/day. This implies the growing importance of decisions-making regarding the operation of the distribution network on the part of the distribution company when the amount power injection from renewable generation increases. Finally, the biggest effect associated with the availability of the renewable generation to inject active power corresponds to the amount CO 2 emissions, since this variable is directly connected to the total power injection in the slack node, which is then directly connected to the power injections in the distributed generators. This is particularly true while the daily operative costs for all the percentages of penetration between the extremes remain the same in the case of the nominal operation, i.e., 100% of renewable generation availability. These results imply that the BESS can control the grid losses in better form, since it depends on the voltage drops in lines, as compared to the the case of the greenhouse emissions, since these depend directly on the usage of the diesel generator.

IEEE 69-Bus Test Feeder
For the IEEE 69-bus test feeder, we consider the possibility of operating the BESSs while considering that the voltage control of the substation is free and can can be moved from 0.90 to 1.10 pu by maintaining its angle at zero for all periods of time. The Pareto front for this test feeder is presented in Figure 8. Note that the extreme solutions in the Pareto front are the following: (i) the minimum daily energy costs is US$ 65.8980 with maximum CO 2 emissions of 18.5373 tons/day; and (ii) the minimum emissions of CO 2 are 10.9535 tons/day, with a maximum daily costs of energy losses of US$ 89.1888. 10 11 It is worth mentioning that the difference between the extreme solutions in the Pareto front in Figure 7 is US$ 23.2908 and 7.5838 tons/day. These values imply that, depending on the distribution system operator, the daily indicators can reduce until these values are selected as a function of the operative point. In addition, it is possible to observe that the most promissory solutions that allow minimizing both objective functions are in the region between 12 and 15 tons/day, since these have daily energy loss costs of between US$ 79 and US$ 71.

Conclusions
We studied the problem of operation of a BESS in radial AC grids from the multiobjective point of view, considering the simultaneous minimization of CO 2 emissions and the costs of the daily energy losses. The GAMS software combined with the pondering objective functions approach were employed to solve the resulting nonlinear, non-convex, and multi-period optimal power flow problem. Numerical validations demonstrated that the assignation of the voltage magnitude in the substation bus deteriorates the behavior of the optimal Pareto front since both objectives present higher values in comparison with the scenario where voltage magnitude in the substation is left free.
When reactive power injections are available for operating the BESS, considering its power electronic converters, the objective function regarding energy loss costs is drastically reduced. This was made possible since these reactive power injections allowed the improvement of voltage profiles, which is directly connected with the reduction of magnitude of the current in branches. This reduction was about 54.27% in comparison to the unity factor power case.
The effect of the renewable generation availability was tested for different percentages of active power generation in distributed sources. This demonstrated that the amount of greenhouse gas emissions is directly connected to the power supply by distributed generators, while daily energy losses can be effectively controlled for the BESSs by maintaining these on the extreme values of the nominal operative case, i.e., between US$ 37.5963 and US$ 59.1780, for all the renewable generation penetration cases evaluated.
In the IEEE 69-bus system, it was observed that the maximum reduction of CO 2 emissions is about 40.91% when the daily cost of energy losses has a maximum value, i.e., US$ 89.1888. In the case of energy losses, the maximum reduction is about 26.11% when the maximum CO 2 emissions occur. These values correspond to the extreme solutions in the Pareto front in Figure 7, which implies that, depending on the distribution system operator's decision, the maximum improvements possible will be contained in the aforementioned percentages of reduction.
The following research can be developed as part of future research efforts following this paper's contribution. First, the reformulation of the proposed branch multi-period optimal power flow model for multi-objective operation of the BESS in AC grids with radial structure into a convex conic representation that ensures the global optimum finding from the formal mathematical point of view. Second, the application of proposed multi-objective optimization model to direct current networks with high penetration of renewable energy resources and batteries. Finally, the inclusion of new battery behaviors in the proposed optimization model, such as lifespan and deep discharging characteristics, among others, to approximate the best behavior of these in real operative conditions. Funding: This research was funded by the Agencia Estatal de Investigación, Spain (AEI) and the Fondo Europeo de Desarrollo Regional (FEDER) aimed at the Challenges of Society (Grant No. ENE 2017-83860-R "Nuevosservicios de red para microredes renovables inteligentes. Contribución a la generación distribuida residencial").

Data Availability Statement:
No new data were created or analyzed in this study. Data sharing is not applicable to this article.
The training procedure for an ANN is carried out using an input-output space to reach a nonlinear mapping of the items. This training methodology is adopted when the relations among inputs and outputs are unknown. The general nonlinear learning rule takes the following form: − 1), ..., z(t − n z ), w(t − 1), ..., w(t − n w )) (A1) where w defines the input space and z corresponds to the output space, which depends on the previous n z values of the variable under forecast. The input and output spaces for forecasting the PV generation correspond to the temperature and time as well as solar radiation, respectively [26]. The procedure to train the ANN to forecast the solar radiation was carried out using MATLAB software and its ntstool package. Note that, for the solar radiation prediction, two inputs were considered (i.e., temperature and time) along with six delays (n z = 6) and 18 neurons in the hidden layer.

Appendix A.2. Computational Implementation of the Ann
The schematic configuration of the ANN implemented for solar generation forecasting is presented in Figure A1, which was developed using the ntstool package in MATLAB. All the information used to train, adjust, and validate the proposed ANN for solar generation forecasting was taken from [55]. It is worth mentioning that, for training, adjusting, and validation, we employed 70%, 15%, and 15% of the data, respectively. Finally, Figure A2 presents the solar generation information.