*Article* **Data-Driven Optimal Battery Storage Sizing for Grid-Connected Hybrid Distributed Generations Considering Solar and Wind Uncertainty**

**Abdul Rauf 1,2, Mahmoud Kassas 1,2 and Muhammad Khalid 1,2,3,\***


**Abstract:** A large-scale renewable-based sustainable power system requires multifaced technoeconomic optimization and energy penetration. Due to the volatile and non-periodic nature of renewable energy, the uncertainty of renewables combined with load uncertainties significantly impacts the operational efficiency of renewable integration. The complexities in balancing demand, generation, and maintaining system reliability have introduced new challenges in the current distribution system. Most of the associated challenges can be effectively reduced by using a battery energy storage system (BESS) and the right techniques for handling uncertainties. In this paper, a distributionally robust optimization (DRO) technique with a linear decision rule is formulated for the unit commitment (UC) framework for optimal scheduling of a distribution network that consists of a wind farm, solar PV, a distributed generator (DG), and BESS. To cut the energy cost per unit, BESS plays an important role by storing energy at an off-peak time for on-peak-time use with relatively lower prices. For the all-time minimum overall systems cost, the distribution system requires an optimal size of the BESS to be connected to provide optimal scheduling of DGs. Three case studies are formulated using an IEEE 14 bus system (converted from MW to kW to match the BESS size available in the market) and solved with the proposed distributionally robust optimization technique to achieve the maximum operating point with an optimal capacity of BESS, i.e., wind, solar and hybrid. Each case study has its own optimal 30-min interval schedule for DGs along with the optimal capacity of BESS. The cost comparison with and without BESS and its impact on the start-up and shut down of DGs is reported with all the dynamic economic dispatch results, including the battery's state-of-charge profile. The proposed technique can handle the uncertainties in renewables and allows economical energy dispatch and optimal BESS sizing with comparatively lower computational processing and complexities.

**Keywords:** unit commitment; battery energy storage systems; wind-farm uncertainty; distributionally robust optimization; solar pv uncertainty; distributed generators

#### **1. Introduction**

#### *1.1. Motivation*

Due to depletion of fossil fuels decade after decade with the rise in energy demand, renewable energy sources are a better alternative for the energy demands of the emerging population of the earth. In addition, the climate of the earth is severely impacted due to carbon emissions coming out of the energy generation plants using these types of fuels. To cut the usage of fossil fuels, renewable energy sources play a major role, i.e., solar photo-voltaic (PV) and wind power. These sources are the most abundantly available energy sources around the world [1,2]. Due to the volatile and non-periodic nature of

**Citation:** Rauf, A.; Kassas, M.; Khalid, M. Data-Driven Optimal Battery Storage Sizing for Grid-Connected Hybrid Distributed Generations Considering Solar and Wind Uncertainty. *Sustainability* **2022**, *14*, 11002. https://doi.org/10.3390/ su141711002

Academic Editor: George Kyriakarakos

Received: 13 June 2022 Accepted: 1 August 2022 Published: 2 September 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

renewable energy, the complexities in balancing load with generation and maintaining system reliability have introduced new challenges in the current distribution system [3]. These uncertainties cost money in terms of making the whole system capable of dealing with unwanted circumstances, i.e., optimum economic dispatch and sensible unit commitment, while considering other sources of energy to minimize the total system cost.

#### *1.2. Literature Review*

Unit commitment determines when a particular unit should be started so that, at a given time when the power is needed, it can be provided because each unit needs time to startup and shutdown. These startups and shutdowns have an economic impact in terms of fuel, manpower, apparatus, and other related costs [4,5]. On the other hand, the economic dispatch of the generating units determine how much power each unit produces at a certain time to cope with the load and overcome losses due to the transmission network. Ultimately, to minimize the cost of the generating units, scheduling of the generating units is performed based on the load profile data, whether it is one day ahead or one hour [6]. The problem of economic dispatch and UC becomes more complex when there is an intermittent and uncertain renewable energy source, i.e., solar PV.

For better approximations and more reliable results, more historical data is needed to access the true distribution of the data, i.e., the normal distribution, mean, variance, standard deviation, and probabilities of specific events that behave periodically [7]. Similarly, high penetration of renewable sources means more and more historical data is needed to deal with the uncertain profile of those renewable sources [8–10]. Handling this data distribution is performed in [11] using a method proposed to adjust the parameter of the distribution in distributionally robust optimization. Unit commitment and energy management/economic dispatch in [12,13] use distributionally robust optimization with chance constrained. A method proposed in this system uses mean and variance for the distribution set to handle uncertainty in renewable energy sources for the micro-grid and performs the energy dispatch by not considering unit commitment as constrained to reduce the start-up/shut-down cost.

The uncertainty of wind and solar power needs to be modeled to use for the current power generation system [13,14]. There are many models proposed to deal with the uncertainty of wind power generation so that the UC of all the generating units becomes possible. From the numerous uncertainty models proposed for UC over the last decade, stochastic programming [15,16] is being extensively explored to improve the scheduling of UC decisions under wind farm uncertainty [17,18]. The method proposed in [19] uses an alternative scenario selection method to check consistency with the moments of a wind time series and to explicitly specify the modelers that are believed to significantly influence the performance of the unit commitment schedule. Nevertheless, stochastic programming performs a lot of computations pertaining to various scenarios to outline and formulate the expected results. This leads to undesirable computational time and space as well as requiring a bigger processing unit. To address a large number of scenarios for a given problem, some advanced scenario selection algorithms [18] and decomposition techniques have been developed, i.e., at the first stage, mixed-integer programming provides the results and modeling approaches for deterministic UC, i.e., priority listing, Lagrangian relaxation, and dynamic programming; later on, stochastic programming changes the conventional way of solving such UC problems [20,21]. Then, combined stochastic UC and robust UC formulations are introduced for unit commitment decisions to overcome problem solving time required due to the larger set of scenarios in stochastic optimization and the conservativeness of the robust optimization; the weights of the events for the robust and stochastic parts in the objective function are adjusted by the system operator to obtain optimal and time-saving results [22]. However, a feasible and effective realization requires an optimal compromise between the degree of accuracy and computational time.

Besides the aforementioned methods above, a comprehensive formulation of securityconstrained unit commitment with compressed air energy storage and wind generation

is developed in [23]. Simultaneous optimization of energy and ancillary services with storage is proposed and justified with case studies and results. With the help of case studies, the impact of compressed air energy storage on both economical and technical aspects is reported. Pumped hydro energy storage is also an option for storing the energy in a dynamic economic dispatch problem where unit commitment is a major part of reducing the cost of power produced by thermal generators. This type of energy storage is being used in [24], where deterministic unit commitment and interval unit commitment formulations are modeled that co-optimize the UC and pumped hydro energy storage decisions considering hydraulic limits constraining the pumped hydro energy storage. The study is performed on the system for day-ahead decisions and the results are reported. It employs the stochastic unit commitment model to solve the small-scale (available) wind power.

The optimal sizing of BESS in a system that includes renewable resources is discussed in many papers due to the uncertainties of the renewable resources that could be overcome with the integration of the BESS. Reference [25] suggested a method to find the optimal size of BESS integrated with wind turbines and considered wind and load uncertainties. Two parts of the operational strategy are proposed in [26] for distribution companies. Those two parts are day-ahead and real-time, where, in day-ahead, the load, wind, solar, and prices should be forecasted and in real-time, the gap between the forecasted and real value is considered. The objective here is to locate BESS in the network to minimize the cost and the loss by developing a highly nonlinear model for the network and BESS. Stochastic planning formulation for BESS in a micro-grid using Monte Carlo simulations (MCS) is proposed in [27]. Although uncertainties in wind generation are considered, the network constraints are neglected. Reference [28] used a similar Stochastic approach but with a Radial IEEE distribution system nonlinear model to simulate the line and voltage limits. A deterministic approach to optimize the battery sizing and location in the distribution network is proposed in [29]. The effects of uncertainty in wind power resources using the point estimate method (PEM) are enlisted in [30], where the naturally inspired PSO is combined with the tabu search (TS) to solve the problem. For the optimum size and location of the storage system, the stochastic mixed integer linear programming (MILP) technique is used in the distribution system to minimize the costs of investment and operation [31]. In [32], two levels of the profit-maximizing strategy were introduced, including planning and control. For optimal BESS planning and control in the primary control market, a framework has been developed to achieve the goal. This developed framework provides the balance between the capital cost and the operating cost considering the energy capacity factor. BESS degradation was considered here as a weighting factor that depends on the BESS lifetime.

The charging and discharging rate (C), or the rate at which the power is provided by the battery at any instant, is directly related to battery size. For the better operation of energy storage, an optimum value of the charging and discharging rates of the battery play a major role [33,34]. By using a smaller battery size but larger power requirement, the battery will discharge more quickly than its rated power discharge, which will not only reduce the battery life but also damage the battery cell by increasing the temperature of the battery due to higher power losses inside the battery [35,36]. With a small storage capacity and lesser charging and discharging rates, the battery will not be fully charged/discharged as compared to the bigger storage size for the same power requirement.

For a high penetration of renewable energy sources, more historical data will be required for distribution to be more contracted and to achieve true distribution (i.e., normal distribution) for any uncertain parameter, which makes the optimization model more complex in terms of solving techniques, i.e., the quantization of the normal distribution curve for each event generated by the CPLEX compiler [8]. To deal with the distribution, ref. [11] proposed a method to address economic dispatch and energy management, using distributionally robust optimization with chance constrained, which uses only mean and variance for the distribution set to forecast wind for the micro-grid, and performs the

energy dispatch, but unit commitment constraints are not considered for units scheduling. In [12], UC is performed with DRO using chance constrained for wind-farm uncertainty, but the impact of BESS on unit scheduling is not studied. According to the model solved through chance constrained, the total cost of the system increases with a higher confidence bound due to an uncertainty error. Due to rapid change in the total system cost using DRO and chance constrained, this model creates the research gap for improvements in terms of handling the distribution curve. In addition, the chance-constrained transformation increases the optimization complexity if the distribution is precisely modeled over a set of linear values for random numbers [37]. In addition, with higher uncertainties, chance constraint becomes more computationally complex for random numbers [38]. An ambiguity set method was developed in [39] which was based on historical data. In fact, more historical data gives more ambiguous sets and, consequently, a less conservative solution. The case study conducted in this paper shows that the more information and maximum confidence bound in uncertainty an error is, the lower will be the system total cost. A model discussed in [40] describes the estimated and real energy consumption by an energy storage system. The proposed model estimates the energy consumption by electric vehicles with traffic flow theory and mechanics of locomotion. The author focuses on the percentage usage of ESS in terms of estimated and actual usage of ESS by using floating cara data (FCD) with available data provided by information and communications technology (ICT) devices.

As discussed above, the impact of ESS on UC with uncertainties of RES is not discussed with the help of distributionally robust optimization. Some topics in the literature are near to the topic discussed in this research work. A robust optimization approach for designing an off-grid solar-powered charging station is proposed to provide electric vehicles (EVs) with electricity and hydrogen vehicles (HV) with hydrogen using deterministic mixed-integer linear programming (MILP) and robust optimization in [41]. Therein, a robust optimization approach was employed to design the charging station based on the different levels of system robustness against the uncertainties. This stochastic approach provides worst-case solutions for the uncertainties, i.e., either the smallest or the largest outcome for the uncertainty to minimize or maximize the objective function. Due to worstcase outcomes, this model gives a robust solution. The sizing and siting of the RES for the local distribution system having solar PV uncertainty are designed using DRO and cone relaxation techniques. By using the cone relaxation technique, the DRO becomes mixed-integer second-order cone programming (MISOCP) [42]. The second-order cone programming (SOCP) makes the system more complex, and the solution time also increases as compared to the linear decision rule where nonlinear functions (equations) are linearized by finding their respective linear coefficients for their cumulative linear function (equation).

#### *1.3. Contribution*

In this paper, a method is developed to demonstrate the impact of BESS on the DG schedule and total cost of the system under hybrid uncertainty using a distributionally robust optimization approach. In the proposed model using distributionally robust optimization with a linear decision rule, the ambiguity set gives the freedom to not only control the distribution but also the computational burden by providing the dual gap between the random variables and the auxiliary variables [43]. A linear decision rule has an advantage over the chanced constrained as this method provides the vicinity to the solver to adopt the complexity of choosing the value from the random distribution by using the duality gap given by the solver. These gaps are the stages for the linear piece-wise function over the quadratic function of the probability distribution which grows moderately with the stages that are involved by the solver in terms of the dual gap. In light of the above literature and propositions, BESS is not being considered with UC for solar PV and wind-farm uncertainty using distributionally robust optimization. However, BESS, as shown in Figure 1, not only reduces the startup cost of DGs under given conditions but also mitigates the problem/challenges associated with the randomness of the wind farm and solar PV by

providing power to the system with high ramp up as well as acting as a storage tank [44–46]. The behavior of the BESS as a storage tank also provides the energy at peak load time by storing the energy at off-peak load time. In this way, at an off-peak time, the surplus energy produced by the generators having the least cost is stored to BESS to be used at peak load time, which reduces the running cost of the generators by generating power with a significant figure.

**Figure 1.** The schematic diagram of the proposed system having distributed generator, solar PV, wind-farm, and battery energy storage system.

The significance of this model includes its flexibility in adding more DGs, solar PVs, wind farms, and ESSs. The contribution of this paper includes:


The inclusion of BESS has an important impact on the system, as it reduces the system startup cost as well as adhering to the uncertain behavior of solar PV energy.

#### *1.4. Paper Organization*

The remainder of the paper is organized as follows: Section 2 describes the problem at hand. Mathematical modeling of UC and ambiguity matrix construction with DRO using hybrid generation is discussed in Section 3. Four case studies are conducted in Section 4: 1—sample distributionally robust optimization, 2—an IEEE 14 bus system with optimal BESS (30-min of solar PV data), 3—an optimal BESS for an IEEE 14 bus system (30-min wind data), 4—the optimal BESS for hybrid RESs under given loads. The results obtained through these case studies illustrate the significance of the model proposed. Finally, the conclusion followed by future work, and acknowledgments, are listed in Section 5.

#### **2. Problem Description**

Unit commitment provides the necessary scheduling data required for optimal operation between generation and demand because each unit needs time to startup and shut down. These startups and shutdowns cost money in terms of fuel and some other costs related to manpower and apparatus. Therefore, to minimize that cost, scheduling of the generating units is performed based on the load profile data, whether it is one day ahead or one hour. The problem of economic dispatch and UC becomes more complex when there is an intermittent and uncertain renewable energy source, i.e., solar PV and wind farms. The uncertainty of solar PV and wind farms needs to be modeled for use in the current power generation system. There are many models proposed to deal with the uncertainty of solar PV and wind-farm generation so that the UC of all the generating units becomes possible. The complexity of the problem may be reduced if an energy storage system were to be introduced to overcome the sudden changes so, that the load duration curve and the uncertain output of solar PV and wind farm will become smooth and output power requirements from all the thermal generators will be met at all times at the minimum cost.

#### **3. Problem Methodology**

#### *3.1. Mathematical Formulation of Unit Commitment*

The unit commitment model listed below provides here and now solution while considering the deterministic wind power output in (1). Likewise, UC model with deterministic solar PV is listed in (2).

$$\Xi(\mathbf{x}, \mathbf{o}) = \min \sum\_{t \in \pi} \left\{ \sum\_{k \in \kappa} (c\_{k,t} + z\_{k,t}) + P^{sur} \sum\_{b \in \beta} p\_{b,t}^{cur} \right\} \tag{1}$$

$$\Xi(\mathbf{x}, \boldsymbol{\upmu}) = \min \sum\_{t \in \mathbf{r}} \left\{ \sum\_{k \in \kappa} (c\_{k,t} + z\_{k,t}) + P^{sur} \sum\_{b \in \beta} p\_{b,t}^{cur} \right\} \tag{2}$$

The deterministic mathematical model for the UC with hybrid RES is described in (3). This model is derived linearly from the above two models for wind farms and solar PV in (1) and (2), respectively.

$$\Sigma(\mathbf{x}, \mathbf{o}, \boldsymbol{\Psi}) = \min \sum\_{t \in \mathsf{T}} \left\{ \sum\_{k \in \mathsf{x}} (c\_{k,t} + z\_{k,t}) + P^{\mathrm{surr}} \sum\_{b \in \mathsf{\tilde{\mathcal{S}}}} p\_{b,t}^{\mathrm{surr}} \right\} \tag{3}$$

s.t.

$$z\_{k,t} \ge \mathbb{C}\_k^s(\mathbf{x}\_{k,t} - \mathbf{x}\_{k,(t-1)}) \quad \forall k \in \kappa, \quad t \in \tau \tag{4}$$

$$c\_{k,t} \ge a\_k p\_{k,t}^t + b\_k \varkappa\_{k,t} \quad k \in \kappa, \quad t \in \tau \tag{5}$$

$$\sum\_{k \in \mathbb{x}} p\_{k,t}^t + \sum\_{l \in \Lambda} p\_{l,t}^s + \sum\_{j \in \mathcal{J}} p\_{j,t}^w + \sum\_{b \in \mathcal{\mathcal{J}}} p\_{b,t}^d = \sum\_{b \in \mathcal{\mathcal{J}}} D\_{b,t} + \sum\_{b \in \mathcal{\mathcal{J}}} p\_{b,t}^c + \sum\_{b \in \mathcal{\mathcal{J}}} p\_{b,t}^{cur} \quad \forall t \in \tau \tag{6}$$

$$\sum\_{b \in \mathcal{B}} LCF\_{\mathcal{g},b} \left( \sum\_{k \in \mathcal{x}} p\_{k,t}^{t} + \sum\_{l \in \Lambda} p\_{l,t}^{s} + \sum\_{j \in \mathcal{J}} p\_{j,t}^{w} + p\_{b,t}^{cur} - D\_{b,t} \right) \le L\mathcal{C}\_{\mathcal{g}} \quad \forall \mathcal{g} \in \mathcal{L}, \quad \forall t \in \tau \tag{7}$$

$$-\sum\_{b\in\mathcal{B}} L\mathcal{C}F\_{\mathcal{G},b}\left(\sum\_{k\in\kappa} p\_{k,t}^{t} + \sum\_{l\in\Lambda} p\_{l,t}^{s} + \sum\_{l\in\mathcal{J}} p\_{j,t}^{w} + p\_{b,t}^{cur} - D\_{b,t}\right) \le L\mathcal{C}\_{\mathcal{g}} \quad \forall \mathcal{g} \in \mathcal{L}, \quad \forall t\in\tau \tag{8}$$

$$
\underline{P}\_k \underline{\boldsymbol{\chi}}\_{k,t} \le \underline{p}\_{k,t}^t \le \overline{P}\_k \underline{\boldsymbol{\chi}}\_{k,t} \quad \forall k \in \boldsymbol{\kappa}\_\prime \quad \forall t \in \boldsymbol{\tau} \tag{9}
$$

$$0 \le p\_{l,t}^s \le \overline{s}\_{l,t} + \psi\_{l,t} \quad \forall l \in \Lambda\_\prime \quad \forall t \in \mathfrak{r} \tag{10}$$

$$0 \le p\_{j,t}^w \le \overline{w}\_{j,t} + o\_{j,t} \quad \forall l \in \mathcal{J}, \quad \forall t \in \tau \tag{11}$$

$$p\_{k(t-1)}^t - p\_{k,t}^t \le R D\_k \cdot \mathbf{x}\_{k,t} + \mathcal{P}\_k (1 - \mathbf{x}\_{k,t}) \quad \forall k \in \kappa, \quad \forall t \in \tau \tag{12}$$

$$p\_{k,t}^t - p\_{k,(t-1)}^t \le R \ell L\_k \cdot \mathbf{x}\_{k,(t-1)} + \overline{P}\_k \left(1 - \mathbf{x}\_{k,(t-1)}\right) \quad \forall k \in \kappa, \quad \forall t \in \tau \tag{13}$$

In the above formulation, the objective function in (3) includes startup cost *zk*,*t*, generation cost *ck*,*<sup>t</sup>* and power loss *pcur <sup>k</sup>*,*<sup>t</sup>* . Startup cost and generation cost is calculated through (4) and (5), respectively. In (4), *C<sup>s</sup> <sup>k</sup>* is the fixed startup cost for unit k, *xk*,*<sup>t</sup>* is the binary variable for generator status at time *t*, *xk*(*t*−1) is the binary variable for generator status at time *t* − 1 and *xk*,*<sup>t</sup>* − *xk*(*t*−1) gives the binary difference "1" if a particular DG was turned off at time *t* − 1 and it is turned on at time *t* and "0", if a particular DG was turned on at time *<sup>t</sup>* − 1 and it is still turned on at time *<sup>t</sup>*. In (5), *ak* is the generator *<sup>k</sup>th* first-order cost parameter, and *bk* is the generator *kth* second-order cost parameter. The Equation (6) represents the power balance between the generation and demand, as *p<sup>t</sup> <sup>k</sup>*,*<sup>t</sup>* is the power generated by the *kth* DG unit at time *t*, *p<sup>s</sup> <sup>l</sup>*,*<sup>t</sup>* is the power generated by the *l th* solar PV unit at time *t*, *p<sup>w</sup> <sup>j</sup>*,*<sup>t</sup>* is the power generated by the *j th* wind-farm unit at time *t*, *p<sup>d</sup> <sup>b</sup>*,*<sup>t</sup>* is battery discharge by the battery storage connected to *bth* bus at time t, *p<sup>c</sup> <sup>b</sup>*,*<sup>t</sup>* is battery charge (acting as a load) by the battery storage connected to *bth* bus at time t and *Db*,*<sup>t</sup>* is the load demand at *bth* bus in time *t*, *pcur <sup>b</sup>*,*<sup>t</sup>* is the power surplus/loss at bus *b* in time *t*, if it is negative then there is power surplus at bus b in time t and if positive then it is load shedding at bus *b* in time *t*. The dc power flow model confines the power transmission below the line capacity *LCg* in inequalities (7) and (8) [47]. The maximum and minimum capacity of the DG units is defined in (9). In (10), solar PV generation is less than the maximum capacity of the solar PV unit *l* at time *t* and (11) defines that the wind-farm generation is less than the maximum capacity of the wind-farm unit *j* at time *t*. The ramp-up *RUk* and ramp-down *RDk* limits of DG units are enforced in (12) and (13).

#### *3.2. Power Flow Model through Transmission Lines*

The distributionally robust optimization with the linear decision rule model used in this paper solves the UC problem by using mixed integer linear programming (MILP). The DRO with linear decision rule is a two-stage optimization model, where unit commitments are determined at the first stage with the help of MILP and economic dispatch and cost calculations in the second stage with the standard normal distribution of the random variables used in the model to obtain the expectation of the random variable presenting the uncertainty of wind and solar. The second stage of the optimization makes the system nonlinear, but DRO solves the model with MILP by using the linear decision rule. The linear decision rule transforms the nonlinear model to its equivalent linear model. Similar is the case for power flow through the transmission lines by using Newton–Raphson and Gauss–Seidel; the DRO model solves the equivalent linear model of the nonlinear equations related to voltages, phase angles, and impedances in a network containing nodes/buses. Instead of finding the linear model for these methods, dc power flow is also one of the linear models being used to give an estimation of power flow and overcome the challenge being faced by the DRO method. The Q-power flow and Q-losses are not considered at this stage to make the problem simple, but the AC power flow can also be conducted using the distflow method at a later stage to examine the exact Q-power flow and Q-losses and their impacts on ESS.

The power flows through the transmission lines in the proposed model are modeled using the DC power flow method as listed in (14), the net active power injection *Pb* at bus *b* is the difference between power generation and the power demand at that bus, i.e., *Pb* = *PGb* − *PDb*.

$$P\_b = \sum\_{b'=1}^{N} B\_{bb'} (\theta\_b - \theta\_{b'}) \tag{14}$$

where *Bbb* is the reciprocal of the reactance between bus *b* and bus *b* , and *θ<sup>b</sup>* and *θb* are the voltage angles of bus *b* and bus *b* , respectively. The active power flow *PLbb* between buses *b* and *b* can be calculated from (15). These line flows are confined in the form of (7) and (8), as discussed earlier.

$$P\_{Lbb'} = \frac{1}{X\_{Lbb'}} (\theta\_b - \theta\_{b'}) \tag{15}$$

where *XLbb* is the reactance of line between bus *b* and *b* .

#### *3.3. Battery-Energy-Storage-System Modeling*

The objective function for the battery energy storage system modeled is described in (16), where the cost and charge cycles of BESS are minimized so that the overall cost of the system is minimized, as discussed in the here and now objective functions in (1), (2) and (3)

$$\mathbf{C}\_{B}^{T}(\boldsymbol{o},\boldsymbol{\Psi}) = \min \sum\_{b \in \mathcal{\mathcal{S}}} \left\{ \sum\_{t \in \tau} \mathbf{C}^{fix} p\_{b,t}^{d} + \mathbf{C}^{fix} \mathbf{SOC}\_{b}^{\max} + B\_{\text{count},b}^{T} \right\} \tag{16}$$

s.t.

$$SOC\_{b,t} = SOC\_{b,t-1} + (p\_{b,t}^c \eta\_c - p\_{b,t}^d / \eta\_d) \Delta\_t \quad \forall b \in \mathcal{\beta}, \quad \forall t \in \tau \tag{17}$$

$$p\_{b,t}^{c,\text{min}} \le p\_{b,t}^{c} \le p\_{b,t}^{c,\text{max}} \quad \forall b \in \mathcal{B}, \quad \forall t \in \tau \tag{18}$$

$$p\_{b,t}^{d,\min} \le p\_{b,t}^d \le p\_{b,t}^{d,\max} \quad \forall b \in \mathcal{\beta}, \quad \forall t \in \tau \tag{19}$$

$$SOC\_{b,t}^{\min} \le SOC\_{b,t} \le SOC\_{b,t}^{\max} \quad \forall b \in \mathcal{\beta}, \quad \forall t \in \tau \tag{20}$$

$$SOC\_{b,t}^{\max} \ge 0 \quad \forall b \in \mathcal{\mathcal{B}}, \quad \forall t \in \mathfrak{r} \tag{21}$$

The state of charge of the battery is also linked to its efficiency of charging *η<sup>c</sup>* and discharging *η<sup>d</sup>* in (17). Maximum/minimum charging and discharging of the battery are constrained in (18) and (19), respectively. In (20) battery's state of charge is also restricted with minimum and maximum limits. Most importantly, the constraint for battery sizing is listed in (21), where the maximum size of BESS with the minimum objective cost is determined through (23).

To minimize the BESS charge and discharge cycles for optimum battery life, an algorithm is listed in Algorithm 1 to count for charge (*B<sup>c</sup> count*,*b*) and discharge (*B<sup>d</sup> count*,*b*) cycles at bus b for a complete time period during which the optimization and UC is performed.

$$B\_{\text{count},b}^T \ge \max(B\_{\text{count},b\prime}^c B\_{\text{count},b}^d) \quad \forall b \in \mathcal{B} \tag{22}$$

$$BC\_b = \max(SOC\_{b,t}^{\max}) \quad \forall b \in \mathcal{B}, \forall t \in \mathfrak{r} \tag{23}$$

The total charge/discharge cycles count (*B<sup>T</sup> count*,*b*) is calculated using (22). This constraint in the objective function forces the battery to optimally charge and discharge, which helps the battery to have a longer life. Long-lifespan BESS has the least O&M cost with respect to those having a shorter lifespan.

#### **Algorithm 1** Battery charge/discharge cycle counter

*t* ← 1 *Bc count*,*<sup>b</sup>* ← 0 *Bd count*,*<sup>b</sup>* ← 0 **if** *Pd*(*t* − 1) > 0 & *Pc*(*t*) > 0 & *SOC*(*t*) ≤ 20% **then** *Bd count*,*<sup>b</sup>* ← *<sup>B</sup><sup>d</sup> count*,*<sup>b</sup>* + 1 **end if if** *Pc*(*t* − 1) > 0 & *Pd*(*t*) > 0 & *SOC*(*t*) ≥ 80% **then** *Bc count*,*<sup>b</sup>* ← *<sup>B</sup><sup>c</sup> count*,*<sup>b</sup>* + 1 **end if**

#### *3.4. Distributionally Robust Optimization Model*

The models demonstrated in (3) and (16) are used to formulate the solar PV uncertainty based on (25) and wind-farm uncertainty based on (24) that have an average value (*sl*,*t*) of the solar PV output and average value (*wj*,*t*) of the wind-farm output produced with difference between expected and actual power (*ψ*˜*l*,*t*) and (*o*˜*j*,*t*), respectively.

$$
\overline{w}\_{j,t} = \overline{w}\_{j,t} + \overline{\sigma}\_{l,t} \quad \forall j \in \mathcal{J}, \quad \forall t \in \mathfrak{r} \tag{24}
$$

$$
\overline{s}\_{l,t} = \overline{s}\_{l,t} + \psi\_{l,t} \quad \forall l \in \Lambda, \quad \forall t \in \mathfrak{r} \tag{25}
$$

Both models share the same steps to derive the model for distributionally robust optimization. Therefore, in this paper, a distributionally robust optimization model with solar-PV uncertainty is derived to obtain the ambiguity matrix. Based on past data, the mean solar-PV output for the upcoming year can be determined. The difference between expected and actual power (*ψ*˜*l*,*t*) is acting as an uncertain variable in the proposed model. The ambiguity set for uncertain variables in distributionally robust optimization is constructed using the information based on past data, i.e., mean, standard deviation, variance, and confidence bound. In the proposed two-stage problem, UC problem in (26)–(28) gives the here-and-now solution but the model (26)–(28) is intractable in its current form.

$$\min\_{\mathbf{M}\in\mathbb{L}} \sup\_{\mathbf{M}\in\mathbb{L}} \mathbb{E}\_{\mathbb{M}}\{\Xi(\mathbf{x},\mathbf{\bar{o}},\mathbf{\bar{\Psi}})\}\tag{26}$$

s.t.

$$\mathfrak{x} \in \mathfrak{J} \tag{27}$$

$$\mathbf{x} \in \{0, 1\}^{|\mathbf{x}| \times |\mathbf{r}|} \tag{28}$$

where *<sup>κ</sup>* is the set of all generators. The set *<sup>ζ</sup>* in (27) represents the feasibility region of *x* defined by minimum up/down time constraints. The objective function minimizes the expectation of function <sup>Ξ</sup>(*x*, *<sup>ψ</sup>*˜ ) under a distribution <sup>M</sup>, which is the worst-case distribution over an ambiguity set <sup>I</sup>. The function <sup>Ξ</sup>(*x*, *<sup>ψ</sup>*˜ ) indicates the economic dispatch cost associated with UC decision *x*, under solar PV output outcome *<sup>ψ</sup>*, which can be calculated by solving the second-stage problem. Simple deterministic UC problem considering mean solar-PV output (*sl*,*t*) can be modeled in a matrix form as in (29) and (30).

$$\min \,\Xi(\mathfrak{x})\tag{29}$$

s.t.

$$Ax \le b$$

However, considering uncertainty in the output as having the difference between actual and mean value of the solar-PV output (*ψ*˜ ) under worst-case distribution, the expected cost <sup>Ξ</sup>(*x*) can be formulated using (31).

$$\Xi(\mathbf{x}) = \sup\_{\mathcal{M} \in \mathbb{T}} \mathbb{E}\_{\mathcal{M}} \{ \Xi(\mathbf{x}, \mathbf{\bar{o}}, \mathbf{\bar{\Psi}}) \} \tag{31}$$

where

$$\Xi(\mathbf{x}, \mathbf{\bar{o}}, \boldsymbol{\Psi}) = \min \; q^T \mathbf{y} \tag{32}$$

s.t.

$$Ax + by \le h(\bar{o}, \psi) \tag{33}$$

The facilitating vector *<sup>h</sup>*(*o*˜, *<sup>ψ</sup>*) is defined as

$$h(\bar{o}, \psi) = h^0 + \sum\_{\mathfrak{c} \in \mathcal{S}} h\_{\mathfrak{r}}^{\mathfrak{o}} o\_{\mathfrak{r}} + \sum\_{r, \mathfrak{c} \in \mathcal{S}} h\_{\mathfrak{c}}^{\psi} \psi\_{\mathfrak{c}} \tag{34}$$

The second-stage recourse decisions are represented by a vector (*y*) in (32). All the constraints for second stage problems are presented by (33), where the recourse decisions represented by (*y*) are directly related to the first stage decisions (*x*). All the constants in (33), i.e., *h*0, *h<sup>o</sup> <sup>r</sup>* and *<sup>h</sup><sup>ψ</sup> <sup>e</sup>* , define the function at right side of the constraint in (33) and these constants are directly affected by the uncertain variables *or* and *<sup>ψ</sup>e*.

#### 3.4.1. Modeling Ambiguity Parameters for Solar-PV Uncertainty

To facilitate above model an ambiguity set construction is needed as in (35).

$$\mathbb{I}\_{\Phi} = \left\{ \mathbb{M} \in \mathcal{P}\_{\Psi}(\mathbb{R}^{|S|}) : \begin{array}{c} \bar{\Psi} \in \mathbb{R}^{|S|} \\ \mathbb{E}\_{\mathbb{M}}\{\bar{\Psi}\} = \mathbf{0} \\ \mathbb{M}\{\bar{\Psi} \in \mathcal{V}\} = 1 \\ \mathbb{E}\_{\mathbb{M}}\{v\_{i}(\bar{\Psi})\} \le \Gamma\_{i} \quad \forall i \in \mathcal{I} \end{array} \right\} \tag{35}$$

where <sup>P</sup>*ψ*(R|S|) denotes the set of all probability distributions on *<sup>R</sup>*|S|. The expected value of the random variable *ψ*˜ is 0, which enforces the mean error signal to be "0" and sum of the probability for all outcomes for *ψ*˜ is 1. Function *vi* in (35) incorporates distribution information into the ambiguity model. The uncertainty set in (36) specifies the lower bound *V*− *<sup>l</sup>*,*<sup>t</sup>* and the upper bound *<sup>V</sup>*<sup>+</sup> *<sup>l</sup>*,*<sup>t</sup>* of each random variable *ψl*,*t*.

$$\mathcal{V} = \left\{ \boldsymbol{\Psi} \in \mathbb{R}^S \, : \, V\_{l,t}^- \le \boldsymbol{\Psi}\_{l,t} \le V\_{l,t}^+ \quad \forall l \in \Lambda\_\prime \quad \forall t \in \boldsymbol{\tau} \right\} \tag{36}$$

To obtain the expectation of each function *vi* under ambiguous distributions easily, the ambiguity set in (35) needs to be further extended in (37). Here, an auxiliary variable is introduced to make the ambiguity set in (37) less conservative.

$$\mathbb{H}\_{\Psi} = \left\{ \mathbb{D}\_{\Psi} \in \mathcal{P}\_{\Psi}(\mathbb{R}^{|S|} \times \mathbb{R}^{|\mathcal{T}|}) : \begin{array}{c} (\overline{\mathbb{Y}}, \mathfrak{a}) \in \mathbb{R}^{|S|} \times \mathbb{R}^{|\mathcal{T}|} \\ \mathbb{E}\_{\mathbb{O}\_{\Psi}} \{ \overline{\Psi} \} = 0 \\ \mathbb{O}\_{\Psi} \{ (\overline{\Psi}, \mathfrak{a}) \in \mathcal{V} \} = 1 \\ \mathbb{E}\_{\mathbb{O}\_{\Psi}} \{ \overline{\mathfrak{a}}\_{i} \} \le \gamma\_{i} \quad \forall i \in \mathcal{I} \end{array} \right\} \tag{37}$$

The ambiguity set in (37) needs to be extended further to incorporate joint distribution information for the auxiliary variable as well as the influence of the uncertain variable. The joint distribution for the auxiliary and uncertain variables is presented in (38).

$$\bar{\mathcal{V}} = \left\{ (\boldsymbol{\Psi}, \boldsymbol{\mathfrak{a}}) \in \mathbb{R}^{|\mathcal{S}|} \times \mathbb{R}^{|\mathcal{T}|} : \begin{array}{c} \boldsymbol{\Psi} \in \mathcal{V} \\ \boldsymbol{v}\_{i}(\boldsymbol{\Psi}) \le \boldsymbol{a}\_{i} \quad \forall i \in \mathcal{T} \\ \boldsymbol{a}\_{i} \le \max\_{\boldsymbol{\Psi} \in \mathcal{V}} \boldsymbol{v}\_{i}(\boldsymbol{\Psi}) \quad \forall i \in \mathcal{T} \end{array} \right\} \tag{38}$$

In expression (38), the function *vi* is restricted by the auxiliary variable *ai* so that the ambiguity parameter I having all possible outcomes in (35) holds if set H is valid in (37). To solve the objective function with given constraints, the above ambiguity set needs to be linearized with a linear decision rule, as depicted in (39) having auxiliary random variables.

$$y\_n(\boldsymbol{\psi}, \boldsymbol{a}) = y\_n^0 + \sum\_{\boldsymbol{\varepsilon} \in \mathcal{S}} y\_{i\boldsymbol{\varepsilon}}^{\boldsymbol{\psi}} \boldsymbol{\psi}\_{\boldsymbol{\varepsilon}} + \sum\_{\boldsymbol{r} \in \mathcal{S}} y\_{i\boldsymbol{r}}^{\boldsymbol{a}} \boldsymbol{a}\_{\boldsymbol{r}} \quad \forall \boldsymbol{i} \in \mathcal{I} \tag{39}$$

The Equations (31) and (33) are re-arranged in the form of Equations (40) and (41) so that the linear decision rule can be applied.

$$\mathbb{E}(\mathbf{x}) = \sup\_{\mathbf{M} \in \mathbb{I}} \mathbb{E}\_{\mathbb{M}} \{ \mathbb{E}(\mathbf{x}, \Psi) \} = \sup\_{\mathbf{M} \in \mathbb{I}} \mathbb{E}\_{\mathbb{M}} \left\{ q^T y(\Psi) \right\} \tag{40}$$

where *y* is the recourse decision which depends on *<sup>ψ</sup>***˜** and is expressed as

$$y(\boldsymbol{\Psi}) \in \arg\min \left\{ \boldsymbol{q}^T \boldsymbol{y} : \boldsymbol{T} \boldsymbol{x} + \boldsymbol{W} \boldsymbol{y} \le h(\boldsymbol{\Psi}) \right\} \quad \forall \boldsymbol{\Psi} \in \mathcal{V} \tag{41}$$

By applying the principle of linear decision rule on Equations (40) and (41), the proposed model can be converted to (42)–(43).

$$\bar{\Xi}(\mathbf{x}) = \min \sup\_{\mathbb{O} \in \mathcal{H}} \mathbb{E}\_{\mathbb{O}} \left\{ q^T y(\boldsymbol{\upupmu}, \boldsymbol{\upmu}) \right\} \tag{42}$$

s.t.

$$T\mathfrak{x} + \mathcal{W}y(\mathfrak{y}, \mathfrak{a}) \le h(\mathfrak{y}) \quad \forall (\mathfrak{y}, \mathfrak{a}) \in \bar{\mathcal{V}} \tag{43}$$

These results are taken from [47]. Now, the model discussed in (2) and (3) with the uncertainty model of solar PV can be solved by using an ambiguity set for the distribution of RES's data for uncertain variables, i.e., characteristics of the distribution with the help of (42)–(43), which makes the model tractable.

#### 3.4.2. Modeling Ambiguity Parameters for Wind Uncertainty

The ambiguity-parameters modeling for wind uncertainty follows the same steps as discussed in the previous section. The ambiguity matrix for wind is derived from the same method as the ambiguity matrix for solar but with different variables and parameters. The ambiguity set and extended ambiguity set for wind farms are listed in (44) and (48).

$$\mathbb{I}\_{o} = \left\{ \mathbb{M} \in \mathcal{P}\_{o}(\mathbb{R}^{|S|}) : \begin{array}{c} \mathsf{\tilde{o}} \in \mathbb{R}^{|S|} \\ \mathbb{E}\_{\mathsf{M}}\{\mathsf{\tilde{o}} \, | \, \in} \\ \mathsf{M}\{\mathsf{\tilde{o}} \in \mathcal{V}\} = 1 \\ \mathbb{E}\_{\mathsf{M}}\{v\_{i}(\mathsf{\tilde{o}})\} \le \Gamma\_{i} \quad \forall i \in \mathcal{D} \end{array} \right\} \tag{44}$$

where <sup>P</sup>*o*(R|S|) denotes the set of all probability distributions on *<sup>R</sup>*|S|. The expected value of the random variable *o*˜ is 0, which enforces the mean error signal to be "0" and sum of the probability for all outcomes for *<sup>o</sup>*˜ is 1. Function *vi* in (44) incorporates distribution information into the ambiguity model. To obtain the expectation of each function *vi* under ambiguous distributions easily, the ambiguity set in (44) needs to be further extended in (45). Here, an auxiliary variable is introduced to make the ambiguity set in (45) less conservative.

$$\mathbb{H}\_{o} = \left\{ \mathbb{O}\_{o} \in \mathcal{P}\_{o}(\mathbb{R}^{|\mathcal{S}|} \times \mathbb{R}^{|\mathcal{X}|}) : \begin{array}{c} (\mathfrak{o}, \mathfrak{s}) \in \mathbb{R}^{|\mathcal{S}|} \times \mathbb{R}^{|\mathcal{X}|} \\ \mathbb{E}\_{\mathcal{O}\_{o}} \{\mathfrak{o}\} = 0 \\ \mathbb{O}\_{o} \{ (\mathfrak{o}, \mathfrak{s}) \in \bar{\mathcal{V}} \} = 1 \\ \mathbb{E}\_{\mathcal{O}\_{o}} \{ \mathfrak{s}\_{i} \} \le \gamma\_{i} \quad \forall i \in \mathcal{I} \end{array} \right\} \tag{45}$$

The model discussed in (1) and (3) with the uncertainty model of wind farms is solved by using an ambiguity set (45) for the distribution of RES's data for uncertain variables, i.e., characteristics of the distribution.

#### **4. Results and Discussions**

Case studies were performed in this paper with the help of the ambiguity sets developed in the previous section and the objective functions discussed above are now tractable models due to the linear decision rule implemented in (42)–(43).

#### *4.1. Example Case Study for DRO Illustration with One DG for an Instance*

In this section, a sample case study was conducted with a distributed generator and a solar PV for an instance. This sample case study elaborates the recourse action for all solar PV outcomes in an instance to achieve the worst-case expected cost objective. Here, demand is *D* = 280 kW, mean solar PV output is *ψ*¯ = 40 kW, and penalty cost for load loss is *Psur* = 150 *USD*/kW. To simplify the problem and to elaborate on the initial method for solving with BESS, one can take *SOCmax* = 0 kWh, which means there is no storage in this example, and eventually power charge or discharge for BESS *pc*/*p<sup>d</sup>* = 0 kW. The generation cost coefficients a and b are 1.7 × <sup>10</sup>−<sup>7</sup> USD/kW and 16.57 × <sup>10</sup>−<sup>3</sup> USD/kW, respectively, where the startup cost for the generator is USD 890. The upper and lower limit for the generator is *P* = 240 kW and *P* = 20 kW, respectively. The ambiguity matrix for the solar PV uncertainty is listed in (46). The duality gap for this example is 0.01.

$$\mathbb{H} = \left\{ \mathbb{O} \in \mathcal{P}\_0(\mathbb{R}^2) \, : \, \mathbb{O} \left\{ \begin{array}{l} \mathbb{E}\_{\mathbb{O}} \{\check{\psi}\} = 0 \\ -10 \le \check{\psi} \le 10 \\ \max\{\check{\mathbb{P}}, 0\} \le a \\ a \le 10 \\ \mathbb{E}\_{\mathbb{O}} \{a\} \le 5 \end{array} \right\} = 1 \right\} \tag{46}$$

In the ambiguity matrix construction in Equation (46), in line one, the mean value of error in solar PV output is 0; in lines, two to four, the upper and lower bound of the confidence for the mean value of the solar PV output is from −10 to 10 which means if the mean solar PV output at a particular instance is 40 kW, then the uncertainty in the output power ranges from 30 to 50 kW; in line five, the expected positive error should be less than 5 kW. The worst-case expected cost for the sample case is found to be USD 753.9106 using CPLEX 12.9.0.

#### *4.2. Optimum Battery Sizing and Its Impact on Unit Commitment in an IEEE 14 Bus System*

After promising results obtained from the above sample case study using the DRO technique, the following case studies include solar PV, wind farm, and a BESS using an IEEE 14 bus system having four generators each connected to bus 1 to 4, respectively, [48] for a 24 h time period with a 30-min interval. These case studies elaborate the recourse action for all solar-PV and wind-power outcomes in a day to achieve the minimum expected cost objective. Data for battery storage is shown in Table 1; similarly, each distributed generator is shown in Table 2. The load profile for this case study is shown in Table 3. Solar-PV-output power data for a 200 kW solar PV is taken from [49] where the ambiguity matrix for the solar-PV uncertainty is listed in (47). The wind-power output data for a 700 kW wind farm is taken from [50], where the ambiguity matrix for the wind uncertainty is listed in (48). To make this case study realistic in terms of BESS, wind farm, and solar PV, all the generator's data is converted from MW to kW, and their respective prices are also converted from USD/MW to USD/kW. The mean output power of the solar PV for 30-min intervals provided by the source, as shown in Figure 2, is a bit tailored and converted from MW to kW to show the UC schedule. Similar is the case with wind power, as shown in Figure 3. Load flow limits are considered as per IEEE 14 bus system data in kW having a load capacity factor *LCFgb* for each transmission line in all the case studies conducted here. In all the below case studies, the duality gap of 0.001 and the penalty cost for load loss of *Psur* = 125 *USD*/kW were used.

**Table 1.** The data for battery energy storage system (BESS) integrated with unit commitments and dynamic economic dispatch [49].


$$\mathbb{H}\_{\Psi} = \left\{ \mathbb{O}\_{\Psi} \in \mathcal{P}\_{\Psi}(\mathbb{R}^{2}) \, : \, \mathbb{O}\_{\Psi} \left\{ \begin{array}{c} \mathbb{E}\_{\mathbb{O}\_{\phi}} \{\bar{\Psi}\} = 0 \\ -5\% \le \bar{\Psi} \le 5\% \\ a \le 5\% \end{array} \right\} = 1 \right\} = 1$$

$$\mathbb{H}\_{o} = \left\{ \begin{array}{c} \mathbb{E}\_{\mathbb{O}} \{\bar{o}\} = 0 \\ \mathbb{O}\_{o} \in \mathcal{P}\_{o}(\mathbb{R}^{2}) \\ s \le \mathcal{P}\_{o}(\mathbb{R}^{2}) \end{array} \, : \, \mathbb{O}\_{o} \left\{ \begin{array}{c} -5\% \le \bar{o} \le 5\% \\ \max\{\bar{o}, 0\} \le s \\ s \le 5\% \end{array} \right\} = 1 \right\} \tag{48}$$

$$\mathbb{E}\_{\mathbb{O}\_{o}}\{s\} \le 5\%$$

**Table 2.** Thermal unit's data for dynamic economic dispatch and unit commitments [51].


The 30-min solar-PV output data from solar plates and wind-power output data from wind farms are shown in Figures 2 and 3, respectively. In ambiguity matrix (47) for solar PV, the upper and the lower confidence bound is ±5% of the mean value of the solar-PV output and the expected value of error is 0. The expected positive error should be less than 5% of the mean value of the solar-PV output at a particular instance. Likewise, in ambiguity matrix (48) for wind power, the upper and the lower confidence bound is ±5% of the mean value of the wind power output and the expected value of error is 0. The expected positive error should be less than 5% of the mean value of the wind power output.

**Table 3.** Load/demand profile used with IEEE 14 bus system having 30-min interval.


**Figure 2.** Expected solar-PV output and its upper/lower bounds.

**Figure 3.** Expected wind output and its upper/lower bounds.

4.2.1. Solar-PV Uncertainty with 30-Minute Interval Unit Commitments

The "Here and Now" decisions of the unit scheduled for a 24-hour time period without BESS are shown in Figure 4; on the top of the figure, a colored square shows the status of a particular generator at a certain time instance as "turned on" while no square shows the status of a particular generator at a certain hour as "turned off". The "Wait and See" decisions in terms of economic dispatch for each generator are also shown in Figure 4 on the bottom, where all "turned on" generators are providing power with optimal dispatch and their individual contribution is shown to meet the load demand in the distributed generation system.

The UC schedule in Figure 4 shows that the generator *P*<sup>4</sup> *gen* becomes active from 4:30 to 11:00 p.m. in a 24-hour time period. The load demand from 4:30 to 11:00 p.m. can also be achieved by using generator *P*<sup>2</sup> *gen* power at an off-peak time using energy storage from 5:00 a.m. to 12:00 p.m. Utilizing power from other active generators at peak time, the generator *P*4 *gen* is avoided, which reduces the start-up cost as shown in Figure 5. By turning on/off the generator more than once a day, the total system's cost also increases. The frequency of turning on/off the generators is multiplied by the generator's start-up and shut-down cost, which increases the total system cost. The BESS can reduce more costs if a generator is turned on more than twice, because BESS can provide power at that time when the power is needed and store energy at off-peak times when there is a surplus to save costs from both sides. Therefore, the BESS also saves energy from being lost and provides the necessary backup when it is needed.

**Figure 4.** Unit commitment schedule with power contribution from each distributed generator after incorporating solar-PV output power to the system with 30-min duration without using BESS and *LCFgb* = 1.0 for each bus.

**Figure 5.** The power contribution and the status of each distributed generator after incorporating solar-PV output power to the system with optimal capacity of BESS and *LCFgb* = 1.0 for each bus.

The total system cost observed without using BESS is USD 11,112.1 and the total system cost observed using optimal BESS of 1520 kWh having 0.25C of charge and discharge rating is USD 9334.1. The cost with optimal BESS has a significant improvement (+16%). Battery profile is also shown in Figure 6, where the BESS mostly stores the energy when it is available through the solar PV and generator *P*<sup>2</sup> *gen*. Later on, this energy is given to the system to relax not only generator *P*<sup>4</sup> *gen* but generator *P*<sup>1</sup> *gen*, as shown in Figure 5.

**Figure 6.** Charging and discharging power and hourly energy stored in the battery having BESS capacity optimized to 1520 kWh.

The empirical cumulative distribution function with the size of BESS is shown in Figure 7, where the reader has the freedom to choose the battery size based on the compromise with the total system's cost. The cost effectiveness observed with the optimal use of BESS is +16%, as listed above, so the cost effectiveness will be multiplied with normalized battery usage to obtain the significance of BESS over the current IEEE 14 bus system.

**Figure 7.** Empirical cumulative distribution graph considering solar PV having optimal BESS capacity of 1520 kWh.

The whole system took 139.04 s to solve the problem with optimum objective value for 24 h operation of all scheduled distributed generators.

#### 4.2.2. Wind-Farm Uncertainty with 30-Minute Interval Unit Commitments

The UC schedule without BESS in Figure 8 shows that, from 3:30 a.m. to 10:00 a.m., the generator *P*<sup>2</sup> *gen* and *P*<sup>3</sup> *gen* are active but *P*<sup>2</sup> *gen* is providing a small amount of power as compared to *P*<sup>3</sup> *gen* due to the reason of being active during that period to avoid shut-down and startup costs, as after that period of time the system needs *P*<sup>2</sup> *gen* badly. The start-up cost for generator *P*<sup>2</sup> *gen* is higher than *P*<sup>3</sup> *gen*, but the running cost of generator *P*<sup>2</sup> *gen* is lower than that of generator *P*<sup>3</sup> *gen*. Now comes the role of BESS, as shown in Figure 9, when the optimal size of the battery having a capacity of 558.13 kWh is placed inside the system. The generator *P*<sup>2</sup> *gen* is producing power at its peak by providing the power to the system with a relatively low running cost per unit and the rest of the power is being provided by the BESS to meet the load for the time duration specified above.

**Figure 8.** Unit commitment schedule with power contribution from each distributed generator after incorporating wind power to the system with 30-min duration without using BESS and *LCFgb* = 1.0 for each bus.

**Figure 9.** The power contribution and the status of each distributed generator after incorporating wind power to the system with optimal capacity of BESS and *LCFgb* = 1.0 for each bus.

The total system cost observed without using BESS is USD 7499.8 and the total system cost observed using optimal BESS of 558.13 kWh having 0.35C of charge and discharge rating is USD 6336.3. The cost with optimal BESS has significant improvement (+15.51%). The battery profile is also shown in Figure 10, where the BESS initially stores the energy from 1:30 a.m. to 2:30 a.m. and then delivers this power to the system to turn off generator *P*3 *gen* for the above mentioned time. Later on, BESS stores energy to be used at the end of the day to turn off generator *P*<sup>3</sup> *gen* again for reducing the cost incurred due to the generator's *P*3 *gen* higher running cost.

**Figure 10.** Charging and discharging power and hourly energy stored in the battery having battery capacity optimized to 558.13 kWh.

The empirical cumulative distribution function with the size of BESS is shown in Figure 11, where the reader has the freedom to choose the battery size based on the compromise with the total system's cost. The cost effectiveness observed with optimal use of BESS is +14.56%, as listed above, so the cost effectiveness will be multiplied with normalized battery usage to obtain the significance of BESS over the current IEEE 14 bus system.

**Figure 11.** Empirical cumulative distribution graph considering wind farms having optimal BESS capacity of 558.13 kWh.

#### 4.2.3. Hybrid Uncertainty with 30-Minute Interval Unit Commitments

The unit commitment schedule without BESS in Figure 12 shows that, from 0:00 a.m. to 5:00 a.m., the generator *P*<sup>2</sup> *gen* and *P*<sup>3</sup> *gen* are active but *P*<sup>2</sup> *gen* is providing a small amount of power as compared to *P*<sup>3</sup> *gen* and then is turned off from 5:30 a.m. to 12:00 p.m. due to the reason of being active during that period of time to avoid shut down and startup costs, as after that period of time the system needs *P*<sup>2</sup> *gen* badly. The start-up cost for generator *P*<sup>2</sup> *gen* is higher than *P*<sup>3</sup> *gen* but the running cost of generator *P*<sup>2</sup> *gen* is lower than that of generator *P*3 *gen*. Now comes the role of BESS as shown in Figure 13, when the optimal size of the battery having a capacity of 712.99 kWh is placed inside the system. The generator *P*<sup>2</sup> *gen* is providing the power to the system with a relatively low running cost per unit and the rest of the power is being provided by the BESS to meet the load for the time duration of 5:30 a.m. to 12:00 p.m. The most important thing can be observed by looking to Figures 12 and 13, the total system cost for a day without using BESS is USD 6404.1 while the system cost with BESS has reduced to USD 5874.9, which is 8.26% less than the total system cost without BESS.

**Figure 12.** Unit commitment schedule with power contribution from each distributed generator after incorporating hybrid power to the system with 30-min duration without using BESS and *LCFgb* = 1.0 for each bus.

**Figure 13.** The power contribution and the status of each distributed generator after incorporating hybrid power to the system with optimal capacity of BESS and *LCFgb* = 1.0 for each bus.

Total system costs also increase by turning on/off the generator more than once a day. The frequency of turning on/off the generators is multiplied by the generator's start-up and shut-down cost, which increases the total system cost. The BESS can reduce more costs if a generator is being turned on more than twice because BESS can provide power at that time when the power is needed and store energy at off-peak times when there is a surplus to save cost from both sides. Therefore, the BESS also saves energy from being lost and provides the necessary backup when it is needed.

There is a total of three cycles of charging and discharging being utilized for 24 h in the current IEEE 14 bus system. The battery behavior and its contribution to the system can be seen in Figure 14, where the battery's charge and discharge cycles and the state charge in the battery at any time for a 24-hour time period are shown. With a 0.35C of charging/discharging rate, the total cost of the system including BESS is changing with the storage size of BESS. Initially, without the battery energy storage system, the total system cost is USD 6404.14. The total system cost is at its peak, and this cost gradually decreases to USD 5874.9 and then increases due to the battery cost. The increasing behavior is due to the size of BESS as the size of BESS increases, but the battery utilization remains ineffective after a certain limit.

**Figure 14.** Charging and discharging power and hourly energy stored in the battery.

The BESS available in the market normally have a continuous charging and discharging rate ranging from (0.1C to 0.4C or 10% to 40% of C) of the battery energy storage system, as according to the General Electric with their energy storage unit "RSU-4000" [52]. This is due to several reasons, i.e., battery temperature, battery life, and its continuous charging and discharging capabilities. Due to high charging and discharging rates, the inner temperature of the battery increases, which needs to be cooled enough to make the optimum temperature for the battery, otherwise it may burn the battery or at least create power losses and reduce the battery life. For high charging and discharging rate batteries, cooling systems are needed which cost money. In addition, due to high temperature, power losses inside the battery increase, due to which the battery will become unable to supply the rated power for which it is designed. Therefore, the optimum range of the charging and discharging rate (C) for heavy-duty BESS in the industries is (0.25C to 0.35C).

The BESS power and capacity optimization can be observed in Figure 15, where the mesh plot shows the system objective cost for battery capacity and power (C-rate). In Figure 16, the empirical cumulative distribution function with the size of BESS is shown, which gives an overall perspective on selecting the battery size based on the compromise with the total system's cost. The cost-effectiveness observed with the optimal use of BESS is 8.26%, as listed above, so the cost effectiveness will be multiplied with normalized battery usage to obtain the significance of BESS over the current IEEE 14 bus system.

**Figure 15.** Total system cost vs battery capacity with charging/discharging rates ranging from 0.05C to 1C.

**Figure 16.** Empirical cumulative distribution graph considering hybrid system having optimal BESS capacity of 712.99 kWh.

Figure 17 shows the whole picture of the economic dispatch by distributed generators, wind farm, solar PV, and battery energy storage systems. The system is balanced, which means the load demand is fulfilled by the power supplied through sources discussed in this paper.

**Figure 17.** Total system's demand vs generation (including distributed generation, wind-farm, solar PV, and optimal capacity of BESS).

#### *4.3. Comparison with Similar Studies*

The IEEE RTS 24 bus system is investigated here with DRO as well as the stochastic through scenario approach in current research work. The results obtained through the DRO technique are compared with the stochastic approach presented in [53] with the IEEE 24-Bus system. The system used in [53] is an IEEE 24-Bus system with a time span divided into 24 1-hour time slots having two wind farms connected at buses 10 and 17, and three ESS installed on buses 10, 17, and 20. The system has ten thermal units for scheduling to obtain the overall minimum generating cost while undermining the line limits. The cost for energy not served used in that case study is 200 USD/MWh. The data for thermal units, ESS, hourly load, and mean wind power are provided in [53].

Total system cost objective comparison between distributionally robust optimizations and stochastic optimization with penetration level 100% over various forecasting accuracy variances for an IEEE RTS 24-Bus is presented in Table 4. The total system's cost obtained through the scenario approach is less than the deterministic cost against 100% penetration of RES and a variance of 0.1. This cost is the worst-case solution and, hence, conservative for the IEEE 24-Bus system. However, the total cost of the system with the same parameters obtained with DRO is slightly higher as compared to stochastic, which means the proposed method in the current research has a less conservative solution while handling uncertainties with more than one uncertain parameter. In addition, the value of the stochastic solution (VSS) with stochastic optimization in Table 4 has higher variations as compared to the VSS with DRO, which shows the robustness as well as the accuracy of the method.

**Table 4.** Total system cost objective comparison between distributionally robust optimizations and stochastic optimization with forecasting accuracy variance 0.1 over various penetration level (IEEE RTS 24-Bus).


Similarly, total system cost objective comparison between distributionally robust optimizations and stochastic optimization with penetration level 100% over various forecasting accuracy variances for an IEEE RTS 24-Bus is presented in Table 5. With different wind-forecast-accuracy variances, both models are tested to claim the same behavior of using the DRO model as discussed above. The results obtained through DRO with various wind-forecast-accuracy variances with 100% RES penetration also prove that the DRO model gives a less conservative and more robust solution as compared to stochastic optimization through scenarios.

**Table 5.** Total system cost objective comparison between distributionally robust optimizations and stochastic optimization with penetration level 100% over various forecasting-accuracies variances (IEEE RTS 24-Bus).


Therefore, from the above three cases, it is concluded that BESS has a major impact on unit scheduling. It reduces the startup cost of the generators and extra power generated due to the ramp up and ram down limits is stored to BESS in order to minimize the generation cost for peak times. Similarly, the cold cost of all the generators participating even in a single hour of that particular day is saved. All of the above case studies were solved with Xprog V1.0, a MATLAB-based platform by using IBM ILOG CPLEX Optimization Studio V12.6.3; the system requirements were a 64-bit Windows 11-based operating system with 16GB RAM.

#### **5. Conclusions**

Optimal sizing of a battery energy storage system using the ambiguity-based parametric model of distributionally robust optimization with a linear decision rule for gridconnected distributed generators along with uncertain wind farm and solar PV was developed to achieve the optimal scheduling of the distributed generation with optimal battery energy storage system capacity and power rating. The uncertainty of wind farms and solar PV is modeled through DRO by developing their respective ambiguity sets with mean, minimum, and maximum output for each time step (30-min) and each RES. The DRO model employed in this research provides less conservative solutions under uncertainty as compared to other models, i.e., the robust optimization model and adopted robust optimization model. Accordingly, the effect of BESS on unit commitment is examined with three different case studies conducted with solar-PV, wind-farm, and hybrid uncertainties on distributed generators over a 24-hour time period. These case studies show that the schedule of UC observably changes with BESS placement in the system. Further, the optimal capacity of BESS also reduces the maximum operating point of distributed generators by providing power to the system at peak times and storing energy in BESS at off-peak times. The optimal size of BESS is established, which is inclusive of the practical startup and shut down of distributed generators. This study also discussed the effect of the economical aspect of BESS size on unit scheduling, although with an increment in BESS capacity reducing the start-up cost, nevertheless, the initial investment of BESS economically limits this function; this trade-off defines the efficacy of scheduling-based optimization algorithms. The case studies discussed in this paper have the beauty of not having a complex system to make it more complex for the reader to understand the model proposed here; for future work, these case studies can be extended to multiple energy

storage systems to evaluate the cost-effectiveness.

**Author Contributions:** Authors' contribution are as follows: Conceptualization, A.R. and M.K. (Mahmoud Kassas); Data curation, A.R., M.K. (Mahmoud Kassas) and M.K. (Muhammad Khalid); Formal analysis, A.R. and M.K. (Mahmoud Kassas); Funding acquisition, M.K. (Muhammad Khalid); Investigation, A.R. and M.K. (Muhammad Khalid); Methodology, A.R., M.K. (Mahmoud Kassas) and M.K. (Muhammad Khalid); Project administration, M.K. (Mahmoud Kassas) and M.K. (Muhammad Khalid); Resources, M.K. (Mahmoud Kassas) and M.K. (Muhammad Khalid); Software, A.R. and M.K. (Mahmoud Kassas); Supervision, M.K. (Mahmoud Kassas) and M.K. (Muhammad Khalid); Validation, A.R. and M.K. (Mahmoud Kassas); Visualization, A.R. and M.K. (Muhammad Khalid); Writing—original draft, A.R., M.K. (Mahmoud Kassas) and M.K. (Muhammad Khalid); Writing—review and editing, M.K. (Muhammad Khalid). All authors have read and agreed to the published version of the manuscript.

**Funding:** The research is funded in part by the Interdisciplinary Research Center for Renewable Energy and Power Systems (IRC-REPS) at KFUPM under Project No. INRE2106, and SDAIA-KFUPM Joint Research Center for Artificial Intelligence (JRC-AI).

**Acknowledgments:** The authors would like to acknowledge the support provided by the Deanship of Research Oversight and Coordination (DROC) at the King Fahd University of Petroleum and Minerals (KFUPM), Dhahran 31261, Kingdom of Saudi Arabia.

**Conflicts of Interest:** The authors declare no conflict of interest and the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

#### **Nomenclature**

#### **Sets and Indices for UC Model**


#### **Constants for UC Model**



#### **Decision Variables for UC Model**


*Bd count*,*<sup>b</sup>* Battery's discharge cycle count at bus b

#### **Parameter Set for Uncertainty Model**


#### **Others**


#### **Abbreviations**

The following abbreviations are used in this manuscript:


#### **References**

