A Linear Stochastic Formulation for Distribution Energy Management Systems Considering Lifetime Extension of Battery Storage Devices

Recently, there has been a tremendous growth in the number of Battery Energy Systems (BESs) connected to the grid. These assets can alleviate some operational issues such as demand surges and occasional power fluctuations associated with the Renewable Energy Sources (RESs) connected to the grid. Nonetheless, both overcharging and frequent usage severely affect their health status and shorten their life expectancy. In this paper, an Energy Management System (EMS) framework with linearised algorithm and in-depth analysis on BES life extension is presented, which optimises the techno-economic aspects of an Active Distribution Network (ADN) connected to BESs and RESs. By applying a mathematical linearisation formulation, a Mixed-Integer Linear Programming (MILP) model is proposed for linearising the Optimal Power Flow (OPF) problem. This technique, which has the merit of fair accuracy while having high speed, is used for scheduling BESs to increase their durability as well as to decrease grid costs. To consider the inherent uncertainty associated with demand and RES generation, a two-stage Stochastic Programming (SP) method is implemented in our proposed model. In terms of battery Loss of Health (LoH) assessment, a linearised battery lifetime method is introduced. Ultimately, a modified 33-bus radial distribution test system with the day-ahead Real-Time Pricing (RTP) program was chosen to apply the proposed algorithm and assess its efficiency.

INDEX TERMS energy management system (EMS), optimal power flow (OPF), linearized AC-OPF, battery scheduling, battery degradation, rain-flow cycle counting, day-ahead pricing

Indices & Sets t
Indice of time interval t, n Indices of time intervals/number of days ω, bat Indices of scenarios/energy storage systems i, j, k Indices of network buses X,Y Indices for lifetime curve piecewise linearisation Ω T , Ω ω Sets of time intervals/scenarios Ω bat , Ω B Sets of network buses/energy storage systems Λ DoD , Λ CtoF Horizontal and vertical axes sets for piecewise linearisation of battery lifetime curve I N recent years, the use of Renewable Energy Sources (RESs) has expanded substantially in both small-scale and large-scale integration. Generated electricity from these abundant sources, such as wind and solar energy, can alleviate many of the issues the power grid is struggling with today. Firstly, by generating electricity inside cities and adjacent to load demand centres, these assets have a huge impact on reducing distribution system network losses. Secondly, by providing a proportion of increasing demand, they can save a tremendous amount of finances for network expansion or postpone it at the very least. While being beneficial to a large extent, the usage of these resources has introduced new challenges. Unlike their conventional fossil-fuel-based rivals, stochasticity and unpredictability of energies -such as wind and solar-have introduced new impediments in energy management of the power network [1]- [3]. The output power of RESs primarily depends on the weather conditions and cannot be accurately predicted [4].
In the last few decades, the technological advancement of Battery Energy Systems (BESs) along with energy conversion systems has made them worth using in the power grid. These units are capable of surmounting numerous current power system issues that come with the utilization of RESs, such as high demand peaks, poor power quality, and voltage fluctuations [5]. As a viable solution to these issues, BES units can be scheduled to charge in off-peak hours and discharge in peak hours, which benefits the system in terms of reducing bottleneck and congestion as well as operating costs [6]. Frequent usage, however, along with overcharging or overdischargi of these assets, does harshly harm their health conditions and leads to the reduction of their lifetime [7], [8]. Thus, an optimal charging schedule and strategy consisting of their input and output energy as well as an accurate lifetime model based on their use is required to not only reduce grid operation expenses but also result in BES longer lifespan.

A. LITERATURE REVIEW
In the existing research, numerous models are employed to model the BES lifetime, which are different in terms of accuracy, speed, and practicability, and each has unique advantages and flaws. Firstly, Peukert Lifetime Energy Throughput (PLET) is one of them, which is utilised in [9], where BES sizing and lifetime, as well as grid costs, are the main objectives. This model is also taken into account in [10], [25] with some further simplifying assumptions considering objectives such as optimally operating network and prolonging battery life. However, this method, which measures battery loss of health by the output current in each cycle, was first introduced for small-scale batteries and is not completely appropriate in terms of accuracy for power grid applications. Secondly, the Ampere-hour throughput model is widely considered in the existing literature. In [23], this method is used on a residential scale to anticipate the life depreciation of electric vehicle batteries with the objective of prolonging their life and decreasing customers' electricity costs. Compared to other BES lifetime methods, however, this model is less accurate. Therefore, in some research, such as [26] and [27] , a modified version of this model with higher precision is used for Li-ion battery life assessment and BES and wind farm correlation. Additionally, this method is considered in [28] to anticipate the end of life of Li-ion batteries and assess their economic benefits. Finally, another technique to assess the BES lifetime in various conditions is the Rain-Flow Cycle Counting (RFCC) model. By conducting several laboratory experiments, the RFCC and Ah throughput models Li-ion NLP Multi [10] N/A NLP Single [11] Lead-Acid NLP Multi [12] N/A NLP Multi [13] Li-ion NLP Single [14] N/A MILP Single [15] Li-ion NLP Single [16] * Lead-Acid MILP Multi [17] Li-ion LP Multi [18] Li-ion PSO Multi [19] Lead-Acid PSO Multi [20] N/A GA Multi [21] ZnBr PSO Single [22] N/A PSO Single [23] Li-ion MILP Multi [24] Li-ion MILP Multi This paper Li-ion MILP Multi * A weighted power loss function is used in the objective function.
are compared in terms of accuracy in [29]. According to this reference, while being more complicated, the RFCC method has the benefit of higher precision, since it considers more stress factors (destructive inherent and ambient elements that a battery faces in its lifespan). In [11], it is used for lead-acid batteries, and the simulation required data is obtained from the manufacturer's datasheets. In [24], this method is taken into account in an operational problem with the objective of extending the BES lifetime and lowering operating costs. In this reference, a plain DC-OPF is introduced, which does not consider network losses thoroughly. In [12], [13], with some modifications to the model details, this approach is used for battery life extension to achieve higher accuracy and lower complexity.
Another substantial element that needs to be addressed is future demand and supply predictions, for in real-world conditions, the output power of RESs and day-ahead customer demand are uncertain variables. Stochastic programming is widely used to tackle this issue by considering highly probable scenarios for these variable events in power grids [30]- [33]. A stochastic problem with a two-stage solution with uncertain load demands, PV, and wind generation is taken into account in [34]. In addition, a large number of scenarios (which are highly probable) are considered, and a data clustering method is implemented to reduce their quantity and solve them in two stages. In [10], a neuralnetwork-based stochastic approach is taken into account to anticipate future load demand and PV generation.

B. CONTRIBUTIONS SUMMARY
Based on the reviewed literature and to the authors' best knowledge, a gap exists in the modelling techniques and methods that are utilised in the existing research works.
Hence, in this work, an EMS framework with linearised approach and in-depth analysis on BES life extension is presented which optimises the techno-economic aspects of an Active Distribution Network (ADN) connected to BESs and RESs. This includes a dual-objective model to determine the optimum scheduling scheme for BESs both to minimize electricity purchasing costs from the perspective of Distribution System Operators (DSOs) and to maximize the life expectancy of BES units. The novelties in this paper include, but are not limited to, formulating the problem as a stochastic, Mixed-Integer Linear Programming (MILP) model, meaning that all non-linear elements of the problem are linearised using mathematical techniques. Furthermore, a satisfactory, accurate, highly fast, and linearised AC power flow method is adopted for the first time in the context of scheduling BESs and distribution EMSs. These qualities in solving energy management problems-accuracy and speed-are of high importance, especially for DSOs to schedule charging/discharging based on the future energy price and predicted renewable generation to meet load demand, maximise revenue and minimise costs, and shave demand peaks as much as possible. Regarding numerical studies, to illustrate the viability of this methodology, the proposed algorithm is tested on a manipulated radial network. Table 1 presents a taxonomy to highlight the novelties of the present paper compared to previous research. To summarise, the main contributions of this paper are as follows: 1) Developing a two-stage stochastic optimisation framework with the K-means clustering method as the reduction algorithm to tackle the uncertainties associated with the load demand and renewable generations -solar and wind energies-considering historical weather conditions and time of the year for a one-year period. VOLUME X, 2021 2) Implementing an epsilon-relaxed linearised AC Optimal Power Flow (OPF) model on a radial network for the first time in the BES scheduling context. In contrast to previously introduced linear OPFs in the existing literature, this method contains no binary variable. As a result, with relatively high accuracy, it has less execution time, which makes it a suitable choice for utilizing in real-world large-scale distribution networks. 3) Implementing a linearised RFCC method for battery life expectancy estimation. Extending existing work, a piecewise linearisation technique is taken into account to formulate the battery life based on its discharge rate. As a whole, by adopting this technique, we developed a MILP formulation, achieving a globally optimal solution which cannot be achieved in a Non-Linear Programming (NLP) solution. The remainder of this paper is organised as follows: Section II describes the general concept of the proposed model. Section III presents the objective function and formulation of the model. The BES units' lifetime model is explained in Section IV. The chosen stochastic approach is presented in section V. In Section VI, the details of the proposed case study based on a modified 33-bus radial distribution system are depicted, and simulation results are presented. Conclusions are made in Section VII and the future possible developments of this paper are given.

II. MODEL OUTLINE
The general framework of the proposed model is illustrated in Fig. 1. According to this model, BESs are employed as assets to shift loads from peak hours to off-peak ones. To this end, these resources are being controlled by a centralised EMS which determines when they should connect to the distribution network and when they are best to be isolated. It also dictates charging/discharging patterns and rates for BESs when they are connected to the network. These decisions are made based on various variables such as energy prices (provided by the DSO throughout the day), network characteristics and constraints, and the predicted loads of the customers as well as renewable generations. The main goal of the system is to schedule the BESs to not only extend their lifetime but also to decrease the network operating costs as much as possible. While there are a number of studies in the current literature using control algorithms in event-triggered fuzzy as well as neural-network-based eventtriggered adaptive methods in [35], [36], this paper focuses on the optimisation approaches in energy management to optimally schedule BESs in an ADN.
Two-stage stochastic programming is engaged to tackle the uncertainty of the problem. Here, renewable generation and load demands are considered as uncertain variables, meaning that they can take different quantities in each scenario. To generate realistic scenarios based on historical data, initial data including wind speed, solar irradiance, and load profile are required, which are extracted from historical real-world databases. Subsequently, based on the inherent Some of the symbols are taken from freepik.com website. FIGURE 1: Energy storage system scheduling in the proposed framework FIGURE 2: Problem solving algorithm characteristics of each data set, an appropriate probability distribution function is chosen, and scenarios are generated accordingly. To manage a large number of scenarios, the Kmeans clustering method is used to shrink the number of scenarios for calculating first-stage variables. While reducing scenarios usually leads to data loss and incorrect density of data in each region, this method retains the distribution of the main scenarios in each region to a great degree, making the output reduced scenario data set more reliable. Finally, by considering the first-stage variables as constants and solving the stochastic problem with the main scenarios, the secondstage variables and their expected values are computed. Fig.  2 illustrates the main algorithm of the proposed model. Another significant element that needs to be addressed in operational problems is the OPF method. Several existing methods are focused on AC non-linear iterative models [37], [38]. Nevertheless, these methods-while having the advantage of accuracy-are considerably slow in solving time, particularly for large networks. On the other hand, despite having the advantage of high solving speed, the linear DC-OPF method is not always the best option. Since it does not take bus voltages, network losses, and reactive power into account, the results of this solution are not genuinely accurate. To get the best out of both, several linearised AC-OPF methods [14], [39]- [41] were assessed. These are formulated and compared with each other on some criteria-such as calculation speed, accuracy, and compatibility with distribution networks. While some of these methods were more accurate, the solving time and complexity of implementation were burdensome in some cases. The algorithm in [14], which is based on minimal approximations, was chosen to be implemented since it was introduced mainly for distribution networks and is rapid in calculation while having fair precision. Additionally, it results in a globally optimal solution which cannot be obtained by NLP methods. This model was formerly introduced for network reconfiguration.

III. PROBLEM FORMULATION
In this paper, we undertake a MILP formulation to solve the proposed problem. The main goal is to calculate the optimal charging/discharging power as well as its pattern throughout the day such that it can bring the minimum cost to the DSO while maximizing the life span of BESs. Later in this section, different aspects of the formulation, including objective function, network constraints, cost-based formulas, and the linear AC-OPF model, are explained.

A. OBJECTIVE FUNCTION
In the proposed bi-objective problem, the operating cost of the system is considered as the main objective. This includes the cost of energy purchased from the upstream network by the DSO. The second objective is the lifetime of BESs, which here is converted to a price-based term to match the unit of the main objective. The complete objective function is defined by (1) which is a cost-based equation and requires to be minimised in the optimisation problem.
It should be noted that since we introduced stochastic programming, second-stage cost terms take scenario index. Nonetheless, Cost BES , as a first-stage variable, is calculated with decreased scenarios and appears as fixed in the secondstage calculation, and therefore, it does not take a scenario index. The operating cost of each scenario is multiplied by its chance of occurrence, and finally, the expected cost of operation is calculated as the ultimate objective function. Network costs are explained in the next subsection, and Cost BES is comprehensively explained in section IV.

B. GRID COSTS AND BES CONSTRAINTS
The upstream network cost equations are shown in (2),where the electricity unit price, Price i,t , is considered as a constant parameter. Other constraints regarding BES modelling are shown in (3)-(6). Equation (3) is the operating constraint which calculates the SoC of each BES throughout the day based on its initial, input, and output energy. Equation (4)-(6) are inequalities regarding battery charging and discharging limits and battery high and low energy limits.

IV. BATTERY MODELLING
Generally, a battery's life expectancy is dependent on the number of times it has been charged (or discharged) in its lifetime. Apart from that, RFCC method implies that the lifetime of a chemical-based battery is dependent on other stress factors including, but not limited to, the total capacity of the battery, the number of incomplete cycles, batteries discharging current, temperature, and charging method. The more stress factors are considered, the more the accuracy of the model would be. Here, it is assume that the battery ambient temperature is fixed on 25 degrees Celsius, and all stress factors except the discharging current, incomplete cycles are considered. Less energy exchange between a BES and the connected network can lead to its longer life span. Additionally, the lifetime is also dependent on other factors such as usage patterns, meaning that during a significant rate of charge/discharge in a given time interval, the battery's state of health degrades at a quicker pace. As a consequence, life expectancy is affected more severely. As a solution, if a high capacity BES is available, the energy could be exchanged in a gradual and steady manner, which results in higher efficiency and a longer BES lifespan.
To follow the life depreciation of BESs, a battery life estimation model based on [29] is introduced. In this process, battery life depreciation is measured by using the cycleto-failure versus Depth of Discharge (DoD) curve. Fig. 3a portrays an example Li-ion battery lifetime curve which is employed in this work [43]. The RFCC algorithm, which was originally introduced to track material fatigue, is implemented to assess each cycle's effect on the BES lifetime [44].
This battery life assessment algorithm implies that, if in the mentioned lifetime curve for DoD of k, it shows N cycle-to-failure, meaning that the storage unit can charge or discharge N times before the end of life of this unit. Hence, if the battery goes through a cycle with DoD of k, 1/N of its life perishes, and consequently (N − 1)/N -which we call remaining life fraction-is the fraction that stands for the remained battery life. the life depreciation of each cycle is a function of its DoD. When the remaining life fraction reaches zero, the battery is considered to stop operating and this stage is regarded as the battery's end of life. Formerly, the RFCC technique has been successfully implemented for battery lifetime modelling in [11], [12], [29], [45].
To include fractional charge cycles (which were not available in the manufacturer's datasheet) and their impact on battery life expectancy, the mentioned lifetime curve was extrapolated using a two-term exponential curve fitting equation. The formula and the results of the calculation are shown in (19), and Fig. 3a illustrates the extrapolated curve.
The BES life depreciation in each time interval can be calculated by a piecewise linearised equation which is shown in (20). This linearisation of the cycle-to-failure versus DoD curve is undertaken based on battery manufacturer data. Fig.  3b depicts the original and linearised curve. It is worth mentioning that in (20), X i and Y i are the horizontal and vertical axis data of the cycle-to-failure versus DoD curve. X 1 and Y 1 are the starting points, and X 2 and Y 2 are the ending points of each section, while X 0 is the predetermined linearisation step (which is assumed to be 5%). Additionally, each BES life expectancy, as well as the deterioration cost of all of these units, are calculated using (21) and (22), respectively.

V. STOCHASTIC PROGRAMMING
Due to the uncertain nature of input variables-load demand and PV as well as wind generation-a two-stage stochastic method is proposed to handle the uncertainty and fluctuation of these variables. Naturally, more generated scenarios can lead to a more reliable and also more accurate answer. However, considering all possible scenarios can add to the problem's size and complexity, and a trade-off between accuracy and solving speed should be considered. In terms of load demand uncertainty, 100 scenarios are generated based on a Gaussian Distribution Function (GDF). In each time interval, the maximum deviation of 10% of the maximum daily load is considered. The extra load in each scenario-positive or negative-is randomly distributed to VOLUME X, 2021 buses that contain load demands. In Fig. 4a, the bounded area for scenario generation of load demands is characterised by the coloured surface.
As for the PV generation stochasticity, the Beta Distribution Function (BDF) is implemented based on the solar irradiance data available in online databases [46]. According to [48], compared to other distribution functions for PV generation outputs, this function results in more accurate and realistic scenarios. A total of 10 scenarios are generated for each time interval, in which every single one deviates from 80% to 105% of the mean value. The coloured surface in Fig.  4b indicates the scenario generation domain.
Lastly, the Rayleigh Distribution Function (RDF), with a fixed shape parameter k set to 2, is engaged to take wind stochasticity into account. This function is a single-parameter one, which can be utilised for generating accurate wind scenarios [49]. The scale parameter and an RDF scenario generation formula are depicted in (23) and (24), respectively [50].
Where c is the scale parameter, v and v m are wind speed and mean wind speed, respectively. In total, 10 random scenarios are generated based on the historical wind speed data for each time interval. Fig. 5a illustrates wind speed captured on the first day of summer in 2019, based on historical data [47]. Fig. 5b shows an example of wind speed probability based on Rayleigh PDF at 9:00 on the same day with an average wind speed of 3.7 m/s. The scenarios are generated according to the probability distribution of this curve for the mentioned date and time and likewise for other time intervals.
The results are calculated by taking each of the 100 load scenarios with all 10 renewable scenarios. As a result, for each time interval, 10 × 100 = 1000 scenarios are generated. In total, this will leave us with a 1000 × 24 scenario matrix. A large number of scenarios lead to a complicated problem, and usually, it is shrunk to a sensible one with the same range and distribution density as the original scenarios. Cluster analysis has been used in many existing research works to separate items from a set with similar inherent specifications. In this paper, the K-means clustering method as a type of cluster analysis is employed to shrink the number of scenarios, since it has been widely used and tested successfully in previous research [34], [51], [52]. After generating the main scenarios, a single-dimensional K-means clustering method is employed to reduce the number of scenarios to 10 for each time interval, resulting in 10 × 24 scenario matrix.
In this paper, control variables in the proposed model are divided into two groups. First-stage variables are P ch bat,t and P dch bat,t , which are calculated on the first program running considering a reduced number of scenarios. After the first stage of simulation, these variables are fixed and treated as constants. In the next simulation step, the problem is solved with the original scenarios and second-stage variables consisting of V i,t,ω , I i j,t,ω , P i j,t,ω , Q i j,t,ω and other variables with index ω are computed for each scenario. By virtue of mathematical expressions explained in the previous section and probability of each scenario, the expected value of OF is computed.

A. CASE STUDY
In the present paper, a modified radial distribution network (20.9 kV) with 33 buses is considered to be used as a test system. The original network data for the simulation were obtained from [53]. The assumed test system along with the added components is depicted in Fig. 6. It is worth mentioning that RESs are considered non-dispatchable and their generated power is consumed as it is produced. In terms of load demand, a seasonal load profile is considered, which takes four separate curves for each season into account. To reduce the size of demand data, the first day of each season is assumed to represent the entire season. Therefore, four different load profiles for Málaga, Spain (the chosen site for our network) are obtained from [54], which are illustrated in Fig. 7. In scenarios in which the load demands are higher or lower than the original network [53], the excess load demand is distributed to the buses proportionally (based on their original load).
The electricity price is assumed to follow a market-based RTP scheme. In this paper, two representative curves for the entire year are considered to reduce the bulky data input, one representing spring and summer, and the other representing autumn and winter. The prices for the first day of summer and winter are assumed to represent the warm and cold seasons, respectively. These figures and data are taken from [55], which are illustrated in Fig. 8.
According to [43], each battery pack with a 110Ah capacity can store approximately 1.4kWh. In our proposed network, each BES unit includes 72 battery packs, which raises the total capacity to 100.8 kWh. According to [56], in the simulation period, the BES system investment cost is presumed to be $150/kWh. The data for BES units are depicted in Table 2.  Concerning renewable generation, each PV unit's maximum generation is set at 50 kW (see Fig. 4b). The generated power is based on solar irradiance data obtained from [46]. In addition, each wind unit's capacity is nominally 100 kW. The wind speed data for 10 meters above the ground are obtained from [47], and the power is calculated proportionally. It is worth mentioning that, similar to load demand data, for renewable generations, the first day of each season is assumed to represent the entire season. The renewable site is considered to be in Málaga, Spain, which is located at coordinates of 36.71 degrees North and 4.41 degrees West.
The processor for the simulation platform is Intel(R) core-i5 @ 2.30GHz and 4GB of RAM. Scenarios generation and

B. NUMERICAL RESULTS
The proposed optimisation problem is solved based on the data assumed in the previous subsection. As for the numerical results, expected costs are calculated for four representative days of each season and generalised to that whole season for each case. Finally, by adding these numbers together, the expected cost for a year is calculated. The numerical results for the case studies are shown in Table 3.
In case A, only the effects of RESs are considered, removing BESs from the network. According to the data depicted in Table 3, in this case, the operating cost of the system is relatively high.
In case B, while considering BES units, no lifetime algorithm is implemented, meaning that Cost BES is removed from the objective function equation (see section III). Even though BESs are charged in off-peak hours (when the electricity price is lower) and discharged in peak hours when the electricity price is higher, it is observed that the cost of the operation increases in each season and in total, in comparison to case A. As a result, the expected operating cost is 0.31% higher than case A. This mainly happens because the BES units are employed fully without any considera-VOLUME X, 2021 tion, and the LoH of each unit is significantly high during charge/discharge cycles. In other words, the entire capacity of the BES is employed, which influences their lifespan in a negative and destructive manner. Furthermore, these units discharge at a tremendous rate, and their minimum rate is as high as C/3 which influences BES lifetime. Fig. 9a illustrates each BES's SoC in warm and cold seasons in case B.
Finally, for case C, the code is compiled and run with the same BESs, while considering the life expectancy of these units and including it in the objective function. In contrast, the operating costs are lower than in previous cases. Generally, the expected operating cost is 0.05% and 0.36% lower than case A and case B, respectively. Based on the equations, in this last case simulation, the objective goals are achieved by utilising BESs in a moderate and intelligent manner, which results in not only reducing the total expected cost but also their lifetime extension. In Fig. 9b, the charging pattern of each BES unit in case C is illustrated for the warm and cold seasons, respectively. The curves show that in case C, each BES unit has a lower discharging rate compared to case B, which at most is less than C/8. In cold seasons, as two price peaks exist in the price curve, they are charged fully. However, in warm seasons with one electricity price peak, they are only charged up to 81% of their capacity. As a result, the deterioration cost of BESs is relatively lower.
The results indicate that the life expectancy of BESs rises significantly from 10.4 years in case B to 21.8 years in case C, an increase of approximately 110%. This numerical assessment demonstrates that a lower discharge rate and scheduled utilisation can extend the BES lifetime considerably, as can  Globally optimal Locally optimal be seen by comparing Fig. 9a and Fig. 9b for cases B and C.

C. PEAK SHAVING ASSESSMENT
In this subsection, the effect of using BESs on network load flattening is demonstrated. The winter season load profile was chosen to analyse the data, as unlike other seasons, it has two distinguishing peaks and valleys, which allows one to compare the data more comprehensively. The load demand from the upstream network throughout the day for the winter season is depicted in Fig. 10 for three assumed cases. In case A, no BES is considered; RESs account for a slight demand reduction. According to the graph, Uncoordinated usage of BESs in case B allows load shifting to happen in a relatively high and radical manner, and therefore the maximum demand supplied by the upstream network decreases approximately by 2.3% to be 2996 kW. In case C, however, the discharge rate is limited, and consequently, the proposed lifetime model accounts for only a 1% reduction in the maximum network demand, which will be 3034 kW.

D. COMPUTATIONAL TIME AND ACCURACY
To evaluate the model in terms of accuracy and solving time, two other common power flow algorithms, DC-OPF and AC-OPF, are developed to solve the existing problem. The models are standard linear DC-OPF approximations (without considering reactive power and voltage angle) and Newton-Raphson based AC-OPF obtained from [57]. This gives one the opportunity to make a comparison between the undertaken linearised AC-OPF and other methods which are used in the existing research. In modelling the two other OPF methods, (1)- (6) and (19) regarding basic constraints and battery as well as stochastic modelling-were not changed, and the remaining equations were replaced with the main algorithms of the new methods. The solving time, objective function quantity, and the solution status for solving one scenario under three different algorithms, are demonstrated in Table 4. According to these data, with relatively high accuracy compared to the DC-OPF method and approximately 90% less error, the linearised AC-OPF model significantly increases the calculation speed compared to the original AC-OPF model (nearly 7 times faster), while calculating globally optimal solution. In Fig.  11, P G i,t,ω or the power absorbed from the substation as well as total active power loss of the network are depicted for three mentioned power flow algorithms. It can be observed that while in the DC-OPF the power loss is zero and and the total power from substation is the least, in linearised AC-OPF algorithm the power loss and power absorbed from the substation is slightly less that the original AC-OPF method in most time intervals.

VII. CONCLUSION
In this paper, a BES scheduling problem in an ADN is proposed. Operating cost minimization as well as BES lifetime extension are set as the main objectives of the problem. In terms of considering uncertainty, a two-stage stochastic optimisation approach is implemented, and K-means clustering as a scenario number reduction method is engaged. As for the core operation problem, a linearised, convexed AC-OPF model with high calculating speed and fair accuracy is put into practice. Finally, a linearised method based on the RFCC technique is implemented to track BES's deterioration and evaluate the LoH of the battery during the simulation period.
The simulation results indicate that: • Considering the lifetime model, BESs are discharged moderately, while without the lifetime model, they are discharged at a substantial rate and fully charged several times a day. • The operating cost is highest when using BESs without the lifetime model and lowest when optimally scheduling them. • The life expectancy of BESs is extended by 110% by using the proposed scheduling model. • The peak demand is reduced by more than 1% in peak hours, which can be decreased further with higher BES capacity. • By employing the linearised AC-OPF, the execution time is reduced significantly (nearly 85%) compared to the original non-linear formulation, while guaranteeing fair accuracy (approximately 1% error in the objective function). In future works, some modifications can be made to enrich the proposed model in terms of accuracy. Firstly, we only assessed Li-ion batteries in this work. By working on different battery types on the same network, the results can be compared in terms of battery life expectancy and grid profit. Secondly, we assumed that the price of BES units is constant in the period of operation. However, as time passes, by introducing new technologies and mass-production of existing batteries, they become less expensive. Therefore, by implementing an interest rate, their price reduction in the period of operation can be taken into account.