Building a Sustainable Energy Community: Design and Integrate Variable Renewable Energy Systems for Rural Communities

: This study proposes a decentralized hybrid energy system consisting of solar photovoltaics (PV) and wind turbines (WT) connected with the local power grid for a small Najran, Saudi Arabia community. The goal is to provide the selected community with sustainable energy to cover a partial load of the residential buildings and the power requirements for irrigation. For this, a dynamic model was constructed to estimate the hourly energy demand for residential buildings consisting of 20 apartments with a total floor area of 4640 m 2 , and the energy requirements for irrigation to supply a farm of 10,000 m 2 with water. Subsequently, HOMER software was used to optimize the proposed hybrid energy system. Even considering the hourly fluctuations of renewable energies, the artificial neural network (ANN) successfully estimated PV and wind energy. Based on the mathematical calculations, the final R-square values were 0.928 and 0.993 for PV and wind energy, respectively. According to the findings, the cost of energy (COE) for the optimized hybrid energy system is $0.1053/kWh with a renewable energy penetration of 65%. In addition, the proposed system will save 233 tons of greenhouse gases annually.


Introduction
Global warming is a devastating event that threatens the life of human beings. Because of the excessive use of fossil fuel for energy generation, air pollution is increasing at an alarming level. Fortunately, The Paris Agreement committed to keep global warming below 2 ℃ [1]. To achieve this objective, technologies and innovations are needed to address the energy crises, especially in developing nations. Since the early 1970s, the demand for energy in Saudi Arabia has increased rapidly due to human expansion, economic growth, and low energy prices [2]. The energy demand in Saudi Arabia in 2018 was 299.2 terawatt-hours (TWh). This energy demand is comparable to countries with larger populations (e.g., Mexico had a population of 127.5 million in 2019, compared to Saudi Arabia's population of 34.2 million) [2]. The energy demands expanded quickly for decades under the backing of government incentives through fixed and low energy prices. This trend of rising energy demand coupled with low energy prices was considered unsustainable since it threatened the government's capacity to maintain its budget [2].
The transition toward sustainable energy begins by transforming our communities to adopt renewable energy. People within a community embrace sustainable energy technologies such as renewable energy in a shared manner compared to the conventional individual practice of utilizing energy. Many communities and regions have stated clear goals to move their community to sustainable energy and to become energy independent. For example, in the Netherlands, many cities and towns have developed ambitious plans to become energy neutral and achieve low carbon emissions [3]. The Environmental and Energy Study Institute (EESI) community energy is another initiative that aims to make renewable energy more accessible to locals [4]. This initiative focuses on strategies that allow different households and businesses to create, own, or share the expenses of local energy projects.
Saudi Arabia has made it plain that it intends to switch from conventional power facilities that depend on fuel to more environmentally friendly options. By boosting the penetration of renewable energy, Saudi Arabia plans to decarbonize half of its energy industry by 2030 [5]. Transitioning to renewable energy will be impossible without tackling the high demand of energy in the residential and agricultural sectors, which absorb a significant amount of Saudi Arabia's overall energy production (KSA). As a result, this research aims to contribute to the Kingdom's transition to a green economy by designing an energy system for a rural community.
The following is a description of the paper's structure. A review of the literature and an outline of the main contribution are presented in Section 2. Section 3 begins with a description of the proposed microgrid-hybrid energy system. Then, a detailed mathematical model is developed in Section 4 to estimate buildings' energy demands and farming energy requirements for irrigation. Section 5 shows the selected location, resource analysis, and electrical load profile. The results and discussion of the proposed system are described in Section 6. Finally, the conclusions and implications of the study are presented in Section 7.

Literature
The focus on energy consumption and management can be examined in different ways [6][7][8][9][10][11][12][13]. Nanoparticles, which have been widely studied since the last century [14][15][16][17][18], can also be used in this direction [19][20][21][22][23][24][25]. This section summarizes the literature review related to this study. The first section reviews previous studies that aim to optimize hybrid energy systems for residential buildings. The second section discusses the optimization techniques for an irrigation system. In section three, we summarize previous studies that used machine learning for energy forecasting and optimization.

Hybrid Energy System for Residential Buildings
Hybrid energy systems that consist of two or more renewable energy sources have been widely used to develop a sustainable energy community [26][27][28][29][30]. For example, Nyeche and Diemuodeke developed an optimized hybrid energy system comprised of a photovoltaic array, wind turbine, and hydro energy storage [31]. The suggested system was optimized and sized using a genetic algorithm to meet the energy needs for a typical Patani coastline community while minimizing the disparity between energy demand and energy generated. The results showed that the suggested system's levelized cost of energy (COE) was $0.27/kWh. Pal and Bhattacharjee proposed a decentralized biogas-based hybrid energy system to provide sustainable energy for a small rural community located in India [32]. The system component was optimized, and the overall net present value was minimized using particle swarm optimization (PSO). The hybrid renewable energy system was simulated based on typical meteorological year (TMY) data. To ensure that the power supply was not disrupted, an energy management strategy was developed. The proposed hybrid system had a cost of energy of $0.12/kWh, which is attractive compared to similar systems. Another study investigated the potential of developing a hybrid energy system for the Rohingya refugee community in Bangladesh [33]. The proposed system consists of a combination of PV panels, wind turbines, and energy storage. The results of the study indicated that 87% of the energy demand comes from renewable energy resources. The total energy cost for their study was $0.35/kW. Buildings consume 80% of total electricity in Saudi Arabia, with the residential sector accounting for 50% [34]. Due to population growth, the pace of increase in energy demand continues to climb. In order to create an energy-efficient hybrid system that will deliver a stable source of energy for residential construction, several studies have been conducted. A techno-economic optimization of hydrogen power production using solar and wind energy was established by Al-Sharafi et al. [35]. The suggested system investigated several climatic conditions in the Saudi Arabian Kingdom. The minimal levelized COE for the study was $1.208/kWh. Another study [36] investigated the use of a solar PV and wind hybrid energy system for residential buildings in four different climate zones in Saudi Arabia: Yanbu, Sharurah, Hafar Albatin, and Riyadh. Because of the significant renewable energy penetration in Yanbu, the study's findings showed that the suggested hybrid energy system was economically viable. The study's main contribution was reducing greenhouse gas emissions while lowering energy expenses. Baseer et al. [37] investigated the techno-economic analysis and evaluation of a hybrid energy system for residential areas in Jubail. This hybrid energy system combined PV/wind/diesel and PV/wind with battery storage to meet the electric load requirements for three housing compounds. The technical and economic feasibility of various configurations was assessed using HOMER software. Three compounds had a minimal COE of $0.217 per kWh. PV and wind turbines with energy storage had a minimal COE of $0.25/kWh, allowing for 100 percent renewable energy penetration. In addition, the ideal planned system is expected to reduce 2800 tons of CO2 each year. A hybrid system with solar PV, wind turbines, and a diesel generator was also constructed for a town in Saudi Arabia [38]. The proposed hybrid system will replace eight diesel generators that were previously used to supply the village's power needs. With a 35 percent renewable energy penetration, the energy cost was $0.212/kWh according to the optimal results. In addition, Almehmadi and Aljabr studied the possible peak energy reduction of a residential building in a hot and dry climate in Saudi Arabia [39]. A comparative analysis between utilizing variable compressor speed versus integrating an air conditioning system with Maisotsenko evaporative cooling (M-cycle) was theoretically investigated. Results show that using variable compressor speed reduced the peak energy by 20%.

Hybrid Energy System for Irrigation Systems
Hybrid energy systems also have been used widely for agricultural irrigation. For example, Hassan and Kamran proposed a hybrid energy system that consists of PV panels for an irrigation water pump for rural agriculture areas in Pakistan [40]. The proposed hybrid system intends to provide a reliable energy source at a reasonable cost to meet the irrigation needs of farms in Pakistan. In addition, small-scale irrigation powered by solar and WT were designed for the Kalangala district in Uganda [41]. This hybrid system optimized for a stand-alone irrigation system to supply a farm with 33.73 m 3 /day of water. According to the study's findings, the hybrid system may offer farmers a reliable energy source with an annual rate of return of 3.5%.
An experimental verification and sizing optimization for a hybrid water pumping system in a greenhouse was proposed in [42]. The study aimed to develop an optimization model to determine the optimum size of a hybrid PV/WT with a battery-generated system that leads to a minimum annual operating cost. The best configuration of the optimized system was evaluated experimentally for 15 days in a greenhouse in Weinan. The results of the experiment illustrated that the power generated from PV and wind turbine was 41.74 kW and 6.235 kW. This indicated that the proposed hybrid system could meet the irrigation pumping energy requirements.
Ouachani et al. proposed an intelligent algorithm for an optimum renewable energy system for irrigation [43]. This hybrid system consisted of PV/WT and battery banks for energy storage. The goal of the developed algorithm was to ensure continuous and safe operations. Another study attempted to design a sustainable source of energy to cover the irrigation energy requirements as well. The proposed system was conducted in Mecha woreda (district), with a focus on the Koga irrigation command regions. Solar and smallscale hydropower systems incorporated with the microgrid were proposed in [44]. Interestingly, any extra energy produced by the proposed hybrid system would be distributed to the public for other purposes, such as lighting and cooking, to improve the overall quality of life. Therefore, the study concluded that a renewable energy-based microgrid is attractive at the social and environmental level. Another study used a genetic algorithm optimized to find the ideal size of the hybrid system that consists of PV/wind power to meet the irrigation needs [45]. Results demonstrated that a hybrid system comprised of PV/wind was economically feasible for the city of Abu-Rudies with a levelized COE of around $0.179/kWh.

Machine Learning Algorithm for Energy Optimization and Forecasting
Machine learning algorithms have been widely used for optimally sizing sustainable energy systems and forecasting the power output. Because one of the fundamental limitations of machine learning is the absence of training data that are relevant on a large scale, it is necessary to merge physics-based modeling with machine learning. Recently, scientists in many disciplines such as image classification, building energy forecasting, etc., have shown great interest in machine learning due to its capability of analyzing a huge amount of data. Most of the previous studies that aim to forecast energy demand on buildings utilizing machine learning have been solely driven by data [46].
Physical-based modeling and machine learning can be combined in a variety of ways. For example, Li et al. combined the physic-based model machine learning algorithm, namely, support vector machine (SVM) to predict hourly cooling load in office buildings [47]. The input features of the SVM, such as the climate conditions, were obtained from Guangzhou's climate database for a normal meteorological year. The simulated cooling load for the building was used to train the ML model. The study concluded that the SVM model is accurate, especially when the training dataset is limited. In addition, Vaghefi et al. merged a physic-based model and a data-driven approach to forecast and control heating/cooling systems in buildings [48]. A combination of historic real data and datasets generated using Energy Plus were employed to train the ML model to control heating/cooling for buildings optimally. Results indicated that the developed productive model could accurately forecast the indoor temperature for a short period of time, and the overall predicted energy demand was accepted. Sustainable centralized energy system development has recently received more attention to smooth the transition to sustainability. For example, Zhou et al. utilized a supervised machine learning algorithm to forecast on-site renewable energy production [49]. Unlike the physics-based simulation, which usually comes with a high computational cost, the developed driven data approach can predict on-site power generation with high accuracy and at a lower computational cost. In addition, Hou et al. developed a data-driven approach for identifying the effect of high renewable energy perpetration [50].

Research Objective
Saudi Arabia consumes a portion of its oil for electricity production. The residential sector consumes around 52% of total power produced, and the average electricity consumption is three times higher than the world average [51]. In addition, according to the International Energy Agency (IEA), Saudi agricultural power usage more than doubled between 1988 and 2014, rising from 0.05 to 0.39 million tons of oil [52]. Given that the residential and agriculture sectors consume a large portion of energy, maximizing the penetration of sustainable energy in these sectors is a priority. Integrated strategies at all societal and institutional levels are needed to resolve this issue, live in harmony with the environment, and develop a sustainable and green community that will ensure a better future and reduce dependence on oil for electricity production. The transition to sustainability in residential and agricultural sectors could be accomplished through technologies and innovation that combine and optimize different types of renewable energy production and energy storage.
The primary goal of this study was to investigate the possibility of maximizing the renewable energy penetration in rural communities in Saudi Arabia, and based on technoeconomic optimizations, to meet partial electrical loads within the community. Thus, we proposed a microgrid hybrid energy system that intends to provide a rural community with resilience and a reliable energy source to meet the energy demand for residential buildings and irrigation energy required for farms. In addition, this study attempted to integrate machine learning and physics-based simulation to create a robust model for predictions and hybrid energy optimizations.
The current effort resulted in a referable approach for sustainable development in rural communities with a reliable energy source, which can enhance the transition to a green economy. The following are the study's main contributions: • Create a micro-grid hybrid energy system comprised of PV and wind energy to meet partial energy demand in a small rural community in the southwest of Saudi Arabia.

•
Develop a dynamic model that appropriately forecasts the hourly energy demand in the communities based on weather conditions for the selected location.

•
Estimate the water requirements to grow potatoes, tomatoes, and wheat for a 10,000 m 2 farm using CROPMAT software and determine an appropriate irrigation schedule to supply the farm with the necessary amount of water.

•
Optimize the sizing of the proposed system using HOMER software to minimize the total COE. • Integrate the physics-based model with machine learning (ANN) to create robust model production and hybrid energy optimizations.
To the best of our knowledge, this is the first research of its sort for the Najran region. The proposed hybrid system aims to accelerate the transition to a green economy by reducing the reliance on non-sustainable energy. This study's findings apply to similar locations with similar meteorological and soil conditions.

Description and Modeling of the Proposed System
This study considers a hybrid energy system comprised of solar PV/WT for a rural community. The objective of the proposed hybrid system is to provide a reliable source of energy to cover the partial load of a residential building along with the necessary power for irrigation. Figure 1 illustrates the proposed hybrid system. It contains a power field, residential buildings, and a community farm. The power field subsystem includes PV modules and WT. The energy produced from the power field will cover the electric load within the residential buildings and the required pumping energy used for irrigation. When the energy produced from the power field exceeds the demands, the excess energy will be sold back to the grid. On the contrary, grid power will be utilized when the proposed hybrid system cannot meet the energy demand for the residential building and the power needed for irrigation. Figure 1. Block diagram of the proposed system; subsystems include the power field, irrigation pumps, residential buildings, and farm.

Typical Residential Building Model
The following is a description of the developed model of a residential building. First, a typical residential building model is constructed based on geometrical and energy characteristics defined in Table 1. This model is developed to estimate the energy consumption of specific typical buildings.

Residential Buildings Energy Requirements
This section creates a model for a residential building that can forecast heat gains/losses, related heating/cooling requirements for the exterior environment, and estimations of energy consumption from plug-in loads, such as lighting and other equipment. The developed model aims to evaluate hourly energy consumption and forecast heat losses/gains of the building with the surrounding environment to determine the amount of cooling/heating energy needed to maintain a 24 °C interior temperature. As a result, the total energy consumption of a residential structure can be estimated as follows [54]: Ėt otal = ĖH VAC + Ėb aseline (1) where Ėt otal and Ėb aseline are the total electricity and the baseline energy loads expressed in kWh. Estimating cooling/heating loads involves modeling the dynamic behavior of a typical residential building. HVAC energy consumption was calculated with the following equation: where T amb and T idoor are the ambient and indoor temperatures, respectively, expressed in ℃; V, ρ a , and c pa are the volume of the house, air density, and specific heat capacity of air, respectively; UA and ACH are the overall heat transfer coefficient of the W/℃ and the air change per hour, respectively; and Q̇c ooling and COP are the cooling loads required to maintain indoor temperature at 24 ℃ and the coefficient performance of the unit, respectively. The heat generated inside the house from occupants, lighting, and appliances is expressed as Q gen .

Irrigation Pumping Energy Requirements
Estimating the crop water requirements (CRW) of various crops grown, particularly in arid regions, is vital. Due to the low level of rainfall, knowing the crop water requirements allows for more effective water use and efficient irrigation practices. The FAO-CROPWAT model was adopted to estimate the crop water needs of the main crop cultivated in the city of Najran, Saudi Arabia [55]. According to the Ministry of Municipal and Rural Affairs [56], agriculture is one of Najran's most important economic sectors. In 2011, the total crop area was estimated to be around 11,000 hectares, accounting for about 1.4 percent of the entire crops in the Kingdom. The FAO CROPWAT model, which adopts the Penman-Monteith method to estimate the evapotranspiration (ET0), was used to calculate the CRW according to [57].
To estimate the total irrigation requirements of the selected crops (potatoes, wheat, and tomatoes), the climate condition of the city of Najran was entered into CROPWAT software. This includes the planting and harvesting dates, and soil types.

Selected Location
The region of Najran lies in the south of Saudi Arabia and has more than 100 ancient sites. Najran has been a key link connecting the north, west, and Yemen throughout history. Geographically, it is located between 17 and 20 degrees north in latitude, and between 44 and 52 degrees east in longitudes (18.00° N, 45.40° E). The climate in this area includes dry winters with humid-subtropical (specified by the Köppen-Geiger climate classification system: "CWa" [58]) and receives a lot of sunlight all year. Even though it is likely that this district could use solar energy, it is difficult to find specific information about solar energy on flat and sloped surfaces.
The hybrid system's performance and economic viability were investigated based on the actual weather conditions for the city of Najran. Figure 2 shows the specifically selected area of the study. Najran is considered one of the most modern cities. The entire population of the Najran region was 569,000 individuals in 2014, accounting for 1.85 percent of the Kingdom's overall population of 30.8 million [56]. The majority of the Najran valley is made up of agricultural lands, which are mainly used for growing wheat, maize, palm, and acidic fruit crops. West Najran is surrounded by mountains and has several residential communities and agricultural farms, whereas East Najran is primarily desert [56]. In 2011, the overall agricultural area was estimated to be 11,000 hectares, accounting for about 1.4 percent of the total crops in the Kingdom, which totaled 788,000 hectares in the same year [56].  Table 2 shows the climate characteristics, rainfalls levels, and the average estimated ET0 for each month. The average yearly ET0 was estimated to be 6.55 mm. Overall, the outdoor temperature and rainfall vary significantly throughout the year, as shown in Figure 3. Rainfall is at its peak during March and April. Throughout the summer, the city of Najran has a very high-temperature record that reaches its peak in August.

Figure 3.
Monthly average outdoor temperature, rain rate, and evapotranspiration data for Najran city. Figure 4 shows the probable distribution of wind speed at the selected location. To evaluate the available wind resource, a Weibull distribution analysis has been implemented. The x-axis in Figure 4 shows that the scale parameter represents wind speed in m/s, and the shape parameter is shown in the y-axis. A closer look at the figure illustrates that the wind speed ranged from 4 to 6 m/s most of the time during the year.

Electric Load Profile: A Case Study
To assess the potential value of the proposed hybrid energy system, an estimate of the hourly power demand for the selected community is established for a typical weather year. A MATLAB dynamic model was constructed based on the data in Tables 1-3 and Equations (1) and (2) to estimate residential buildings' hourly electric load profiles. Results show that the total annual energy demand for the community is 753,568 kWh, while the peak energy demand is 170 kW. Figure 5A demonstrates the daily pumping energy requirements along with the water flow rate needed for the farms. Figure 5B shows the total power demand for the community. A closer look at Figure 5B reveals that power demand spikes during summer due to higher outdoor temperatures.

Benchmark Comparison of the Developed Model
There are a few benchmarks for residential buildings' energy intensities in Saudi Arabia. Thus, the energy consumption of the developed physics model of a residential building was compared against benchmark data reported by Krarti et al. [53]. Their study reported the yearly fluctuation in electricity use for residential building in Saudi Arabia. Annual electricity demand in four KSA regions was reported in terms of energy use intensity (EUI) and expressed in . In this study, the benchmark results for the southern region reported in [46] was used to validate the developed model for residential buildings. Based on the physic-based model illustrated in Equations (1) and (2) and the defined building's characteristics in Table 1, the EUI is 134 kWh m 2 year

Result and Discussion
A typical meteorological condition for the city of Najran, Saudi, was used to evaluate the proposed hybrid system. Figure 6 shows a detailed description of the chosen renewable energy sources connected to the utility grid. Figure 6 also dictates the implemented procedure used to evaluate the hybrid system, divided into two main steps. The first step is estimating the selected community's electric load profile. As mentioned previously, the community consists of residential buildings surrounded by farms. Thus, the total load profile represents the energy required for the residential and agriculture sector within the community. A MATLAB dynamic model was developed to estimate the hourly electric load profile for the residential buildings based on the information presented in Table 1 and Equations (1) and (2). It is critical to determine the CWR for irrigation energy requirements, which was accomplished using CROPWAT software. Based on the results obtained from CROPWAT, the pumping energy requirements to supply the farm with the required water were calculated. The second step was an optimization to determine the optimum size of the PV/wind system. The proposed hybrid system was simulated and optimized using HOMER Software. HOMER is an optimization software primarily used to enhance the size of various renewable energy systems based on net present value (NPC) and the COE. It has been widely used for optimization, and environmental and economic analysis [59]. Table 4 summarizes the physical and economic characteristics used in the simulation. It also shows the price list for each component.

Optimum Size
Combinations of the hybrid energy system, PV/WT, connected with the conventional power grid are the only energy sources to the community. The selected community can access the local grid power but might experience inconsistent electrical supply. Thus, this study aims to develop a hybrid energy system to provide the community with sustainable energy sources with access to the grid. The hybrid system is optimized to determine the proper component size, leading to a minimum renewable energy penetration of 50%. The electricity purchase and sell back rates in case of shortage or excess production are set at US $0.08/kWh and US $0.06/kWh, respectively (Table 5).  Figure 7 shows the monthly energy load for the community where the energy demand spikes during the summer due to the high outdoor temperatures. As a result of increasing energy demand during the summer months, the produced power from the PV/WT is not sufficient, which leads to an increase in the reliance on the power from the grid. From May to August, it is estimated that 51% of the electricity demand was purchased from the grid.

Figure 7.
Monthly power generation of the PV/wind system, load demand, and exported and imported grid power to the community. Figure 8A,B demonstrate the power output of the WT and PV panels simultaneously during the course of the year for 24 h a day. As shown, solar power is intermittent because the sun is not available at all hours of the day. The power output from the PV is available for about 11.8 h per day, and it fluctuates between 5 and 40 kW depending on the available solar resources. The WT gives more consistent energy during the day and operates at partial load during the off-peak hours. The proposed hybrid design in this study does not have energy storage systems. Thus, excess energy will be sold back to the grid at a rate of $0.06/kWh.

Artificial Neural Network Implementation
The essence of renewable energies is their temporal and geographical nationality. Renewable energies, such as solar and wind [61], experience extreme fluctuations that make them very difficult to analyze. Generally, similar to many studies in which data mining-based methods were used [62][63][64][65][66], the renewable energy is also predictable through this methodology [67] To simulate renewable energy and its sensitivity to the location and the prevailing climate, its daily or hourly changes must be analyzed. By considering the hourly values shown in Figure 9, the average production power associated with wind and solar energies can be obtained. Then, a neural network is developed for it by creating input, middle, and output layers. In Figure 9, the correlations are depicted, and it is clear that the closer the data is to the bisector, the better the ANN results. In Figure 9 (bottom), the actual and predicted values of the power output for PV and wind energy are demonstrated. The number of fluctuations in wind energy is greater, but still, the neural network provides better results in estimating wind energy. It should be noted that although the error rate for some points in Figure 9 appears to be high, considering an annual analysis, the calculations show that the error for PV and wind energy is below 4%.  Figure 10 shows the amount of error due to the use of the neural network in estimating solar/wind energy. As expected, for this solar system, citizenship is much stronger than time, so the amount of predictive error is even greater.

Economic and Energy Analysis
An economic analysis of the proposed hybrid system was investigated at different renewable penetration (RP) values (Figure 11 (upper)). The COE at 75% RP was 13% higher than the non-renewable energy option. The computed COE was found to be more than the average cost of power provided by the local grid, which was estimated to be $0.08 kWh. The lowest COE of the PV/WT was $0.1053/kWh at an RP of 65%. The obtained COE at an RP of 65% was a turning point and could be considered the optimized value. Increasing the RP beyond 65% led to higher COE. This was attributed to high capital expenditures due to the oversized nature of the system. Previous studies have shown that the energy cost varies from 0.1 to 0.3 $/kWh [35,38].The simulated results from this study were compared to previous studies where the COE was $0.1053/kWh. In addition, conventional power plants relying on fossil fuels are the primary source of electricity in Saudi Arabia. Efforts have been made to shift to more sustainable energy sources to reduce the dependency on fossil fuels and lower greenhouse emissions [36,54]. Figure 11 (lower) depicts the amount of CO2 emissions in kg/year as a function of the total renewable penetration. It was estimated that increasing the renewable energy perpetration from 25% to 75% would reduce CO2 emissions by 47%. In addition, this figure shows the yearly imported and exported energy in kWh from the grid. Results showed that the grid's annual energy purchases and sales at 75% penetration were 251,034 and 923,444 kWh, respectively. The competitive economy of the proposed system would be greatly influenced by the capital and investment cost of the PV/WT system. Figure 12 shows the results of the sensitivity analysis, which explored the impact of the capital price of the PV/wind system on the COE $/kWh. The proposed hybrid system's COE and the system's cost details used in the simulation shown in Table 4 represent base case 1. In this case, the capital costs of PV and WT were 3463$/kW and 5000$/kW, respectively. Therefore, the COE for base case 1 was $0.1053/kWh. The economic feasibility of the proposed system is influenced by the investment and capital cost of purchasing solar energy, namely, PV and WT. At the current market price, the COE of the hybrid system is higher than the local grid price. In this figure, the impact of the capital and installation cost is explored. This analysis revealed that the proposed hybrid system would be economically viable if the cost of purchasing the system's equipment was 20% less than the current market price.

Implications of the Proposed System
The COE of the proposed hybrid system is marginally higher than the local grid's average cost, which is assumed to be 0.08$/kWh. Currently, the average energy cost produced by renewable sources is not attractive from an economic standpoint to consumers due to the low energy prices generated by conventional power plants. For example, the energy price in Saudi Arabia between 1988 and 2014 was less than 50% of the global average [68]. However, the average cost of energy from renewable resources in Saudi Arabia from previous studies is in the range of 0.15 to 0.3$/kWh [38]. This makes such systems economically unfeasible compared to the energy cost from local providers.
Reduced electricity prices are a result of Saudi government subsidies. Low energy costs stimulate increases in energy demand and inefficient use of energy. Additionally, they limit consumers from investing in energy efficiency and slow the transition to more sustainable energy. For example, energy incentives through government assistance are crucial for the agriculture sector, since it is essential to the production process and assists the agricultural region to thrive. However, cheap energy can potentially lead to wasteful use of energy resources [69], such as increased gas emissions, degradation of the environment, and an impediment to social initiatives [70]. Napoli et al. suggested that implicit and explicit incentives for the agricultural industry may not be sustainable in the long run [71].
Generally, increasing the cost of renewable energy is a barrier that prevents a smooth transition to a sustainable energy community, especially when the electricity price of a conventional power plant powered by fossil fuels is low. Therefore, the proposed hybrid system might not be appealing from an economic standpoint without the government's financial support or reforming energy costs to align with the average international level. Fortunately, the Saudi government has implemented a domestic energy price reform to boost energy efficiency and gradually eliminate energy subsidies by 2025 [72]. In addition, the Saudi government's proposed 2030 vision aims to diversify the country's energy production, reduce the reliance on fossil fuels, and increase the use of natural gas and renewable energy to 50% [5]. With subsidies ending in the energy sector, and Saudi's plan to diversify energy production in the near future, the proposed system discussed in this study might be attractive in the coming years.

Conclusions
Developing sustainable energy sources is a critical factor in improving the socioeconomic situation of rural communities. In this study, an attempt was made to design a sustainable energy community, where community members can work collaboratively to fund a project and receive a share of their investment. As previously stated, the selected community is comprised of residential buildings surrounded by farms. Thus, the hybrid energy system proposed in this study aims to supply the community with clean energy to cover the demand in the residential and agriculture sectors. A MATLAB dynamic model was developed to predict the hourly energy demand for residential buildings. The CWR for the selected crops defined in Table 3 was estimated using CROPWAT, and subsequently, the pumping energy needed to supply water to the community's farm was determined. Based on the theoretical power demand estimation, HOMER software was used to optimize the size of the proposed hybrid PV/WT energy system. The objective of the optimization was to minimize the COE $/kWh supplied. Results of the study revealed that the COE of the proposed system is influenced by the renewable energy penetration and the capital investment cost. The optimized hybrid renewable energy system is capable of supplying reliable energy to a remote area in the southwest of KSA and could save more than 200 tons of greenhouse gases annually. In addition, the hybrid system was simulated with different renewable energy penetrations where the lowest COE was $0.1053/kWh at an RP of 65%. Therefore, the results from this simulation could potentially help motivate the selected community to become energy independent. PV and wind energy are time-dependent, especially for solar energy, which has a stronger function. The neural network can be useful for estimating both energies by establishing connections between neurons. The neural network R-square was 0.928 for PV and 0.993 for wind energy. This indicates that the neural network was more in tune with wind energy. The error rate in the annual analysis for PV and wind energy was less than 4%.
Aside from developing a sustainable energy system for a rural community, this study attempted to design an energy-efficient irrigation system. Farmers need access to technology at a competitive cost to reduce food waste and boost agriculture yields. This potential integration was created to enhance the overall energy efficiency and help reduce the reliance on fossil fuel as the main energy source. The results of this technology may also help farmers gain access to a sustainable source of energy that enables them to grow crops sustainably.
Future research might investigate the following: (I) Perform experimental work to compare the outcomes with the theoretical results in this study.
(II) Study the possibility of designing net zero energy consumption for the selected community.
(III) Incorporate a biogas plant into the proposed study and study its economic and environmental impacts.
(IV) Investigate the economic impact of extending the service life of the project beyond 25 years.

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

Symbols
Name of Symbols Unit Ėt otal Total electricity consumption kWh ĖH VAC HVAC energy consumption to control indoor temperature kWh T indoor Indoor temperature C T amb Outdoor temperature C Q gen Heat generated inside the house kWh A Floor area m 2 ACH Air change per hour 1/h ρ a Air density m 3 /kg C a Specific heat of air kJ/kg-k V House volume m 3 UA Overall heat transfer coefficient W/K