Optimal Design of Hybrid PV-Battery System in Residential Buildings : End-User Economics , and PV Penetration

This paper proposes an optimal design for hybrid grid-connected Photovoltaic (PV) Battery Energy Storage Systems (BESSs). A smart grid consisting of PV generation units, stationary Energy Storage Systems (ESSs), and domestic loads develops a multi-objective optimization algorithm. The optimization aims at minimizing the Total Cost of Ownership (TCO) and the Voltage Deviation (VD) while considering the direct and indirect costs for the prosumer, and the system stability with regard to intermittent PV generation. The optimal solution for the optimization of the PV-battery system sizing with regard to economic viability and the stability of operation is found while using the Genetic Algorithm (GA) with the Pareto front. In addition, a fuzzy logic-based controller is developed to schedule the charging and discharging of batteries while considering the technical and economic aspects, such as battery State of Charge (SoC), voltage profile, and on/off-peak times to shave the consumption peaks. Thus, a hybrid approach that combines a Fuzzy Logic Controller (FLC) and the GA is developed for the optimal sizing of the combined Renewable Energy Sources (RESs) and ESSs, resulting in reductions of approximately 4% and 17% for the TCO and the VD, respectively. Furthermore, a sensitivity cost-effectiveness analysis of the complete system is conducted to highlight and assess the profitability and the high dependency of the optimal system configuration on battery prices.


Introduction
Recent studies indicate that the world energy consumption will increase from 575 quadrillion British thermal units (Btu) in 2015, to 663 quadrillion Btu by 2030, and then to 736 quadrillion Btu by 2040 [1].Moreover, carbon dioxide annual emissions are expected to reach 45.5 billion metric tons in 2040 [1].In the meanwhile, it not only leads to significant ecological degradation, but also security crises and it engenders economic growth limitations [2].In that regard, the European Commission (EC) has set a target to reduce greenhouse gas (GHG) emissions to at least 40% below the 1990 level by 2030 [3].Moreover, in December 2015, the 21st session of the Conference of the Parties (COP 21) to the United Nations Framework Convention on Climate Change (UNFCCC) in Paris, France ended with the landmark agreement to reduce GHG emissions by 80% by year 2050, and enhance the use of Renewable Energy Sources (RESs) to shift to a future with decarbonized energy supply and improving energy efficiency [4].Thus, the electric power generation is undergoing a new evolution phase, which is highly characterized by a transition from hydrocarbon based energy to the post-petroleum-based sources [5].Regarding the economic aspects, the RESs provide affordable electricity and can help in stabilizing energy prices in the future.In particular, the recent decrease in the cost of Photovoltaic (PV) makes it an economically and environmentally beneficial solution at the residential level [6].This situation prompts scientists and researchers around the world to work on the integration of RESs into the grid [7].
Nevertheless, the inherent dependency of RESs on climatic and weather conditions makes it an intermittent and stochastic energy source, which threatens the balance between generation and demand, and thus it potentially leads to instabilities on the grid.Moreover, the high penetration of grid-connected residential PV units poses tremendous technical challenges to the distribution grid, which has not been sized accordingly.Indeed, the excess of PV generation induces voltage rise and imbalance [8].These challenges could be tackled by the use of Energy Storage Systems (ESSs) that facilitate the management of the power system with high RES penetration by providing extra flexibility [9,10].In that regard, the ESSs are key elements in the renewable energy-driven systems and they could be used to store excess energy from generation sources and improve the balance between generation and demand with a local consumption of electricity [9].Among the various ESS technologies, Battery Energy Storage Systems (BESSs) have drawn considerable attention through their massive advantages, such as fast response, controllability, and geographical independence [10].Furthermore, the integration of RESs and BESSs in power systems is an effective method to perform peak shaving, load leveling, Demand Response (DR), voltage regulation, frequency regulation, and other ancillary services [8,11,12].In addition, the transition from traditional power systems to the Smart Grid (SG) solution requires considerable scientific effort.
However, one of the main drawbacks of the PV-battery systems is their relatively high capital cost as compared to conventional energy sources [8].Therefore, the sizing of PV units and the battery of the ESS to meet a given demand is crucial in the system design phase.In this regard, Tervo et al. [13] investigated, in detail, how the PV unit size and battery capacity affect the performance of the system and the cost metrics; in particular, they demonstrated that, with appropriate sizing, the PV-battery systems can be more affordable than PV systems alone.Similarly, Segundo et.al. [11] highlighted that the combination of solar energy and storage units could be a good opportunity to increase the value of renewable power generation, secure grid stability, improve asset utilization, potentially reduce emissions, provide demand load-shifting and ancillary services, and increase both the levelized value and the levelized cost of PV generation units.Magnor et al. [12] performed an optimal sizing of a PV-battery system, minimizing the Levelized Cost Of Electricity (LCOE), which refers to the average cost per kWh that is supplied to the load.In addition, the technical challenges, such as voltage stability, have been considered as well for optimizing the system operation.Furukakoi et al. [14] investigated the minimization of the operational cost and maximization of voltage stability of a grid-connected PV-battery by employing a multi-objective optimization algorithm.Aryanezhad et al. [15] applied the Genetic Algorithm (GA) to preserve the system voltage profile by minimizing Voltage Deviations (VDs).The authors reported that VD could be substantially lowered by 71% when the ESS smooths the fluctuating output of PV generation.Besides that, Jiaming [8] presented the optimal sizing algorithms of grid-connected PV-battery systems for the residential houses to minimize their total annual cost of electricity, including a centralized battery system.In this regard, the coordination of PV units and ESSs needs to be analyzed to determine their optimal sizes, gather their potential economic benefits, and guarantee an efficient transition to SG systems.Therefore, an economic problem that considers the Total Cost of Ownership (TCO), which aims at minimizing all the direct and indirect costs that are associated with their lifetime, should be solved [16].Nevertheless, technical aspects, such as voltage stability, should also be considered, as they play a prominent role in power quality [17].Moreover, the successful coordination between PV, batteries, and smart grid is unlikely without an integration of proper controllers enabling efficient Battery-to-grid (B2G) and Grid-to-Battery (G2B) operations in the smart grid.Therefore, the goal of the present study is to address the technical and economic challenges that are related to PV-battery integration into the power system.
Besides that, batteries can help with the demand-generation balance, and thus need a proper controller to enable B2G and G2B services [18].Furthermore, controlling the charging and discharging of batteries is required to maintain the voltage level and stability of the power system.In this regard, Bandpey et al. [19] used a Fuzzy Logic Controller (FLC) to smooth the load profile and obtain an optimum charging strategy when considering the State of Charge (SoC) and the Urgency Level (UL) as inputs, which refers to battery charging urgency, and as output the Preference Factor (PF), which indicates the batteries charging/discharging priority.Moreover, Suresh et al. [20] developed a battery capacity fade minimization model by introducing the model predictive control (MPC) framework, which has also been developed in [21], for the identification and realization of optimal charge-discharge cycles for Lithium-ion batteries.The proposed approach can be used to improve the battery life and charge carrying capacity of Li-ion batteries.Suresh et al. [21] used an MPC to develop efficient charging protocol for optimal battery charging and to identify an optimal trade-off between the charging time and battery life using information regarding the battery State of Health (SoH) and three performance metrics, namely charging time, capacity losses, and energy losses.Ref. [22] also proposed an optimized fuzzy controller to control the charging and/or discharging power of each Electric Vehicle (EV) battery based on two variables and inputs to the fuzzy controller: battery SoC and grid frequency deviation, while considering the 35-bus system.Additionally, Jiang et al. [23] proposed a decentralized smart controller that is intended for a single EV charger, which determines the optimal charging current based on three signals to the fuzzy logic controller: battery SoH, user defined charging current and grid node voltage.However, these studies used smart control techniques to analyze charging/discharging of BESSs in interaction with the grid, but they have not considered both the technical and economic aspects to control the charging/discharging rates of batteries while considering the operation constraint of energy storage units.The on/off-peak electricity prices and the voltage profile are required in order to assess the economic, sustainable, and effective operation of SG systems.Therefore, a proper controller in the function of variable electricity prices, PV generation, energy consumption, on-and off-peak hours, and state of the battery (including SoC) is needed to control the charging/discharging rates of the batteries.
Consequently, this work aims at developing a fuzzy-based control strategy for reaching an optimum grid-connected renewable-powered BESS that enhances power quality and system stability by minimizing the VD and decreasing the TCO while considering the purchased and sold energy prices, operation and maintenance costs, charges, and taxes.To do so, a multi-objective optimization has been developed using the GA for the optimal sizing of the system, coupled with an FLC based controller for energy management.In particular, the proposed FLC controller is implemented to schedule the charging and discharging for a centralized battery, while also considering the technical and economic aspects (SoC, voltage characteristics, and on/off-peak prices of electricity).Indeed, this article proposes a FL-based control strategy which controls the charging and discharging C-rate (current) of a stationary energy storage system whose size and PV size will be defined by the GA, according to the environment response, such as voltage, on/off peak, and SoC to find the minimum TCO and VD.For clarification, the FL-based control strategy is designed and then implemented in the Simulink framework to find the best PV-battery combination to minimize the above targets.In this regard, an accurate estimation of the SoC is needed to settle the energy content of the battery and to prevent it from excessive discharge.Moreover, precise information regarding load and power generation are required for the optimal B2G and G2B services.In this research, the SoC, which indicates the percentage of the remaining energy of the battery, is introduced as a direct signal for the battery energy storage system, to avert detriment due to the excessive depth of discharge.Besides that, as the high purchase price of the storage could reduce the financial gain of the PV system [24], a sensitivity cost-effectiveness analysis has been conducted while varying the battery cost.
The remainder of this paper is organized, as follows.In Section 2, the proposed grid structure is provided.Section 3 presents the optimal sizing of the PV-battery system to deal with the cost and voltage minimization.Section 4 proposes the formulations of the FL-based controller to enable B2G and G2B services and control the charging/discharging rates of the BESS, by observing the SoC, the voltage fluctuation, and the on/off-peak times.Section 5 presents the simulation results augmented with the cost-effectiveness analysis that is associated with the payback time and expectation of future economic profitability of the studied system based on saving and on-peak, off-peak prices of electricity.Finally, Section 6 concludes this paper.

Grid Structure
The grid structure, as illustrated in Figure 1, is designed using Matlab Simulink simulation platform and considers the Belgian electric network with a frequency of 50 Hz.The Flemish, Walloon, and Brussels-Capital Regions are responsible for distributing electricity with a nominal voltage of 70 kV or less [25].In the present study, 25 kV is used for the upper grid, which is transformed to 11 kV.In addition, a second transformer is used to set the voltage for the distribution network to 400 V.
voltage fluctuation, and the on/off-peak times.Section 5 presents the simulation results augmented with the cost-effectiveness analysis that is associated with the payback time and expectation of future economic profitability of the studied system based on saving and on-peak, off-peak prices of electricity.Finally, Section 6 concludes this paper.

Grid Structure
The grid structure, as illustrated in Figure 1, is designed using Matlab Simulink simulation platform and considers the Belgian electric network with a frequency of 50 Hz.The Flemish, Walloon, and Brussels-Capital Regions are responsible for distributing electricity with a nominal voltage of 70 kV or less [25].In the present study, 25 kV is used for the upper grid, which is transformed to 11 kV.In addition, a second transformer is used to set the voltage for the distribution network to 400 V.The three-phase grid structure is composed of a low voltage loop, which is 400 V, a centralized PV farm, a centralized stationary ESS, and augmented with domestic loads that encompass 692 houses.The ESS is equipped with an FLC to control the charging and discharging rates and enable B2G and G2B functionalities.

Optimal Sizing of Distributed Generators (DGs): Formulation, Constraints and Algorithm
As discussed earlier, the present research aims to find the optimal sizing of a DG system by adapting to a multi-objective optimization problem.In this regard, different aspects are considered in the optimization process, including the TCO, which refers to the total cost of the DG unit based on capital cost, annual Operation and Maintenance (O&M) costs, replacement cost, and the cost of consumed and produced energy.The first and second terms of the optimization objectives are to minimize the TCO and VD.Furthermore, the designed controller is implemented for the BESS to maintain system stability by controlling its charging and discharging rates.The proposed approach The three-phase grid structure is composed of a low voltage loop, which is 400 V, a centralized PV farm, a centralized stationary ESS, and augmented with domestic loads that encompass 692 houses.The ESS is equipped with an FLC to control the charging and discharging rates and enable B2G and G2B functionalities.

Optimal Sizing of Distributed Generators (DGs): Formulation, Constraints and Algorithm
As discussed earlier, the present research aims to find the optimal sizing of a DG system by adapting to a multi-objective optimization problem.In this regard, different aspects are considered in the optimization process, including the TCO, which refers to the total cost of the DG unit based on capital cost, annual Operation and Maintenance (O&M) costs, replacement cost, and the cost of consumed and produced energy.The first and second terms of the optimization objectives are to minimize the TCO and VD.Furthermore, the designed controller is implemented for the BESS to maintain system stability by controlling its charging and discharging rates.The proposed approach involves different criteria that are based on system design, load behavior, output power of PV, BESS capacity, DG power utilities, and owners.

Time Sequence Characteristic of Load and DG
To consider a realistic case, the time-dependent load curve on an hourly basis for Belgium, Brussels, is considered (see Figure 2) in the present study [26].
capacity, DG power utilities, and owners.

Time Sequence Characteristic of Load and DG
To consider a realistic case, the time-dependent load curve on an hourly basis for Belgium, Brussels, is considered (see Figure 2) in the present study [26].
Knowing that the output of PV electric generators is significantly affected by the geographical location and weather conditions, the assumption of constant PV outputs in all seasons is far from reality.Hence, the measured solar irradiance for one year is utilized.Figure 3 presents the solar irradiance dataset for Brussels, Belgium, being plotted in 24 h throughout the year.These data are utilized for the purpose of the present study [27].Knowing that the output of PV electric generators is significantly affected by the geographical location and weather conditions, the assumption of constant PV outputs in all seasons is far from reality.Hence, the measured solar irradiance for one year is utilized.Figure 3 presents the solar irradiance dataset for Brussels, Belgium, being plotted in 24 h throughout the year.These data are utilized for the purpose of the present study [27].
involves different criteria that are based on system design, load behavior, output power of PV, BESS capacity, DG power utilities, and owners.

Time Sequence Characteristic of Load and DG
To consider a realistic case, the time-dependent load curve on an hourly basis for Belgium, Brussels, is considered (see Figure 2) in the present study [26].
Knowing that the output of PV electric generators is significantly affected by the geographical location and weather conditions, the assumption of constant PV outputs in all seasons is far from reality.Hence, the measured solar irradiance for one year is utilized.Figure 3 presents the solar irradiance dataset for Brussels, Belgium, being plotted in 24 h throughout the year.These data are utilized for the purpose of the present study [27].

TCO Minimization
The minimization of the TCO is the first objective function of the optimum design problem.It is calculated based on the initial investment cost C inv , the O&M cost C O&M , and the replacement cost C Rep of the DG.In addition, as generated electricity can be used locally, sold to the grid, or stored in the battery, the TCO considers the cost of energy purchasing C P-on-P and selling C S-on-P at peak time, and the cost of energy purchasing C P-off-P and selling C S-off-P at off-peak time.Assuming that the DG power output in each time segment remains constant, the first cost function can be determined, as follows: The initial investment cost of PV C inv PV is defined in this study as 1200 €/kWp.Moreover, C O&M PV and C Rep PV are the O&M cost and the replacement cost of PV, respectively, being considered both at 47.44 €/kWp/year.C Inv ESS , C O&M ESS , and C Rep ESS are the investment cost, the O&M cost, and the replacement cost of the BESS, respectively; their sum is taken to 350 €/kWh in this study.Furthermore, the lifetime of PV and battery systems is defined as 20 years and 10 years, respectively [28].Thus, the first objective function can be determined, as follows: where A, N Houses , and B Cap are the PV installed capacity (kWp), the number of houses, and the battery installed capacity (kWh), respectively.Note that 692 houses are considered in this study.

VD Minimization
The second objective is to minimize the VD, which determines the difference between the nodal voltage and the specified nominal voltage.The nodal voltage is considered to be one of the most important security and power quality indexes.Equation ( 3) calculates the VD, as follows: where N, V i , and V spec i are the number of buses, the voltage magnitude at the ith bus, and the specified nominal voltage at the ith bus, respectively.The nominal voltage is set to 400 V.When considering the power system's perspective, the per-unit quantity is used, i.e., V spec i = 1.Thus, the VD is determined, as follows [29]:

Constraints
In the optimization model, two constraints are considered: the PV and battery installed capacities.
The PV is constrained, as follows: The following battery capacity limits apply: In the above two inequality constraints, A min , A max , B Cap min , and B Cap max denote the minimum, the maximum size for PV, and battery capacity, respectively.The minimum and maximum of PV and Battery are set to 0 to 5 kWp and 0 to 3 kWh for each home, respectively.Indeed, the search space for total size of PV and the battery capacity is 0 to 3.5 MWp and 0 to 2 MWh, respectively.

Overview of Optimal Sizing Problem Formulation
The present model is designed while considering the minimal cost of ownership and the minimal VD under boundary conditions.Integrating the objectives and constraints, the problem can be formulated, as follows: Subject to : g i (x, u) ≤ 0, i = 1, . . ., n ineq (8) where n ineq denotes the number of inequality constraints, x is the vector which refers to the control variables, and u is the vector of the state variables.When considering the PV installed capacity A for each house and the unit capacity of battery B Cap , the total solar power is A * N Houses and the total battery capacity is B Cap * N Houses , representing the control variables of the optimization.

Genetic Algorithm
The GA, which is an artificial intelligence-based optimization technique, is one of the first evolutionary algorithms that was developed on the basis of Darwin's theory of evolution [30], and it is used for the optimal sizing of DGs in the present study.GA is considered as one of the promising algorithms for solving micro-grid problems and it has proven its suitability for application in energy contexts [31].Moreover, the GA can be used to solve a broad range of problems, such as smart grid applications [32], sizing of a multi-source PV/Wind with Hybrid Energy Storage System (HESS) [33], energy management [34], and operating costs of electricity [35].The algorithm is widely accepted in energy systems optimization and more specifically in multi-objective methods, where a set of optimal solutions, called Pareto front is obtained [36].The solution to a multi-objective optimization problem with multiple objective functions consists of sets of compromised objectives, and the set of optimal solutions is referred to the Pareto-optimal set, whose members are referred to as the Pareto-optimal solutions [37].In this way, a Pareto-optimal front is created by connecting the Pareto-optimal solutions.In the first step of GA optimization, an initial population is randomly initiated; then the fitness of each individual solution (chromosome) is evaluated and a new population is generated through a combination of genetic operators: crossover and mutation.During each successive generation, the GA conducts a process of fitness-based selection and a portion of the existing population is selected to engender a new generation.Finally, the process ends up with the optimal solution.To clarify the GA process, the flow chart of Figure 4 illustrates the entire method.

FL-Based Controller: Formulation, Constraints and Algorithm
The integration of ESSs and RESs into the power system requires a proper control to have better performance on the grid scale, and better energy management in a SG context.Conventional controllers, such as Proportional Integral Derivative (PID) or Proportional Integral (PI), are not able to provide control under a wide range of operations and parameters.In this regard, an adaptive charging and discharging FLC (charging and discharging rates are adapted based on the environment) is designed and described in this section, along with its formulation, constraints, and configuration.The controller is applied to the ESS in order to schedule the charging and discharging of batteries while also considering the technical and economic aspects.

Fuzzy Logical Controller
The FLC, which was developed by Lofti Zadeh [38], originates from the Fuzzy set theory that

FL-Based Controller: Formulation, Constraints and Algorithm
The integration of ESSs and RESs into the power system requires a proper control to have better performance on the grid scale, and better energy management in a SG context.Conventional controllers, such as Proportional Integral Derivative (PID) or Proportional Integral (PI), are not able to provide control under a wide range of operations and parameters.In this regard, an adaptive charging and discharging FLC (charging and discharging rates are adapted based on the environment) is designed and described in this section, along with its formulation, constraints, and configuration.The controller is applied to the ESS in order to schedule the charging and discharging of batteries while also considering the technical and economic aspects.

Fuzzy Logical Controller
The FLC, which was developed by Lofti Zadeh [38], originates from the Fuzzy set theory that is based on Knowledge Base (KB) and human expertise rather than mathematical models, which are difficult to model due to the complexity, nonlinearity, and time varying characteristics of the practical systems [39].An FLC is composed of four principal components: a fuzzification interface, a rule base, an inference logic, and a defuzzification interface [40].The real valued inputs are first fuzzified with statically defined membership functions.Subsequently, the IF-THEN rules are created based on input and output sets.The human expertise represents the "IF-THEN" rules [41].Therefore, using an FLC could provide controlled information for the energy management of the power system.

Constraints and Formulation of Charging and Discharging Control
A proper energy management in SGs is necessary to maintain the supply-demand power balance.In this regard, the FLC has been implemented to the hybrid PV-battery system and is connected to the GA (see previous section), as shown in Figure 5.Briefly, the initial population (size of battery capacity and PV) is generated by the GA and then the generated population is forwarded to the model to calculate VD and TCO for one year.Note that the battery tries to reduce the VD and shift demand based on on/off peaks according to its size, while the TCO should be reduced according to the investment costs, purchased, sold electricity from/to the grid, and so forth.
to the model to calculate VD and TCO for one year.Note that the battery tries to reduce the VD and shift demand based on on/off peaks according to its size, while the TCO should be reduced according to the investment costs, purchased, sold electricity from/to the grid, and so forth.Moreover, the FLC defines four membership functions.Briefly, both the charging and discharging power rates are controlled and adapted by the FL-based controller, according to the state of voltage, battery SoC, and on/off peak demand.It means that the battery acts as a regulator to stabilize the voltage and decrease the TCO through peak shaving to reach the optimal size that is based on the boundaries and defined and detailed in the following subsections.

SoC membership function
In order to consider the energy requirements that should be met by battery owners and that can be applied in different ways, it is important to limit the energy that is allowed for use in B2G and G2B operation, ensuring that the battery will not be completely depleted or overcharged.Thus, the SoC must be limited by two different thresholds to insure safety, longevity, and performance [42].In the present study, the battery cannot discharge to less than 20% or charge to more than 100% of its capacity.Moreover, the input SoC is fuzzified into four ranges, as illustrated in Figure 6; 'Very low SoC' (VLSoC), referring to SoC between 20% and 35%, 'Low SoC' (LSoC), referring to SoC between 36% and 60%, 'Medium SoC' (MSoC) for SoC between 61% and 80%, and 'High SoC' (HSoC) for SoC between 81% and 100%.Moreover, the FLC defines four membership functions.Briefly, both the charging and discharging power rates are controlled and adapted by the FL-based controller, according to the state of voltage, battery SoC, and on/off peak demand.It means that the battery acts as a regulator to stabilize the voltage and decrease the TCO through peak shaving to reach the optimal size that is based on the boundaries and defined and detailed in the following subsections.

SoC Membership Function
In order to consider the energy requirements that should be met by battery owners and that can be applied in different ways, it is important to limit the energy that is allowed for use in B2G and G2B operation, ensuring that the battery will not be completely depleted or overcharged.Thus, the SoC must be limited by two different thresholds to insure safety, longevity, and performance [42].In the present study, the battery cannot discharge to less than 20% or charge to more than 100% of its capacity.Moreover, the input SoC is fuzzified into four ranges, as illustrated in Figure 6; 'Very low SoC' (VLSoC), referring to SoC between 20% and 35%, 'Low SoC' (LSoC), referring to SoC between 36% and 60%, 'Medium SoC' (MSoC) for SoC between 61% and 80%, and 'High SoC' (HSoC) for SoC between 81% and 100%.

Voltage Membership Function
The controller should maintain the adequate charging and discharging voltage.For instance, as the voltage may rise due to the high penetration of PV, the controller is required to regulate the voltage and prevent the battery from any over-discharging and over-charging.Indeed, the power system may experience voltage drops due to high power demand that is related to on-peak hours.Thus, a proper controller should take into account the voltage variations and avert any damage due to excessive depth of battery discharge.In that regard, the input membership voltage is fuzzified into the corresponding fuzzy voltage signals with seven linguistic variables, as shown in Figure 7; Very High Negative (VHN), High Negative (HN), Low Negative (LN), Normal (NO), Low Positive (LP), Medium Positive (VH), and Very High Positive (VHP).

On/Off Peak Hours Membership Function
Integrating ESSs into the grid is considered to be the best strategy for peak shaving, which consists in providing or absorbing the power surplus, thereby shaving the total exchanged power [43].In this way, the coordination of charging and discharging of batteries offers the opportunity to

Voltage Membership Function
The controller should maintain the adequate charging and discharging voltage.For instance, as the voltage may rise due to the high penetration of PV, the controller is required to regulate the voltage and prevent the battery from any over-discharging and over-charging.Indeed, the power system may experience voltage drops due to high power demand that is related to on-peak hours.Thus, a proper controller should take into account the voltage variations and avert any damage due to excessive depth of battery discharge.In that regard, the input membership voltage is fuzzified into the corresponding fuzzy voltage signals with seven linguistic variables, as shown in Figure 7; Very High Negative (VHN), High Negative (HN), Low Negative (LN), Normal (NO), Low Positive (LP), Medium Positive (VH), and Very High Positive (VHP).

Voltage Membership Function
The controller should maintain the adequate charging and discharging voltage.For instance, as the voltage may rise due to the high penetration of PV, the controller is required to regulate the voltage and prevent the battery from any over-discharging and over-charging.Indeed, the power system may experience voltage drops due to high power demand that is related to on-peak hours.Thus, a proper controller should take into account the voltage variations and avert any damage due to excessive depth of battery discharge.In that regard, the input membership voltage is fuzzified into the corresponding fuzzy voltage signals with seven linguistic variables, as shown in Figure 7; Very High Negative (VHN), High Negative (HN), Low Negative (LN), Normal (NO), Low Positive (LP), Medium Positive (VH), and Very High Positive (VHP).

On/Off Peak Hours Membership Function
Integrating ESSs into the grid is considered to be the best strategy for peak shaving, which consists in providing or absorbing the power surplus, thereby shaving the total exchanged power [43].In this way, the coordination of charging and discharging of batteries offers the opportunity to

On/Off Peak Hours Membership Function
Integrating ESSs into the grid is considered to be the best strategy for peak shaving, which consists in providing or absorbing the power surplus, thereby shaving the total exchanged power [43].In this way, the coordination of charging and discharging of batteries offers the opportunity to participate in Demand Side Management (DSM) to reduce the peak load demand in the grid and avoid the surplus of PV generation injection into the grid [44].Thus, the on/off-peak hours and electricity prices should be considered and varied with the load demand to allow for the scheduled operation of the battery and reduce the gap between the power generation and the load demand.For these reasons, the implemented controller considers the on-peak and off-peak times and it considers an input membership 'On/Off peak hours', which is fuzzified into on-peak hours: from 7 a.m. to 10 a.m. and from 5 p.m. to 9 p.m., off-peak hours: from 10:01 a.m. to 4:59 p.m., and from 9:01p.m. to 6:59 a.m., as illustrated in Figure 8.
participate in Demand Side Management (DSM) to reduce the peak load demand in the grid and avoid the surplus of PV generation injection into the grid [44].Thus, the on/off-peak hours and electricity prices should be considered and varied with the load demand to allow for the scheduled operation of the battery and reduce the gap between the power generation and the load demand.For these reasons, the implemented controller considers the on-peak and off-peak times and it considers an input membership 'On/Off peak hours', which is fuzzified into on-peak hours: from 7 a.m. to 10 a.m. and from 5 p.m. to 9 p.m., off-peak hours: from 10:01 a.m. to 4:59 p.m., and from 9:01p.m. to 6:59 a.m., as illustrated in Figure 8.

Char/Dischar Rate Membership Function
In order to gather the charging and discharging power rates of the BESS, an output membership function, 'Char/Dischar rate', is considered for the output of the fuzzy controller with seven ranges, as shown in Figure 9; very high discharge (VHD), high discharge (HD), medium discharge (MD), zero charge/discharge rate (ZR), medium charge (MC), high charge (HC), and very high charge (VHC).

Char/Dischar Rate Membership Function
In order to gather the charging and discharging power rates of the BESS, an output membership function, 'Char/Dischar rate', is considered for the output of the fuzzy controller with seven ranges, as shown in Figure 9; very high discharge (VHD), high discharge (HD), medium discharge (MD), zero charge/discharge rate (ZR), medium charge (MC), high charge (HC), and very high charge (VHC).
The input/output functioning memberships, as shown in Figure 10, result in 140 rules (see Appendix A, Table A1), ensuring all operating conditioning of the controller and the electric grid.For instance, if the battery has VLSoC and the voltage is VHP and the time is in the range of 0 a.m. to 7 a.m.(Foff), which corresponds to off-peak time, then the output membership function 'Char/Dischar rate' is VHC, and the battery charges with a very high rate.Another example of the implemented rules is when the battery has HSoC and the voltage is HN and the time is in the range of 7 a.m. to 10 a.m.(Fon), which corresponds to on-peak time, in this case, the output membership function 'Char/Dischar rate' is VHDICR and the battery discharges with a very high rate.In addition, Figure 11 shows the surface of implemented rules when considering SoC, voltage, and charging and discharging rates.
In order to gather the charging and discharging power rates of the BESS, an output membership function, 'Char/Dischar rate', is considered for the output of the fuzzy controller with seven ranges, as shown in Figure 9; very high discharge (VHD), high discharge (HD), medium discharge (MD), zero charge/discharge rate (ZR), medium charge (MC), high charge (HC), and very high charge (VHC).The input/output functioning memberships, as shown in Figure 10, result in 140 rules (see Appendix A, Table A1), ensuring all operating conditioning of the controller and the electric grid.For instance, if the battery has VLSoC and the voltage is VHP and the time is in the range of 0 a.m. to 7 a.m.(Foff), which corresponds to off-peak time, then the output membership function 'Char/Dischar rate' is VHC, and the battery charges with a very high rate.Another example of the implemented rules is when the battery has HSoC and the voltage is HN and the time is in the range of 7 a.m. to 10 a.m.(Fon), which corresponds to on-peak time, in this case, the output membership function 'Char/Dischar rate' is VHDICR and the battery discharges with a very high rate.In addition, Figure 11 shows the surface of implemented rules when considering SoC, voltage, and charging and discharging rates.The input/output functioning memberships, as shown in Figure 10, result in 140 rules (see Appendix A, Table A1), ensuring all operating conditioning of the controller and the electric grid.For instance, if the battery has VLSoC and the voltage is VHP and the time is in the range of 0 a.m. to 7 a.m.(Foff), which corresponds to off-peak time, then the output membership function 'Char/Dischar rate' is VHC, and the battery charges with a very high rate.Another example of the implemented rules is when the battery has HSoC and the voltage is HN and the time is in the range of 7 a.m. to 10 a.m.(Fon), which corresponds to on-peak time, in this case, the output membership function 'Char/Dischar rate' is VHDICR and the battery discharges with a very high rate.In addition, Figure 11 shows the surface of implemented rules when considering SoC, voltage, and charging and discharging rates.

Results and Discussion
In this section, the results of the optimal sizing of PV-battery systems are presented.Additionally, the TCO, VD, and energy management technique that are used to enable B2G and G2B services during the optimization process are discussed.Moreover, the payback time and profitability of the proposed system are presented and discussed.Subsequently, a sensitivity analysis for different ESS costs is conducted to assess the effect on the profitability, since there is no direct subsidy for BESSs in Europe.The model has been run on a core i-7 computer with 12G DRR4 RAM and CPU 2.70 GHz in MATLAB ® (academic license).The time of simulation from the start to end was 111 seconds for one day with fixed step time of one second.Table 1 provides the details of the economical parameters that have been used in the PV-battery system optimization.In Belgium, there are several national taxes and levies, such as the electricity excise tax, also called contribution on electricity, and the VAT rate on electricity, which is fixed at 21% since August 2015.Moreover, federal levies are imposed to finance the federal regulator, nuclear decommissioning, social tariffs, RESs, and Combined Heat and Power High Performance (CHP) support [50].In addition, the regional levies and their rates for renewable energy are set by the respective regional governments in Flanders, Wallonia, and Brussels to fund various components, including compensation for municipalities, support for energy efficiency, and the regional budget for actions in the energy field [50].In this study, the purchase and sell prices per kWh are based on Luminus [48], which is a producer and supplier of energy (electricity and natural gas) in Belgium.These prices include levies surcharge with a VAT rate of 21% and they consider the day and night prices for on-peak and off-peak times.Moreover, the annual inflation rate of electricity is assumed to be 2% over a year [51].Besides that, Belgium has a sensitive array of incentives, with the main two being a Feed-In Tariff (FIT) and some regions have adopted a Green Certificate (GC) Scheme.In this regard, the FIT is widely used as a policy mechanism in the world that is designed to accelerate investment in renewable energy technologies, which accounts for a greater share of RE development than either tax incentives or renewable portfolio standard (RPS) policies [52].In the meanwhile, Belgium opted for investment grants, VAT reductions, and beneficial credit terms.In this study, the sell and purchase prices per kWh are considered as same prices, being based on the Brussels energy market [49,53].
The voltage stability analysis is critical in the operation of electric power systems.In this regard, Furukakoi et al. [14] used the Multi-Objective Genetic Algorithm (MOGA) for multi-purpose operation plan to achieve an improved voltage stability and reduce the PV output prediction error and it showed a 6% improvement in the voltage stability index.Moreover, Bode et al. [54] used a multi-objective Particle Swarm Optimization (PSO) algorithm for optimal penetration of PV, while maintaining the system stability, and it showed an 11% improvement for the novel line stability index.In addition, Andrew et al. [55] used a combination of PSO and Newton Raphson Power Flow (NRPF) methods for the optimal allocation of DG to minimize VD and it showed a 16% reduction in VD.Besides that, the results that were obtained in the present study (see Table 2) demonstrate that the used method improves the system performance in terms of VD reduction after integrating the optimally sized PV-battery system into the studied grid.In particular, the results reflect reductions of approximately 4% and 17% for the TCO and VD, respectively.The optimal multi-objective solution of PV-battery sizing while considering the TCO and VD provides the results in Table 3.The PV farm and battery capacity with 2 MWp and 1.27 MWh, respectively, are the optimal solutions with regard to improvement of system performance, system stability, and minimization of the total cost of DG while considering the purchased and sold energy.Figure 12 compares the voltage deviation for one day before and after the implementation of the optimally sized PV farm and BESS.3.62 The optimal multi-objective solution of PV-battery sizing while considering the TCO and VD provides the results in Table 3.The PV farm and battery capacity with 2 MWp and 1.27 MWh, respectively, are the optimal solutions with regard to improvement of system performance, system stability, and minimization of the total cost of DG while considering the purchased and sold energy.Figure 12 compares the voltage deviation for one day before and after the implementation of the optimally sized PV farm and BESS.To verify the effectiveness and performance of the proposed FLC controller, the input/output membership functions were introduced to control the charging and discharging rates of the battery bank and facilitating B2G and G2B operations.The objective of controlling the charging and discharging rates is to provide the exact power to the grid respecting voltage, load constraints, and battery characteristics.Uncoordinated charging of batteries threatens the distribution system and it can lead to power outage and undesirable voltage sag [19].Hence, the real time smart control charging strategy maximizes customer satisfaction and it adjusts both the energy that is delivered by the grid to the battery and the energy that is injected on the grid from the battery, with fair power allocation.To perform energy management, the real time charging and discharging rates could be controlled via proper controllers with the aim of achieving peak shaving and enhancing the battery to be charged during off-peak times and discharged during on-peak times.Figure 13 illustrates the load voltage profile through 24 hours in one-second step time.Moreover, Figure 14 shows the behavior of the load, grid, PV, and SOC in 24 h on January 1 st in one farm.The results To verify the effectiveness and performance of the proposed FLC controller, the input/output membership functions were introduced to control the charging and discharging rates of the battery bank and facilitating B2G and G2B operations.The objective of controlling the charging and discharging rates is to provide the exact power to the grid respecting voltage, load constraints, and battery characteristics.Uncoordinated charging of batteries threatens the distribution system and it can lead to power outage and undesirable voltage sag [19].Hence, the real time smart control charging strategy maximizes customer satisfaction and it adjusts both the energy that is delivered by the grid to the battery and the energy that is injected on the grid from the battery, with fair power allocation.To perform energy management, the real time charging and discharging rates could be controlled via proper controllers with the aim of achieving peak shaving and enhancing the battery to be charged during off-peak times and discharged during on-peak times.Figure 13 illustrates the load voltage profile through 24 hours in one-second step time.Moreover, Figure 14 shows the behavior of the load, grid, PV, and SOC in 24 h on January 1st in one farm.The results show that, in winter, the maximum power generation from PV can be 1.2 MW due to low irradiation.In the meanwhile, the supplied power from the grid between 10:00 a.m. and 05:00 p.m. decreases and the battery is charged.During peak hours (e.g., 9 a.m., 7:30 p.m.), corresponding to high load demand (see Figure 2), and when the voltage drops below 0.98, the designed controller incites the battery to discharge, as a 'High SoC' (between 81% and 100%) characterizes its SoC.During off-peak hours, (e.g., 2:30 a.m., 3:30 p.m., 23:30 p.m.), and when the voltage is very high (VH), the designed controller incites the battery to charge.In the case of a normal voltage (e.g., 7:30 a.m., 4:30 p.m.), the battery is neither in charge nor in discharge mode.As a result, it can be concluded that the energy management system properly controls the charging and discharging power rates and it enables B2G and G2B services in sizing the DG optimization process.Therefore, the proposed technique provides successful coordination between a RES with PV and ESS with stationary battery.
show that, in winter, the maximum power generation from PV can be 1.2 MW due to low irradiation.In the meanwhile, the supplied power from the grid between 10:00 a.m. and 05:00 p.m. decreases and the battery is charged.During peak hours (e.g., 9 a.m., 7:30 p.m.), corresponding to high load demand (see Figure 2), and when the voltage drops below 0.98, the designed controller incites the battery to discharge, as a 'High SoC' (between 81% and 100%) characterizes its SoC.During off-peak hours, (e.g., 2:30 a.m., 3:30 p.m., 23:30 p.m.), and when the voltage is very high (VH), the designed controller incites the battery to charge.In the case of a normal voltage (e.g., 7:30 a.m., 4:30 p.m.), the battery is neither in charge nor in discharge mode.As a result, it can be concluded that the energy management system properly controls the charging and discharging power rates and it enables B2G and G2B services in sizing the DG optimization process.Therefore, the proposed technique provides successful coordination between a RES with PV and ESS with stationary battery.To guarantee the global optimal solution and avoid any local solutions, the optimization process has been run three times, as shown in Figure 15.As it can be seen, after 800 function evaluations, the cost has reached the same value of 1094 × 10 3 euros.Therefore, it can be concluded that the solution is globally optimum for the defined problem.show that, in winter, the maximum power generation from PV can be 1.2 MW due to low irradiation.In the meanwhile, the supplied power from the grid between 10:00 a.m. and 05:00 p.m. decreases and the battery is charged.During peak hours (e.g., 9 a.m., 7:30 p.m.), corresponding to high load demand (see Figure 2), and when the voltage drops below 0.98, the designed controller incites the battery to discharge, as a 'High SoC' (between 81% and 100%) characterizes its SoC.During off-peak hours, (e.g., 2:30 a.m., 3:30 p.m., 23:30 p.m.), and when the voltage is very high (VH), the designed controller incites the battery to charge.In the case of a normal voltage (e.g., 7:30 a.m., 4:30 p.m.), the battery is neither in charge nor in discharge mode.As a result, it can be concluded that the energy management system properly controls the charging and discharging power rates and it enables B2G and G2B services in sizing the DG optimization process.Therefore, the proposed technique provides successful coordination between a RES with PV and ESS with stationary battery.To guarantee the global optimal solution and avoid any local solutions, the optimization process has been run three times, as shown in Figure 15.As it can be seen, after 800 function evaluations, the cost has reached the same value of 1094 × 10 3 euros.Therefore, it can be concluded that the solution is globally optimum for the defined problem.To guarantee the global optimal solution and avoid any local solutions, the optimization process has been run three times, as shown in Figure 15.As it can be seen, after 800 function evaluations, the cost has reached the same value of 1094 × 10 3 euros.Therefore, it can be concluded that the solution is globally optimum for the defined problem.To analyze the economic assessment of the proposed system, the total yearly costs are calculated over 20 years for both cases; without the PV-battery and with the PV-battery system that is optimized by the GA.Subsequently, profitability is obtained based on the calculated yearly costs for both scenarios.Note that different drivers influence the profitability with solar PV and battery storage systems, which are broadly grouped into 'finance-related' factors, such as market-based characteristics and DG costs, and 'quantity-related' factors, such as the amount of demand and supply and weather conditions [51].As shown in Figure 16, the system is profitable from the first year.Moreover, Table 4 presents the total yearly profits from PV production while considering a total DG cost of 0.3 Million Euros.The resulted payback time and the yearly profits from PV generation could provide society with an initial indication of economic viability of such systems and incite consumers to purchase PV and battery systems and make the most financially sound investment decision.To analyze the economic assessment of the proposed system, the total yearly costs are calculated over 20 years for both cases; without the PV-battery and with the PV-battery system that is optimized by the GA.Subsequently, profitability is obtained based on the calculated yearly costs for both scenarios.Note that different drivers influence the profitability with solar PV and battery storage systems, which are broadly grouped into 'finance-related' factors, such as market-based characteristics and DG costs, and 'quantity-related' factors, such as the amount of demand and supply and weather conditions [51].As shown in Figure 16, the proposed system is profitable from the first year.Moreover, Table 4 presents the total yearly profits from PV production while considering a total DG cost of 0.3 Million Euros.The resulted payback time and the yearly profits from PV generation could provide society with an initial indication of economic viability of such systems and incite consumers to purchase PV and battery systems and make the most financially sound investment decision.To analyze the economic assessment of the proposed system, the total yearly costs are calculated over 20 years for both cases; without the PV-battery and with the PV-battery system that is optimized by the GA.Subsequently, profitability is obtained based on the calculated yearly costs for both scenarios.Note that different drivers influence the profitability with solar PV and battery storage systems, which are broadly grouped into 'finance-related' factors, such as market-based characteristics and DG costs, and 'quantity-related' factors, such as the amount of demand and supply and weather conditions [51].As shown in Figure 16, the proposed system is profitable from the first year.Moreover, Table 4 presents the total yearly profits from PV production while considering a total DG cost of 0.3 Million Euros.The resulted payback time and the yearly profits from PV generation could provide society with an initial indication of economic viability of such systems and incite consumers to purchase PV and battery systems and make the most financially sound investment decision.

Profits Cost (Million Euros)
Profit from PV production (sell to the grid) 0.0425 every year Profit from PV production (load reduction) 0.383 every year Total yearly investment, O&M, and replacement cost 0.3 The cost of batteries is one of the main factors that influence the profitability.Especially, the battery costs could affect the payback time and provide economic benefits.The high capital cost of battery is still the primary barrier to its widespread implementation under the current energy market [56].In this regard, the further decreasing cost of battery will make battery investment more attractive and highly beneficial to consumers.The used battery prices for the residential and commercial levels range from 120 €/kWh (absolute minimum) to 450 €/kWh (absolute maximum) [47].Moreover, the pack price of new Li-ion batteries ranges from 400 €/kWh to 600 €/kWh for the residential and commercial/industrial systems, while taking into consideration that the cost of the actual installed systems in 2015 was in the range of 800 €/kWh to 1000 €/kWh, including charges, such as inverter, software, and other installation costs [47].For these reasons, the system profitability is analyzed and discussed in this section with different cost scenarios for BESSs, varying the investment cost C Inv ESS (see Table 5).Please note that 10 years is the assumed life-time of the battery.Table 5 provides the profits over 20 years.According to the projective studies, it has been predicted that the price of Li-ion batteries will be substantially reduced by the end of 2030 [58].Therefore, providing a clear picture of how the battery prices can affect profitability with designers and battery cell manufactures could be helpful and useful.In this regard, Schopfer et al. [45] performed a sensitivity analysis on a PV-battery system with PV installation costs of 2500, 2000 (base case), 1500 and 1000 €/kWp, and battery storage costs of 1000 (base case), 750, 500, and 250 €/kWh, and demonstrated that the battery will only improve the profitability of the system with a price of 250 €/kWh.Moreover, the results of the sensitivity analysis that was performed by Magnor et al. [12] on a PV-battery system demonstrated that only battery costs of 550 €/kWh, which are hardly available today, could lead to a profitable PV-battery system operation.Naumann et al. [59] showed the sensitivity of the Return On Investment (ROI) to storage prices and concluded that, when considering their assumption with a storage price of 500 €/kWh, the system is not profitable; profit may be only made with storage prices below 450 €/kWh.However, in the present study, the battery costs will significantly improve the profitability of the proposed system once they are used with initial battery costs of less than or equal to 1000 €/kWh.

Conclusions
This paper presented an optimization framework for a grid-connected PV-battery system.The GA optimization is used for optimal sizing of the system and it is coupled with a real-time FLC-based controller, which ensures the proper integration of the system into a SG infrastructure, with respect to technical and economic aspects.
In order to integrate batteries and deal with the intermittent behavior of renewable power generation units, the FL-Based control method was introduced and then developed.It tackles the technical and financial problems while considering VD and TCO and allowing for G2B and B2G functionalities.Moreover, the proposed approach could provide techno-economic benefits by offering ancillary services, such as peak shaving, voltage and frequency regulations, demand response, and cost reduction.Therefore, this research developed a control method to demonstrate the beneficial prospects for the grid-friendly deployment of PV-battery systems in a SG environment.Moreover, the proposed technique improved the system performance, maintained system stability, and reduced the direct and indirect costs related not only to DG system costs, but also to prices of purchased and sold energy from/to the grid.The TCO and VD were reduced by 4% and 17%, respectively.Indeed, it was demonstrated that the introduced technique could accurately perform energy management in a SG context enabling B2G and G2B services and while considering technical aspects, such as voltage and battery characteristics and financial aspects, such as on/off peak hours that are related to energy prices.Besides that, a sensitivity analysis demonstrated that a reduction in battery costs could provide the most financially attractive solution to RES integration into the SG and the transition towards sustainable energy.

Figure 2 .
Figure 2. Time sequence characteristic curve of the total load.

Figure 3 .
Figure 3. Hourly solar radiation throughout the year received on a horizontal surface in Brussels, Belgium.

Figure 2 .
Figure 2. Time sequence characteristic curve of the total load.

Figure 2 .
Figure 2. Time sequence characteristic curve of the total load.

Figure 3 .
Figure 3. Hourly solar radiation throughout the year received on a horizontal surface in Brussels, Belgium.

Figure 3 .
Figure 3. Hourly solar radiation throughout the year received on a horizontal surface in Brussels, Belgium.

Figure 5 .
Figure 5. Flow chart of the implemented controller and GA.

Figure 5 .
Figure 5. Flow chart of the implemented controller and GA.

Figure 6 .
Figure 6.Input membership function State of Charge (SoC).

Figure 6 .
Figure 6.Input membership function State of Charge (SoC).

Figure 6 .
Figure 6.Input membership function State of Charge (SoC).

Figure 8 .
Figure 8. Input membership function On/Off peak hours.

Figure 8 .
Figure 8. Input membership function On/Off peak hours.

Figure 9 .
Figure 9. Output membership function Charge and Discharge rate.Figure 9. Output membership function Charge and Discharge rate.

Figure 9 .
Figure 9. Output membership function Charge and Discharge rate.Figure 9. Output membership function Charge and Discharge rate.

Figure 12 .
Figure 12.Voltage deviation before and after implementation of the optimally sized Distributed Generator (DG) and battery.

Figure 12 .
Figure 12.Voltage deviation before and after implementation of the optimally sized Distributed Generator (DG) and battery.

Figure 13 .
Figure 13.Voltage profile of the load.

Figure 13 .
Figure 13.Voltage profile of the load.

Figure 13 .
Figure 13.Voltage profile of the load.

Figure 15 .
Figure 15.Evaluation of Total Cost of Ownership (TCO) over Number of Evaluation Function (NFE) in optimization process.

Figure 16 .
Figure 16.Total yearly cost with/without PV-battery system.

Figure 15 .
Figure 15.Evaluation of Total Cost of Ownership (TCO) over Number of Evaluation Function (NFE) in optimization process.

Figure 15 .
Figure 15.Evaluation of Total Cost of Ownership (TCO) over Number of Evaluation Function (NFE) in optimization process.

Figure 16 .
Figure 16.Total yearly cost with/without PV-battery system.

Figure 16 .
Figure 16.Total yearly cost with/without PV-battery system.

Table 1 .
Parameters with values used for the economic analysis.

Table 2 .
System improvement after implementation of the optimally sized DG in year 2017.

Table 2 .
System improvement after implementation of the optimally sized DG in year 2017.

Table 4 .
Total yearly profit and yearly DG's cost over 20 years.

Table 5 .
Sensitivity results for different battery investment costs.