Optimal Controllers and Conﬁgurations of 100% PV and Energy Storage Systems for a Microgrid: The Case Study of a Small Town in Jordan

: Renewable energy systems such as Photovoltaic (PV) have become one of the best options for supplying electricity at the distribution network level. This is mainly because the PV system is sustainable, environmentally friendly, and is a low-cost form of energy. The intermittent and unpredictable nature of renewable energy sources which leads to a mismatch between the power generation and load demand is the challenge to having 100% renewable power networks. Therefore, an Energy Storage System (ESS) can be a signiﬁcant solution to overcome these challenges and improve the reliability of the network. In Jordan, the energy sector is facing a number of challenges due to the high energy-import dependency, high energy costs, and the inadequate electriﬁcation of rural areas. In this paper, the optimal integration of PV and ESS systems is designed and developed for a distribution network in Jordan. The economic and energy performance of the network and a proposed power network under different optimization algorithms and power network operation scenarios are investigated. Metaheuristic optimization algorithms, namely: Golden Ratio Optimization Method (GROM) and Particle Swarm Optimization (PSO) algorithms, are employed to ﬁnd the optimal conﬁgurations and integrated 100% PV and ESS for the microgrid.


Background
Electrical demand worldwide is increasing due to the increase in population, electrification of vehicles, economic expansion, and customer energy behaviour [1]. In Jordan, the electricity demand is growing at a rate of 3% every year [2]. Many developing and developed countries such as Jordan have limited traditional energy resources (fossil fuels) which contributes to economic challenges due to high and volatile operating costs [1][2][3]. The electrical demand trend in global consumerism requires improvements in power generation methods. In addition, there is a need to meet the growth in demand and develop a more cost-efficient energy system by motivating the consideration of new generation methods, in particular, distribution generation, renewable energy, and energy storage technologies [4]. The concerns of energy costs, climate change, and fossil fuel depletion have led many countries to move towards low-polluting Renewable Energy Sources (RES) such as Photovoltaic (PV), which offer cost-effective and environmental friendliness options [4,5]. algorithm called the Golden Ratio Optimization Method (GROM) with the motivation of achieving the global solution within an efficient time for complex problems. The research studies in [24] employed the GROM to solve the power flow problem for a power network with renewable energy sources. Therefore, the GROM algorithm could beneficially solve stochastic energy optimization problems and it will have a significant impact on improving the energy efficiency performance.

Contributions
Designing an optimal integration of PV and ESS systems for microgrids and investigating the economic and energy performance under different optimization algorithms is the objective of this article. To the best of the authors' knowledge, no studies have provided a comparison of optimization operation algorithms for microgrids based on 100% PV and ESS. In addition, metaheuristic optimization algorithms, namely GROM and PSO algorithms, are employed to find the optimal configurations and integrated 100% PV and ESS for the microgrid. The main objectives and contributions of this article are:

•
Providing one of the first extensive investigations into the load demand and PV power generations of rural areas in Jordan; • Designing an optimal 100% PV and ESS system for a microgrid and rural areas in Jordan; • Employing new metaheuristic optimization algorithms (GROM and PSO) to improve the economic and energy performance of 100% PV and ESS systems for the microgrid.

Outline of Paper
The following sections are organized as follows: The description of the 100% PV and ESS systems and methodology are introduced in Section 2. In Section 3, the proposed model results are discussed. Finally, the summary and conclusion of this paper are introduced in Section 4.

The Description of the 100% PV and ESS Systems and Methodology
This section aims to introduce the 100% PV and ESS systems for microgrid topology and the optimal controllers for the ESS. Firstly, the schematic energy flow diagram, as shown in Figure 1, shows the flow of energy from the main energy source (the PV system G(t)) and ESS, E(t), to the demand side of the gird, L(t). The energy flow diagram presents that the PV system, G(t), supplies all the required electrical energy consumption, L(t), and charge to the storage device (E(t) with the red arrow, in Figure 1). However, in the case of discharging the ESS, (E(t) with the green arrow, Figure 1), the PV system, G(t), will supply the energy of the grid demand, L(t), minus the discharged energy from the ESS. The energy flow can be described as follows [1][2][3]: In addition, this work aims to develop and present an optimal energy controller for the ESS to improve the power network performance compared to the common energy controller, the set-point algorithm [25]. The optimal energy controller aims to find the optimal ESS operation condition (charging and discharging). Figure 2 introduces the proposed energy control loop for the microgrid system. The actual electrical demand and the ESS measurements are fed to the energy controller to generate a control decision to optimally charge or discharge the energy storage. The main components of the proposed system in this paper, as presented in Figure 2, will be discussed in the following subsections. In addition, this work aims to develop and present an optimal energy contro the ESS to improve the power network performance compared to the common controller, the set-point algorithm [25]. The optimal energy controller aims to find timal ESS operation condition (charging and discharging). Figure 2 introduces th posed energy control loop for the microgrid system. The actual electrical demand a ESS measurements are fed to the energy controller to generate a control decision t mally charge or discharge the energy storage. The main components of the propos tem in this paper, as presented in Figure 2, will be discussed in the following subse

Area and Load Demand Analysis
This work focuses on the development of a 100% renewable energy resources for low voltage networks (microgrid). In general, the electrical demands at the low v level of the network have higher volatile and stochastic behaviour compared to th and medium voltage levels [2,6]. This increases the complexity of designing and de ing 100% renewable energy resources with ESS. In this paper, electrical demand d a town in Jordan were collected from the Electrical Distribution Co (EDCO) over  In addition, this work aims to develop and present an optimal energy controller for the ESS to improve the power network performance compared to the common energy controller, the set-point algorithm [25]. The optimal energy controller aims to find the optimal ESS operation condition (charging and discharging). Figure 2 introduces the proposed energy control loop for the microgrid system. The actual electrical demand and the ESS measurements are fed to the energy controller to generate a control decision to optimally charge or discharge the energy storage. The main components of the proposed system in this paper, as presented in Figure 2, will be discussed in the following subsections.

Area and Load Demand Analysis
This work focuses on the development of a 100% renewable energy resources system for low voltage networks (microgrid). In general, the electrical demands at the low voltage level of the network have higher volatile and stochastic behaviour compared to the high and medium voltage levels [2,6]. This increases the complexity of designing and developing 100% renewable energy resources with ESS. In this paper, electrical demand data for a town in Jordan were collected from the Electrical Distribution Co (EDCO) over a year from 1 January 2020 to 31 December 2020 with a 15 min resolution. The smart meter data were collected at Al-Mashari'e town in Irbid. The location of the town is in the northwest of Jordan, Northern Shuna, Al-Mashari'e in Irbid within the geographical coordinates 35°44′88″ N, 35°59′51″ E, as shown in Figure 3. Al-Mashari'e town has a population of over 27,000 according to the Jordanian Department of Statistics. To develop an optimal PV

Area and Load Demand Analysis
This work focuses on the development of a 100% renewable energy resources system for low voltage networks (microgrid). In general, the electrical demands at the low voltage level of the network have higher volatile and stochastic behaviour compared to the high and medium voltage levels [2,6]. This increases the complexity of designing and developing 100% renewable energy resources with ESS. In this paper, electrical demand data for a town in Jordan were collected from the Electrical Distribution Co (EDCO) over a year from 1 January 2020 to 31 December 2020 with a 15 min resolution. The smart meter data were collected at Al-Mashari'e town in Irbid. The location of the town is in the northwest of Jordan, Northern Shuna, Al-Mashari'e in Irbid within the geographical coordinates 35 • 44 88 N, 35 • 59 51 E, as shown in Figure 3. Al-Mashari'e town has a population of over 27,000 according to the Jordanian Department of Statistics. To develop an optimal PV system and ESS for a network, it is important to understand the behaviour of the demand and to study the electrical demand trends. The following subsection aims to provide an overview of the demand and an investigation of the town demand trend. system and ESS for a network, it is important to understand the behaviour of the and to study the electrical demand trends. The following subsection aims to pro overview of the demand and an investigation of the town demand trend.

Demand Trend and Analysis
The section aims to present and analyse the profile of electricity demand at Mashari'e town in Jordan. The electrical energy usage is used to provide a detaile ination of demand based on the following criteria:  Overview of the town demand patterns based on the hourly, daily, and mont consumption;  The seasonal demand (winter and summer).
Firstly, the profile of hourly electricity demand in the Al-Mashari'e town in shown in Figure 4. In 2020, the maximum hourly power recorded was 420 kW September. The hourly power consumption registered the minimum power value the spring season (March to May) with power less than 100 kW. As seen in Figu hourly demand was examined by plotting the average demand based on the sort per day. The hourly demand distribution shows that the hourly demand data i two main peak patterns at 2:00 and 17:00, as shown in Figure 5.

Demand Trend and Analysis
The section aims to present and analyse the profile of electricity demand at the Al-Mashari'e town in Jordan. The electrical energy usage is used to provide a detailed examination of demand based on the following criteria:

•
Overview of the town demand patterns based on the hourly, daily, and monthly load consumption; • The seasonal demand (winter and summer).
Firstly, the profile of hourly electricity demand in the Al-Mashari'e town in 2020 is shown in Figure 4. In 2020, the maximum hourly power recorded was 420 kW during September. The hourly power consumption registered the minimum power values within the spring season (March to May) with power less than 100 kW. As seen in Figure 5, the hourly demand was examined by plotting the average demand based on the sort of hour per day. The hourly demand distribution shows that the hourly demand data included two main peak patterns at 2:00 and 17:00, as shown in Figure 5. and to study the electrical demand trends. The following subsection aims to provide an overview of the demand and an investigation of the town demand trend.

Demand Trend and Analysis
The section aims to present and analyse the profile of electricity demand at the Al-Mashari'e town in Jordan. The electrical energy usage is used to provide a detailed examination of demand based on the following criteria:  Overview of the town demand patterns based on the hourly, daily, and monthly load consumption;  The seasonal demand (winter and summer).
Firstly, the profile of hourly electricity demand in the Al-Mashari'e town in 2020 is shown in Figure 4. In 2020, the maximum hourly power recorded was 420 kW during September. The hourly power consumption registered the minimum power values within the spring season (March to May) with power less than 100 kW. As seen in Figure 5, the hourly demand was examined by plotting the average demand based on the sort of hour per day. The hourly demand distribution shows that the hourly demand data included two main peak patterns at 2:00 and 17:00, as shown in Figure 5.    In order to design the optimal size of PV and ESS systems, the peak and valley demand values need to be taken into account. Therefore, Figure 6 introduces the average hourly minimum and maximum power consumption recorded for all days of the year. The average hourly maximum power consumption showed a variation based on the time of the day. The average maximum power consumption was 417 kW at 4 o'clock and power consumption registered at over 400 kW at the time between 3 and 5 o'clock. The minimum power consumption showed a constant behaviour with power values between 50 kW and 70 kW. To examine the peak power values over a year, Figure 7 presents the maximum peak values that occurred over a year on a specific day. The maximum power consumption occurred on Thursday 5th of September. Figure 7 introduces a comparison between the maximum, minimum, and average hourly power consumption over a day during the year. This introduces the highly volatile behaviour of the power consumption for the same day over the year. For example, the hourly power consumption at 17:00 was between 81 and 367 kW as the minimum and maximum power consumption, respectively. In order to design the optimal size of PV and ESS systems, the peak and valley demand values need to be taken into account. Therefore, Figure 6 introduces the average hourly minimum and maximum power consumption recorded for all days of the year. The average hourly maximum power consumption showed a variation based on the time of the day. The average maximum power consumption was 417 kW at 4 o'clock and power consumption registered at over 400 kW at the time between 3 and 5 o'clock. The minimum power consumption showed a constant behaviour with power values between 50 kW and 70 kW. To examine the peak power values over a year, Figure 7 presents the maximum peak values that occurred over a year on a specific day. The maximum power consumption occurred on Thursday 5th of September. Figure 7 introduces a comparison between the maximum, minimum, and average hourly power consumption over a day during the year. This introduces the highly volatile behaviour of the power consumption for the same day over the year. For example, the hourly power consumption at 17:00 was between 81 and 367 kW as the minimum and maximum power consumption, respectively. In order to design the optimal size of PV and ESS systems, the peak and valley demand values need to be taken into account. Therefore, Figure 6 introduces the average hourly minimum and maximum power consumption recorded for all days of the year. The average hourly maximum power consumption showed a variation based on the time of the day. The average maximum power consumption was 417 kW at 4 o'clock and power consumption registered at over 400 kW at the time between 3 and 5 o'clock. The minimum power consumption showed a constant behaviour with power values between 50 kW and 70 kW. To examine the peak power values over a year, Figure 7 presents the maximum peak values that occurred over a year on a specific day. The maximum power consumption occurred on Thursday 5th of September. Figure 7 introduces a comparison between the maximum, minimum, and average hourly power consumption over a day during the year. This introduces the highly volatile behaviour of the power consumption for the same day over the year. For example, the hourly power consumption at 17:00 was between 81 and 367 kW as the minimum and maximum power consumption, respectively.  To develop an optimal PV system, it is important to examine the behaviour of th daily demand. Figure 8 aims to provide an overview of the daily power consumption (cu mulative over the day) and the investigation of the town demand trend. The minimum and maximum daily power consumption over each month during a year are presented i Figure 8. The minimum and maximum power values have the same seasonal trend ove the year, as shown in Figure 8. The maximum daily power value occurred during Septem ber was 7284 kW and the minimum daily power consumption occurred during April wa 1664 kW.

Seasonal Analysis
The previous analysis presented a seasonal trend for the power consumption; there fore, the load demand profiles are examined based on the season cycles over a year. Figure 9 shows the monthly load demand over the year. The monthly load demand had an increasing trend during the period (July, August, and September). This is mainly re lated to the switching on of the cooling systems as the temperature went to around 40 In addition, the average hourly power consumption over each month is presented in Fig  ure 10  To develop an optimal PV system, it is important to examine the behaviour of the daily demand. Figure 8 aims to provide an overview of the daily power consumption (cumulative over the day) and the investigation of the town demand trend. The minimum and maximum daily power consumption over each month during a year are presented in Figure 8. The minimum and maximum power values have the same seasonal trend over the year, as shown in Figure 8. The maximum daily power value occurred during September was 7284 kW and the minimum daily power consumption occurred during April was 1664 kW. To develop an optimal PV system, it is important to examine the behaviour of the daily demand. Figure 8 aims to provide an overview of the daily power consumption (cumulative over the day) and the investigation of the town demand trend. The minimum and maximum daily power consumption over each month during a year are presented in Figure 8. The minimum and maximum power values have the same seasonal trend over the year, as shown in Figure 8. The maximum daily power value occurred during September was 7284 kW and the minimum daily power consumption occurred during April was 1664 kW.

Seasonal Analysis
The previous analysis presented a seasonal trend for the power consumption; therefore, the load demand profiles are examined based on the season cycles over a year. Figure 9 shows the monthly load demand over the year. The monthly load demand had an increasing trend during the period (July, August, and September). This is mainly related to the switching on of the cooling systems as the temperature went to around 40 . In addition, the average hourly power consumption over each month is presented in

Seasonal Analysis
The previous analysis presented a seasonal trend for the power consumption; therefore, the load demand profiles are examined based on the season cycles over a year. Figure 9 shows the monthly load demand over the year. The monthly load demand had an increasing trend during the period (July, August, and September). This is mainly related to the switching on of the cooling systems as the temperature went to around 40 • C. In addition, the average hourly power consumption over each month is presented in Figure 10. The hourly power consumption curves during the summer period were significantly increased compared to winter and other months of the year. However, the hourly power trend for each season (summer and winter) was almost consistent, as shown in Figures 10 and 11. In gen- and winter, Figure 11b) trend in the power profile data due to the weather effects on the demand behaviour.    and winter, Figure 11b) trend in the power profile data due to the weather effects on the demand behaviour.

Sizing of the PV System
In general, the size of the PV system depends on different terms such as the scale of the project (small, medium, or large scale) and location. The impact of location on the PV system is related to the ambient conditions (temperature and solar radiation) which affect the efficiency of the PV system (energy production) [2,5]. In this section, the annual and monthly averaged values of global horizontal irradiance (GHI), direct normal irradiation (DNI), diffuse horizontal irradiation (DIF), and global tilted irradiation at an optimum angle (GTI) were downloaded from the solar energy database provided (SolarGIS website) [26]. The annual average GHI is 5.485 kWh/m 2 per day which introduced this location as a significant location for installing PV systems with a high level of solar radiation, as shown in Table 1 and Figure 12. In addition, from April to September, the irradiance level is more than 6 kWh/m 2 per day. The solar radiation in summer is significantly higher and reaches above 8 kWh/m 2 per day in June and July, whereas in winter it still records a sufficient level of radiation with an amount of around 3 kWh/m 2 per day in December and January.

Sizing of the PV System
In general, the size of the PV system depends on different terms such as the scale of the project (small, medium, or large scale) and location. The impact of location on the PV system is related to the ambient conditions (temperature and solar radiation) which affect the efficiency of the PV system (energy production) [2,5]. In this section, the annual and monthly averaged values of global horizontal irradiance (GHI), direct normal irradiation (DNI), diffuse horizontal irradiation (DIF), and global tilted irradiation at an optimum angle (GTI) were downloaded from the solar energy database provided (SolarGIS website) [26]. The annual average GHI is 5.485 kWh/m 2 per day which introduced this location as a significant location for installing PV systems with a high level of solar radiation, as shown in Table 1 and Figure 12. In addition, from April to September, the irradiance level is more than 6 kWh/m 2 per day. The solar radiation in summer is significantly higher and reaches above 8 kWh/m 2 per day in June and July, whereas in winter it still records a sufficient level of radiation with an amount of around 3 kWh/m 2 per day in December and January.  Global tilted irradiation at the optimal angle (GTI) 6.089 kWh/m 2 per day A power network based on a 100% RES system with high-reliability performance in microgrids was the main goal of this study. The size of the PV system considering the different load demand scenarios is presented in Table 2. Equation (2) was used to calculate the size of the PV systems, Z in kW [5]: where E is the average daily load energy (kWh/day), S is the average direct sunlight hours within the day, and Ƞ is the PV system efficiency. In this work, the Ƞ was considered to be 0.79 and S to be 5.485 kWh/hour-day. The data analysis in the previous section showed the stochastic behaviour of the load demand, as shown in Figure  9. Therefore, the size of the PV system was investigated in this work based on a different level of demand by using Equation (2), as follows:  Scenario 1: The monthly average load demand;  Scenario 2: 1.5 of the monthly average load demand to cover maximum days of demand as presented in the previous section;  Scenario 3: The average of the highest daily power consumption in the month over a year, as shown in Table 3.  A power network based on a 100% RES system with high-reliability performance in microgrids was the main goal of this study. The size of the PV system considering the different load demand scenarios is presented in Table 2. Equation (2) was used to calculate the size of the PV systems, Z PV in kW [5]: where E daily is the average daily load energy (kWh/day), S daily is the average direct sunlight hours within the day, and η pv is the PV system efficiency. In this work, the η pv was considered to be 0.79 and S daily to be 5.485 kWh/hour-day. The data analysis in the previous section showed the stochastic behaviour of the load demand, as shown in Figure 9. Therefore, the size of the PV system was investigated in this work based on a different level of demand by using Equation (2), as follows: • Scenario 1: The monthly average load demand; • Scenario 2: 1.5 of the monthly average load demand to cover maximum days of demand as presented in the previous section; • Scenario 3: The average of the highest daily power consumption in the month over a year, as shown in Table 3.  A computational model called photovoltaic yield simulation [27] was used to calculate the PV out generation (kWh) on monthly bases for the different PV system scenarios, as presented in Table 4. The results in Table 4 show that the three PV system scenarios provided the required electrical energy over the year as yearly power generation and load demand consumption. However, in terms of monthly load demand consumptions, the PV system (scenario 1) was not able to cover it 100% compared to scenarios 2 and 3. Table 4 presents the percentage of coverage for the total daily demand by the PV power generation over a year. For example, the total load demand in December was approximately 93 MWh which was not able to be achieved by the generation of the PV system (scenario 1) with 89 MWh. In terms of daily load demand consumptions, the PV system was able to cover the required load demand by 52.3%, 95.61%, and 80.72% for scenarios 1, 2, and 3, respectively. Therefore, there is significant potential for covering the required daily demand by developing an optimal energy management system including an ESS.

Sizing of ESS
ESS is introduced into the power network, as described in Equation (1), as a solution to guarantee to cover the load demand and match between PV power supply and demand.
In this article, the power network was developed based on an isolated network scenario; therefore, ESS (lithium-ion battery) was used for the intermittency of a 100% PV system. Figure 13 introduces a basic flow chart for the operation of the power network with ESS. To determine the size of the EES, techno-economic analysis needs to be performed, usually under different defined assumptions. Firstly, the background of the case study needs to be identified such as load profile scenarios, the PV generation size, and profiles and the sun irradiation profile. The required background has been presented and discussed in Sections 2.1 and 2.2. The load demand refers to Al-Mashari'e town in Irbid with a mean hourly power of 164 kW, while the peak power reached 420 Kw and the total energy demand over a year was 1417.5 MWh. The PV plant was investigated in the previous section with three scenarios to match PV power supply and demand. Scenario 2 with a peak power equal to 1363.02 kWp covered the town demand for 95.61% of the days in the year. The total energy production from the PV plant (scenario 2) was 2202.6 MWh. Furthermore, Table 5 presents the monthly energy consumption during the night period with an average of 72.9 MWh/monthly and 2.4 MWh/day. The maximum monthly demand during nights was during August with 115.2 MWh.
To determine the size of the EES, techno-economic analysis needs to be performed, usu under different defined assumptions. Firstly, the background of the case study need be identified such as load profile scenarios, the PV generation size, and profiles and sun irradiation profile. The required background has been presented and discusse Sections 2.1 and 2.2. The load demand refers to Al-Mashari'e town in Irbid with a m hourly power of 164 kW, while the peak power reached 420 Kw and the total energy mand over a year was 1417.5 MWh. The PV plant was investigated in the previous sec with three scenarios to match PV power supply and demand. Scenario 2 with a p power equal to 1363.02 kWp covered the town demand for 95.61% of the days in the y The total energy production from the PV plant (scenario 2) was 2202.6 MWh. Furtherm Table 5 presents the monthly energy consumption during the night period with an a age of 72.9 MWh/monthly and 2.4 MWh/day. The maximum monthly demand du nights was during August with 115.2 MWh.
With regard to the ESS (lithium-ion battery) specification and re-electrification formance [25,28], the inverter efficiency is set to 85% and the charge/discharge effici is 90%. Then, the minimum and maximum State of Charge (SoC) is set to be equal to and 100%, respectively [25,28]. In this work, the main task of the ESS was to help th system match the demand during the night and autonomy days (when the PV genera was less than the load demand), as shown in Figure 13. In addition, this control pro for the BESS is called the set-point control model.   With regard to the ESS (lithium-ion battery) specification and re-electrification performance [25,28], the inverter efficiency is set to 85% and the charge/discharge efficiency is 90%. Then, the minimum and maximum State of Charge (SoC) is set to be equal to 20% and 100%, respectively [25,28]. In this work, the main task of the ESS was to help the PV system match the demand during the night and autonomy days (when the PV generation was less than the load demand), as shown in Figure 13. In addition, this control process for the BESS is called the set-point control model.
Based on the previous analysis, Equation (3) is used to determine the size of the battery system [6,25]: where the BESS is the size of the battery storage system in kWh, D atu is the days of Autonomy (2 day), L daily is average daily demand during the night period in kWh/day, DoD is the depth of discharge, η inv is the efficiency of the inverter, η dis is the charge/discharge efficiency, and f is a safety factor. Furthermore, the size of the energy storage system will depend on the role of this storage such as frequency controlling or peak shaving. The ESS size was chosen to cover the daily demand based on the kWh term by using Equation (3), as presented in [6,25]. The size of the BESS and main specification are summarized in Table 6 from the literature [6,25]. There are also different factors that can affect the size of the ESS such as the location of the ESS in the network. The location of the energy storage system in the microgrid also has a direct impact on the size and performance of the storage model [29,30]. In general, the location of the energy storage system on the network depends on the role of this storage. For example, a central energy storage system located on the distribution substation to cover the town demand will help to reduce the total peak and cover the total demand of the town and control it in total. In addition, the central energy storage will support the substation to mitigate the operational constraints and reduce the thermal and voltage problems at the substation in this zone [25,28]. In another scenario, the energy storage system can be divided into smaller sizes and located near the load or on the distribution feeders, as distributed energy storage system. In this scenario, the distributed energy storage system will help to reduce the peak, control the demand, and minimize thermal and voltage problems on the cables at the end of the feeder. However, the distributed energy storage system will have a limited impact on controlling the total demand or reducing the thermal problem at the substation [25]. Therefore, the location of the energy storage system depends on the role of the storage in the network. In this work, the covering of total demand and cost-saving performance were considered which led to the central storage system being located at the substation. A comparison analysis for the central and distributed energy storage system will be discussed in Section 3.
In addition, the effective controlling of the energy storage system, demand response (DR), and the dynamic thermal rating (DTR) system will help to improve the network performance [30,31]. The controlling of the energy storage system and DR aim to cover the load demand and reduce peaks and blackouts [25,31]. The DTR is mainly used to enhance the capacity of the power lines and mitigate the thermal constraints of the power lines by considering the advantages of the variability of power line rating based on the fluctuations of the weather conditions [30,31]. Therefore, the DTR can help to improve the performance of the power network and minimize the size of the required ESS [31]. In this work, the thermal rating for the power lines (voltage and current) has not been studied; the controlling of ESS is the main technique used to improve the network performance and the focus is on covering the total demand and energy cost-saving performance.

Optimization Operation Method for the BESS
The power sources, the PV plant, and the BESS feed the required load demand consumption to cover 100% of the power network demand, as shown in Figure 1. Let L, as described in Equation (4), be the hourly load demand of the network over more than one day (two days): L = (L(1), . . . , L(t), . . . , L(24) ) T ∈ R 24 (4) The basic operation of the BESS is presented in the previous section as shown in Figure 13. In this section, an optimal BESS controller is introduced and developed to achieve the optimal operation plan for the BESS over a day. The objective is to minimize the function, d l (t), which is described as the status of not covering 100% of load demand by PV and BESS over the day.
The BESS model presented in this section has been introduced by the authors of [25]. The BESS model works under a number of constraints, as presented by Equations (6) and (7). In general, The SoC at the time step t is SoC(t) is required to be within the minimum and maximum SoC value, SoC min , and SoC max , respectively, and the charging/discharging energy E(t) restricted to lower and upper limits (E min , E max ). The SoC(t) shows the stored energy in the BESS which depends on the previous status of the BESS, SoC(t − 1), E(t), and the efficiency of the BESS, η, [25,28] as follows: The energy flow problem is formulated in Equation (5); the BESS control loop is introduced in Figure 2. As stated in Section 1, optimally controlling the BESS normally shows significant increases in the reliability of the power system. Therefore, new metaheuristic optimization algorithms (GROM and PSO) have been used in this paper to improve the economic and energy performance of 100% PV and ESS systems for microgrids by solving the optimization problem in Equation (5). The optimal BESS controller based on GROM and PSO will aim to find the optimal operation plan of the BESS. Here, the E(t) is the charging or discharging energy for the BESS at time t and to describe the BESS plan or operation sequence over a day, the E = (E(1), . . . , E(t), . . . , E(24)) T ∈ R 24 .

Results
The proposed optimal BESS controller in this work was applied to a power network equipped with a BESS, as described in Table 6, and a PV system based on three different scenarios, as described in Table 4. The optimal BESS controllers based on GROM and PSO were modelled in Matlab (R2016b, The MathWorks, Inc., Natick, MA, USA). In this section, we aim to discuss and present the results from the proposed optimal BESS controllers compared to the common controller (set-point): • Firstly, the results of the optimal BESS controllers for the power network with the three PV system scenarios are presented; • Then, the impact of the optimal BESS controllers on the sizing of BESS is investigated under a specific case study; • Finally, the feasibility and economic results of using the BESS with different operation scenarios are presented.

Three Scenarios of PV Systems for the Isolated Power Grid
In Section 2, the size of the PV system was investigated and calculated based on three different scenarios: Scenario 1 (908.7 kWp), Scenario 2 (1363.02 kWp), and Scenario 3 (1104.1 kWp). Table 5 showed that the PV system was able to cover the required load demand, based on daily load demand consumptions, by 52.3%, 95.61%, and 80.72% for scenarios 1, 2, and 3, respectively. Therefore, the BESS, as shown in Table 6, was employed with the PV systems to cover the 100% of the load demand. Figure 14 shows that the BESS covered the night demand and increased the percentage of covering daily demand for the three PV system scenarios. For example, Scenario 2 achieved 100% while the percentage of coverage increased by 62.3% and 15.6% for Scenario 1 and Scenario 3, respectively. tion scenarios are presented.

Three Scenarios of PV Systems for the Isolated Power Grid
In Section 2, the size of the PV system was investigated and calculated based on three different scenarios: Scenario 1 (908.7 kWp), Scenario 2 (1363.02 kWp), and Scenario 3 (1104.1 kWp). Table 5 showed that the PV system was able to cover the required load demand, based on daily load demand consumptions, by 52.3%, 95.61%, and 80.72% for scenarios 1, 2, and 3, respectively. Therefore, the BESS, as shown in Table 6, was employed with the PV systems to cover the 100% of the load demand. Figure 14 shows that the BESS covered the night demand and increased the percentage of covering daily demand for the three PV system scenarios. For example, Scenario 2 achieved 100% while the percentage of coverage increased by 62.3% and 15.6% for Scenario 1 and Scenario 3, respectively. To improve the performance of BESS, the proposed optimal BESS controllers based on GROM [24] and PSO [23] were used. Table 7 shows that the optimal controllers for BESS significantly improved the percentage of covering daily demand. For example, the GROM and PSO algorithms increased the percentage of covering in Scenario 1 by 5.4% and 4.3%, respectively, compared to the set-point controller. This means that the PV systems (Scenario 1 and 3) can be relied upon to cover 100% of load demand by using load scheduling and shaving algorithms. This will help to decrease the cost of the PV system and the land requirement. To improve the performance of BESS, the proposed optimal BESS controllers based on GROM [24] and PSO [23] were used. Table 7 shows that the optimal controllers for BESS significantly improved the percentage of covering daily demand. For example, the GROM and PSO algorithms increased the percentage of covering in Scenario 1 by 5.4% and 4.3%, respectively, compared to the set-point controller. This means that the PV systems (Scenario 1 and 3) can be relied upon to cover 100% of load demand by using load scheduling and shaving algorithms. This will help to decrease the cost of the PV system and the land requirement.

Sizing of BESS
This section aims to investigate the impact of the optimal BESS controllers on the sizing of BESS under the different sizes of BESS. In Section 2, the size of the BESS system has been investigated by using three different cases: • As shown in Figure 15, the BESS (Case 1) covered 100% of the load demand without any hours that the power went off. With the calculated size of BESS (9535.725 kWh), Case 2 As shown in Figure 15, the BESS (Case 1) covered 100% of the load demand without any hours that the power went off. With the calculated size of BESS (9535.725 kWh), Case 2 achieved 100% cover of the demand over a year while Case 2 and 3 had 30 and 81 h where the power was off, respectively. In order to reduce the number of hours for the power sources (PV and BESS) that were not able to cover the load demand, the proposed optimal BESS controllers were used for the performance of BESS. Table 8 presents the optimal controllers for BESS which showed a significant solution to improve the percentage of covering daily demand. For example, the GROM and PSO algorithms reduced the number of hours with power off in Scenario 3 by 39.5% and 35.8%, respectively, compared to the set-point controller. This means that the BESS (Case 2 and 3) can be relied upon to cover 100% of load demand by using load scheduling and shaving algorithms. This will also help to decrease the capital cost of BESS. In order to reduce the number of hours for the power sources (PV and BESS) that were not able to cover the load demand, the proposed optimal BESS controllers were used for the performance of BESS. Table 8 presents the optimal controllers for BESS which showed a significant solution to improve the percentage of covering daily demand. For example, the GROM and PSO algorithms reduced the number of hours with power off in Scenario 3 by 39.5% and 35.8%, respectively, compared to the set-point controller. This means that the BESS (Case 2 and 3) can be relied upon to cover 100% of load demand by using load scheduling and shaving algorithms. This will also help to decrease the capital cost of BESS.

Economic Results
This section aims to introduce the economic implications of the proposed system by presenting a primary economic analysis. This economic investigation aims to show the commercial benefits of the BESS and PV system for 100% covering the load demand. BESS such as lithium-ion batteries has been used in different power network applications [25,28]. In general, BESS has a medium power density level and high energy density with a low self-discharge rate; therefore, BESS is suitable for power network applications which need slow gains of energy (in hours). In this work, the major capital cost of BESS and PV systems are presented in Table 9 based on the required PV and BESS specifications in Tables 4 and 6. The capital costs for the PV and BESS have been obtained from [28,32], which provide the recent prices of the PV and BESS. Table 9. The main capital costs for a BESS and PV system.

Capital Costs Value
BESS (Case 1) USD 2,860,717 (300 USD/kWh) PV includes panels, inverters, and cables. (Scenario 2) USD 559,870 Total capital costs USD 3,420,587 In this work, the presented power network aimed to cover 100% load demand of the network. The electricity energy tariff in Jordan is 211 USD/MWh. According to the data provided by Electrical Distribution Power Company in Jordan, the annual electricity energy cost is around USD 299,469. Table 10 presents an economic analysis of the BESS case studies. The economic viability analysis introduces the Net Present Value (NPV), Internal Rate of Return (IRR) and payback period for the BESS case studies. The results indicated that the three options of BESS are potentially economically profitable with a payback period of 11 years or less. In addition, the three options recorded positive NPV values and an IRR greater than 3% which are usually used in energy projects.

ESS Location Results
In this section, a comparison of the central energy storage system (Case 1) and the distributed energy storage system at the end of three feeders is presented in Table 11 in terms of the percentage of covering daily demand for the different optimal BESS controllers. In this section, a central PV system with a 908.7 kWp size (Scenario 2) was used for both types of energy storage. The GROM outperformed the other controllers for both of the ESS location scenarios. The percentage of covering daily demand shows that the GROM improved the performance by achieving 89.5% and 84.4% for the central and distrusted location scenarios, respectively. The distributed ESS scenario achieved a reasonable demand covering but was lower than the central ESS scenario. This is mainly related to the power loss between the PV and the distributed ESS and the demand behaviour at feeders.

Conclusions and Discussion
In general, developing countries such as Jordan rely heavily on importing the main energy sources to cover their needs. Therefore, the movement toward a sustainable energy sector based on renewable energy systems such as Photovoltaic (PV) is important. The cost-efficient and optimal structure of a 100% RES system with high-reliability performance in microgrids at Jordan was the main goal of this article. This work provides one of the first extensive investigations into the load demand and PV power generations of rural areas in Jordan. This investigation designed an optimal 100% PV and ESS system for rural areas in Jordan. Metaheuristic optimization algorithms were developed and employed in different areas such as power flow problems to improve the performance of solving challenging engineering problems. In this paper, metaheuristic optimization algorithms, namely: GROM and PSO algorithms, were employed to find the optimal configurations and integrated 100% PV and ESS for a microgrid. For example, the GROM and PSO algorithms reduced the number of hours with power off in Scenario 3 by 39.5% and 35.8%, respectively, compared to the set-point controller. In terms of the ESS location, a comparison between the central and distributed energy storage systems was presented for the different optimal BESS controllers. The central ESS scenario achieved a higher performance compared to a distributed storage system in terms of demand covering. This is mainly related to the stochastic demand behaviour and the power loss between the PV and the distributed ESS.
In addition, the GROM outperformed the other controllers for both of the ESS location scenarios by achieving daily demand covering equal to 89.5% and 85.4% for central and distributed ESS, respectively. The analysis of the results indicated that to achieve and implement a 100% renewable energy system for a microgrid system (small town demand), the following points are recommended:

•
The size of the PV system depends on different factors such as the scale of the project (small, medium, or large scale) and location. The size of PV is usually calculated based on the monthly average of the demand. However, the results showed that is recommended to take safety factors and increase the size of PV to cover the seasonal and night peaks for a 100% renewable network model; • The type and size of ESS selected based on the main role of the ESS in the network. In this work, the ESS was used to cover 100% of the demand with the PV. Therefore, the size was calculated based on the maximum peak and demand during the night and based on the PV generation. However, the results showed that it can be relied upon to minimize the size of ESS and cover 100% of load demand by using load scheduling and shaving algorithms; • It is important to develop and implement an effective controller for the ESS to improve the network performance. The results showed that the optimal controller can help to cover the load demand and reduce peaks and blackouts.

Acknowledgments:
We would like to thank the Renewable Energy Center at The Hashemite University for their support.

Conflicts of Interest:
The authors declare no conflict of interest.