Optimal Capacity and Cost Analysis of Hybrid Energy Storage System in Standalone DC Microgrid

DC microgrid systems have been increasingly employed in recent years to address the need for reducing fossil fuel use in electricity generation. Distributed generations (DGs), primarily DC sources, play a crucial role in efficient microgrid energy management. Energy storage systems (ESSs), though vital for enhancing microgrid stability and reliability, currently lack cost-effectiveness. Each ESS technology serves a specific purpose, suggesting that hybridizing these technologies can improve microgrid stability and reliability while extending the ESS’s lifespan. This paper proposes an optimization of the capacity and cost of a hybrid ESS, comprising a battery and a supercapacitor, in a standalone DC microgrid. This optimization is achieved by calculating the cut-off frequency of a low-pass filter (LPF). The supercapacitor supplies the high fluctuation component of renewable power generation and load demand, while the battery caters to the low fluctuation component. To minimize the designed objective function, including the total net present value (NPV) and replacement cost of the hybrid ESS, a meta-heuristic strategy called the Whale optimization algorithm (WOA) is employed within a MATLAB environment. The optimization takes into account real PV power, wind turbine power and load demand. The results show that reducing power fluctuation for the battery can lower the cost of the hybrid ESS. Compared to a battery-only microgrid system with an <inline-formula> <tex-math notation="LaTeX">$NPV_{total}$ </tex-math></inline-formula> of <inline-formula> <tex-math notation="LaTeX">$\$ $ </tex-math></inline-formula>6,153,059, the hybrid ESS has an <inline-formula> <tex-math notation="LaTeX">$NPV_{total}$ </tex-math></inline-formula> of <inline-formula> <tex-math notation="LaTeX">$\$ $ </tex-math></inline-formula>5,413,846. Thus, the hybrid ESS can reduce the total cost of the entire project by 12.01% compared to the system with only a battery. Consequently, the hybrid ESS’s total system life-cycle cost is lower than that of a system using only a battery.

− → X Current position vector.

− → X gbest
Position vector of the best solution. − → X r Random position vector. σ Rate of self-discharge of supercapacitor. b Constant coefficient used to define the spiral pattern.

C b_E
Cost per energy of battery.

C b_install
Initial installation cost of battery.

C b_o&m
Operation and maintenance cost of battery.

C b_P
Cost per power of battery.

C install
Initial installation cost of hybrid ESS.

C sc_E
Cost per energy of supercapacitor. C sc_install Initial installation cost of supercapacitor.

C sc_o&m
Operation and maintenance cost of supercapacitor.

C sc_P
Cost per power of supercapacitor.

NPV b_o&m
Net present value of battery operation and maintenance cost.

NPV b_replace
Net present value of battery replacement.

NPV o&m
Net present value of the operation and maintenance cost throughout the project.

NPV replace
Net present value of hybrid ESS replacement.

NPV sc_o&m
Net present value of supercapacitor operation and maintenance cost. NPV sc_replace Net present value of supercapacitor replacement.

NPV total
Net present value of total cost of hybrid ESS. P b_ch Battery charged active power. P b_dis Battery discharged active power. P b_rated Rated battery active power.

P b_ref
Active power reference of battery. P H _ref Reference active power of hybrid ESS.

P Load
Active power of load demand. P PV Active power of PV system. P sc_ch Supercapacitor charged active power. P sc_dis Supercapacitor discharged active power. P sc_rated Rated supercapacitor active power.

P sc_ref
Active power reference of supercapacitor. P WT Active power of WT system.

I. INTRODUCTION
At present time, microgrid systems, in which the DGs are heavily integrated into the power grids, are gaining more attention from researchers and system operators. In Thailand, the most widely used DGs are solar PV and wind turbine (WT) power generations [1]. Grid-connected renewable energy resources (RESs) are viable solutions to meet rapidly growing demands in microgrid systems. However, the intermittent and volatile nature of the RESs hinders their performance and prevents them from being used efficiently. It is a common practise to combine the RESs with an efficient battery energy storage system (BESS). Lead-acid batteries play an important role in stationary ESS. Recently, lithiumion battery (Li-ion) technology has been developed, and its price has continued to decrease [2]. A technological and economic analysis of the Li-ion and lead-acid batteries integrated into grid-connected power networks and PV systems was conducted by considering commercial load profiles [3]. The performance of the mentioned battery technologies is also greatly affected by the rate of charge and discharge, which in turn gradually decreases their capacity. Thus, the employed battery required optimal sizing of the entire system to maximize its efficient utilization. Therefore, both types of batteries are viable options in the microgrid system [3], [4]. At present, ESSs come in many forms, sizes and features. The most widely used ESS in the microgrid system is the battery because it can store a large amount of energy. Also, the battery has a fast response time, is easy to control, and has many types and sizes available on the market. A battery can support charging and discharging with constant characteristics according to electrochemical and chemical reactions. Therefore, the constant charging and discharging characteristics of current can extend the battery's lifetime. However, electricity generation from the RESs and load demands in power systems are characterized by inconsistency due to rapid increases or decreases, resulting in high fluctuations in the current charging or discharging of the battery. Therefore, other technologies of the ESSs are necessary for enhancement of system efficiency [5], [6], [7]. Hybrid ESS combines the advantages of different ES technologies. The common use of hybrid ESSs is between batteries and supercapacitors, in which the supercapacitor is suitable due toÂ its ability to respond to charge and discharge many times faster than batteries. However, the supercapacitor has a small energy capacity and is suitable for supplying or receiving power in the form of surges in a short time with less heat than a battery because of its low internal resistance [8]. Using hybrid ESS between battery and supercapacitor can increase power system stability and reliability and prolong the battery's lifetime.
A microgrid system is a key component in extending modern electricity services to power consumers. A detailed cost analysis of battery in a microgrid can provide the high performance of a Li-ion or lead-acid battery and minimize total cost [9]. The analysis and application of hybrid ESSs in small standalone DC microgrids for remote areas have attracted widespread attention [10]. The volatile nature of wind energy produces large fluctuations in power generation, which in turn can have serious consequences for the battery's lifetime [11]. The uncertainty of the RESs has inspired researchers to combine different technologies for the energy sources, including energy storage devices, to ensure the reliability of the microgrid. Intelligent energy management systems (EMS) are used to define the energy flow between hybrid renewable energy systems, energy storage, and the power grid [12]. Highcapacity lithium-ion battery and high-power supercapacitor are the ideal ESS for a DC microgrid. It is important to have a power management strategy that increases bus voltage feedback compensation and can keep the bus voltage within a reasonable range due to load fluctuations [13]. Energy exchanged between energy storage devices (ESDs) by utilizing a low-pass filter (LPF) can reduce the size of the ESS without negatively impacting the battery lifetime [14], [15]. The operating cost of a battery is determined by the depth of discharge (DOD) over time. Optimal battery sizing using the Firefly algorithm (FA) was applied, which can reduce the cost of the microgrid and achieve optimal battery sizing [16], [17].
However, combining renewable energy sources with batteries can cause high fluctuations in battery charging and discharging, leading to a shorter battery lifetime and a higher replacement cost. Therefore, this paper proposes a technique for optimizing the capacity and cost of the hybrid ESS combining battery and supercapacitor in a standalone DC microgrid. A low-pass filter is used to separate the low-frequency power needed to charge and discharge the battery and the high-frequency part is allocated to the supercapacitor. Several techniques are currently used for optimization tasks, including Particle Swarm Optimization (PSO) and Firefly Algorithm (FA) and Whale Optimization Algorithm (WOA). Each optimization technique has a different solution, parameters, and performance. The WOA technique is relatively unique since it is able to obtain a quick solution by using a small number of iterations [18], [19]. Moreover, the WOA has the ability to maintain the balance between exploration and exploitation during the search process and has no velocity tracking for each individual in the population, thus reducing computational overhead compared to the PSO-based approach. It is found that there are no studies using the WOA technique for optimal capacity and cost analysis of hybrid ESS in DC microgrids. Therefore, this paper applies the WOA method to the optimization of the capacity and cost of a hybrid ESS combining battery and supercapacitor in a standalone DC microgrid.
The salient features of the paper are summarized as follows: 1) This paper proposes a method for optimal capacity and cost analysis of the hybrid ESS with a battery and a supercapacitor in a standalone DC microgrid. A filterbased approach is employed to separate different frequency components of microgrid active powers and allocate them to the hybrid ESS. The high-frequency component of the active power is supplied by the supercapacitor, while the low frequency component of the active power is provided by the battery. Thus, frequent charge and discharge of the battery is decreased, extending battery lifetime and reducing battery replacement costs. 2) Due to its simplicity of implementation, the Whale optimization algorithm (WOA) is applied to optimize the cut-off frequency of the low-pass filter and obtain the optimal sizing of the hybrid ESS using yearly real data on load demand, wind turbine and PV power generations. Compared to the only-battery case study, the total cost of the hybrid ESS throughout the entire project is reduced by 12.01% compared to the onlybattery case. The rest of this paper is structured as follows. Section II explains the microgrid. Section III introduces hybrid energy storage systems. The theory of the Whale optimization algorithm is given in Section IV. Section V provides the methodology of this work, whereas Section VI verifies the performance of the proposed strategy. Finally, Section VII concludes the paper.

II. DESCRIPTION OF DC MICROGRID
A microgrid is a small LV power system, consisting of small scale DGs and loads. Typically, the DGs in the microgrids are mainly from renewable energy sources such as PV and WT systems. In the microgrid system, there are several load types classified based on user types, such as household sectors, commercial building sectors, industrial plants, and various agencies [20]. As mentioned earlier, the ESS is an important part of the energy management FIGURE 1. Typical components of a DC microgrid system. system in the microgrid system. The microgrid systems can be classified into DC and AC systems and be operated in two modes: grid-connected and islanded modes. The DC microgrid has been gaining more attention in recent years due to various advantages such as higher conversion efficiency, lower costs of power converters and simpler controllability (as thre is no concern of reactive power, frequency and phase unbalance) [21]. The grid-connected mode of microgrid is stable and able to supply electricity back to the main power grid. In the islanded mode, the microgrid is completely disconnected from the main grid. Therefore, the power used in the standalone microgrid is entirely supplied by the internal power sources. The standalone microgrid is suitable for rural or remote areas. The concept of the standalone microgrid is to generate enough electricity to be used in the control and management systems. The disadvantage of renewable power generation is that it fluctuates and cannot be controlled to meet the load. Therefore, the ESSs are important in the standalone DC microgrid [22], [23]. Figure 1 shows the components of a typical DC microgrid system. DC-DC and DC-AC power converters are crucial parts of the DC microgrid system. The microgrid can be either connected to or disconnected from the main grid. In the DC microgrid system, there are small-scale DG units and local loads. A diesel generator can be used for backup or emergency power generation. The ESS is an essential part of effective energy management within the power system.

III. HYBRID ENERGY STORAGE SYSTEM
Due to the short service life of battery systems, new installations increase costs. This paper explores a hybrid ESS that uses supercapacitors to help extend battery life and uses battery life as an efficiency factor. In this section, the hybrid energy storage system combining a battery and supercapacitor installed in the standalone DC microgrid is briefly explained.

A. BATTERY MODEL
The battery is a high-energy, low-power source and a relatively expensive component of the microgrid system. Thus, battery life is an important economic and reliability factor. The lifespan of the battery needs to be studied and various operating factors that affect its lifespan should be taken into account. The service life of a battery is typically depleted when its current capacity is reduced to 80% of its initial rated capacity. The service life of the battery can be considered in two ways: • Battery life cycle: It is the loss of life caused by the use of the battery. When the battery is operated, it deteriorates depending on the nature of the discharge or charge, the depth of discharge (DoD) and the temperature.
• Calendar life: It is the battery's deterioration over time, called aging in calendar years, and it is also affected by temperature. For example, the battery can be used as a backup or emergency power storage device without being used at all. [24].
The mathematical model describing the characteristics of the battery can be defined as, where E b is the capacity of the battery; P b_ch (t) is the charging power of the battery at time t; P b_dis (t) is the discharging power of the battery at time t; η b_ch is the charging efficiency of the battery; η b_dis is the discharge efficiency of the battery; E b_rated is the rated capacity of the battery; t is the cycle time; SoC b (t) is the battery state of charge at time t and β is the rate of self-discharge of the battery.

B. SUPERCAPACITOR MODEL
A supercapacitor (SC) is a low-energy and high power source that is typically used in small power grids. The SC is commonly used as a complement to the battery system. High fluctuations in RESs can cause the battery to operate at a high energy rate (depth cycle), shortening its lifespan. The battery may be considered in conjunction with the SC, which can operate at higher power ratings, have more charge and discharge cycles than the battery, and operate at higher temperatures. This increases system reliability and prolongs the service life of the battery in terms of investment. The SC can operate at high DOD, so it is unnecessary to replace it over its lifetime. The operation of the SC is chemically inert, even at high DoD. Therefore, the high fluctuations in the RESs have no effect on its life. In general, the voltage and temperature of the SC are controllable factors and are constant within the scope of application [25]. Hence, the effect of temperature and voltage on the SC's life can be ignored. In this work, the lifetime of the SC is set to be equal to the calendar year. Similar to the battery, the SC is a bidirectional power source. The mathematical model that described the characteristics of the SC can be defined as, where E sc is the capacity of the SC; P sc_ch (t) is the charging power of the SC at time t; P sc_dis (t) is the discharging power of the SC at time t; η sc_ch is the charging efficiency of the SC; η sc_dis is the discharging efficiency of the SC, E sc_rated is the rated capacity of the SC; SoC sc (t) is the SC state of charge at time t and σ is the rate of self-discharge of the SC.

IV. WHALE OPTIMIZATION ALGORITHM
The whale optimization algorithm (WOA) is a meta-heuristic algorithm [26]. The WOA technique is applied in this study owing to its simplicity and fast approach. The humpback whale's social hunting behavior was applied as an algorithm. Humpback whales are gifted with locomotion in search of food and attack prey with bubble nets. In this way, foraging carried out by humpback whales creates unique bubbles in a circular path. Figure 2 shows Humpback whales breathe underwater and produce bubbles in the form of clouds and pillars. These large groups of bubbles connect to each other and gather bait or schools of fish together. Then, the whales continuously create more bubbles and move to the surface by inhaling and exhaling. The target shrinks by narrowing the bubble circle as it approaches the prey. This hunting of prey appears to aid in finding or capturing the prey by surrounding or immobilizing them. Also, this behavior can hide predators from the prey. The humpback whales can predict the location of their prey so that they can surround it with air bubbles. The whale starts by identifying the best search agent, and then the position of the other search agents is updated using the best search agent. The new search agent location for global search is determined by a randomly selected search agent [27]. Based on the nature of the hunting behavior of humpback whales, the WOA technique employs the hunting behavior that involves encircling prey, bubblenet attacks and random search, as presented in the following sections [28], [29].

A. ENCIRCLING PREY
Humpback whale prey surrounds begin with each whale representing a search. Each individual's position in the search area represents a food source. It is assumed that the current optimal location is the food source or target prey. All search agents in the group will move to the optimal position to surround the prey [30]. Thus, this behavior can be mathematically written as, where − → A and − → C are the coefficient vectors; t is the current iteration; − → X gbest (t) is the position vector of the best solution obtained at the t-th iteration and − → X (t) is the current position vector.
The vectors − → A and − → C can be calculated as, where r rand represents the random vector in [0,1]; − → a indicates a convergence factor that linearly decreases from 2 to 0 as the number of iterations increases; T is the maximum iteration and t is the current iteration.

B. BUBBLE-NET ATTACKS
For the whale bubble-net attack pattern, it moves upward in a spiral and continuously decreases the circle size, as shown in Figure 2. The humpback whale's prey attack pattern is split into two parts to simulate bubble net behaviors.
• Shrinking Encircling Mechanism: This behavior is achieved by reducing the vector from 2 to 0 in (12). The search agent's new location can be set between the current location and the prey's location. This demonstrates the whale's ability to locate local prey.
• Spiral Updating Position: Position improvements are made by calculating the sample between each whale's position and the current optimal position of its prey and then simulating the humpback whale's spiral motion to get closer to the best answer. This behavior can be written as, where − → D * represents the distance between the i-th whale and the current optimal position; b is the constant coefficient used to define the spiral pattern and l is a random number between [0,1].
The whale can swim towards its prey in a spiral shape during hunting while reducing the size of the closed circle. Thus, to model this behavior a probability of 0.5 was set as the criterion to determine how the whale's position should be improved, which can be defined as, C. RANDOM SEARCH Random search requires vector − → A to have a random value greater than 1 or less than -1, and p less than 0.5. The system selects a random search agent to guide the search and increase the searchability of the algorithm. The mathematical model . Schematic diagram of the standalone DC microgrid with energy management system. In the microgrid system, there are two power sources, namely PV and WT sources, and load demand connected to the common DC bus. A hybrid ESS is responsible for minimizing the active power mismatch between power generation and load demand. A low-pass filter is employed to separate different frequency components of the mismatched active powers.
for this step is determined by, − → where − → X r (t) is the random position vector.

V. METHODOLOGY
In this section, the standalone DC microgrid used as a test system in this paper is introduced. Based on the test system, the objective function is proposed and then solved by employing the WOA optimization technique explained in the previous section.

A. STANDALONE DC MICROGRID
A standalone DC microgrid shown in Figure 3 is considered in this paper. In the microgrid system, a residential load, a PV system and a WT system are installed. A hybrid ESS with a battery and SC is also installed to efficiently improve energy management in the system. The main aim of this paper is to optimize the cut-off frequency of the low-pass filter of the hybrid ESS in order to extend battery lifetime under high fluctuations of the RESs and local load demand. Under standalone DC microgrid operating conditions, the reference active power of the hybrid ESS can be calculated as, where P H _ref is the reference active power of the hybrid ESS; P Load is the active power of the load demand; P PV is the active power of PV generation system and P WT is the active power of WT generation system. In the case of a hybrid ESS, the reference active power required from the ESS is divided into two parts. The reference active powers are allocated to the battery and the SC using the first-order low-pass filter. It is widely used for active power sharing in hybrid ESS [31], [32]. The smooth or low-frequency component of microgrid active power is fed to the battery, and the high-frequency portion of microgrid active power is supplied by the SC. The power allocation of the hybrid ESS in the s-domain is given by, where T f = 1 2πf c and 0 < f c < 1 2T s ; P b_ref is the reference power of the battery; P sc_ref is the reference power of the supercapacitor; T f is the time constant of the frequency filter circuit; f c is the cut-off frequency of the low-pass filter and T s is the sampling period.
The power allocation depends on the cut-off frequency of the filter (20), which is the parameter to be optimized so that battery lifetime can be extended by decreasing frequent charges and discharges. The cut-off frequency is bounded by the Nyquist principle, i.e., not more than half of the sampling frequency or the Nyquist frequency according to (21).
The reference power of the ESS is used to determine the actual operating power of the hybrid ESS. The operating power of the battery and supercapacitor is obtained by, where P b is the battery's active power and P sc is the supercapacitor's active power. The positive values denote discharging, the negative value charging, and zero the standby state. The magnitude of the rated power of batteries and supercapacitors can be calculated from the absolute value of the maximum power as,Â where P b_rated is the rated power of the battery and P sc_rated is the rated power of the supercapacitor. The ESS is controlled to operate within the specified DoD for safety and to increase its service life. For this reason, the acceptable DoD is less than 100% and more than 0%. Therefore, when considering the range of DoD, the rated capacity of the battery and supercapacitor are larger than the VOLUME 11, 2023 baseline capacity and are given as, where E b_based is the baseline battery capacity; E sc_based is the baseline SC capacity; DoD b_max and DoD b_min are the upper and lower bounds of the battery depth of discharge; DoD sc_max and DoD sc_min are the upper and lower bounds of the SC depth of discharge.

B. OBJECTIVE FUNCTION
Objective function is developed in this subsection. The total cost of implementing an ESS in a microgrid system is an important metric for project planning and optimization. This paper uses the total cost of hybrid ESS as an objective function. The cut-off frequency of the low-pass filter is calculated to determine the optimal size of the battery and supercapacitor. The objective function is defined by, where NPV total is the net present value of the total cost of the hybrid ESS; C install is the initial installation cost; NPV replace is the net present value of the replacement cost throughout the project and NPV o&m is the net present value of the operation and maintenance costs throughout the project. The net present value of the total cost of the hybrid ESS is obtained as the sum of the initial installation cost, the replacement costs and the operation and maintenance costs. Where the initial installation cost of the hybrid ESS is obtained by the sum of the initial installation of the battery and supercapacitor as, where C b_P is the cost per power of the battery; C b_E is the cost per energy of the battery; C sc_P is the cost per power of the supercapacitor and C sc_E is the cost per energy of the supercapacitor. As ESS is used, it will deteriorate over time. Replacement costs of battery and supercapacitor can be defined as, where N b_re is the number of battery replacements (L P /L b − 1); N sc_re is the number of supercapacitor replacements (L P /L sc − 1); L b is the cycle life of the battery; L sc is the cycle life of the supercapacitor and d is the discount rate. The operation and maintenance costs are obtained from (37), which is the sum of the operation and maintenance costs of the battery and supercapacitor. This paper uses the net present value estimation of the total cost over the life of the project to convert the cost over time to its present value. The uniform series worth factor (USW) equation was applied to convert annual expenses to their present value. The NPVs can be defined as, where C b_o&m is the operation and maintenance cost of the battery; C sc_o&m is the operation and maintenance cost of the supercapacitor and L p is the life of the project. The WOA optimization technique was applied to optimize the cut-off frequency of the low-pass filter. In this paper, we used a total of 100 search agents and a maximum of 30 iterations. The parameters are designed based on the work in [33]. Figure 4 shows the procedure for obtaining the cut-off frequency for the hybrid ESS in the standalone DC microgrid. Determination of the optimum cut-off frequency begins with obtaining the powers of load demand, PV and WT systems. The reference power of the hybrid ESS is then calculated. This reference power is fed to the low-pass filter to obtain the reference powers of the battery and supercapacitor. Also, the rated power and energy of the hybrid ESS are calculated. Then, the battery life and the NPV total cost of the system over the project life are calculated. The iteration is checked, and finally the optimum cut-off frequency is obtained.

VI. SIMULATION RESULTS
The results in this paper are verified using MATLAB running on a MacBook Air (Early 2015), 1.6 GHz Dual-Core Intel Core i5, RAM 8 GB 1600 MHz DDR3. In this study, we used one-year data of load demand, PV and WT systems, as shown in Figures 5, 6 and 7 respectively, for analysis of the entire project life. Table 1 shows the setup parameters of the hybrid ESS used in this study. The data in the table is taken from [35]. This paper considers a 20-year operation and analyzes the total cost of the hybrid ESS combining a battery and a supercapacitor. A lithium-ion battery was chosen for the analysis due to its widespread use at the present time.
The data of load demand, PV power and WT power generations over 24 hours on 18 June extracted from Figures 5, 6 and 7 are illustrated in Figure 9. The hybrid ESS is responsible for minimizing the active power mismatch between power generation and load demand. Figure 10 shows an example of the active power reference of the hybrid ESS   One-year active power data of the PV system that was used for verification of the proposed method. The data was provided by Suranaree University of Technology, Thailand.

FIGURE 7.
One-year active power data of the WT system that was used for verification of the proposed method, taken from [34]. supercapacitor, can prolong battery lifetime and minimize total cost of the entire project. Figure 8 shows the convergence characteristics of the WOA-based and PSO-based methods. It is clearly seen  from the convergence characteristic curves that the proposed WOA-based method converges to the optimal value of the total net present value faster than the result obtained by the PSO-based method. The WOA-based method required 15 iterations and 611 seconds to converge to the optimal net present value, whereas the PSO-based method required 21 iterations and 671 seconds. Table 2 shows the obtained results, including cut-off frequency, rated power and energy of the battery and supercapacitor, respectively. Comparing to using only battery in the microgrid system, the capacity of the battery with hybrid ESS was almost the same at 705.22kWh and 705.23kWh for only battery and hybrid ESS respectively. The simulation results showed that a cut-off frequency of 1.1725mHz is the optimal value for the considered microgrid system. The optimal capacities of the battery and the supercapacitor are 705.23kWh and 3.583kWh respectively. Figure 11 shows the active power allocation of the battery with a cut-off frequency of 1.1725mHz over 24 hours on 18 June. The battery operated in charging and discharging modes with a smoothed curve. The supercapacitor was responsible for the high-frequency component of the microgrid's active power. Figure 12 depicts active power allocated   to the supercapacitor over 24 hours on 18 June. It is evident that the supercapacitor is effective in responding to the high-frequency component of the microgrid's active power. Table 3 shows the comparison of parameters and costs for only battery and hybrid ESS. The only battery system has a cycle life of 4.68 years with 4 cycles of battery replacement over the project life, whereas the hybrid ESS has a battery life of 4.74 years with 3 cycles of battery replacement  throughout the project life. Due to the high fluctuation of load demand and PV and WT systems, the only battery case study frequently charged and discharged its active power, leading to high battery replacement costs. Therefore, employing a hybrid ESS can reduce the total cost by 12.01% compared to using only battery in the microgrid system.

VII. CONCLUSION
Employing battery storage systems in standalone DC microgrid systems can be cost-inefficient. This paper focused on the optimal capacity and cost analysis of a hybrid ESS, combining a battery and a supercapacitor, in a standalone DC microgrid. The required hybrid ESS' active power was divided into low-and high-frequency components by a low-pass filter. The low frequency of the active power was supplied by the battery, while the high frequency of active power was provided by the supercapacitor. The Whale optimization algorithm was applied to obtain the optimal cut-off frequency of the low-pass filter. The simulation results showed that the battery life increased when the high-frequency component of the active power was provided by the supercapacitor. This is because the number of frequent high-frequency charge/discharge cycles of the battery was reduced, resulting in a smoothed profile. The hybrid ESS reduced the total cost of the entire project by 12.01% compared to the case of employing only the battery. The microgrid system with only the battery has an NPV total of $6,153,059, whereas the hybrid ESS has an NPV total of $5,413,846. As a result, the total life-cycle cost of the hybrid ESS is lower than the cost of the battery alone. However, the installed capacity of the supercapacitor had to be increased.
Future work will consider deep neural network-based prediction methods to forecast renewable energy generations and load demands instead of using historical data. Also, a large scale power system will be considered.