Economic Dispatch of Renewable Generators and BESS in DC Microgrids Using Second-Order Cone Optimization

: A convex mathematical model based on second-order cone programming (SOCP) for the optimal operation in direct current microgrids (DCMGs) with high-level penetration of renewable energies and battery energy storage systems (BESSs) is developed in this paper. The SOCP formulation allows converting the non-convex model of economic dispatch into a convex approach that guarantees the global optimum and has an easy implementation in specialized software, i.e., CVX. This conversion is accomplished by performing a mathematical relaxation to ensure the global optimum in DCMG. The SOCP model includes changeable energy purchase prices in the DCMG operation, which makes it in a suitable formulation to be implemented in real-time operation. An energy short-term forecasting model based on a receding horizon control (RHC) plus an artiﬁcial neural network (ANN) is used to forecast primary sources of renewable energy for periods of 0.5h. The proposed mathematical approach is compared to the non-convex model and semideﬁnite programming (SDP) in three simulation scenarios to validate its accuracy and efﬁciency.


Introduction
In the last decades, the development of power electronics has allowed increasing the levels of penetration of renewable energy resources in electricity networks and the creation of new kinds of network concepts as microgrids (MGs) or high-voltage direct current [1,2]. The MGs can be operated in alternating current (AC) and direct current (DC); However, the DCMGs present several advantages over AC counterparts, such as: (i) no need of synchronizing generators, (ii) less number of power converters, (iii) lower losses, (iv) better voltage profiles, and (v) do not require analysis and controls of reactive power and frequency [3]. Additionally, the DCMGs go hand-in-hand with the global concerns about the effects of global warming since they reduce greenhouse effects and the cost of energy generation and transportation [4]. However, the integration of renewable energy resources

Economic Dispatch Model
The mathematical non-convex model for the optimal daily operation of renewable energy and BESSs is composed of an objective function and non-linear constraints [6]. The objective function is related to the cost operation of DCMGs, while the non-linear constraints are related to technical and operational aspects in DCMGs [8]. The control variables for economic dispatch are power delivered/absorbed for devices of system, such as conventional generators, renewable generators, and BESSs.

Objective function
where z denotes the function to be minimized, which corresponds to the daily operative costs of conventional generators, CoE i,t is the purchase costs of energy at node i in period t, p i,t is the power generation delivered at node i during period t, and ∆t is the length of the time period under analysis, this study is 30 minutes (in per unit 0.5). T and N are the sets of periods of time considered and the number of nodes considered in the DCMG, respectively.

Set of constraints
where p denotes the power delivered/absorbed for devices, the superscripts dg, b, and d denote renewable energy generations, BESSs, and demand, respectively. i and t represent node and the time period under analysis. SoC is the state of charge of each BESS. v denotes the voltage profile, and g ij is the conductance value, which represents the physical connections of the nodes in DCMG. SoC b,ini and SoC b, f in are the initial and final desired states of charge of the BESSs. The superscripts min and max denote the minimum and maximum admissible bounds in DCMG related to its technical and operational aspects, and ϕ is the charge coefficient of the BESSs. Equation (1) shows the objective function in this study, whose goal is to minimize the total energy purchasing costs in DCMG. Equation (2) represents load-generation balance at each node of the DCMG, also well-known power balance equation. Equation (3) provides the state-of-charge of BESSs. Equations (4) and (5) define the initial and final state-of-charge desired for the BESS, respectively. Equations (6)-(8) limits minimum/maximum power delivered by the conventional generator, renewable energy and BESSs, respectively. Equation (9) defines the minimum/maximum limits of voltages in DCMG, and Equation (10) defines the minimum/maximum bounds of the state-of-charge of BESSs.
It is important to mention that this model is non-linear non-convex due to the power balance equation (see Equation (2)) since it is a non-affine equality constraint [9]. This constraint generates a hyperbolic relation between power and voltage at all nodes of DCMG [6]. Hence, it is not possible to guarantee global optimum, applying conventional optimization techniques [8].
Note that there are multiple models that can used for optimal operation of batteries in dc networks; nevertheless, here we present an economic dispatch formulation as well as a convex reformulation, where the main idea is minimizing the total energy purchase costs in conventional generators, subject to classical power flow equations and device capacities [10]. In specialized literature, the main difference between economic dispatch models and optimal power flow ones is only the objective function value since in the first case are used economical (monetary) functions, while the second case considers energy loss as the objective function [22]. For a better understanding of both mathematical models regarding main control variables, sets, parameters and etc., see the Abbreviations presented at the end of this paper.

Second-Order Cone Programming Reformulation
The SOCP formulation is part convex of the optimization models, which is a field that has recently taken great importance in engineering since it can solve their problems reliably and efficiently by guaranteeing a unique solution (global optimum) [23]. The SOCP formulation minimizes a linear function over a convex region, which consists of the intersection of an affine linear space with second-order cones [24].
The canonical formulation for SOCP problems has the following representation, min c x subject to where k and l denote the number of conical and affine constraints, respectively, · refers to the Euclidean norm and A k ∈ R n i ×n and F l ∈ R p×n are real matrices; c, b k , α k ∈ R n , and g l ∈ R p are vectors. β k ∈ R is a scalar and x ∈ R n is the optimization variable.

Economic Dispatch Model as a SOCP
The economic dispatch model (1)-(10) can be transformed into a SOCP model by defining the following slack variables, and a matrix Then, the economic dispatch (1)-(10) is transformed into where P t , P dg t , P b t , and P d t are column vector that contains respectively. denotes positive semi-definiteness and rank(·) refers to rank of the matrix. Note that the economic dispatch model of (1)-(10) and (15)-(28) are equivalent and non-convex. Now, the non-convexity is represented in the rank constraint (27). When Equation (27) is relaxed (eliminated or neglected), the SOCP formulation is reached. Even when this constraint is eliminated of the SOCP optimization, the global optimum of the problem can be achieved if the following conditions are satisfied [22]:

•
The upper bounds for all nodal voltages are the same, which is easily comparable in per unit. This entail that V max The total network loss of DCMG is positive, which is met by the physical power system. This entails that ∑ i∈N p i > 0.
The conditions above-mentioned have not to be met for the SOPC model to converge. However, if these conditions are satisfied, that can guarantee what the solution of SOPC relaxed is equal to SOCP non-convex (non-relaxed), hence, the solution is global optimum (See [22] for details).
The original variables are recovered, as follows Note that the SOCP model for power balance expression can be non-unique, and its structure depends on the form that the product between voltage profiles be analyzed [21]. Nevertheless, the final convex reformulations are equivalents, and they can be found using transformation variables [25].

Energy Short-Term Forecasting Model
The high variability of primary sources of renewable energy, such as solar radiation and temperature for solar generation systems or wind speed for the wind generation systems, increases DCMG's operating costs if they do not have a good prediction of these [6]. Therefore, it is necessary to implement a strategy, which allows minimizing the forecasting errors. Here we adopted the strategy proposed in [8], which combines a receding horizon control (RHC) with an artificial neural network (ANN). The RHC repeatedly computes the economic dispatch model on a moving time horizon by employing the predictions of the wind speed or solar radiation in order to reduce the error of the forecasting. While the ANN tries to predict the values of solar radiation and wind speed, also using a mobile time window. The methodology adopted has the following steps: • Implementing the ANN, the wind speed and solar radiation, are estimated by periods m, where m is the prediction horizon. • Using the SOCP optimization, the economic dispatch for renewable energy and BESS is found from period t to period t + m.

•
Employing the previous measurement of the wind speed and solar radiation from t − m to t, the forecast of them are recalculated for t + 1 period.

Artificial Neural Network
The ANNs are mathematical tools that can be applied to a wide range of problems which from function approximation, clustering, optimization, pattern classification to series forecasting with a high degree of accuracy [26]. In this study, the ANNs are used to predict the wind speed for wind power systems and solar radiation for solar power systems. The data of input and output used to train the ANN has been listed in Table 1. The data shown in Table 1 are employed for training the ANN with the following nonlinear learning rule: where x and y are input and output data, respectively. n y and n x are the last values of the prediction and the input data, respectively. We used the configuration to train the ANN presented in [6]. This configuration for the solar generation system considers two inputs (see Table 1), six delays, and 18 hidden neurons. For the wind generation system, we employ four inputs (see Table 1), four delays, and 12 neurons. The ANN has been implemented in MATLAB software using ntstool. In Figure 1 has illustrated the ANN scheme for the solar generation system implemented in MATLAB. In Figure 1 can be noted that the ANN scheme is composed of a two-layer feed-forward network. The first layer is known as a hidden layer, which functions as a sigmoid transfer function. While the second layer is known as the output layer, which is a linear transfer function. The hidden layer needs stores previous values such as input x(t) data as well as output y(t) data to train the proposed ANN. From the training process, the ANN gets weights (W) and bias (v) values, which are used for the output layer to predict the output y(t + 1). Additionally, the output layer also employs a rectified linear unit (ReLU) layer in order to eliminate negative estimates of solar radiation or wind speed. ReLU function has the following form, The proposed ANN has been trained by using the Levenberg-Marquardt algorithm [8]. Mean squared normalized error was employed as the performance function. The proposed ANN has configured with 100 epochs, a reduction of learning rate drop 0.02 every 8 epochs, and the initial learning rate of 0.3.
All data of Table 1 to train the ANN were taken in [27]. We employed in training, adjusting, and validating with a 70%, 15%, and 15% of the data, respectively. Lastly, Figure 2 illustrates solar and wind power information.  It is important to highlight that the precision of the forecasting method based on artificial neural networks is highly dependent on the data history about renewable energy inputs, i.e., wind speed, wind direction, sunlight, temperature, pressure, radiance, humidity, etc. Since for countries where there is the presence of different seasons is required information at least for five years to have an acceptable prediction of the power output. Nevertheless, for countries located around the equatorial line, with data historical at least for one year must be enough to have an adequate generation forecasting [6].

Test System and Simulation Scenarios
This presents the test system, scenarios considered, and their results.

The 21-Node Test System
The test system scheme used to validate the economic dispatch problem using a SOCP formulation is depicted in Figure 3, which is a modified version of DCMG proposed in [8]. Table 2 lists the parameters of the DC branches and power demands of DCMG, which has a total power consumption of 5.54 p.u. with a base value of 100 kW. The test system is composed of 21 nodes, 21 branches, and 16 loads, where their data is presented in Table 3. Additionally, it also has a conventional generator (slack bus), a wind generation system (2.1152 p.u.maximum power), and a solar generation system (2.8158 p.u.maximum power) located at the nodes 1, 12 and 21, respectively. Moreover, the BESSs are located at buses 7, 10, and 15, respectively; Their parameters are listed in Table 4. Finally, the minimum and maximum operating bounds for the voltages are restricted from 0.9 to 1.1 p.u.(i.e., around ±10% of the nominal voltage (1 p.u.)). These bounds are typical values for medium-voltage grids in Colombia [6].

Simulation Scenarios
We considered three simulation scenarios to evaluate the proposed mathematical model, which are: • Scenario 1 (S 1 ): This scenario analyzes the optimal dispatch of DCMG considering that the BESSs begin and end their daily operation in the fully discharged state. • Scenario 2 (S 2 ): In this scenario is considered that the BESS must begin and end their daily operation with a 50% charge. However, during their daily operation, they can discharge or charge from 0% to 100% of their nominal capacity. • Scenario 3 (S 3 ): In this scenario is analyzed that the BESS can only vary their nominal capacity from 50% to 100% during the day.
Scenario S 1 allows the BESSs to use the total energy stored during the day to operate. Scenario S 2 also enables that the BESSs to work with the total energy stored during the day; however, they are forced to end the day with a defined state-of-charge to meet unexpected energy demands at the beginning of the next day. Lastly, scenario S 3 always limits the state-of-charge of BESSs to work at least 50% of their nominal capacity, as recommended by Standard IEEE 1561-2007 [28].

Simulation Results
The proposed economic dispatch model is compared to the non-convex model and semidefinite programming (SDP) proposed in [8] to validate its accuracy and efficiency. The SOCP and SDP models were solved on CVX programming software [29] on MATLAB environment [30], while the non-convex model was executed in GAMS commercial optimization package.
All simulations have been carried out on a desk-computer INTEL(R) Core(TM) i7-7700HQ, 2.80 GHz, 16 GB RAM with 64-bits Windows 10 Pro by using MATLAB 2019b.

Comparison of Simulation Results
This part compares the simulation results obtained with the different economic dispatch models considered for each of the simulation scenarios presented in Section 5.2. Table 5 shows the results of economic dispatch for each of the mathematical models analyzed in this paper.  Table 5 shows that the convex models always present a better objective function than the non-convex model. Nevertheless, these differences are lower than 4.05 × 10 −3 % for all the simulation cases when we compared the SOCP and SDP models with the exact one. These soft variations around the global optimum can be attributable to the rank relaxation of both convex models; notwithstanding, for practical applications, the results of the proposed SOCP model (including the SDP model) can be considered optimum with the main advantage that after each evaluation of the SCOP model it remains unaltered, while the non-linear model can be stuck in local optima since the solution space is non-convex and there is no guarantee of reaching the global solution with existing methods.

Scenarios Analysis
In this part, the effect on economic dispatch is analyzed by including BESSs and varying their operating limits in a DCMG system. Nevertheless, the forecast errors of the solar and wind powers do not include yet since the aim is to analyze how the operation costs of the DCMG system are affected.
In Table 5 was noted that scenario S 2 results presented the lowest operating costs than other scenarios since, in this scenario, the BESSs start with an initial charge of the 50%. This allows having stared energy in hours that there are not primary resources for the PV system. In scenarios S 1 and S 3 the operating costs are increasing in 1.4% and 4.4% in relation to the scenario S 2 , respectively. The slight increase of scenario S 3 in operating costs is to be expected since the scenario S 3 always limits the BESS to have a minimum load of 50% in any period. This entails that the BESSs cannot deliver all energy stored, which reduces the power injection in comparison to scenarios S 1 and S 2 . However, the useful life of the BESSs is increased (IEEE Standard 1561-2007).
On the other hand, in Figures 4 and 5 are depicted the results for the scenario S 3 . Figure 4 shows the generated powers for the slack generator, wind, and solar power systems, and loads in each period, while Figure 5 illustrates the state-of-charge of the BESSs and voltage profiles in all the nodes.    Note in Figure 4 is observed that the slack generator is only required in two situations: The first situation is when the energy costs are cheap, and it is possible to charge the BESSs (time from 00:00 to 5:00). The second situation is when the available energy of renewable generators is less than the system demand. This situation also happens when the BESSs are charging, or they do not have sufficient stored energy (see Figure 5a).
Observe in Figure 5a that the BESSs begin and end their daily operation with a 50% charge and are never below 50% as required by the scenario S 3 . In addition, they increase their stored energy when the energy purchases present, on average, the lowest prices (from 00:00 to 04:00, see Table 3).
As can be seen in Figure 5b, all the voltage profiles in any hour fulfill the operating bounds used in this paper. Observe that the voltage profiles suffer drop voltages when the slack generator delivers to the DCMG. This is because the majority of the energy injected into DCMG is concentrated at one point (bus slack); therefore, the energy must be transferred along larger routes increasing the current through the branches.

Real and Projected Energy Analysis
In this part, it is analyzed the error forecasting in the economic dispatch model using SOCP formulation. In Table 6 is presented the objective function values when there is not the error forecasting (Real) as well as the energy short-term forecasting model presented in Section 4 is implemented. In Table 6 can be noted that the operating purchase costs in economic dispatch are not affected when the energy short-term forecasting model is implemented. Since the maximum error obtained is around 1.25%. This indicates that the RHC plus the ANNs are a suitable combination to predict the most likely primary resources for renewable energy. Figure 6 illustrates the real and estimation power for renewable energies and percent error of the estimates. Note that mean squared errors for the wind and solar power are 0.05 and 0.008, respectively. While the mean percent errors for the wind and solar power are 0.96% and 6.63%, respectively; These results support that the predictions made estimate wind speed and solar radiation appropriately with minimal errors. It is important to mention that the peak errors in the case of the photovoltaic generation (see Figure 6) higher in the instants where solar radiation starts to increase and ends, i.e., 8 h and 18 h. This produces that a minimum variation between real and estimated power outputs be significantly superior in contrast to the rest of the day, due to the definition of the error using to make this plot.

Conclusions
A convex mathematical model based on second-order cone programming for the economic dispatch of a DCMG with renewable generators and BESS was proposed. The SOCP formulation permitted converting the non-convex model of economic dispatch into a convex approach that guarantees the global optimum and has an easy implementation in specialized software, such as the CVX. The proposed convex model considered the variation of the energy purchase price for the efficient operation of DCMG in each period, which makes it in a suitable formulation to implement in real-time obtaining better results than the exact model executed in GAMS. The advantage of the SOCP model in comparison to the SDP model is that it guarantees exact optimal solutions for the economic dispatch problem in DCMG. Additionally, the SOCP model can be exploited in problems such as planning and operation of DCMG with a precision-level, reducing local optimum and computational efforts.
The RHC plus the ANN showed to be a great tool to predict the primary resources of renewable energies and does not affect the dispatch of the BESSs, only increasing the final purchase costs in 1.25% in the worst scenarios.
It was also demonstrated that the implementation of BESSs in DCMG enhance its operation, reducing its operating costs. Therefore, it is important to propose efficient operation strategies that maximize the useful life of BESSs without making it work inadequately or have a fully discharged state.
Future work may include the development of operational strategies for BESSs in order to minimize the operating costs in DCMG and increase their useful life. Since its strategy also affect the performance of the DCMG, as observed in this study.