Optimization of Large-Scale Battery Storage Capacity in Conjunction with Photovoltaic Systems for Maximum Self-Sustainability

: The photovoltaic array has gained popularity in the global electrical market. At the same time, battery storage, which is recently being placed by energy consumers alongside photovoltaics, continues to fall in price. Domestic and community loads may be combined utilizing central battery storage and shared solar power through an integrated grid or microgrid system. One of the main targets is maximum self-sustainability and independence of the microgrid system and implemented solution. This research study looks at the energy ﬂows in a single household system that includes solar arrays and battery storage. The analysed household system is represented by a model which uses real load proﬁles from experimental measurements, local solar distribution, and onsite weather data. The results show that depending on the system conﬁguration, two important parameters, self-consumption and self-sufﬁciency, can vary signiﬁcantly. For a properly designed photovoltaic system, the energy self-consumption can be up to 90.19%, while self-sufﬁciency can be up to 82.55% for analysed cases. As an outcome, a large sample size with a variety of setups is recommended for a thorough examination of self-sustainability. Regional variations can worsen under different weather conditions, different photovoltaic and battery capacities, and different municipal rules.


Introduction
The global energy strategy at present is aimed at increasing the percentages of renewable energy sources in the global energy mix.Accelerating the transition to zero carbon energy is necessary given the current trends in the global energy market and the historic Paris Climate Agreement, which aims to reduce greenhouse gas emissions.The Kyoto Protocol and the Paris Climate Agreement, both of which were enacted twenty years ago, serve as the basic frameworks for accelerating global changes to renewable energy [1].It is worth noting that several countries invest in both short-and long-term renewable energy initiatives.The European Union's Europe 2030 policy aims to guarantee that renewable sources account for at least 32% of total electricity production by 2030 [2].The United States created the Federal Energy Management Program with the goal of reducing CO 2 emissions by 40% (compared with 2008).The Russian Ministry of Energy has developed the Energy Strategy-2035, which plays a significant role in renewable energy development in that region.According to the Russian Ministry of Energy, the contribution of renewable energy sources to the total Russian energy balance is expected to rise to between 3% and 4% within the scope of the Energy Strategy-2035 [3].
Energies 2022, 15 Several research studies have been carried out on the use of battery storage to improve the use of renewable energy systems and their stabilization.Seward et al. [4] calculate the contribution of distributed battery storage to the functioning of a grid power system.The study examines the energy exchange between decentralized battery storage and the national power grid using a bilevel optimization technique.The autonomous operational goals of battery storage systems are expressly addressed by analysing their influence on the functioning of a national electricity system.The results indicate that the centralized optimization technique overestimates the utility of dispersed battery storage in the power system.Furthermore, the results underscore the importance of the retail contract structure in optimizing the value of decentralized battery storage for the national electricity system.Karamov and Suslov [5] show methodological and technological strategies for improving the working environment for storage batteries.Each of these strategies focuses on the issue of equipment optimization in relation to battery storage categorisation.That method has been shown in practice to significantly enhance the lifespan of storage batteries.This paper describes the researchers' findings based on several solar systems, including an examination of the working modes of battery storage and some other technical parameters.

Renewable Systems Analysis under Various Optimisation Criteria
Jindal and Shrimali [6] investigated the deployment of battery management at scale in grid power systems.The study was adopted into three categories.The first was the cost-competitiveness of renewable energy and battery storage in comparison with new coalfired generation.The second, was to ensure that the essential battery storage deployment occurred.Finally, purchasing procedures were used for battery storage in conjunction with renewable energy.The results indicated that renewable energy and battery storage are cost competitive with new coal generation, which should implement battery or other efficient energy storage.Argyrou et al. [7] presented a power management model for a gridconnected building-integrated photovoltaic system with battery-supercapacitor storage to increase the self-sustainability of renewable energy.The presented results demonstrate that the model operates correctly and reacts remarkably quickly during mode transitions, with very rapid DC-bus voltage regulation and tiny ripple voltage.Additionally, both the battery and the supercapacitor stay within their specified operating ranges, which means that an efficient power-sharing mechanism is established between the PV system, the batterysupercapacitor storage system, the building load, and the grid.Chatzisideris et al. [8] studied the economic and environmental evolution of organic photovoltaic (PV)/battery energy storage (BT) for self-consumption in the residential sector.The frame interpolation of organic photovoltaic technologies was modelled from the experimental to industrial scale, and the authors identified probable trends using two different scenarios, for Denmark and for Greece.Economic analysis indicates that adding battery storage is not economically sustainable in Greece or Denmark until battery prices fall by more than 10% or 30%, respectively.Additionally, the authors determine OPV cost thresholds of 0.9 €/Wp in Denmark and 1.6 €/Wp in Greece, below which organic PV/BT systems are more costeffective than organic PV only systems.
Researchers have discovered that battery storage can enhance the environmental and social performance of organic photovoltaic systems using particular criteria such as battery pricing, the capacity of cost-optimal organic photovoltaic systems, and the environmental effects.Furthermore, the configuration of the country's power grid mix was shown to have a significant influence in determining whether organic PV self-consumption was ecologically advantageous.These results could assist energy policymakers in developing both energy policies and organic photovoltaic technology who take a methodical approach and include battery and systems balance in the development stages.Barzegkar-Ntovom et al. [9] evaluated the feasibility of battery energy storage systems in conjunction with photovoltaic systems to improve self-consumption.The authors searched for feasible alternative energy storage to examine the economic feasibility of hybrid photovoltaic energy systems with stor-age at the domestic building level in the framework of potential pure self-consumption that does not compensate for surplus photovoltaic energy injected into the grid.The investigated levelized cost of use (COU) is used to examine the profitability of hybrid PV-and-storage systems in the electricity sector, taking into account various hybrid power system capacities, BT prices, and consumer and enterprise types in six Middle Eastern countries.
1.1.2.Self-Consumption and Self-Sufficiency Analysis Roberts et al. [10] examine the energy and capital flows through five Australian housing units equipped with photovoltaic and BT.The study uses real apartment intervalmetered load profiles and simulated solar generation profiles generated using an opensource tool created for this purpose.The results demonstrated that central batteries with a capacity of between 2 and 3 kWh per apartment could improve energy self-consumption by approximately 19%, building self-sufficiency by approximately 12%, and total building peak demand of 16 kW by approximately 30%.Hassan et al. [11] developed a system with supercapacitors integrated with a photovoltaic array to improve self-consumption and self-sufficiency.The research study determined an average daily power load demand of 0.299 kW, with a daily energy consumption of 7.2 kWh/day at a maximum peak of 5.36 kW and an annual energy demand of 2620 kWh/year.The evaluated results indicated that using the supercapacitor module, fast peaks in electrical demand could be met, considerably increasing energy self-consumption and self-sufficiency.Using only five supercapacitor modules, yearly self-consumption increases from 21.8% to 28.1% and self-sufficiency increases from 28.1% to 40.8%.Jaszczur and Hassan [12] analysed the improvement in self-consumption by optimizing the size of the supercapacitor implemented in photovoltaic systems designed for single-family homes.The study was carried out using experimental load and local weather data.The presented results indicate that by combining small and fast-responding energy storage, self-consumption can be enhanced by approximately 83% on a sunny day and 114% on a cloudy day.The annual average of self-consumption growth for the proposed load exceeds 100% with reference to the system without any local energy storage.Muoz-Rodrguez et al. [13] present a novel method for the analysis of such systems.The study represents the energy used directly by the photovoltaic system and the energy supplied by the battery.This type of system is often analysed using complicated three-dimensional charts.As a result of the analysis, a novel and straightforward two-dimensional contour tool has been introduced called "industry standard self-consumption curves".The proposed technique was tested during three house analyses in Spain.The results indicate that a total self-sufficiency of 51% is possible when the PV array size and rated capacities are less than 3.6 kWp and 1.1 kWh, respectively, and that the direct and battery self-sufficiency indices may approach 41% and 11%, respectively.Bayod-Rujula et al. [14] scaled the parameters of photovoltaic/wind turbine (WT) hybrid energy systems with the battery bank to improve self-consumption in relation to grid interaction.The case study system under consideration delivers energy to a typical house in Spain.Annual hourly measurements of total energy from wind turbines and photovoltaic systems in Aragon, Spain, were used as input parameters to a Matlab-developed model of the real system.On an hourly basis, annual energy balances for hybrid systems with multiple configurations and capacities of photovoltaic and hybrid renewable energy systems, including BT, were simulated.The index results documented that the use of BT could feed to or receive energy from the grid based on whether the energy generated exceeds or falls short of the house demand and its operating limitations are not exceeded.In the context of validating against moderate-and high-voltage distributors in the real world in Jordan using PV/BT for self-consumption improvement, the system presented by Alnaser et al. [15] was investigated.For the net metering case, the analysis indicates that approximately 41% of residential photovoltaic systems expect voltage difficulties.Additionally, it is determined that the use of batteries for customer satisfaction would not improve the outcomes of grid system penetration levels greater than 61%.Additionally, the results underscore the critical role of distribution network operators in managing battery adoption for the mutual benefit of consumers and distribution networks.In exchange for regulating batteries to resolve network faults, network operators can help consumers adopt larger battery storage capacities to achieve the necessary PV self-consumption.This allows 100% PV penetration and increases PV self-consumption to 51%.

Multiscale Simulations of Systems with Battery
Albouys-Perrois et al. [16] presented multiscale simulations to evaluate the impact of BT on large-scale self-consumption.The presented study provides a multiscale model to assess the effects of self-consumption on the domestic sector.It considers human activities to be the primary source of power consumption in houses.The investigation process added a layer to simulate interactions within a home association, as well as communal factors of production and storage, to find a multiscale model of social activities.The selected model was applied in several different investigations.In this model, in the first step, individual and communal storage were simulated to maximise self-consumption.The results demonstrated the influences of individual and community energy storage on energy flows as well as charged and discharged processes in a group of families and within each family.Ultimately, a complex structure was constructed that included energy exchanges among a group of families that comprised self-consumption.The facts clearly demonstrated the effects of energy exchange between neighbourhoods on mean self-consumption.Litjens et al. [17] assessed the economic advantages of increased self-consumption with the frequency recovery resources provided by PV/BT systems.The study evaluated the benefits of PV/BT integration in order to increase self-consumption and resuscitation reserves for residential and commercial buildings.Six battery storage dispatch techniques were created and tested against the technological and financial performance of 48 households and 42 commercial buildings.The systems were modelled with a temporal resolution of 5 min using historical energy consumption measurements and market prices over their economic lifespans.The results obtained showed that resuscitation generates an approximately 0.5% decrease in self-consumption.Annual revenues, on the other hand, have grown considerably.With the assumptions used in this analysis, using battery storage devices for self-consumption is not economical.Based on smart meter measurements, Al Khafaf et al. [18] assessed the influence of battery storage on energy at home.The study provided insight into how domestic battery installation contributes to behaviour change and the way energy is used in the Australian case.Moreover, data-driven suggestions are made toward both the transmission grid and regulators.More than 5000 energy customers with or without distributed generating systems such as photovoltaics and BT were included.The study analysed energy consumption for consumers with and without BT.Furthermore, an economic study of the benefits of implementing battery storage was offered, including payback time and residual income.The result showed that domestic energy storage devices improve the distribution network in a variety of ways.It is recommended that governments continue to encourage the deployment of such systems through subsidies and the implementation of essential policy requirements.
[19] evaluated the impacts of various battery charging procedures on residual power supplies and self-consumption percentages on a regional scale.The study examined the impacts of batteries on residential residual loads on a regional scale using spatial resolution with hourly time increments.A system model, a demand component, and a BT device were used to analyse energy flows.The case study was conducted for southern Bavaria, for 4907 residences with PV systems ranging from 3 to 10 kWp and an average battery storage capacity of approximately 6.2 kWh.Three charging techniques for residential BT are investigated: (1) self-consumption maximization, (2) a fixed feed-in limit of 70% of PV peak power, and (3) a daily dynamic feed-in limit based on optimal predictions.The third method is the best, with an average self-consumption rate of 79.5% and a 21% drop in grid flows by dampening grid excesses.A significant sample size with various configurations is suggested for a comprehensive assessment of battery charging Energies 2022, 15, 3845 5 of 21 procedures.Regional variances are exacerbated by weather factors, varying capacities and specifications of photovoltaic and BT, and municipal demand patterns.

Complex Systems with Fuel Cell or Battery
Hassan [20,21] presented a computational technique for optimizing a photovoltaic with battery storage and a hydrogen fuel cell energy system using experimental data for electrical load and weather data with a 1-min time step.The results clearly show that using an average daily energy of 6.9 kWh, the optimal fuel cell capacity is approx.2.3 kW, ESB 1.7 kW in a 1.9 kW PV power system.Due to the integration of the photovoltaic system with ESB and fuel cells (FCs), the annual renewable energy component increased from 32 percent to 96 percent.Furthermore, the energy supply, which is the most cost-effective part of the optimal system, levelled the power costs by approximately $0.12/kWh.Lokar and Virti [22] investigate the feasibility of using hydrogen for total energy self-sufficiency in residential structures with solar photovoltaic and BT.The research work examines the production of energy in a pilot building in Slovenia, which is a normal residential house with a photovoltaic system and a BT system.Every 15 min, the power system collects data from smart meters.Because solar radiation is substantially lower in winter than in the summer, and snow may cover solar panels and prevent energy generation, solar photovoltaic systems could be supplemented with BT and hydrogen fuel cells to attain total self-sufficiency.The self-sufficiency share of the hybrid PV/BT/FC system would be 63%, which means that the prototype system cannot provide 100% self-sufficiency.However, a more efficient system could be built.A hybrid system that includes a solar system, a battery storage system, and hydrogen fuel cells may provide total self-sufficiency.Fioriti et al. [23] determined the size of battery systems for households using a multiyear dynamic and an innovative rain flow-based storage degradation model.The study proposes a multiyear optimization methodology for domestic applications in which the entire lifetime of battery systems is modelled at a 15-min time step using an improved nonlinear degradation model.In this work, the aging of the PV module is also taken into account.An examination of the economic and commercial sizes suitable for 400 selected load profiles in Italy is provided.According to the conclusions, the break-even price of storage is about 400 €/kWh, which is lower than the estimated commercial price.Household photovoltaic capacity is typically used for utilities but is less so because more batteries are required to reduce the monthly bill.Say et al. [24] studied the effects of residential photovoltaics and BT on energy production.The study used two open-source and two techno-economic models for situations in Western Australia.The study concluded that to avoid overinvestment, power system planners and investors in long-lived utility-scale renewable production and storage assets must carefully examine the expanding usage of prosumage.Li et al. [25] studied the performance of a grid-connected PV/BT household system with the purpose of increasing self-consumption.The study simulated the performance of the techno-economic criteria of a grid-connected residential PV/BT system.The results show that self-consumption ratios vary significantly between months, that they can be increased by subsequently increasing battery capacity, and that their rate of increase varies significantly between months, as well as being highly dependent on characteristics of the customer load and PV energy profiles.Optimal management solutions for domestic storage dispatch have the ability to reduce grid peak demand.Cumulative generation of a residential PV/BT system represents 2.0% of the total grid load.The study shows that the proposed grid-supporting PV/BT systems can contribute to a 1.1% decrease in peak grid demand.In short, a great deal of previous research has investigated how to obtain an optimal BT system that is integrated with parts of renewable energy [26][27][28][29][30].

Motivation
Although energy investments are usually recognized as long term, their viability must be evaluated over a one-year span.As a result, it becomes critical to comprehend and accurately predict the energy produced by the system under examination throughout one year.Given the drive to increase renewable penetration and achieve environmental standards, the development of smart residences is critical, but their optimum capacity has seldom been considered for one year, such as PV array and BT system deterioration modelling.Among these, modelling the battery unit is one of the most difficult.
As a result, it is important to address the optimal 1-year sizing of residential by BT by utilizing experimental load profiles at 1-min resolution based on a detailed model of battery deterioration and realistic data to provide a picture of the state-of-the-art profitability of BT systems.A thorough literature review was conducted to determine the most appropriate models for all components of the system, and a revised version was designed and implemented.

Significant Contributions
Based on the recommended literature study and the authors' knowledge, the following are the major contributions of this work: Development of a technique for selecting the optimal BT capacity from a variety of technical and commercial solutions, including operational impact modelling of battery and photovoltaic deterioration and comprehensive evaluations.
Estimation of home BT demands based on load profiles collected over a one-year period to provide a realistic picture of domestic consumption patterns.

Selected Case Study
In this study, we evaluate the advantages of adding a number of storage batteries to residential grid-connected applications in Baghdad, Iraq (latitude 33.3152 • N, longitude 44.3661 • E), where photovoltaic systems will be installed on their roofs.The design of the system is shown in Figure 1, reflecting the two distinct scenarios explored: 1.
PV array only: This is the simplest scenario, in which each user is equipped with a photovoltaic system shown in Figure 1a.2.
PV array + BT: Each user is equipped with the same PV array as the standard case plus an ESS (shown in Figure 1b), whose size is determined by the technique of maximum self-sustainability (self-consumption and self-sufficiency) using commercially available varieties at the lowest possible cost.
research has investigated how to obtain an optimal BT system that is integrated with parts of renewable energy [26][27][28][29][30].

Motivation
Although energy investments are usually recognized as long term, their viability must be evaluated over a one-year span.As a result, it becomes critical to comprehend and accurately predict the energy produced by the system under examination throughout one year.Given the drive to increase renewable penetration and achieve environmental standards, the development of smart residences is critical, but their optimum capacity has seldom been considered for one year, such as PV array and BT system deterioration modelling.Among these, modelling the battery unit is one of the most difficult.
As a result, it is important to address the optimal 1-year sizing of residential by BT by utilizing experimental load profiles at 1-min resolution based on a detailed model of battery deterioration and realistic data to provide a picture of the state-of-the-art profitability of BT systems.A thorough literature review was conducted to determine the most appropriate models for all components of the system, and a revised version was designed and implemented.

Significant Contributions
Based on the recommended literature study and the authors' knowledge, the following are the major contributions of this work: Development of a technique for selecting the optimal BT capacity from a variety of technical and commercial solutions, including operational impact modelling of battery and photovoltaic deterioration and comprehensive evaluations.
Estimation of home BT demands based on load profiles collected over a one-year period to provide a realistic picture of domestic consumption patterns.

Selected Case Study
In this study, we evaluate the advantages of adding a number of storage batteries to residential grid-connected applications in Baghdad, Iraq (latitude 33.3152° N, longitude 44.3661° E), where photovoltaic systems will be installed on their roofs.The design of the system is shown in Figure 1, reflecting the two distinct scenarios explored: 1. PV array only: This is the simplest scenario, in which each user is equipped with a photovoltaic system shown in Figure 1a.2. PV array + BT: Each user is equipped with the same PV array as the standard case plus an ESS (shown in Figure 1b), whose size is determined by the technique of maximum self-sustainability (self-consumption and self-sufficiency) using commercially available varieties at the lowest possible cost.The detailed specifications for the proposed system components are shown in Table 1.
Table 1.The specifications of the selected system components.The detailed specifications for the proposed system components are shown in Table 1.

Electrical Load Consumption
To present generalized results for the selected residential communities, a comprehensive measurement campaign was carried out in three residences over a one-year period (2021) at a 1-min temporal resolution, resulting in the collection of actual load profiles with 1.29 kWh, 16.1 kw peak, 30.8 kWh/day, and 11,237 kWh/year.Figure 2 shows the daily load profiles for four selected days during the year 2021.

Experimental Weather Data
The solar irradiance and ambient temperature data were measured using a weather station model f0300 located at the same selected site at a 1-min temporal resolution for the year 2021.The average daily ambient temperature was 23.8 °C, and the daily solar irradiance on the horizontal surface was found to be 4.6 kWh/m 2 /d.Figures 3 and 4 show the daily measurements of solar irradiance and ambient temperature, respectively, for

Experimental Weather Data
The solar irradiance and ambient temperature data were measured using a weather station model f0300 located at the same selected site at a 1-min temporal resolution for the year 2021.The average daily ambient temperature was 23.8 • C, and the daily solar irradiance on the horizontal surface was found to be 4.6 kWh/m 2 /d.Figures 3 and 4 show the daily measurements of solar irradiance and ambient temperature, respectively, for four selected seasonal days.Figure 5 shows the monthly and yearly averages for energy consumption, solar irradiance, and ambient temperature.The average monthly energy consumption was 925.47 kWh, which fluctuated from month to month, and the total annual energy consumption for the year 2021 was 11,237 kWh.The daily average solar irradiance was recorded at 4.6 kWh/m 2 /day, the highest in current solar irradiance due to the summer months (May-October) and the lowest during winter months (November-February).Spring and fall seasons have higher solar irradiance than winter.The annual average of the ambient temperature is 23.71 • C, which is high during summer and low during winter.Figure 5 shows the monthly and yearly averages for energy consumption, solar irradiance, and ambient temperature.The average monthly energy consumption was 925.47 kWh, which fluctuated from month to month, and the total annual energy consumption for the year 2021 was 11,237 kWh.The daily average solar irradiance was recorded at 4.6 kWh/m 2 /day, the highest in current solar irradiance due to the summer months (May-October) and the lowest during winter months (November-February).Spring and fall seasons have higher solar irradiance than winter.The annual average of the ambient temperature is 23.71 °C, which is high during summer and low during winter.

System Modelling and Governing Equations
The selected system presented in Figure 1 consists of a PV array and storage batteries connected through the inverter to the grid system and the electrical load.The battery energy storage capacity was increased in each simulation to obtain the capacity that could serve the highest self-sustainability.By default, the storage batteries are designed to charge only from renewable energy (PV array) in case (1), charge from the grid in case (2), and charge from both PV array and the grid in case (3).
The power flow of the proposed systems can be described as follows: For scenario (A) P L,t = P PV,t + P BT,t + P Grid,t And for scenario (B) P L,t = P PV,t + P BT,t + P Grid,t where P L,t is the load power of at time P PV,t is the PV array power, P BT,t is the battery power (kW) and P Grid,t is the power taken from the grid, all in (kW).

System Modelling and Governing Equations
The selected system presented in Figure 1 consists of a PV array and storage batteries connected through the inverter to the grid system and the electrical load.The battery energy storage capacity was increased in each simulation to obtain the capacity that could serve the highest self-sustainability.By default, the storage batteries are designed to charge only from renewable energy (PV array) in case (1), charge from the grid in case (2), and charge from both PV array and the grid in case (3).
The power flow of the proposed systems can be described as follows: for scenario (A) where PL,t is the load power of at time PPV,t is the PV array power, PBT,t is the battery power (kW) and PGrid,t is the power taken from the grid, all in (kW).The power of the PV array in (kW) can be obtained as [34]: where C PV is the PV array capacity, α PV is the PV array capacity derating factor (%), G T,STC is the solar radiation at STC (standard conditions) (kW/m 2 ), G T,t is the incident solar radiation (kW/m 2 ), α P denotes the PV cell temperature coefficient of power (%/ • C) [35,36], T C,t is the PV cell temperature ( • C) and T C,STC is the PV cell temperature ( • C) at STC.The voltage battery model proposed in [29] may indeed be summarized as follows: where V b,t represents the battery voltage (V), V C,t represents the instant charge, R b represents the terminal resistance (ohm), K represents the polarization constant, which is generally 0.1 (ohm), D S,t represents the discharge current (A), and SoC represents the state of charge (%).
The SoC has the greatest influence on battery power, and P b,t is dependent on the level of charge of the battery and could be determined using the following formulae [26]: charging, P b,t = (P n (t) and discharging, where P b (t − 1) is the power at the end of the interval t, P k (t) the load demand at time t, P n (t) is the total energy charged at time t, s d is the self-discharge factor, and η b and η N are the efficiency of the battery charger and the inverter, respectively.Systems based on renewable energy, such as solar and wind energy, are strongly influenced by weather conditions.For this reason, in order to increase system stability as well as to gain energy, self-consumption energy storage devices (battery, supercapacitor, hydrogen tank, water pumping system, flywheel, flow batteries) are used.Without energy storage, further increase of renewable energy systems in national energy mixes will not be possible [37][38][39][40].
The synchronous load-balancing equation, which explains the flow of energy among parts of the system, is as follows.

Energy Metrics
The self-sufficiency metric (self-consumption and self-sufficiency) has been described in [41][42][43][44] as the fraction of the load profiles and generation profiles that intersect, with the values of E SC and E SS in (kWh) given as: The percentages of E SC and E SS are given as: where E G is the energy produced by (PV + BT) and E Load denotes the electrical energy used (kWh), E From grid denotes the energy drawn from the grid (kWh), E Fed to grid is the energy fed to the grid (kWh), and n denotes the number of simulation steps.
To optimize energy self-sufficiency and simplify system construction, it is assumed that the battery cannot be charged from the grid.This has a significant impact on power flows and the final outcome.The energy system simulation flow chart is shown in Figure 6.
where EG is the energy produced by (PV + BT) and ELoad denotes the electrical energy used (kWh), EFrom grid denotes the energy drawn from the grid (kWh), EFed to grid is the energy fed to the grid (kWh), and n denotes the number of simulation steps.
To optimize energy self-sufficiency and simplify system construction, it is assumed that the battery cannot be charged from the grid.This has a significant impact on power flows and the final outcome.The energy system simulation flow chart is shown in Figure 6.

Results and Discussion
The simulations were performed using experimental data pertaining to the desired electrical load, solar irradiance, and ambient temperature.The electrical load and weather data were collected using the same resolution as a 1 min modelling technique.The photovoltaic array consisted of 16 modules (8 kWp) installed on the roof of the selected building.The PV modules were oriented optimally (β = 30 • , γ = 0 • south-facing) to maximize annual solar radiation at the specified locations.The influence of module temperature on the produced energy was considered, with the coefficient of the PV cell temperature of power set to α p = −0.48%/• C and the overall system derating factor set to 95%.The analysis goals were to quantify the effect of storage units on the self-sustainability of energy in the systems under consideration as well as to analyse the energy flows within systems that include renewable energy PV and BT units.

Usage Only PV System
The results presented in Figure 7 show the daily power flows for four seasonal days and indicate the profitability of adding solar PV array systems in real residential applications.The daily power flow is highly dependent on the desired load and the power generated by the photovoltaic array.For the days of January 1 and October 1, the energy generated by the PV array was 10.48 kWh and 36.67 kWh, respectively.These values are strongly influenced by the amounts of incident solar irradiance (see Table 2).Due to the high incidence of solar radiation, the solar energy generated by the PV array on April 1 and July 1 was higher than the previous days, which were recorded at 40.16 kWh and 54.93 kWh, respectively (refer to Table 2).There is less energy taken from the grid when there is more solar energy produced (see Figure 7 and Table 2).There is more energy fed into the grid when there is more solar energy produced.Figure 8 shows the daily energy self-consumption for the selected days using only the PV array: 1 January is 7.27 kWh, 1 April is 17.05 kWh, 1 July is 15.16 kWh, and 1 October is 6.15 kWh.The high energy generated by the photovoltaic array leads to high energy self-consumption considering the electrical load energy.This investigation demonstrates the profitability of combining a battery energy system with a photovoltaic system to increase the self-sustainability by a high percentage.

The Profitability of Battery Usage
Figure 9 shows the profitability of self-sustainability using various battery capacities to further illustrate the influence of changing battery capacities on the objective function (increasing self-sustainability). Self-sustainability varies from one day to another and is highly dependent on the load and amount of renewable energy generated by the designed system (BT-5 means five batteries connected in series according to the specifications presented in Table 1).

The Profitability of Battery Usage
Figure 9 shows the profitability of self-sustainability using various battery capacities to further illustrate the influence of changing battery capacities on the objective function (increasing self-sustainability). Self-sustainability varies from one day to another and is highly dependent on the load and amount of renewable energy generated by the designed system (BT-5 means five batteries connected in series according to the specifications presented in Table 1).Figure 10 shows the energy self-consumption and energy self-sustainability for various battery bank capacities that are combined with a photovoltaic array for four seasonal days.On 1 January 2021, the optimum bank capacity that could match the highest self-consumption at 100% was BT-25, and the observed energy self-consumption was 37.68 kWh.For 1 April 2021, it was determined that the optimal battery bank capacity that could meet the maximum self-consumption at 100% was BT-20, with a self-consumption of 36.49kWh.For 1 July 2021, it was calculated that the optimal battery bank capacity that could meet the maximum self-consumption at 100% was BT-10, with a self-consumption of 22.91 kWh.For 1 October 2021, it was found that the optimal battery bank capacity capable of meeting 100% self-consumption was BT-10, with a self-consumption of 16.03 kWh. Figure 10 shows the energy self-consumption and energy self-sustainability for various battery bank capacities that are combined with a photovoltaic array for four seasonal days.On 1 January 2021, the optimum bank capacity that could match the highest selfconsumption at 100% was BT-25, and the observed energy self-consumption was 37.68 kWh.For 1 April 2021, it was determined that the optimal battery bank capacity that could meet the maximum self-consumption at 100% was BT-20, with a self-consumption of 36.49kWh.For 1 July 2021, it was calculated that the optimal battery bank capacity that could meet the maximum self-consumption at 100% was BT-10, with a self-consumption of 22.91 kWh.For 1 October 2021, it was found that the optimal battery bank capacity capable of meeting 100% self-consumption was BT-10, with a self-consumption of 16.03 kWh.   Figure 11 shows the monthly energy distribution at several battery capacities.Figure 11a presents the monthly energy fed to the grid generated by the photovoltaic array at various battery capacities.It can be inferred from this figure that more energy can be fed to the grid during the summer months than during the winter months.The net energy for each month is shown in Figure 11b.The positive value is the amount of energy that needs to be taken from the grid, while the negative value is the amount of energy fed to the grid, which is the amount of energy that exceeds the amount of energy that is needed to charge the battery and supply the load.Figure 11 shows the monthly energy distribution at several battery capacities.Fig 11a presents the monthly energy fed to the grid generated by the photovoltaic array various battery capacities.It can be inferred from this figure that more energy can be to the grid during the summer months than during the winter months.The net energy each month is shown in Figure 11b.The positive value is the amount of energy that ne to be taken from the grid, while the negative value is the amount of energy fed to the gr which is the amount of energy that exceeds the amount of energy that is needed to cha the battery and supply the load.Determining the battery bank capacity that can provide the optimal s sustainability for daily energy distribution is very difficult; however, this task is essen from a microgrid system point of view.Figure 12 shows the annual self-consumption energy, with the highest energy value reaching 16,117.18Determining the battery bank capacity that can provide the optimal self-sustainability for daily energy distribution is very difficult; however, this task is essential from a microgrid system point of view.Figure 12 shows the annual self-consumption of energy, with the highest energy value reaching 16,117.18kWh at a rate of 90.19% at BT-35. Figure 13 shows that the net energy is negative, which indicates that part of the energy goes back to the grid, ant this is the amount of energy that exceeds the local amount of energy that is required to charge the battery and feed the local load.

Conclusions
Systems based on renewable energy such as solar or wind energy are strongly influenced by weather conditions.A typical grid-on photovoltaic system from a photovoltaic array point of view due to modern inverters and MPPT algorithms can work with relatively high efficiency without any energy storage (battery, supercapacitor, hydrogen tank, water pumping system, flywheel, flow batteries).However, from the grid system point of view, as well as the local energy producer-consumer perspective, high system performance is not the only parameter that should be taken into account.To increase system stability as well as to gain energy self-consumption, energy storage is required.Without energy storage, it will not be possible to further increase the percentages of renewable energy systems in national energy mixes.The battery storage in a PV system acts as a link to the power grid, allowing more sustainable energy consumption.Backstage-dispersed battery storage devices are managed by their individual owners, who may have different interests than the national grid.This paper discusses methodological and technical techniques for enhancing the storage battery Figure 13 shows that the net energy is negative, which indicates that part of the energy goes back to the grid, ant this is the amount of energy that exceeds the local amount of energy that is required to charge the battery and feed the local load.Figure 13 shows that the net energy is negative, which indicates that part of the energy goes back to the grid, ant this is the amount of energy that exceeds the local amount of energy that is required to charge the battery and feed the local load.

Conclusions
Systems based on renewable energy such as solar or wind energy are strongly influenced by weather conditions.A typical grid-on photovoltaic system from a photovoltaic array point of view due to modern inverters and MPPT algorithms can work with relatively high efficiency without any energy storage (battery, supercapacitor, hydrogen tank, water pumping system, flywheel, flow batteries).However, from the grid system point of view, as well as the local energy producer-consumer perspective, high system performance is not the only parameter that should be taken into account.To increase system stability as well as to gain energy self-consumption, energy storage is required.Without energy storage, it will not be possible to further increase the percentages of renewable energy systems in national energy mixes.The battery storage in a PV system acts as a link to the power grid, allowing more sustainable energy consumption.Backstage-dispersed battery storage devices are managed by their individual owners, who may have different interests than the national grid.This paper discusses methodological and technical techniques for enhancing the storage battery

Conclusions
Systems based on renewable energy such as solar or wind energy are strongly influenced by weather conditions.A typical grid-on photovoltaic system from a photovoltaic array point of view due to modern inverters and MPPT algorithms can work with relatively high efficiency without any energy storage (battery, supercapacitor, hydrogen tank, water pumping system, flywheel, flow batteries).However, from the grid system point of view, as well as the local energy producer-consumer perspective, high system performance is not the only parameter that should be taken into account.To increase system stability as well as to gain energy self-consumption, energy storage is required.Without energy storage, it will not be possible to further increase the percentages of renewable energy systems in national energy mixes.The battery storage in a PV system acts as a link to the power grid, allowing more sustainable energy consumption.Backstage-dispersed battery storage devices are managed by their individual owners, who may have different interests than the national grid.This paper discusses methodological and technical techniques for enhancing the storage battery industry working environment.Among these solutions is addressing the issue of equipment optimization with respect to the categorization of storage batteries.
In addition, consider the year-round operation of storage batteries in solar systems.This technology has been shown to use storage batteries more efficiently and much longer, as well as to be more self-sustaining in practice.
The analysed household system is a model that uses real load profiles from experimental measurements, local solar distribution, and onsite weather data.The results of system optimization show that a properly designed photovoltaic system such as that under analysis can have energy self-consumption up to 90.19% and self-sufficiency up to 82.55% in the analysed cases.As an outcome, a large sample size with a variety of setups is recommended for a thorough examination of self-sustainability.The presented technique for sizing battery energy storage systems in conjunction with photovoltaic systems for domestic applications was based on extensive one-year simulations supported by experimental measurements and enhanced self-sustainability; however, a longer period can be analysed including with more advanced ageing components (see [27] for references).The proposed approach is applied to the case of Iraqi houses, and the results offer a full overview of the battery requirements of Iraqi domestic users.Self-sustainability with an 8.0 kWp photovoltaic system and several battery capacities has been extensively investigated.In all cases, increasing self-consumption is positive for customers (less energy has to be purchased from the grid), and what is crucial on the large scale is also positive for the national grid (less energy is sent to the grid in an unpredictable way, avoiding local voltage increases).
The present research study could lay the groundwork for future research on the number of microgrid PV systems that work together locally.It could also give information to producers and regulators about how the demand for home systems changes.

Figure 2 .
Figure 2. The experimental load profiles for four selected days.

Figure 3 .
Figure 3. Daily measurements of solar irradiance for four selected days.Figure 3. Daily measurements of solar irradiance for four selected days.

Figure 3 .
Figure 3. Daily measurements of solar irradiance for four selected days.Figure 3. Daily measurements of solar irradiance for four selected days.

Figure 4 .
Figure 4. Daily measurements of ambient temperature for four selected days.

Figure 4 .
Figure 4. Daily measurements of ambient temperature for four selected days.

Figure 5 .
Figure 5.The monthly and yearly averages of the energy consumption, solar irradiance, and ambient temperature.

Figure 5 .
Figure 5.The monthly and yearly averages of the energy consumption, solar irradiance, and ambient temperature.

Figure 6 .
Figure 6.The flow chart for simulating an energy system.Figure 6.The flow chart for simulating an energy system.

Figure 6 .
Figure 6.The flow chart for simulating an energy system.Figure 6.The flow chart for simulating an energy system.

Figure 7 .
Figure 7.The daily power flows for four seasonal days.Figure 7. The daily power flows for four seasonal days.

Figure 7 .
Figure 7.The daily power flows for four seasonal days.Figure 7. The daily power flows for four seasonal days.

Energies 2022, 15 , 3845 16 of 23 Figure 8 .
Figure 8.The daily self-consumption energy for four seasonal days using only a photovoltaic array.

Figure 8 .
Figure 8.The daily self-consumption energy for four seasonal days using only a photovoltaic array.

Figure 9 .
Figure 9.The ESC for various battery bank capacities for four days.

Figure 9 .
Figure 9.The E SC for various battery bank capacities for four days.

Figure 10 .
Figure 10.The ESC and ESS in kWh and percentage for four different days: (a,b) January 1, (c,d) April 1, (e,f) July 1, (g,h) December 1, at various battery bank capacities.

Figure 10 .
Figure 10.The E SC and E SS in kWh and percentage for four different days: (a,b) January 1, (c,d) April 1, (e,f) July 1, (g,h) December 1, at various battery bank capacities.

Figure 11 .
Figure 11.Monthly energy flows: (a) energy fed to the grid, (b) net energy.

Figure 11 .
Figure 11.Monthly energy flows: (a) energy fed to the grid, (b) net energy.

Figure 12 .
Figure 12.The annual (a) ESC in kWh, (b) ESC and ESS in percentage.

Figure 13 .
Figure 13.The net annual energy for different battery capacities.

Figure 12 .
Figure 12.The annual (a) E SC in kWh, (b) E SC and E SS in percentage.

Figure 13 .
Figure 13.The net annual energy for different battery capacities.

Figure 13 .
Figure 13.The net annual energy for different battery capacities.

Table 1 .
The specifications of the selected system components.
t for P PV,t ≥ P L,t P BT,t for P BT,t ≥ P L,t ; P PV,t = 0 P Grid,t for P PV,t + P BT,t = 0 P Grid,t + P PV,t + P BT,t for P PV,t + P BT,t < P L,t P Grid,t + P PV,t for P BT,t = 0 and P PV,t < P L,t P Grid,t + P BT,t for P PV,t = 0 and P BT,t < P L,t P PV,t + P BT,t for P PV,t + P BT,t ≥ P L,t

Table 2 .
Daily energy flow (kWh) for four seasonal days.
kWh at a rate of 90.19% at B 35.