# Optimum Energy Flow Management of a Grid-Tied Photovoltaic-Wind-Battery System considering Cost, Reliability, and CO2 Emission

Authors: Meryeme Azaroual; Mohammed Ouassaid; Mohamed Maaroufi
Journal: International Journal of Photoenergy
 (2021)

---

## Abstract

The main goal of this paper is to explore the performance of a residential grid-tied hybrid (GTH) system which relies on economic and environmental aspects. A photovoltaic- (PV-) wind turbine- (WT-) battery storage system with maximizing self-consumption and time-of-use (ToU) pricing is conducted to examine the system efficiency. In so doing, technical optimization criteria with taking into consideration renewable energy benefits including feed-in-tariff (FIT) and greenhouse gas emission (GHG) reduction are analyzed. As the battery has a substantial effect on the operational cost of the system, the energy management strategy (EMS) will incorporate the daily operating cost of the battery and the effect of the degradation. The model can give the opportunity to the network to sell or purchase energy from the system. The simulation results demonstrate the effectiveness of the proposed approach in which the new objective function achieves the maximum cost-saving (99.81%) and income (5.16 $/day) compared to other existing strategies as well as the lowest GHG emission. Furthermore, the battery enhances the best daily self-consumption and load cover ratio. Then, as the model is nonlinear, a comparison with other existing algorithms is performed to select the feasible, robust, and reliable model for the residential application. A hybrid algorithm (HGAFMINCON) is developed to demonstrate the superiority of the algorithm over FMINCON and GA shown in terms of cost savings and income.


---

## Body

## 1. Introduction

### 1.1. Motivation and Literature Review

Recently, the increasing electricity costs and GHG emissions around the world lead to a major transition of energy from fossil fuels to renewable energy sources (RES) [1, 2]. It is expected to install above 198 GW of renewable capacity, to break another record, and to account for nearly 90% of the increase in the total power capacity. In 2020, important additions of wind (8%) and hydropower (43%) are expected, whereas the solar PV is stable [3, 4]. In North Africa, Morocco is typified by a suitable geographical position and considered the ninth best in the world in terms of the rate of sunshine. With the deficiency of conventional hydrocarbons and the increase of GHG emissions from fuel combustion, the kingdom has approved the Kyoto Protocol to support the international efforts about climate change mitigation [5]. In effect, electrical energy has approximately more than half of GHG emissions due to the large dependence on fossil fuels. To do so, the solution to overcome this critical issue incorporates the integration of RE and the enhancement of energy efficiency between different sectors. In Morocco, the residential sector is considered an extensive energy consumer because of the enlargement of the urbanization [6]. However, among the crucial problems associated with renewable energy systems is the fluctuation of PV and WT output power which depends on meteorological situations. Therefore, matching consumer demand continuously is the main challenging task of any power generation system. This issue can be overcome by prosumer energy systems such as the battery which can be used as a supplier of energy or/and a consumer [7]. Thus, the current challenge is to assure the demand while managing the energy flow by controlling the generated power to supply the load and the surplus power to or from the battery/grid. Hence, numerous strategies, algorithms of control, and software tools have been applied to optimize the power flow and reduce the global cost. Concerning grid-connected residential RE systems, the welcomed optimal strategy is when considering the electricity tariffs which have a significant effect on the economic performance system. In Morocco, the common electricity tariffs are the ToU and step-rate tariffs due to their ability to improve the energy efficiency of the electricity grid. The authors in [8, 9] proved that the combination of solar and wind power sources is an efficient solution for Moroccan power grid reliability. In [10], the authors focused on the economic power generation system principally based on residential grid-tied PV/battery power to minimize the electricity cost and obtain an income from the surplus energy. The simulation results demonstrated that the proposed model is effective with low cost. Moreover, the economic analysis is performed in terms of the found levelized cost of energy (LCOE) and net present cost (NPC) calculated by HOMER (Hybrid Optimization Model for Electric Renewable) software. Adeli et al. illustrated that PV cannot establish a net-zero energy building; preferably, other renewable sources should be used. It was concluded that using WT for electricity production especially in winter is an appropriate substitute for the reduction of the produced electricity by PV generators. Furthermore, the better condition for the studied building was afforded through optimization of the parameters of reduction of energy consumption and the hours of residents’ thermal dissatisfaction [11]. In Ref. [12], a grid-connected photovoltaic and energy storage system (ESS) is designed to supply a housing demand. The paper aims at increasing the self-consumption of the system and at alleviating the issues resulting from PV power grid injection. Therefore, the proposed energy management algorithm is applied to manage the power flow of the system to maximize self-consumption and reduce household consumption from the utility grid. The authors in Ref. [13] develop a novel optimization method using differential evolution and chaos theory for a microgrid (MG). The MG includes PV, WT, microturbine (MT), and fuel cell (FC). The optimization method is a multiobjective function aiming at reducing the operating cost and pollutants simultaneously during the day. In [14], an optimal EMS of a MG is implemented to reduce the degradation cost of the battery system and the dynamic penalty. The optimization problem is solved using particle swarm optimization (PSO) to control the battery for real-time energy management. The authors in Ref. [15] propose an EMS in MGs which is considered a dynamic economic emission dispatch (DEED). The purpose of this study is to determine the generation level of diesel generator (DG), the cycle of charging and discharging of the ESS, and the energy exchanged with the utility grid. The applied algorithm is the help of whale optimization algorithm (WOA) as the optimization problem is nonlinear, and the results demonstrate that the model with the exchange of zero energy building (ZEB) between the MG and the utility gives an optimal operation cost. In [16], a PV-hydrogen-reusing retired electric vehicle battery (REVB) is designed. A power management strategy is presented to schedule the energy flow while minimizing the loss of power supply and the potential energy waste. The simulation is performed using the evolutionary algorithm (NSGA-II), and the results highlight that the reliability of the system is impaired if ignoring the REVB’s capacity loss, and the system has better performance regarding the distribution of solutions. Mellouk et al. designed a grid-tied PV/WT/concentrated photovoltaic panels (CPV) and parabolic through-solar steam turbine technology (SST) system to show the potential of incorporating the RE technologies in a Moroccan region (Laayoune) which is considered a case study. The hybrid system is scheduled under a novel parallel hybrid genetic algorithm-particle swarm optimization algorithm (P-GA-PSO) to minimize energy cost and energy losses and maximizing renewable energy production. Indeed, the results improve that the obtained energy cost does not surpass 0.17 US$/kWh, which is close to the fossil fuel energy cost, and the applied strategy has good performance in terms of simulation time and solution quality [17]. In [18], the study proposes a novel technique for HGT PV/WT/battery system to minimize the purchased energy from the grid as well as maximize the profit from RE and battery sales. In [19], a novel management algorithm is proposed in order to decrease the payback time of a PV-battery system connected to the grid as well as reduce the size of the residential system. The excess energy can be exported to the grid, and the system works using the Maximum Power Point (MPP) or at the Limited Power Point (LPP) modes to meet the management algorithm requests. To achieve the LPP, the Perturbation and Observation (P&O) algorithm is used. The paper in [20] presents a new “mix-mode” (MM) EMS and method to size battery appropriately battery sizing method for a low operating cost. The implemented strategies are the “continuous run mode,” “power sharing mode,” and “ON/OFF mode” and solved using linear programming (LP) and mixed integer linear programming (MILP) and linear programming (LP) methods. Besides, the PSO algorithm is used to define the optimal energy capacity of the battery. The authors in [21] examine the viability of a combined dispatch (CD) control technique for a PV-diesel-battery system with combining the load following (LF) and cycle charging (CC) strategies. The software used as for the optimization is HOMER in order to investigate the economic and environmental aspect of the system. The results prove that the CD methodology presents the lower net present cost and cost of energy values compared to those of CC and LF strategies. Meanwhile, effects of other parameters such as battery minimum SOC and diesel price are analyzed.Different tariffs (ToU and developed step-rate tariffs) and FITs are applied to schedule the efficiency of the grid and the price of electricity. Besides, many researchers have implemented for optimization problems different software tools such as HOMER and TRYNS [22, 23].


### 1.2. Scope and Contribution

In most of these studies, different energy management strategies are implemented and the main objective of these methods is to minimize the consumed energy from the grid and schedule optimally the energy flow of the hybrid system to maximize the energy efficiency. However, even though the proposed strategies prove good results, their effects on the battery system are still lacking. The battery is discharged when the generated power is less than the power demand, and it is charged if there is excess power. As a result, recurrent variations in renewable power and demand can produce sudden charging and discharging decisions as well as decreasing rates of battery degradation. Consequently, it is required to incorporate the daily operation cost and degradation of the battery in the objective function to reduce the operational cost in the optimization problems. Moreover, to further improve the efficiency of the system, attention to the potential benefits from the carbon emission reduction will be considered.Concisely, to answer all these questions, this paper presents an original EMS for a Moroccan grid-connected residential system consisting of a PV, WT, and battery bank with taking into consideration economic, technical, and environmental criteria. The electricity tariffs including the grid electricity tariff and the FIT have a significant impact on the economic performance of the system and benefits for the end-user. Hence, contributions of the present study are summarized as follows:(i)
The proposed model allows residential end-users to match the energy flow between production and consumption, and it brings the opportunity for the homeowner to sell the energy to the provider. In fact, the economic benefits of the proposed EMS are the reduction of the dependency of the system on the utility grid under the ToU tariff (increasing self-consumption of the generated energy) and reduction of energy costs for the household(ii)
The strategy develops the cost function that takes into account the daily operation cost of the battery, which considers the effect of energy storage and degradation. The battery management is aimed at charging the battery during the off-peak price period(iii)
The EMS permits the residential application to profit from the selling of excess RE and ESS back to the main grid through appropriate FITs. The developed technical optimization and environmental (GHG emission mitigation) criteria are analyzed and compared with other recent energy management strategies considering different energy sources and load demand to verify the efficiency and effectiveness of the proposed method(iv)
A comparison between other modern optimization approaches is performed to prove the robustness of the algorithm in terms of convergence speed and solutions(v)
A comparison between FMINCON and developed hybrid algorithm HGAFMINCON approaches is executed to demonstrate the effectiveness of the algorithm in terms of cost savingsSubsequent to obtaining the results, it can be revealed that the model is appropriate for the household who plans to increase the efficiency of energy with lower cost and mitigate the GHG emission by integrating RE sources.


### 1.3. Framework of the Paper

The remainder of the paper is categorized as follows. Section2 describes the configuration of the HGT system, the mathematical model of each component, and the GHG. Section 3 outlines the suggested energy management strategies under different tariffs and the mathematical formulation of the objective function and the constraints as well as the applied energy management algorithms. In Section 4, the simulation results will be discussed and different comparisons are performed to improve the efficiency of the developed strategy. Finally, Section 5 summarizes the results of the work and draws conclusions.


## 1.1. Motivation and Literature Review

Recently, the increasing electricity costs and GHG emissions around the world lead to a major transition of energy from fossil fuels to renewable energy sources (RES) [1, 2]. It is expected to install above 198 GW of renewable capacity, to break another record, and to account for nearly 90% of the increase in the total power capacity. In 2020, important additions of wind (8%) and hydropower (43%) are expected, whereas the solar PV is stable [3, 4]. In North Africa, Morocco is typified by a suitable geographical position and considered the ninth best in the world in terms of the rate of sunshine. With the deficiency of conventional hydrocarbons and the increase of GHG emissions from fuel combustion, the kingdom has approved the Kyoto Protocol to support the international efforts about climate change mitigation [5]. In effect, electrical energy has approximately more than half of GHG emissions due to the large dependence on fossil fuels. To do so, the solution to overcome this critical issue incorporates the integration of RE and the enhancement of energy efficiency between different sectors. In Morocco, the residential sector is considered an extensive energy consumer because of the enlargement of the urbanization [6]. However, among the crucial problems associated with renewable energy systems is the fluctuation of PV and WT output power which depends on meteorological situations. Therefore, matching consumer demand continuously is the main challenging task of any power generation system. This issue can be overcome by prosumer energy systems such as the battery which can be used as a supplier of energy or/and a consumer [7]. Thus, the current challenge is to assure the demand while managing the energy flow by controlling the generated power to supply the load and the surplus power to or from the battery/grid. Hence, numerous strategies, algorithms of control, and software tools have been applied to optimize the power flow and reduce the global cost. Concerning grid-connected residential RE systems, the welcomed optimal strategy is when considering the electricity tariffs which have a significant effect on the economic performance system. In Morocco, the common electricity tariffs are the ToU and step-rate tariffs due to their ability to improve the energy efficiency of the electricity grid. The authors in [8, 9] proved that the combination of solar and wind power sources is an efficient solution for Moroccan power grid reliability. In [10], the authors focused on the economic power generation system principally based on residential grid-tied PV/battery power to minimize the electricity cost and obtain an income from the surplus energy. The simulation results demonstrated that the proposed model is effective with low cost. Moreover, the economic analysis is performed in terms of the found levelized cost of energy (LCOE) and net present cost (NPC) calculated by HOMER (Hybrid Optimization Model for Electric Renewable) software. Adeli et al. illustrated that PV cannot establish a net-zero energy building; preferably, other renewable sources should be used. It was concluded that using WT for electricity production especially in winter is an appropriate substitute for the reduction of the produced electricity by PV generators. Furthermore, the better condition for the studied building was afforded through optimization of the parameters of reduction of energy consumption and the hours of residents’ thermal dissatisfaction [11]. In Ref. [12], a grid-connected photovoltaic and energy storage system (ESS) is designed to supply a housing demand. The paper aims at increasing the self-consumption of the system and at alleviating the issues resulting from PV power grid injection. Therefore, the proposed energy management algorithm is applied to manage the power flow of the system to maximize self-consumption and reduce household consumption from the utility grid. The authors in Ref. [13] develop a novel optimization method using differential evolution and chaos theory for a microgrid (MG). The MG includes PV, WT, microturbine (MT), and fuel cell (FC). The optimization method is a multiobjective function aiming at reducing the operating cost and pollutants simultaneously during the day. In [14], an optimal EMS of a MG is implemented to reduce the degradation cost of the battery system and the dynamic penalty. The optimization problem is solved using particle swarm optimization (PSO) to control the battery for real-time energy management. The authors in Ref. [15] propose an EMS in MGs which is considered a dynamic economic emission dispatch (DEED). The purpose of this study is to determine the generation level of diesel generator (DG), the cycle of charging and discharging of the ESS, and the energy exchanged with the utility grid. The applied algorithm is the help of whale optimization algorithm (WOA) as the optimization problem is nonlinear, and the results demonstrate that the model with the exchange of zero energy building (ZEB) between the MG and the utility gives an optimal operation cost. In [16], a PV-hydrogen-reusing retired electric vehicle battery (REVB) is designed. A power management strategy is presented to schedule the energy flow while minimizing the loss of power supply and the potential energy waste. The simulation is performed using the evolutionary algorithm (NSGA-II), and the results highlight that the reliability of the system is impaired if ignoring the REVB’s capacity loss, and the system has better performance regarding the distribution of solutions. Mellouk et al. designed a grid-tied PV/WT/concentrated photovoltaic panels (CPV) and parabolic through-solar steam turbine technology (SST) system to show the potential of incorporating the RE technologies in a Moroccan region (Laayoune) which is considered a case study. The hybrid system is scheduled under a novel parallel hybrid genetic algorithm-particle swarm optimization algorithm (P-GA-PSO) to minimize energy cost and energy losses and maximizing renewable energy production. Indeed, the results improve that the obtained energy cost does not surpass 0.17 US$/kWh, which is close to the fossil fuel energy cost, and the applied strategy has good performance in terms of simulation time and solution quality [17]. In [18], the study proposes a novel technique for HGT PV/WT/battery system to minimize the purchased energy from the grid as well as maximize the profit from RE and battery sales. In [19], a novel management algorithm is proposed in order to decrease the payback time of a PV-battery system connected to the grid as well as reduce the size of the residential system. The excess energy can be exported to the grid, and the system works using the Maximum Power Point (MPP) or at the Limited Power Point (LPP) modes to meet the management algorithm requests. To achieve the LPP, the Perturbation and Observation (P&O) algorithm is used. The paper in [20] presents a new “mix-mode” (MM) EMS and method to size battery appropriately battery sizing method for a low operating cost. The implemented strategies are the “continuous run mode,” “power sharing mode,” and “ON/OFF mode” and solved using linear programming (LP) and mixed integer linear programming (MILP) and linear programming (LP) methods. Besides, the PSO algorithm is used to define the optimal energy capacity of the battery. The authors in [21] examine the viability of a combined dispatch (CD) control technique for a PV-diesel-battery system with combining the load following (LF) and cycle charging (CC) strategies. The software used as for the optimization is HOMER in order to investigate the economic and environmental aspect of the system. The results prove that the CD methodology presents the lower net present cost and cost of energy values compared to those of CC and LF strategies. Meanwhile, effects of other parameters such as battery minimum SOC and diesel price are analyzed.Different tariffs (ToU and developed step-rate tariffs) and FITs are applied to schedule the efficiency of the grid and the price of electricity. Besides, many researchers have implemented for optimization problems different software tools such as HOMER and TRYNS [22, 23].


## 1.2. Scope and Contribution

In most of these studies, different energy management strategies are implemented and the main objective of these methods is to minimize the consumed energy from the grid and schedule optimally the energy flow of the hybrid system to maximize the energy efficiency. However, even though the proposed strategies prove good results, their effects on the battery system are still lacking. The battery is discharged when the generated power is less than the power demand, and it is charged if there is excess power. As a result, recurrent variations in renewable power and demand can produce sudden charging and discharging decisions as well as decreasing rates of battery degradation. Consequently, it is required to incorporate the daily operation cost and degradation of the battery in the objective function to reduce the operational cost in the optimization problems. Moreover, to further improve the efficiency of the system, attention to the potential benefits from the carbon emission reduction will be considered.Concisely, to answer all these questions, this paper presents an original EMS for a Moroccan grid-connected residential system consisting of a PV, WT, and battery bank with taking into consideration economic, technical, and environmental criteria. The electricity tariffs including the grid electricity tariff and the FIT have a significant impact on the economic performance of the system and benefits for the end-user. Hence, contributions of the present study are summarized as follows:(i)
The proposed model allows residential end-users to match the energy flow between production and consumption, and it brings the opportunity for the homeowner to sell the energy to the provider. In fact, the economic benefits of the proposed EMS are the reduction of the dependency of the system on the utility grid under the ToU tariff (increasing self-consumption of the generated energy) and reduction of energy costs for the household(ii)
The strategy develops the cost function that takes into account the daily operation cost of the battery, which considers the effect of energy storage and degradation. The battery management is aimed at charging the battery during the off-peak price period(iii)
The EMS permits the residential application to profit from the selling of excess RE and ESS back to the main grid through appropriate FITs. The developed technical optimization and environmental (GHG emission mitigation) criteria are analyzed and compared with other recent energy management strategies considering different energy sources and load demand to verify the efficiency and effectiveness of the proposed method(iv)
A comparison between other modern optimization approaches is performed to prove the robustness of the algorithm in terms of convergence speed and solutions(v)
A comparison between FMINCON and developed hybrid algorithm HGAFMINCON approaches is executed to demonstrate the effectiveness of the algorithm in terms of cost savingsSubsequent to obtaining the results, it can be revealed that the model is appropriate for the household who plans to increase the efficiency of energy with lower cost and mitigate the GHG emission by integrating RE sources.


## 1.3. Framework of the Paper

The remainder of the paper is categorized as follows. Section2 describes the configuration of the HGT system, the mathematical model of each component, and the GHG. Section 3 outlines the suggested energy management strategies under different tariffs and the mathematical formulation of the objective function and the constraints as well as the applied energy management algorithms. In Section 4, the simulation results will be discussed and different comparisons are performed to improve the efficiency of the developed strategy. Finally, Section 5 summarizes the results of the work and draws conclusions.


## 2. Structure Presentation and Mathematical Modeling

The proposed residential grid-connected PV-WT-battery installation is shown in Figure1. The photovoltaic generator, WT generator, and battery storage system are connected to supply the home through bidirectional inverters. The DC bus keeps a constant voltage by DC/DC converters and DC/AC inverter. The interconnection between all energy sources is interconnected by an energy management system to control the different power flows. The hybrid system is also assumed to be connected to the utility grid to import the energy needed and export excess energy.Figure 1
Structure of the proposed hybrid system.The power generated by PV and WT systems is used to feed the load, and the surplus power is used to charge the battery bank or sold to the grid depending on the electricity price. Besides, if the batteries achieve their maximum charge, the excess power is sold to the main grid. If the PV and WT powers are insufficient to feed the load, the battery is discharged. If the battery power cannot satisfy the load demand, the needed power is purchased from the grid. Otherwise, the battery is also charged by the utility grid and discharged to maintain the load demand or exported to the grid to save electricity cost.As shown in the Figure1, the control variables of the hybrid system are the PV power Ppv, WT power Pw, battery power Pbat, and grid power Pgrid. The price data is the daily electricity price, and the weather data is the solar irradiation and wind speed over 24 h horizon.


### 2.1. Photovoltaic System

The output power produced by a PV panel is depending on the solar irradiance, area of the PV panel, ambient temperature, and efficiency of the photovoltaic. Therefore, the power can be given as follows [24]:
(1)PPV=A×SI×ηS×1−γ×TO−25,where PPV is the output power of the PV system; SI refers to the solar irradiance; A and ηs denoted the area of the PV array (m2) and the conversion efficiency (%), respectively; γ is the temperature coefficient of the power and is equal to 0.005; and TO defines the outside air temperature (°C). Then, the total power output of PV array for a number of solar panels can be determined as follows:
(2)PPVT=PPV×NPV,where NPV is the number of PV panels.


### 2.2. Wind Turbine System

The output power produced by the WT depends on the wind speed, the efficiency of conversion, wind energy, and air density. Equation (3) defines the conversion of wind speed to the hub height [25].
(3)ννref=hhrefα,where ν denotes the wind speed (m/s) at the desired hub height h; α refers to the power law exponent ranging; href is the reference height (m); and νref is the wind speed at href.The wind turbine powerPE is represented in terms of wind speed as follows [25]:
(4)PW=0PR×v3−vIN3vR3−vIN3PRif"vOFF<v"or"v≤vIN,"if"vIN≤v≤vR,"if"vR≤v≤vOFF,"where PR and vR define the rated power and rated wind speed, respectively; v denotes the wind speed; and vOFF and vIN refer to the cut-off and the cut-in wind speed, respectively.The total generated output power of the WT can be expressed as follows:(5)PWT=PW×ηWT×NWT,where ηWT is the efficiency of the wind generator and NWT is the number of WT.


### 2.3. Modeling of the Battery Storage System

The state of charge (SoC) of the battery represents the behavior of the battery in percentage, and it can be expressed as follows [26]:
(i)
If the battery is charged:(6)SoCt+1=SoCt+Δt×ηChEnom×PCht=with
(7)PCht=PPV−>batt+PWT−>batt+Pgrid−>batt(ii)
If the battery is discharged:(8)SoCt+1=SoCt−ΔtEnom×ηDis×PDist,PDist=Pbat−>Lt+Pbat−>gridt,where SoC is the percentage of energy storage; PCh defines the power for charging the battery; PDis denotes the power discharged from the battery; ƞdis and ƞch are the battery discharging and charging efficiency, respectively; and Enom is the battery system nominal energy. PPV−>batt and PWT−>batt are the power of PV and WT to charge the battery bank, and Pgrid−>batt is the power imported from the grid to charge the battery. Pbat−>Lt is the power used by the battery to supply the load, and Pbat−>gridt is the power exported from the battery to the grid.


### 2.4. Modeling of the Utility Grid

The grid is considered an infinite source, and the electricity can be exchanged depending on the generation of energy if there is a surplus or deficit. To compute the cost of purchasing power from the utility grid, Equation (9) is applied.
(9)Cgrid−buyt=∑tNpgt×Pgrid‐buyt,where pgt is the daily electricity tariff ($/kWh), Pgrid−buyt is the purchasing power from the utility grid (kWh), and N is the daily number of sampling intervals which is calculated in this case as follows:
(10)N=24×60Δt.The Moroccan National Office of Electricity and Water (ONEE) is a power supply utility company and able to control the production, distribution, and transmission of electricity. Besides, ONEE is responsible for the purification of wastewater necessary to the sustainable development of the country. A residential demand side management (DSM) program is applied recently in Morocco, and the consumer can choose to subscribe to step-rate or ToU tariffs if the average monthly consumption exceeds 500 kWh. The step-rate tariff is listed in Table1 for each corresponding consumption band (step).Table 1
Electricity tariff for Moroccan domestic use [27].
Consumption range per month (kWh)Price (Pr) ($/kWh)Step 10-1000.09Step 2101-2000.10Step 3201-3000.11Step 4301-5000.13Step 5Up to 5000.15For strengthening energy efficiency, the ONEE applies a new ToU tariff in the residential sector (low voltage) where the electricity price varies depending on the season (summer/winter) and period (peak/off-peak). The pattern of ToU pricing for the winter season is depicted in Figure2. For summer, the winter schedule will be shifted by one hour. The local currency in Morocco is Moroccan Dirham (MAD) with 1dollar$=9.80551 MAD.Figure 2
Time-of-use tariff [27].


### 2.5. Greenhouse Gas Emissions

The greenhouse gases (GHGs) have a great effect on the Earth’s warming. Besides, the Global Warming Potential (GWP) is developed to compare the impacts of the global warming of different gases. It is defined as a measure of the amount of energy that emissions of 1 ton of gas can absorb during a period, compared to the emissions of 1 ton of carbon dioxide (CO2), which is considered a reference (in Kyoto Protocol).The reduction of greenhouse gas emission reduction by the system is formulated as(11)GHGsystem−total=RES_GHG+grid_GHG.To compute the emission of the PV (PV_GHG) and WT (WT_GHG) systems, the following expressions can be used:(12)PV_GHG=∑t=124PPVt×em_pv×GWP,WT_GHG=∑t=124PWTt×em_wt×GWP.Therefore,(13)RES_GHG=WT_GHG+PV_GHG,where PPV and PWT are the daily power generated by the PV and WT systems and em_pv and em_wt are the PV and WT factors of emission which equal to 0.045 and 0.011 (kgCO2_eq/kWh), respectively [28, 29].The grid GHG emission is expressed as follows:(14)GHGgrid=Pgrid−L×GWP×Fegrid,where Fegrid is the electricity_specific factor which is equal to 0.731211458 (kgCO2/kWh) in Morocco [30].In this study, GHG emissions are calculated in two cases to calculate the net savings of GHG emissions for the proposed system. The case of meeting the load only from the utility grid is considered a baseline case and the case after implementing RES.Therefore, the net savings will be expressed as follows:(15)GHGnet−saving=baseGHG−GHGsystem−total,with
(16)BaseGHG=PL×GWP×Fegrid.


## 2.1. Photovoltaic System

The output power produced by a PV panel is depending on the solar irradiance, area of the PV panel, ambient temperature, and efficiency of the photovoltaic. Therefore, the power can be given as follows [24]:
(1)PPV=A×SI×ηS×1−γ×TO−25,where PPV is the output power of the PV system; SI refers to the solar irradiance; A and ηs denoted the area of the PV array (m2) and the conversion efficiency (%), respectively; γ is the temperature coefficient of the power and is equal to 0.005; and TO defines the outside air temperature (°C). Then, the total power output of PV array for a number of solar panels can be determined as follows:
(2)PPVT=PPV×NPV,where NPV is the number of PV panels.


## 2.2. Wind Turbine System

The output power produced by the WT depends on the wind speed, the efficiency of conversion, wind energy, and air density. Equation (3) defines the conversion of wind speed to the hub height [25].
(3)ννref=hhrefα,where ν denotes the wind speed (m/s) at the desired hub height h; α refers to the power law exponent ranging; href is the reference height (m); and νref is the wind speed at href.The wind turbine powerPE is represented in terms of wind speed as follows [25]:
(4)PW=0PR×v3−vIN3vR3−vIN3PRif"vOFF<v"or"v≤vIN,"if"vIN≤v≤vR,"if"vR≤v≤vOFF,"where PR and vR define the rated power and rated wind speed, respectively; v denotes the wind speed; and vOFF and vIN refer to the cut-off and the cut-in wind speed, respectively.The total generated output power of the WT can be expressed as follows:(5)PWT=PW×ηWT×NWT,where ηWT is the efficiency of the wind generator and NWT is the number of WT.


## 2.3. Modeling of the Battery Storage System

The state of charge (SoC) of the battery represents the behavior of the battery in percentage, and it can be expressed as follows [26]:
(i)
If the battery is charged:(6)SoCt+1=SoCt+Δt×ηChEnom×PCht=with
(7)PCht=PPV−>batt+PWT−>batt+Pgrid−>batt(ii)
If the battery is discharged:(8)SoCt+1=SoCt−ΔtEnom×ηDis×PDist,PDist=Pbat−>Lt+Pbat−>gridt,where SoC is the percentage of energy storage; PCh defines the power for charging the battery; PDis denotes the power discharged from the battery; ƞdis and ƞch are the battery discharging and charging efficiency, respectively; and Enom is the battery system nominal energy. PPV−>batt and PWT−>batt are the power of PV and WT to charge the battery bank, and Pgrid−>batt is the power imported from the grid to charge the battery. Pbat−>Lt is the power used by the battery to supply the load, and Pbat−>gridt is the power exported from the battery to the grid.


## 2.4. Modeling of the Utility Grid

The grid is considered an infinite source, and the electricity can be exchanged depending on the generation of energy if there is a surplus or deficit. To compute the cost of purchasing power from the utility grid, Equation (9) is applied.
(9)Cgrid−buyt=∑tNpgt×Pgrid‐buyt,where pgt is the daily electricity tariff ($/kWh), Pgrid−buyt is the purchasing power from the utility grid (kWh), and N is the daily number of sampling intervals which is calculated in this case as follows:
(10)N=24×60Δt.The Moroccan National Office of Electricity and Water (ONEE) is a power supply utility company and able to control the production, distribution, and transmission of electricity. Besides, ONEE is responsible for the purification of wastewater necessary to the sustainable development of the country. A residential demand side management (DSM) program is applied recently in Morocco, and the consumer can choose to subscribe to step-rate or ToU tariffs if the average monthly consumption exceeds 500 kWh. The step-rate tariff is listed in Table1 for each corresponding consumption band (step).Table 1
Electricity tariff for Moroccan domestic use [27].
Consumption range per month (kWh)Price (Pr) ($/kWh)Step 10-1000.09Step 2101-2000.10Step 3201-3000.11Step 4301-5000.13Step 5Up to 5000.15For strengthening energy efficiency, the ONEE applies a new ToU tariff in the residential sector (low voltage) where the electricity price varies depending on the season (summer/winter) and period (peak/off-peak). The pattern of ToU pricing for the winter season is depicted in Figure2. For summer, the winter schedule will be shifted by one hour. The local currency in Morocco is Moroccan Dirham (MAD) with 1dollar$=9.80551 MAD.Figure 2
Time-of-use tariff [27].


## 2.5. Greenhouse Gas Emissions

The greenhouse gases (GHGs) have a great effect on the Earth’s warming. Besides, the Global Warming Potential (GWP) is developed to compare the impacts of the global warming of different gases. It is defined as a measure of the amount of energy that emissions of 1 ton of gas can absorb during a period, compared to the emissions of 1 ton of carbon dioxide (CO2), which is considered a reference (in Kyoto Protocol).The reduction of greenhouse gas emission reduction by the system is formulated as(11)GHGsystem−total=RES_GHG+grid_GHG.To compute the emission of the PV (PV_GHG) and WT (WT_GHG) systems, the following expressions can be used:(12)PV_GHG=∑t=124PPVt×em_pv×GWP,WT_GHG=∑t=124PWTt×em_wt×GWP.Therefore,(13)RES_GHG=WT_GHG+PV_GHG,where PPV and PWT are the daily power generated by the PV and WT systems and em_pv and em_wt are the PV and WT factors of emission which equal to 0.045 and 0.011 (kgCO2_eq/kWh), respectively [28, 29].The grid GHG emission is expressed as follows:(14)GHGgrid=Pgrid−L×GWP×Fegrid,where Fegrid is the electricity_specific factor which is equal to 0.731211458 (kgCO2/kWh) in Morocco [30].In this study, GHG emissions are calculated in two cases to calculate the net savings of GHG emissions for the proposed system. The case of meeting the load only from the utility grid is considered a baseline case and the case after implementing RES.Therefore, the net savings will be expressed as follows:(15)GHGnet−saving=baseGHG−GHGsystem−total,with
(16)BaseGHG=PL×GWP×Fegrid.


## 3. Problem Formulation

This study is aimed at minimizing the daily operating costs of the hybrid system “Cop” and improving the self-consumption of the RE sources of the system. The formulation of the optimization problem is performed comprising the cost function and the constraints.


### 3.1. Objective Function

The developed objective function includes three main costs: firstly, (a) the cost of buying electricity from the utility grid to charge the battery and supply the load; secondly, (b) the revenues generated from the surplus energy sold to the main grid; finally, (c) the daily operation cost of energy storage, which incorporates the daily operation of the battery system and the battery degradation.The daily cost function of the studied system is formulated as follows:(17)COP−Sys=Cbuy−Csell+Cbat−op,Cbuy=∑t=1NpgtPgrid−>batt+Pgrid−>LtΔt,Csell=∑t=1NFITRES×PRES−>gridtΔt+∑j=1Npg−p×Pbat−>gridtΔt,Cbat−op=∑t=1NCbat×ηCh×PCht2×NCycΔt+Cbat×PDist2×ηDis×NCycΔt+CDeg×Pbatt,where Pgrid−>bat and Pgrid−>L are imported from the grid to the battery and load, respectively; Δt is the sampling time, and it is equal to 1 h in this study; FITRES is the PV and WT feed-in tariffs [31]; PRES−>grid and Pbat−>grid are the excess renewable energy and energy storage sold to the grid, respectively; pg−p is the peak-price of energy to pay the utility grid; Cbat defines the capital cost of the battery system; CDeg is a coefficient to penalize the degradation operation of the battery bank; NCyc denotes the number of the life cycle of the battery system, and Pbat is the produced power by the battery and it is expressed as follows:
(18)Pbatt=PDist−PCht.


### 3.2. Constraints and Variable Limits

#### 3.2.1. Power Balance Constraint

The power balance equation of the system is valid when the load demand is exactly satisfied by the sum of renewable power, battery, and grid at each sampling time (t). This can be expressed as follows:
(19)PRESt±Pbatt±Pgridt=PLt.


#### 3.2.2. Constraints

The sum of power for satisfying the load, charging into the battery, and exporting to the utility grid should not exceed the total of renewable power output generated. This can be formulated as follows:(20)PRES‐>batt+PRES‐>Lt+PRES−>gridt≤PRESt.Equation (21) prohibits the import and export of grid power simultaneously. This can be formulated mathematically as follows:
(21)Pgrid−importt×Pgrid‐>exportt=0,(22)Pgrid−>batt+Pgrid−>Lt×PRES−>gridt+Pbat−>gridt=0.Furthermore, charging and discharging the battery at the same time should be inhibited. This constraint can be rewritten as follows:(23)PCht×PDist=0,PRES−>batt+Pgrid−>batt×Pbat−>Lt+Pbat−>gridt=0.


#### 3.2.3. Battery Boundaries

The SoC limits are expressed as follows:(24)SoCmin≤SoCt=SoC0+Δt×ηChEnom×PRES−>batt+Pgrid−>batt−ΔtEnomηDis×Pbat−>Lt+Pbat−>gridt≤SoCmax.


#### 3.2.4. Grid Power Limits

The limit of the grid power exchanged is subjected to the following constraints:(25)0≤Pgrid−importt≤Pgridmax,0≤Pgrid−exportt≤Pgridmax,where Pgridmax is the maximum grid power to feed into the utility grid.Besides, the installation cost of RES is not considered in this study since the optimization process is restricted to an analysis of how to schedule the proposed system optimally.


### 3.3. Proposed Energy Management Strategy

The proposed EMS is aimed at the one hand maximizing self-consumption of the PV-WT-battery system and the other hand applying the ToU strategy. Figures3 and 4 represent the flow chart of the two strategies to describe the procedure of scheduling the power of the HGT system.Figure 3
Flow chart of EMS: maximize self-consumption.Figure 4
Flow chart of EMS: ToU strategy.


### 3.4. Calculation of Optimization Problem

In this paper, different methods of optimization will be applied to validate the appropriate one. The algorithms are deterministic and metaheuristic which are used to solve linear and nonlinear problems. The multiobjective function of this research work is linear and subject to nonlinear constraints. Thus, the algorithms used in the MATLAB Optimization Toolbox are “Fmincon,” “Patternsearch:(PS),” and “GA.”The syntax of the three algorithms is formulated as follows [32]:
(26)MinxMaxxFx,subjecttocx≤0,ceqx=0,Ax≤b,Aeqx=beq,lb≤x≤ub,where Fx presents the objective function; cx and ceqx are the linear and nonlinear functions; A and b define the coefficients of inequality constraints; Aeq and beq denote the coefficient of equality constraints.


#### 3.4.1. Fmincon Optimization Solver

As “Fmincon” solver employs the Hessian as the optional input, many “Fmincon” algorithms manipulate this type of input such as interior point, active set. In this work, the algorithm selected for the solver “Fmincon” is the interior point due to its faster convergence and the capacity to solve large-scale kind of optimization problems [33].The flow chart in Figure5 represents the main steps of the algorithm.Figure 5
Flow chart of the Fmincon algorithm.


#### 3.4.2. Genetic Algorithm

GA involves three main rules to develop the next generation from the current population [34]. Figure 6 describe the flow chart of the method.
(i)
Selection rules: select the parents and imply their genes to the next generation(ii)
Crossover rules: integrate two genetic information from the parents to create new children(iii)
Mutation rules: practice random variations on individual parents to arrange childrenFigure 6
Flow chart of the GA algorithm.


#### 3.4.3. Pattern Search Optimization Solver

The “Pattern search” algorithm is an efficient and direct search method. It continues to vary the search direction and increases/decreases frequently the increment until the end condition is attained or the objective function is satisfied [35]. The procedure of the algorithm is presented in Figure 7.Figure 7
Flow chart of the Pattern search algorithm.


## 3.1. Objective Function

The developed objective function includes three main costs: firstly, (a) the cost of buying electricity from the utility grid to charge the battery and supply the load; secondly, (b) the revenues generated from the surplus energy sold to the main grid; finally, (c) the daily operation cost of energy storage, which incorporates the daily operation of the battery system and the battery degradation.The daily cost function of the studied system is formulated as follows:(17)COP−Sys=Cbuy−Csell+Cbat−op,Cbuy=∑t=1NpgtPgrid−>batt+Pgrid−>LtΔt,Csell=∑t=1NFITRES×PRES−>gridtΔt+∑j=1Npg−p×Pbat−>gridtΔt,Cbat−op=∑t=1NCbat×ηCh×PCht2×NCycΔt+Cbat×PDist2×ηDis×NCycΔt+CDeg×Pbatt,where Pgrid−>bat and Pgrid−>L are imported from the grid to the battery and load, respectively; Δt is the sampling time, and it is equal to 1 h in this study; FITRES is the PV and WT feed-in tariffs [31]; PRES−>grid and Pbat−>grid are the excess renewable energy and energy storage sold to the grid, respectively; pg−p is the peak-price of energy to pay the utility grid; Cbat defines the capital cost of the battery system; CDeg is a coefficient to penalize the degradation operation of the battery bank; NCyc denotes the number of the life cycle of the battery system, and Pbat is the produced power by the battery and it is expressed as follows:
(18)Pbatt=PDist−PCht.


## 3.2. Constraints and Variable Limits

### 3.2.1. Power Balance Constraint

The power balance equation of the system is valid when the load demand is exactly satisfied by the sum of renewable power, battery, and grid at each sampling time (t). This can be expressed as follows:
(19)PRESt±Pbatt±Pgridt=PLt.


### 3.2.2. Constraints

The sum of power for satisfying the load, charging into the battery, and exporting to the utility grid should not exceed the total of renewable power output generated. This can be formulated as follows:(20)PRES‐>batt+PRES‐>Lt+PRES−>gridt≤PRESt.Equation (21) prohibits the import and export of grid power simultaneously. This can be formulated mathematically as follows:
(21)Pgrid−importt×Pgrid‐>exportt=0,(22)Pgrid−>batt+Pgrid−>Lt×PRES−>gridt+Pbat−>gridt=0.Furthermore, charging and discharging the battery at the same time should be inhibited. This constraint can be rewritten as follows:(23)PCht×PDist=0,PRES−>batt+Pgrid−>batt×Pbat−>Lt+Pbat−>gridt=0.


### 3.2.3. Battery Boundaries

The SoC limits are expressed as follows:(24)SoCmin≤SoCt=SoC0+Δt×ηChEnom×PRES−>batt+Pgrid−>batt−ΔtEnomηDis×Pbat−>Lt+Pbat−>gridt≤SoCmax.


### 3.2.4. Grid Power Limits

The limit of the grid power exchanged is subjected to the following constraints:(25)0≤Pgrid−importt≤Pgridmax,0≤Pgrid−exportt≤Pgridmax,where Pgridmax is the maximum grid power to feed into the utility grid.Besides, the installation cost of RES is not considered in this study since the optimization process is restricted to an analysis of how to schedule the proposed system optimally.


## 3.2.1. Power Balance Constraint

The power balance equation of the system is valid when the load demand is exactly satisfied by the sum of renewable power, battery, and grid at each sampling time (t). This can be expressed as follows:
(19)PRESt±Pbatt±Pgridt=PLt.


## 3.2.2. Constraints

The sum of power for satisfying the load, charging into the battery, and exporting to the utility grid should not exceed the total of renewable power output generated. This can be formulated as follows:(20)PRES‐>batt+PRES‐>Lt+PRES−>gridt≤PRESt.Equation (21) prohibits the import and export of grid power simultaneously. This can be formulated mathematically as follows:
(21)Pgrid−importt×Pgrid‐>exportt=0,(22)Pgrid−>batt+Pgrid−>Lt×PRES−>gridt+Pbat−>gridt=0.Furthermore, charging and discharging the battery at the same time should be inhibited. This constraint can be rewritten as follows:(23)PCht×PDist=0,PRES−>batt+Pgrid−>batt×Pbat−>Lt+Pbat−>gridt=0.


## 3.2.3. Battery Boundaries

The SoC limits are expressed as follows:(24)SoCmin≤SoCt=SoC0+Δt×ηChEnom×PRES−>batt+Pgrid−>batt−ΔtEnomηDis×Pbat−>Lt+Pbat−>gridt≤SoCmax.


## 3.2.4. Grid Power Limits

The limit of the grid power exchanged is subjected to the following constraints:(25)0≤Pgrid−importt≤Pgridmax,0≤Pgrid−exportt≤Pgridmax,where Pgridmax is the maximum grid power to feed into the utility grid.Besides, the installation cost of RES is not considered in this study since the optimization process is restricted to an analysis of how to schedule the proposed system optimally.


## 3.3. Proposed Energy Management Strategy

The proposed EMS is aimed at the one hand maximizing self-consumption of the PV-WT-battery system and the other hand applying the ToU strategy. Figures3 and 4 represent the flow chart of the two strategies to describe the procedure of scheduling the power of the HGT system.Figure 3
Flow chart of EMS: maximize self-consumption.Figure 4
Flow chart of EMS: ToU strategy.


## 3.4. Calculation of Optimization Problem

In this paper, different methods of optimization will be applied to validate the appropriate one. The algorithms are deterministic and metaheuristic which are used to solve linear and nonlinear problems. The multiobjective function of this research work is linear and subject to nonlinear constraints. Thus, the algorithms used in the MATLAB Optimization Toolbox are “Fmincon,” “Patternsearch:(PS),” and “GA.”The syntax of the three algorithms is formulated as follows [32]:
(26)MinxMaxxFx,subjecttocx≤0,ceqx=0,Ax≤b,Aeqx=beq,lb≤x≤ub,where Fx presents the objective function; cx and ceqx are the linear and nonlinear functions; A and b define the coefficients of inequality constraints; Aeq and beq denote the coefficient of equality constraints.


### 3.4.1. Fmincon Optimization Solver

As “Fmincon” solver employs the Hessian as the optional input, many “Fmincon” algorithms manipulate this type of input such as interior point, active set. In this work, the algorithm selected for the solver “Fmincon” is the interior point due to its faster convergence and the capacity to solve large-scale kind of optimization problems [33].The flow chart in Figure5 represents the main steps of the algorithm.Figure 5
Flow chart of the Fmincon algorithm.


### 3.4.2. Genetic Algorithm

GA involves three main rules to develop the next generation from the current population [34]. Figure 6 describe the flow chart of the method.
(i)
Selection rules: select the parents and imply their genes to the next generation(ii)
Crossover rules: integrate two genetic information from the parents to create new children(iii)
Mutation rules: practice random variations on individual parents to arrange childrenFigure 6
Flow chart of the GA algorithm.


### 3.4.3. Pattern Search Optimization Solver

The “Pattern search” algorithm is an efficient and direct search method. It continues to vary the search direction and increases/decreases frequently the increment until the end condition is attained or the objective function is satisfied [35]. The procedure of the algorithm is presented in Figure 7.Figure 7
Flow chart of the Pattern search algorithm.


## 3.4.1. Fmincon Optimization Solver

As “Fmincon” solver employs the Hessian as the optional input, many “Fmincon” algorithms manipulate this type of input such as interior point, active set. In this work, the algorithm selected for the solver “Fmincon” is the interior point due to its faster convergence and the capacity to solve large-scale kind of optimization problems [33].The flow chart in Figure5 represents the main steps of the algorithm.Figure 5
Flow chart of the Fmincon algorithm.


## 3.4.2. Genetic Algorithm

GA involves three main rules to develop the next generation from the current population [34]. Figure 6 describe the flow chart of the method.
(i)
Selection rules: select the parents and imply their genes to the next generation(ii)
Crossover rules: integrate two genetic information from the parents to create new children(iii)
Mutation rules: practice random variations on individual parents to arrange childrenFigure 6
Flow chart of the GA algorithm.


## 3.4.3. Pattern Search Optimization Solver

The “Pattern search” algorithm is an efficient and direct search method. It continues to vary the search direction and increases/decreases frequently the increment until the end condition is attained or the objective function is satisfied [35]. The procedure of the algorithm is presented in Figure 7.Figure 7
Flow chart of the Pattern search algorithm.


## 4. Simulation Results and Discussion

The case study location is Tangier city in Morocco. The region has quite favorable solar and wind resource patterns. The data and parameters used in this study are listed in Table2. The simulation is performed for a time horizon of 24 h and a sampling time of 1 h.Table 2
Parameters of the proposed hybrid system.
ParametersValuesUnitsMax PV power4kWEfficiency;ηPV18%Efficiency;ηWT95%Max WT power5kWSoCmin20%SoCmax90%SoC080%Capacity of battery40kWhCost of battery157.09$/kWhNcycle6000CDeg10-9The algorithms are executed on a computer with Intel Core i7 processor with 8 GB of RAM using MATLAB (R2015a). The daily profile of load demand and the hourly RE for the selected day are shown in Figures8(a) and 8(b).Figure 8
(a) PV and WT generation profile for 24 h; (b) the power demand of the household for 24 h.
(a)(b)


### 4.1. Simulation Analysis

The study is focused on the daily operational behavior of the hybrid system. Then, a comparison with the cost function without taking into consideration the daily operation cost of the battery is performed. The optimization problem is solved in MATLAB environment using the FMINCON algorithm. The load demand profile as shown in Figure8(b) reaches a peak of 32 kWh during the peak price period, and the monthly energy consumption exceeds 500 kWh. Therefore, as mentioned previously, the ToU tariff is applied instead of the strep-rate tariff.From Figure9(a), it can be noticed that the battery is charged from RES power during the day and from utility especially during the off-peak price period (Figure 9(b)). These are pointed out when the SOC increases in Figure 10(d). An important power is provided from battery to meet the household during the high demand (Figure 9(c)).Figure 9
(a) Produced power from RES to charge the battery; (b) imported power from the utility grid to the battery; (c, d) discharged power from battery system to the load and grid, respectively.
(a)(b)(c)(d)Figure 10
(a) Imported power from the grid to supply the load; (b) generated power from RES to the load; (c, d) RE power injected into the grid and SoC of the battery, respectively.
(a)(b)(c)(d)The householder’s demand is exclusively supplied by the PV and WT power in conjunction with the battery power in the peak demand and during 22 h and 5 h when the RE is minimal. Besides, Figure10(a) illustrates that the grid does not provide any power to the load during the peak pricing time interval and a very small amount of power is generated during off-peak hours. However, as shown in Figure 10(b), there is a sufficient power generated from RES to fill in the deficit during the day. Figure 10(c) reveals that there is significant income generated from the excess energy sold to the grid during the day. A poor surplus of energy storage is also exported to the utility grid, notably over the peak price period (Figure 9(d); this can explain the SOC’s decrease (Figure 10(d)).In Figures11 and 12, P1 defines the power obtained by the proposed method and P2 is the power of the baseline method without considering the daily operation cost of the BESS.Figure 11
(a) Produced power from RES to charge the battery; (b) imported power from the utility grid to the battery; (c, d) discharged power from battery system to the load and grid, respectively.
(a)(b)(c)(d)Figure 12
(a) Imported power from the grid to supply the load; (b) generated power from RES to the load; (c, d) RE power injected into the grid and SoC of the battery, respectively.
(a)(b)(c)(d)Figures11(a)–11(c) illustrate that the baseline method uses the grid as the main supplier, then the renewable power combined with the ESS, on contrary to the proposed method (P1), where any power is purchased from the main grid. Consequently, the energy not used by the load from the battery is fed into the grid as shown in Figure 11(d). However, the PV and WT systems generate less income compared to the proposed method (Figure 12(c)). These can explain the deep decrease of the SOC in the baseline method as shown in Figure 12(d).


### 4.2. Economic and Environmental Analysis

The baseline cost is considered the bill that the consumer should pay without optimization, whereas the optimal cost is the grid energy cost after applying the optimal control. The bill refers to the grid energy imported to supply the load and battery storage system. The income is the surplus of PV, WT, and battery energy sold to the utility grid.Equation (27) represents the calculation of the cost saving:
(27)Costsaving%=baselinecost−optimalcostbaselinecost×100.Table3 shows the cost savings per day of the case study, and the results reveal that the optimal control presents a large benefit with the proposed model. The maximum cost saving was achieved with 91.82%, and a reduction of the bill with 5.75 $/day compared to the baseline method.Table 3
Daily optimal cost and saving comparison.
MethodsBaseline cost ($/day)Optimal cost ($/day)Income ($/day)Cost savings (%)Baseline method70.448.86.7987.49Proposed method70.445.755.1691.82


### 4.3. Technical Optimization Indicator and Impact of the Battery

A technical criterion, such as the self-consumption ratio of RE (SCRRE) to assess the energy supply performance and the load cover ratio (LCR) for demand evaluation, is calculated as shown in Equations (28) and (29).
(28)SCRRE=ERES−>L+ERES−>batERES,where ERES−>L is the total daily electricity from PV and WT system to meet the household (kWh). ERES−>bat is the total daily PV and wind electricity to charge the battery system (kWh). ERES is the daily power production of PV and wind turbines (kWh).The daily average LCR is formulated as the ratio of the generated electricity of renewable systems to the total daily household as follows:(29)LCR=ERES−>L+Ebat−>LEL,where Ebat−>L represents the electricity discharged from the battery to the load (kWh). ELoaddenotes the total daily electrical demand of the household (kWh).The effect of the battery capacity on the technical indicators comprising the LCR and the SCRRE is presented in Figure13. It can be noticed that LCR increases when the battery capacity increases because the amplitude of energy from renewable sources and battery to supply the load rises. On the other hand, the SCRRE decreases with the increased capacity of the battery where more energy will be needed to charge the battery system from RES and utility grid, as well as the increasing of the replacement and investment costs. Table 4 illustrates that the proposed strategy presents the maximum ratios, which means the increase of the self-consumption performance of the system.Figure 13
Impact of battery capacity on the SCREE and LCR.Table 4
Technical indicator comparison.
MethodsSCREELCRBaseline method0.350.42Proposed method0.550.65


### 4.4. Environmental Aspect

From an environmental prospect, Table5 shows that the proposed model presents the best results with the lowest total GHG emissions and the maximum net savings. The reason for the notable increase is when the purpose is to increase the reliance on RES instead of purchasing energy from the utility grid, as well as considering the degradation of the battery will be the favorable economical and environmental solution.Table 5
GHG emissions and net saving comparison.
MethodsBase GHG emissions (kgCO2-eq)GHG emissions system (kgCO2-eq)Net savings (kgCO2-eq)Baseline method318.878939.0900279.7889Proposed method318.878920.1071298.7718


### 4.5. Economic and Environmental Analysis

In this part, a comparison with other strategies is performed to examine the feasibility of the proposed method. These strategies are presented for grid-connected hybrid system and described in the following points:(i)
The first strategy [36] presents an EMS where the cost function does not take into consideration the cost operation of the battery and degradation. The excess power sold to the UG is used only from the battery and not from RES(ii)
The second strategy [37] proposes also a cost function without taking into consideration the operating cost of the battery and degradation. In this case, the exchange power between grid and battery is not applied(iii)
The cost function of the third strategy [7, 38] involves the excess power from battery and RES and the daily operating cost of ESS without exercising the effect of battery degradationFigures14 and 15 show the power flow imported with the utility grid of the different strategies. The system in the three strategies purchased significant energy from the UG to supply the load in contrast to the proposed strategy (Figures 11 and 12). The grid power used from the battery in the strategies compared with that in the proposed strategy is very low. This condition leads to charge more the battery from RES instead of supplying the load.Figure 14
(a, b) Import of grid power in strategy (1); c, d: import of grid power in strategy (2).
(a)(b)(c)(d)Figure 15
Import and export of grid power in strategy (3).Table6 reveals that the developed strategy achieves the maximum cost savings of 5.75$/day and the optimal cost of 91.82% compared to other methods.Table 6
Optimal cost and cost saving comparison.
MethodsBaseline cost ($/day)Optimal cost ($/day)Cost savings (%)Proposed strategy70.445.7591.82Strategy (1) in [36]70.4411.7883.28Strategy (2) in [37]70.4427.2361.34Strategy (3) in [7]70.4417.0675.77


### 4.6. Stochastic and Deterministic Algorithm Analysis

To achieve the best results of the proposed strategy, a comparison between different algorithms such as FMINCON, PS, and GA will be performed.Figures16 and 17 compare the daily economic benefits of the three algorithms to validate the effective approach. It can be noticed that the “FMINCON” algorithm presents the best results on the bill after optimization and sales, respectively. Therefore, a significant percentage saving of cost can be achieved with 91.82%. Besides, a comparison of simulation time is performed to prove the selection of the algorithm. Table 7 exhibits that the execution of the proposed strategy under the “FMINCON” algorithm has a higher computing speed.Figure 16
Daily optimal cost and sales of the three methods.Figure 17
Cost saving of the three methods.Table 7
Time simulation.
AlgorithmFMINCONPSGATime0.189473 seconds2.099819 seconds0.239708 seconds


### 4.7. Comparative Analysis of Hybrid HGAFMINCON Optimization Method

Recently, hybridization of the algorithms becomes an effective method for different problems. In general, the steps of the hybridization of FMINCON and GA are presented in Figure18 as follows:Figure 18
Flowchart of hybrid algorithm.The optimization by FMINCON and GA algorithms applied to the hybrid system gives a good result and management as shown in the figures below.Comparing the results in Figures19(a) and 19(b) and Figures 20(a) and 20(b), it can be shown specially from 5 h to 15 h that hybrid algorithm uses the battery optimally by giving the priority to supply the load demand then sell the excess energy to the UG.Figure 19
(a, b) Discharged power from the battery to the grid and load by the hybrid algorithm, respectively.
(a)(b)Figure 20
(a, b) Discharged power from the battery to the grid and load by FMINCON, respectively.
(a)(b)In Figures21(a) and 21(b) and 22(a) and 22(b), the power purchased from the grid to charge the battery and meet the load demand is more minimized in the hybrid algorithm. Moreover, there is no power imported from UG during peak price period (17 h, 22 h) compared to the FMINCON algorithm.Figure 21
(a, b) Discharged power from the grid to the battery and load by the hybrid algorithm, respectively.
(a)(b)Figure 22
(a, b) Discharged power from grid to the battery and load by the FMINCON algorithm, respectively.
(a)(b)In Figures23(b) and 24(b), there is an important income from selling RE to UG in the hybrid algorithm compared to the FMINCON. Also, as shown from Figures 23(a) and 24(a), the profile of power to supply the load from RE follows the load demand profile.Figure 23
(a, b) Discharged power from RES to the load and grid by the hybrid algorithm, respectively.
(a)(b)Figure 24
(a, b) Discharged power from RES to the load and grid by the FMINCON algorithm, respectively.
(a)(b)As is evident from Table8, the minimum cost of the hybrid system is obtained from the HGAPSO algorithm as well as substantial income and cost savings.Table 8
Optimal cost and cost saving comparison.
AlgorithmsBaseline cost ($/day)Optimal cost ($/day)Incomes ($/day)Cost savings (%)HGAFMINCON70.4433.6148.9152.28FMINCON70.4440.5143.6742.48


## 4.1. Simulation Analysis

The study is focused on the daily operational behavior of the hybrid system. Then, a comparison with the cost function without taking into consideration the daily operation cost of the battery is performed. The optimization problem is solved in MATLAB environment using the FMINCON algorithm. The load demand profile as shown in Figure8(b) reaches a peak of 32 kWh during the peak price period, and the monthly energy consumption exceeds 500 kWh. Therefore, as mentioned previously, the ToU tariff is applied instead of the strep-rate tariff.From Figure9(a), it can be noticed that the battery is charged from RES power during the day and from utility especially during the off-peak price period (Figure 9(b)). These are pointed out when the SOC increases in Figure 10(d). An important power is provided from battery to meet the household during the high demand (Figure 9(c)).Figure 9
(a) Produced power from RES to charge the battery; (b) imported power from the utility grid to the battery; (c, d) discharged power from battery system to the load and grid, respectively.
(a)(b)(c)(d)Figure 10
(a) Imported power from the grid to supply the load; (b) generated power from RES to the load; (c, d) RE power injected into the grid and SoC of the battery, respectively.
(a)(b)(c)(d)The householder’s demand is exclusively supplied by the PV and WT power in conjunction with the battery power in the peak demand and during 22 h and 5 h when the RE is minimal. Besides, Figure10(a) illustrates that the grid does not provide any power to the load during the peak pricing time interval and a very small amount of power is generated during off-peak hours. However, as shown in Figure 10(b), there is a sufficient power generated from RES to fill in the deficit during the day. Figure 10(c) reveals that there is significant income generated from the excess energy sold to the grid during the day. A poor surplus of energy storage is also exported to the utility grid, notably over the peak price period (Figure 9(d); this can explain the SOC’s decrease (Figure 10(d)).In Figures11 and 12, P1 defines the power obtained by the proposed method and P2 is the power of the baseline method without considering the daily operation cost of the BESS.Figure 11
(a) Produced power from RES to charge the battery; (b) imported power from the utility grid to the battery; (c, d) discharged power from battery system to the load and grid, respectively.
(a)(b)(c)(d)Figure 12
(a) Imported power from the grid to supply the load; (b) generated power from RES to the load; (c, d) RE power injected into the grid and SoC of the battery, respectively.
(a)(b)(c)(d)Figures11(a)–11(c) illustrate that the baseline method uses the grid as the main supplier, then the renewable power combined with the ESS, on contrary to the proposed method (P1), where any power is purchased from the main grid. Consequently, the energy not used by the load from the battery is fed into the grid as shown in Figure 11(d). However, the PV and WT systems generate less income compared to the proposed method (Figure 12(c)). These can explain the deep decrease of the SOC in the baseline method as shown in Figure 12(d).


## 4.2. Economic and Environmental Analysis

The baseline cost is considered the bill that the consumer should pay without optimization, whereas the optimal cost is the grid energy cost after applying the optimal control. The bill refers to the grid energy imported to supply the load and battery storage system. The income is the surplus of PV, WT, and battery energy sold to the utility grid.Equation (27) represents the calculation of the cost saving:
(27)Costsaving%=baselinecost−optimalcostbaselinecost×100.Table3 shows the cost savings per day of the case study, and the results reveal that the optimal control presents a large benefit with the proposed model. The maximum cost saving was achieved with 91.82%, and a reduction of the bill with 5.75 $/day compared to the baseline method.Table 3
Daily optimal cost and saving comparison.
MethodsBaseline cost ($/day)Optimal cost ($/day)Income ($/day)Cost savings (%)Baseline method70.448.86.7987.49Proposed method70.445.755.1691.82


## 4.3. Technical Optimization Indicator and Impact of the Battery

A technical criterion, such as the self-consumption ratio of RE (SCRRE) to assess the energy supply performance and the load cover ratio (LCR) for demand evaluation, is calculated as shown in Equations (28) and (29).
(28)SCRRE=ERES−>L+ERES−>batERES,where ERES−>L is the total daily electricity from PV and WT system to meet the household (kWh). ERES−>bat is the total daily PV and wind electricity to charge the battery system (kWh). ERES is the daily power production of PV and wind turbines (kWh).The daily average LCR is formulated as the ratio of the generated electricity of renewable systems to the total daily household as follows:(29)LCR=ERES−>L+Ebat−>LEL,where Ebat−>L represents the electricity discharged from the battery to the load (kWh). ELoaddenotes the total daily electrical demand of the household (kWh).The effect of the battery capacity on the technical indicators comprising the LCR and the SCRRE is presented in Figure13. It can be noticed that LCR increases when the battery capacity increases because the amplitude of energy from renewable sources and battery to supply the load rises. On the other hand, the SCRRE decreases with the increased capacity of the battery where more energy will be needed to charge the battery system from RES and utility grid, as well as the increasing of the replacement and investment costs. Table 4 illustrates that the proposed strategy presents the maximum ratios, which means the increase of the self-consumption performance of the system.Figure 13
Impact of battery capacity on the SCREE and LCR.Table 4
Technical indicator comparison.
MethodsSCREELCRBaseline method0.350.42Proposed method0.550.65


## 4.4. Environmental Aspect

From an environmental prospect, Table5 shows that the proposed model presents the best results with the lowest total GHG emissions and the maximum net savings. The reason for the notable increase is when the purpose is to increase the reliance on RES instead of purchasing energy from the utility grid, as well as considering the degradation of the battery will be the favorable economical and environmental solution.Table 5
GHG emissions and net saving comparison.
MethodsBase GHG emissions (kgCO2-eq)GHG emissions system (kgCO2-eq)Net savings (kgCO2-eq)Baseline method318.878939.0900279.7889Proposed method318.878920.1071298.7718


## 4.5. Economic and Environmental Analysis

In this part, a comparison with other strategies is performed to examine the feasibility of the proposed method. These strategies are presented for grid-connected hybrid system and described in the following points:(i)
The first strategy [36] presents an EMS where the cost function does not take into consideration the cost operation of the battery and degradation. The excess power sold to the UG is used only from the battery and not from RES(ii)
The second strategy [37] proposes also a cost function without taking into consideration the operating cost of the battery and degradation. In this case, the exchange power between grid and battery is not applied(iii)
The cost function of the third strategy [7, 38] involves the excess power from battery and RES and the daily operating cost of ESS without exercising the effect of battery degradationFigures14 and 15 show the power flow imported with the utility grid of the different strategies. The system in the three strategies purchased significant energy from the UG to supply the load in contrast to the proposed strategy (Figures 11 and 12). The grid power used from the battery in the strategies compared with that in the proposed strategy is very low. This condition leads to charge more the battery from RES instead of supplying the load.Figure 14
(a, b) Import of grid power in strategy (1); c, d: import of grid power in strategy (2).
(a)(b)(c)(d)Figure 15
Import and export of grid power in strategy (3).Table6 reveals that the developed strategy achieves the maximum cost savings of 5.75$/day and the optimal cost of 91.82% compared to other methods.Table 6
Optimal cost and cost saving comparison.
MethodsBaseline cost ($/day)Optimal cost ($/day)Cost savings (%)Proposed strategy70.445.7591.82Strategy (1) in [36]70.4411.7883.28Strategy (2) in [37]70.4427.2361.34Strategy (3) in [7]70.4417.0675.77


## 4.6. Stochastic and Deterministic Algorithm Analysis

To achieve the best results of the proposed strategy, a comparison between different algorithms such as FMINCON, PS, and GA will be performed.Figures16 and 17 compare the daily economic benefits of the three algorithms to validate the effective approach. It can be noticed that the “FMINCON” algorithm presents the best results on the bill after optimization and sales, respectively. Therefore, a significant percentage saving of cost can be achieved with 91.82%. Besides, a comparison of simulation time is performed to prove the selection of the algorithm. Table 7 exhibits that the execution of the proposed strategy under the “FMINCON” algorithm has a higher computing speed.Figure 16
Daily optimal cost and sales of the three methods.Figure 17
Cost saving of the three methods.Table 7
Time simulation.
AlgorithmFMINCONPSGATime0.189473 seconds2.099819 seconds0.239708 seconds


## 4.7. Comparative Analysis of Hybrid HGAFMINCON Optimization Method

Recently, hybridization of the algorithms becomes an effective method for different problems. In general, the steps of the hybridization of FMINCON and GA are presented in Figure18 as follows:Figure 18
Flowchart of hybrid algorithm.The optimization by FMINCON and GA algorithms applied to the hybrid system gives a good result and management as shown in the figures below.Comparing the results in Figures19(a) and 19(b) and Figures 20(a) and 20(b), it can be shown specially from 5 h to 15 h that hybrid algorithm uses the battery optimally by giving the priority to supply the load demand then sell the excess energy to the UG.Figure 19
(a, b) Discharged power from the battery to the grid and load by the hybrid algorithm, respectively.
(a)(b)Figure 20
(a, b) Discharged power from the battery to the grid and load by FMINCON, respectively.
(a)(b)In Figures21(a) and 21(b) and 22(a) and 22(b), the power purchased from the grid to charge the battery and meet the load demand is more minimized in the hybrid algorithm. Moreover, there is no power imported from UG during peak price period (17 h, 22 h) compared to the FMINCON algorithm.Figure 21
(a, b) Discharged power from the grid to the battery and load by the hybrid algorithm, respectively.
(a)(b)Figure 22
(a, b) Discharged power from grid to the battery and load by the FMINCON algorithm, respectively.
(a)(b)In Figures23(b) and 24(b), there is an important income from selling RE to UG in the hybrid algorithm compared to the FMINCON. Also, as shown from Figures 23(a) and 24(a), the profile of power to supply the load from RE follows the load demand profile.Figure 23
(a, b) Discharged power from RES to the load and grid by the hybrid algorithm, respectively.
(a)(b)Figure 24
(a, b) Discharged power from RES to the load and grid by the FMINCON algorithm, respectively.
(a)(b)As is evident from Table8, the minimum cost of the hybrid system is obtained from the HGAPSO algorithm as well as substantial income and cost savings.Table 8
Optimal cost and cost saving comparison.
AlgorithmsBaseline cost ($/day)Optimal cost ($/day)Incomes ($/day)Cost savings (%)HGAFMINCON70.4433.6148.9152.28FMINCON70.4440.5143.6742.48


## 5. Conclusion

This paper presents an energy management strategy that minimizes the daily operation cost of the residential grid-tied PV-WT-battery system. Execution of the proposed system under the increasing self-consumption and ToU strategies is performed to investigate the hybrid system operational performance and prove the energy balance and energy management strategy. A comparison is conducted with a baseline method where the strategy is applied without considering the operation cost and degradation of the BESS. An analysis of technical indicators and the impact of batteries and an environmental study are performed. The following findings can be concluded based on the simulation results:(i)
Results show that the proposed EMS succeeded in reducing the daily operating cost of the grid-connected system and maximizing the self-consumption of RE sources(ii)
Comparison between the proposed and other strategies showed that the developed strategy has successfully proved an important cost reduction of 70.44 $/day to 5.75 $/day, maximum cost savings (99.81%), and significant cost-benefit(iii)
The proposed strategy can improve a great self-consumption (SCREE) and load cover (LCR) ratio compared to the baseline method. The comparison was performed based on analyzing the impact of variation of the battery capacity(iv)
From an environmental perspective, it can be deduced that the proposed model is the best, with less GHG emissions 20.1071 (kgCO2-eq).(v)
A comparison between deterministic and stochastic algorithms was made to demonstrate that the FMINCON algorithm can give accurate results and low processing time(vi)
A HGAFMINCON algorithm is designed and gave the better results than the FMINCON and GA algorithm in terms of reduced cost and earnings



---

*Source: 5591456-2021-09-25.xml*